|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectMutablePoint
public class MutablePoint
Constructor Summary | |
---|---|
MutablePoint()
Creates a point at the origin (x=y=0). |
|
MutablePoint(double x,
double y)
Creates a point with the given x-y coordinates. |
|
MutablePoint(MutablePoint p)
Copy constructor. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Determines whether two points are equal. |
double |
getX()
Returns the value of x. |
double |
getY()
Returns the value of y. |
void |
set(double x,
double y)
Sets the value of the coordinates. |
java.lang.String |
toString()
Converts the point to a string. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MutablePoint(double x, double y)
x
- x coordinatey
- y coordinatepublic MutablePoint()
public MutablePoint(MutablePoint p)
p
- MutablePoint object to be copied.Method Detail |
---|
public double getX()
public double getY()
public void set(double x, double y)
x
- New X coordinate.y
- New Y coordinate.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |