edu.ou.utils
Class Tuple<A,B>

java.lang.Object
  extended by edu.ou.utils.Tuple<A,B>

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

A Tuple is simply a pair of objects. Tuples can be chained together to form lisp-like lists or trees, or can simply hold objects for a convenient return type for functions.


Constructor Summary
Tuple(A head, B tail)
           
 
Method Summary
 A head()
          Get the first element of the tuple.
 void setHead(A head)
          Set the first element of the tuple.
 void setTail(B tail)
          Set the second element of the tuple.
 B tail()
          Get the second element of the tuple.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tuple

public Tuple(A head,
             B tail)
Method Detail

setHead

public void setHead(A head)
Set the first element of the tuple.

Parameters:
head - The new first element of the tuple.

head

public A head()
Get the first element of the tuple.

Returns:
The first element of the tuple.

setTail

public void setTail(B tail)
Set the second element of the tuple.

Parameters:
tail - The new second element of the tuple.

tail

public B tail()
Get the second element of the tuple.

Returns:
The second element of the tuple.