edu.harvard.deas.hyperenc.util
Class Pair<T1,T2>

java.lang.Object
  extended by edu.harvard.deas.hyperenc.util.Pair<T1,T2>
All Implemented Interfaces:
Serializable

public final class Pair<T1,T2>
extends Object
implements Serializable

Represents a pair of objects of different types. Pairs are immutable so long as the contained objects are immutable.

Author:
Jason Juang
See Also:
Serialized Form

Constructor Summary
Pair(T1 t1, T2 t2)
           
 
Method Summary
 boolean equals(Object o)
          Returns true if both components of this Pair are equal.
 T1 first()
           
 int hashCode()
           
 T2 second()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(T1 t1,
            T2 t2)
Method Detail

first

public T1 first()

second

public T2 second()

equals

public boolean equals(Object o)
Returns true if both components of this Pair are equal.

Overrides:
equals in class Object
Returns:
true if both the first and second components of each Pair are equal according to their equals methods.

hashCode

public int hashCode()
Overrides:
hashCode in class Object