apollo.util
Class Pair<T,U>

java.lang.Object
  extended by apollo.util.Pair<T,U>
Type Parameters:
T - - the type of the first value
U - - the type of the second value

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

This is an utility class to give pairs and uses generics

Author:
elee

Constructor Summary
Pair(T first, U second)
          Constructs a Pair object containing two elements
 
Method Summary
 boolean equals(java.lang.Object other)
          Overload Object.equals to compare if the two elements are the same
 T getFirst()
          Get the first value
 U getSecond()
          Get the second value
 int hashCode()
          Overload Object.hashCode to return the sum of the the values hashCode
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(T first,
            U second)
Constructs a Pair object containing two elements

Parameters:
first - - first value of the pair
second - - second value of the pair
Method Detail

getFirst

public T getFirst()
Get the first value

Returns:
first value of the pair

getSecond

public U getSecond()
Get the second value

Returns:
second value of the pair

equals

public boolean equals(java.lang.Object other)
Overload Object.equals to compare if the two elements are the same

Overrides:
equals in class java.lang.Object
Parameters:
other - - instance of Pair being compared to
Returns:
whether the two objects are the equal

hashCode

public int hashCode()
Overload Object.hashCode to return the sum of the the values hashCode

Overrides:
hashCode in class java.lang.Object
Returns:
new hash code for this object

toString

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