edu.rice.cs.cunit.util
Class Pair<FIRST,SECOND>

java.lang.Object
  extended by edu.rice.cs.cunit.util.Pair<FIRST,SECOND>

public class Pair<FIRST,SECOND>
extends java.lang.Object

Generic pair container.

Author:
Mathias Ricken

Field Summary
(package private)  FIRST _first
          First value of the pair.
(package private)  SECOND _second
          Second value of the pair.
 
Constructor Summary
Pair(FIRST first, SECOND second)
          Create a new pair of the specified values.
 
Method Summary
 boolean equals(java.lang.Object o)
          Return true if the two values of this value are equal to the two values of the other value.
 FIRST first()
          Accessor for the first value.
 int hashCode()
          Return a hashcode for this pair.
 SECOND second()
          Accessor for the second value.
 void setFirst(FIRST first)
          Mutator for the first value.
 void setSecond(SECOND second)
          Mutator for the second value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_first

FIRST _first
First value of the pair.


_second

SECOND _second
Second value of the pair.

Constructor Detail

Pair

public Pair(FIRST first,
            SECOND second)
Create a new pair of the specified values.

Parameters:
first - first value
second - second value
Method Detail

first

public FIRST first()
Accessor for the first value.

Returns:
first value

setFirst

public void setFirst(FIRST first)
Mutator for the first value.

Parameters:
first - new first value

second

public SECOND second()
Accessor for the second value.

Returns:
second value

setSecond

public void setSecond(SECOND second)
Mutator for the second value.

Parameters:
second - new second value

equals

public boolean equals(java.lang.Object o)
Return true if the two values of this value are equal to the two values of the other value.

Overrides:
equals in class java.lang.Object
Parameters:
o - other value
Returns:
true if equal

hashCode

public int hashCode()
Return a hashcode for this pair.

Overrides:
hashCode in class java.lang.Object
Returns:
hashcode