jrummikub.util
Class Pair<T1,T2>
java.lang.Object
jrummikub.util.Pair<T1,T2>
- Type Parameters:
T1
- Type of first componentT2
- Type of second component
- All Implemented Interfaces:
- java.io.Serializable
public class Pair<T1,T2>
- extends java.lang.Object
- implements java.io.Serializable
A pair of objects
- See Also:
- Serialized Form
Constructor Summary |
Pair(T1 first,
T2 second)
Create a new pair from two values |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
first
private final T1 first
second
private final T2 second
Pair
public Pair(T1 first,
T2 second)
- Create a new pair from two values
- Parameters:
first
- the first pair componentsecond
- the second pair component
getFirst
public T1 getFirst()
- Extract the first component of a pair
- Returns:
- the first pair component
getSecond
public T2 getSecond()
- Extract the second component of a pair
- Returns:
- the second pair component
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object