|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttd.Cercle
public class Cercle
Un Cercle est caractérisé par son centre un Point et par un rayon
Field Summary | |
---|---|
private Point |
centre
Le centre un Point |
private int |
rayon
Le rayon |
Constructor Summary | |
---|---|
Cercle()
Construit un cercle de centre (0,0) et de rayon 1 this( ) permet de faire appel à l'un de ses autres constructeurs |
|
Cercle(Cercle cercle)
Construit un cercle clone d'un autre |
|
Cercle(int x,
int y,
int rayon)
Construit un cercle de centre (x,y) et de rayon rayon |
|
Cercle(Point centre,
int rayon)
Ce constructeur est celui qui est appelé par tous les autres, ce n'est pas obligatoire mais c'est un choix de conception. |
Method Summary | |
---|---|
double |
circonference()
|
void |
deplacer(int x,
int y)
Déplace le cercle en (x,y) |
Point |
getCentre()
|
int |
getRayon()
|
void |
setCentre(Point centre)
|
void |
setRayon(int rayon)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Point centre
private int rayon
Constructor Detail |
---|
public Cercle()
public Cercle(int x, int y, int rayon)
x
- l'abscisse du centre du cercley
- l'ordonnée du centre du cerclerayon
- le rayon du cerclepublic Cercle(Cercle cercle)
cercle
- le cercle qui est recopiépublic Cercle(Point centre, int rayon)
centre
- le centre du cerclerayon
- le rayon du cercleMethod Detail |
---|
public double circonference()
public void deplacer(int x, int y)
x
- l'abscisse de destinationy
- l'ordonnée de destinationpublic Point getCentre()
public int getRayon()
public void setCentre(Point centre)
centre
- le centre du cerclepublic void setRayon(int rayon)
rayon
- le rayon du cerclepublic 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 |