Class Pair<A,B>

java.lang.Object
  extended by Pair<A,B>
Type Parameters:
A - The type of the first value.
B - The type of the second value.
Direct Known Subclasses:
OPair

public class Pair<A,B>
extends java.lang.Object

A pair consists of two values of type A and B.

Author:
Rossmanith

Constructor Summary
Pair(A a, B b)
          Create a new pair with the two values a and b.
 
Method Summary
 A first()
          Selector of the first value
 B second()
          Selector of the second value
 void setfirst(A a)
          Setter for first value
 void setsecond(B b)
          Setter for second value
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(A a,
            B b)
Create a new pair with the two values a and b.

Parameters:
a - the first value
b - the second value
Method Detail

setfirst

public void setfirst(A a)
Setter for first value

Parameters:
a - the new first value

setsecond

public void setsecond(B b)
Setter for second value

Parameters:
b - the new second value

first

public A first()
Selector of the first value

Returns:
the first value of this pair

second

public B second()
Selector of the second value

Returns:
the second value of this pair

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object