edu.jhu.tmaj.util.data
Class Pair
java.lang.Object
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)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
x
public final int x
y
public final int y
Pair
public Pair(int x,
int y)
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()