jrummikub.util
Class Pair<T1,T2>

java.lang.Object
  extended by jrummikub.util.Pair<T1,T2>
Type Parameters:
T1 - Type of first component
T2 - 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

Field Summary
private  T1 first
           
private  T2 second
           
private static long serialVersionUID
           
 
Constructor Summary
Pair(T1 first, T2 second)
          Create a new pair from two values
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 T1 getFirst()
          Extract the first component of a pair
 T2 getSecond()
          Extract the second component of a pair
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

first

private final T1 first

second

private final T2 second
Constructor Detail

Pair

public Pair(T1 first,
            T2 second)
Create a new pair from two values

Parameters:
first - the first pair component
second - the second pair component
Method Detail

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