org.wamblee.general
Class Pair<T,U>

java.lang.Object
  extended by org.wamblee.general.Pair<T,U>
Type Parameters:
T - Type of the first object.
U - Type of the second object.

public class Pair<T,U>
extends java.lang.Object

Represents a pair of objects. This is inspired on the C++ Standard Template Library pair template.

Author:
Erik Brakkee

Constructor Summary
Pair(Pair<T,U> aPair)
          Copies a pair.
Pair(T aT, U aU)
          Constructs the pair.
 
Method Summary
 T getFirst()
          Gets the first object of the pair.
 U getSecond()
          Gets the second object of the pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(T aT,
            U aU)
Constructs the pair.

Parameters:
aT - First object.
aU - Second object.

Pair

public Pair(Pair<T,U> aPair)
Copies a pair.

Parameters:
aPair - Pair to copy.
Method Detail

getFirst

public T getFirst()
Gets the first object of the pair.

Returns:
First object.

getSecond

public U getSecond()
Gets the second object of the pair.

Returns:
Second object.


Copyright © 2010. All Rights Reserved.