edu.gwu.geometry
Class IntPoint

java.lang.Object
  |
  +--edu.gwu.geometry.IntPoint

public class IntPoint
extends java.lang.Object

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

ID

public int ID
Every instance will have a different ID, for use in hashing.

x

public int x
The x coordinate.

y

public int y
The y coordinate.
Constructor Detail

IntPoint

public IntPoint(int x,
                int y)
Constructor.
Parameters:
x - an int value
y - an int value
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides Object's equals method to test point equality.
Overrides:
equals in class java.lang.Object
Parameters:
obj - an Object value
Returns:
a boolean value

hashCode

public int hashCode()
The ID is used as the hashcode.
Overrides:
hashCode in class java.lang.Object
Returns:
an int value

toString

public java.lang.String toString()
Overrides Object's toString().
Overrides:
toString in class java.lang.Object
Returns:
a String value