|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttp.prof.classes.Point
public class Point
Cette classe définit l'objet Point
. Un point est défini par son abscisse et son ordonnée.
Field Summary | |
---|---|
private int |
x
x: abscisse y: ordonnée |
private int |
y
x: abscisse y: ordonnée |
Constructor Summary | |
---|---|
Point()
Permet de créer un point de coordonnées (0,0) |
|
Point(int x,
int y)
Permet de créer un point de coordonnées (x,y) |
|
Point(Point point)
Permet de créer un point de mêmes coordonnées qu'un autre point |
Method Summary | |
---|---|
void |
deplacer(int x,
int y)
déplace le point courant en (newX,newY)(i.e les nouvelles coordonnées de mon Point sont (newX,newY) ) |
double |
distance(Point autrePt)
Renvoie la distance entre deux points |
double |
distanceOrigine()
renvoie la distance à l'origine du Point courant |
int |
getX()
Renvoie l'abscisse |
int |
getY()
Renvoie l'ordonnée |
void |
setX(int x)
Définit l'abscisse |
void |
setY(int y)
Définie l'ordonnée |
java.lang.String |
toString()
|
void |
translater(int dx,
int dy)
translate le point courant de dx et dy (i.e les nouvelles coordonnées de mon Point sont (x+dx,y+dy) ) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int x
private int y
Constructor Detail |
---|
public Point(int x, int y)
x
- l'abscissey
- l'ordonnéepublic Point()
public Point(Point point)
point
- Method Detail |
---|
public int getX()
public void setX(int x)
x
- the x to setpublic int getY()
public void setY(int y)
y
- the y to setpublic void translater(int dx, int dy)
dx
- un intdy
- un intpublic void deplacer(int x, int y)
x
- un inty
- un intpublic double distanceOrigine()
public double distance(Point autrePt)
autrePt
-
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |