ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.util
Class Pair<S,T>

java.lang.Object
  extended by umontreal.iro.lecuyer.util.Pair<S,T>
Type Parameters:
S - the type of the first value.
T - the type of the second value.
All Implemented Interfaces:
Serializable, Cloneable

public class Pair<S,T>
extends Object
implements Cloneable, Serializable

Represents a pair of values.

See Also:
Serialized Form

Constructor Summary
Pair(Pair<? extends S,? extends T> pair)
          Constructs a new pair from the pair pair.
Pair(S first, T second)
          Constructs a new pair for values first and second.
 
Method Summary
 Pair<S,T> clone()
          Clones this pair.
 boolean equals(Object obj)
           
 S getFirst()
          Returns the first value of this pair.
 T getSecond()
          Returns the second value of this pair.
 int hashCode()
           
 void setFirst(S first)
          Sets the first value of this pair to first.
 void setSecond(T second)
          Sets the second value of this pair to second.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(S first,
            T second)
Constructs a new pair for values first and second.

Parameters:
first - the first value.
second - the second value.

Pair

public Pair(Pair<? extends S,? extends T> pair)
Constructs a new pair from the pair pair.

Parameters:
pair - the pair to get values from.
Throws:
NullPointerException - if pair is null.
Method Detail

getFirst

public S getFirst()
Returns the first value of this pair.

Returns:
the first value.

setFirst

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

Parameters:
first - the new first value of this pair.

getSecond

public T getSecond()
Returns the second value of this pair.

Returns:
the second value of this pair.

setSecond

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

Parameters:
second - the second value of this pair.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

clone

public Pair<S,T> clone()
Clones this pair. This method does not clone the values in the pair.

Overrides:
clone in class Object

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.