public class SVectorPixel extends java.lang.Object implements SVector
| Constructor and Description |
|---|
SVectorPixel()
Constructeur d'un pixel par défaut.
|
SVectorPixel(int x,
int y)
Constructeur d'un vecteur de pixel.
|
| Modifier and Type | Method and Description |
|---|---|
SVector |
add(SVector v)
Méthode permettant d'effectuer l'addition mathématique entre deux vecteurs.
|
SVectorPixel |
add(SVectorPixel p)
Méthode pour effectuer l'addition d'une coordonnée de pixel avec une autre.
|
boolean |
equals(java.lang.Object obj) |
int |
getX()
Méthode pour obtenir la coordonnée x du pixel.
|
int |
getY()
Méthode pour obtenir la coordonnée y du pixel.
|
int |
hashCode() |
SVectorPixel |
multiply(double cst)
Méthode pour effectuer la multiplication par un scalaire avec une coordonnée de pixel.
|
java.lang.String |
toString() |
void |
write(java.io.BufferedWriter bw)
Méthode pour écrire un objet SWriteable dans un fichier txt en utilisant un BufferedWriter.
|
public SVectorPixel()
public SVectorPixel(int x,
int y)
throws SConstructorException
x - - La coordonnée x du pixel.y - - La coordonnée y du pixel.SConstructorException - Si le pixel possède une coordonnée négative.public int getX()
public int getY()
public SVector add(SVector v)
SVectorpublic SVectorPixel add(SVectorPixel p)
p - - La coordonnée de pixel à additionner.public SVectorPixel multiply(double cst) throws SConstructorException
multiply in interface SVectorcst - - La constante à multiplier avec la coordonnée de pixel.SConstructorException - Si la constante à multiplier est négative ne permettant pas de construire une coordonnée de pixel avec des composantes négatives.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic void write(java.io.BufferedWriter bw)
throws java.io.IOException
SWriteablewrite in interface SWriteablebw - - Le buffer pour l'écriture.java.io.IOException - Si une erreur de type I/O a été lancée par l'objet BufferedWriter.BufferedWriter