|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectobjectdraw.Location
Location is an implementation of a point on the real plane.
Constructor Summary | |
Location(double x,
double y)
Constructs a new Location object. |
|
Location(Location point)
Constructs a copy of a Location object. |
|
Location(java.awt.Point point)
Constructs a new Location object based on a Point object. |
Method Summary | |
double |
distanceTo(Location point)
Determines the distance to the given Location. |
boolean |
equals(java.lang.Object obj)
Compares Location to another object |
double |
getX()
Retrieves the Location's x coordinate. |
double |
getY()
Retrieves the Location's y coordinate. |
int |
hashCode()
Generates a hashCode for a Location |
java.awt.Point |
toPoint()
Retrieves the nearest point with integer coordinates as a Point. |
java.lang.String |
toString()
Generates a string representation of the Location. |
void |
translate(double dx,
double dy)
Translates the Location by the given increments. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Location(double x, double y)
x
- the point's x valuey
- the point's y valuepublic Location(Location point)
point
- the Location to copypublic Location(java.awt.Point point)
point
- the point to copyMethod Detail |
public double getX()
public double getY()
public double distanceTo(Location point)
public java.awt.Point toPoint()
public void translate(double dx, double dy)
dx
- amount to translate in x-directiondy
- amount to translate in y-directionpublic java.lang.String toString()
public boolean equals(java.lang.Object obj)
public int hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |