edu.jhu.tmaj.util.data
Class Pair

java.lang.Object
  extended by edu.jhu.tmaj.util.data.Pair
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable
Direct Known Subclasses:
Coordinate, Position

public class Pair
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Represents 2 integers.

See Also:
Serialized Form

Field Summary
 int x
           
 int y
           
 
Constructor Summary
Pair(int x, int y)
           
 
Method Summary
 int compareTo(java.lang.Object object)
          Compares by Y, then by X.
 boolean equals(java.lang.Object arg0)
           
 int getX()
           
 int getY()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public final int x

y

public final int y
Constructor Detail

Pair

public Pair(int x,
            int y)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public final boolean equals(java.lang.Object arg0)
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public final int compareTo(java.lang.Object object)
Compares by Y, then by X.

Specified by:
compareTo in interface java.lang.Comparable

getX

public final int getX()

getY

public final int getY()