|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Point
Constructor Summary | |
Point()
sets the default values of the Point object to 0, 0 |
|
Point(int X,
int Y)
sets the value of the Point object to the value of the X and Y parameters (which are ints) |
Method Summary | |
Point |
add(Point other)
adds the x, y values of the passed object to the x, y values respectively of the Point object that invoked the method |
double |
distance(Point other)
determines the distance between the x, y values of the passed object to the x, y values respectively of the Point object that invoked the method Uses the distance function: distance = sqrt((x2 - x1)^2 + (y2 - y1)^2) |
int |
getX()
to be used for debugging or by other methods |
int |
getY()
to be used for debugging or by other methods |
void |
set(java.lang.String X,
java.lang.String Y)
sets the value of the Point object to the value of the X and Y parameters (which are Strings) |
java.lang.String |
toString()
return a string with an external representation (X and Y) of the values of the Point object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Point()
public Point(int X, int Y)
int
- X value in the objectint
- Y value in the objectMethod Detail |
public void set(java.lang.String X, java.lang.String Y)
int
- X value in the objectint
- Y value in the objectpublic int getX()
public int getY()
public Point add(Point other)
Point
- another Point objectpublic double distance(Point other)
Point
- another Point objectpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |