com.metsci.glimpse.util
Class Pair<A,B>

java.lang.Object
  extended by com.metsci.glimpse.util.Pair<A,B>
All Implemented Interfaces:
java.io.Serializable

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

A generic class for pairs of objects.

Author:
hogye
See Also:
Serialized Form

Constructor Summary
Pair(A first, B second)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 A first()
           
 int hashCode()
           
static
<A,B> Pair<A,B>
newPair(A first, B second)
           
 B second()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(A first,
            B second)
Method Detail

newPair

public static <A,B> Pair<A,B> newPair(A first,
                                      B second)

first

public A first()
Returns:
The first element of the pair

second

public B second()
Returns:
The second element of the pair

toString

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2012 Metron, Inc.. All Rights Reserved.