|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgraph.Location
public class Location
The location class represents an integer coordinate location. The class has only two members: x and y coordinates. This class is meant to be used with the Graph API but can be used in many situations.
Field Summary | |
---|---|
static Location |
ORIGIN
A Location that is a the origin of a plane, (0,0). |
Constructor Summary | |
---|---|
Location()
Creates a new location at the coordinates (0,0). |
|
Location(int x,
int y)
Creates a new location at the coordinates (x,y). |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Determines whether or not the coordinates are the same location and returns true or false accordingly. |
int |
getX()
Returns the x coordinate of this location. |
int |
getY()
Returns the y coordinate of this location. |
int |
hashCode()
|
void |
setX(int x)
Sets a new value for the x coordinate of this location. |
void |
setY(int y)
Sets a new value for the x coordinate of this location. |
java.lang.String |
toString()
Generates an output string of the form: (x,y) . |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Location ORIGIN
Location
that is a the origin of a plane, (0,0).
Constructor Detail |
---|
public Location()
public Location(int x, int y)
x
- - the x coordinatey
- - the y coordinateMethod Detail |
---|
public int getX()
public void setX(int x)
x
- - the new valuepublic int getY()
public void setY(int y)
y
- - the new valuepublic java.lang.String toString()
(x,y)
.
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
another
- location
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |