java.lang.Object | +--edu.gwu.geometry.IntPoint
IntPoint
is a simple class to store a point, i.e.
an (x,y) pair, where the coordinates are integers.
Field Summary | |
int |
ID
Every instance will have a different ID, for use in hashing. |
int |
x
The x coordinate. |
int |
y
The y coordinate. |
Constructor Summary | |
IntPoint(int x,
int y)
Constructor. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Overrides Object's equals method to test point equality. |
int |
hashCode()
The ID is used as the hashcode. |
java.lang.String |
toString()
Overrides Object's toString() . |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public int ID
public int x
public int y
Constructor Detail |
public IntPoint(int x, int y)
x
- an int
valuey
- an int
valueMethod Detail |
public boolean equals(java.lang.Object obj)
equals
method to test point equality.equals
in class java.lang.Object
obj
- an Object
valueboolean
valuepublic int hashCode()
hashCode
in class java.lang.Object
int
valuepublic java.lang.String toString()
toString()
.toString
in class java.lang.Object
String
value