jInfer

cz.cuni.mff.ksi.jinfer.base.objects
Class ImmutablePair<S,T>

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.base.objects.ImmutablePair<S,T>
Type Parameters:
S - Type argument of the first object in the pair.
T - Type argument of the second object in the pair.
All Implemented Interfaces:
Pair<S,T>

public class ImmutablePair<S,T>
extends Object
implements Pair<S,T>

Class representing a generic 2-tuple. Immutable class.


Constructor Summary
ImmutablePair(S first, T second)
          Full constructor.
 
Method Summary
 boolean equals(Object obj)
           
 S getFirst()
          Returns the first member of this pair.
 T getSecond()
          Returns the second member of this pair.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImmutablePair

public ImmutablePair(S first,
                     T second)
Full constructor. Both members of this pair must be specified.

Parameters:
first - First member of this pair.
second - Second member of this pair.
Method Detail

getFirst

public S getFirst()
Description copied from interface: Pair
Returns the first member of this pair.

Specified by:
getFirst in interface Pair<S,T>
Returns:
First member of this pair.

getSecond

public T getSecond()
Description copied from interface: Pair
Returns the second member of this pair.

Specified by:
getSecond in interface Pair<S,T>
Returns:
Second member of this pair.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011