jInfer

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

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.base.objects.MutablePair<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 MutablePair<S,T>
extends Object
implements Pair<S,T>

Class representing a generic 2-tuple. Mutable class (contrast Pair).


Constructor Summary
MutablePair(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()
           
 void setFirst(S first)
          Sets the first member of this pair.
 void setSecond(T second)
          Sets the second member of this pair.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutablePair

public MutablePair(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.

setFirst

public void setFirst(S first)
Sets the first member of this pair.

Parameters:
first - 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.

setSecond

public void setSecond(T second)
Sets the second member of this pair.

Parameters:
second - 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