com.espertech.esper.collection
Class Pair<First,Second>

java.lang.Object
  extended by com.espertech.esper.collection.Pair<First,Second>
All Implemented Interfaces:
java.io.Serializable

public class Pair<First,Second>
extends java.lang.Object
implements java.io.Serializable

General-purpose pair of values of any type. The pair only equals another pair if the objects that form the pair equal, ie. first pair first object equals (.equals) the second pair first object, and the first pair second object equals the second pair second object.

See Also:
Serialized Form

Constructor Summary
Pair(First first, Second second)
          Construct pair of values.
 
Method Summary
static
<K,V> Pair<K,V>
createPair(K key, V value)
           
 boolean equals(java.lang.Object obj)
           
 First getFirst()
          Returns first value within pair.
 Second getSecond()
          Returns second value within pair.
 int hashCode()
           
 void setFirst(First first)
          Set the first value of the pair to a new value.
 void setSecond(Second second)
          Set the second value of the pair to a new value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(First first,
            Second second)
Construct pair of values.

Parameters:
first - is the first value
second - is the second value
Method Detail

createPair

public static <K,V> Pair<K,V> createPair(K key,
                                         V value)

getFirst

public First getFirst()
Returns first value within pair.

Returns:
first value within pair

getSecond

public Second getSecond()
Returns second value within pair.

Returns:
second value within pair

setFirst

public void setFirst(First first)
Set the first value of the pair to a new value.

Parameters:
first - value to be set

setSecond

public void setSecond(Second second)
Set the second value of the pair to a new value.

Parameters:
second - value to be set

equals

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

hashCode

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

toString

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

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com