org.eclipse.stardust.common
Class Pair<K,V>

java.lang.Object
  extended by org.eclipse.stardust.common.Pair<K,V>
All Implemented Interfaces:
Serializable

public class Pair<K,V>
extends Object
implements Serializable

Holds pairs of values.

Version:
$Revision$
Author:
rsauer
See Also:
Serialized Form

Constructor Summary
Pair(K first, V second)
          Initializes the value pair.
 
Method Summary
 boolean equals(Object other)
          Compares for equality with another value pair.
 K getFirst()
          Retrieves the first value of the pair.
 V getSecond()
          Retrieves the second value of the pair.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(K first,
            V second)
Initializes the value pair.

Parameters:
first - The first value.
second - The second value.
Method Detail

getFirst

public K getFirst()
Retrieves the first value of the pair.

Returns:
The first value.

getSecond

public V getSecond()
Retrieves the second value of the pair.

Returns:
The second value.

equals

public boolean equals(Object other)
Compares for equality with another value pair. Instances of pair are equal if both values are equal.

Overrides:
equals in class Object
Returns:
true if this pair is equal the given other pair, false if the pairs are not equal or the other value is not an instance of Pair.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2017 Eclipse Stardust. All Rights Reserved.