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)
SVector
public SVectorPixel add(SVectorPixel p)
p
- - La coordonnée de pixel à additionner.public SVectorPixel multiply(double cst) throws SConstructorException
multiply
in interface SVector
cst
- - 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.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void write(java.io.BufferedWriter bw) throws java.io.IOException
SWriteable
write
in interface SWriteable
bw
- - Le buffer pour l'écriture.java.io.IOException
- Si une erreur de type I/O a été lancée par l'objet BufferedWriter.BufferedWriter