com.flexive.shared
Class Pair<X,Y>

java.lang.Object
  extended by com.flexive.shared.Pair<X,Y>
All Implemented Interfaces:
java.io.Serializable

public class Pair<X,Y>
extends java.lang.Object
implements java.io.Serializable

A generic pair. Serialization is best-effort, if both X and Y are serializable, then the Pair can also be serialized.

Version:
$Rev: 2906 $
Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Constructor Summary
Pair(X first, Y second)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 X getFirst()
           
 Y getSecond()
           
 int hashCode()
           
static
<X,Y> Pair<X,Y>
newPair(X first, Y second)
          Create a new pair.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(X first,
            Y second)
Method Detail

newPair

public static <X,Y> Pair<X,Y> newPair(X first,
                                      Y second)
Create a new pair.

Type Parameters:
X - first value type
Y - second value type
Parameters:
first - the first value
second - the second value
Returns:
a new Pair
Since:
3.1

getFirst

public X getFirst()

getSecond

public Y getSecond()

equals

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

hashCode

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