at.molindo.utils.data
Class Pair<A,B>

java.lang.Object
  extended by at.molindo.utils.data.Pair<A,B>
All Implemented Interfaces:
Serializable

public class Pair<A,B>
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary
Pair()
          Contructs a pair holding two null values.
Pair(A a, B b)
          Contructs a pair holding the given objects.
Pair(Map.Entry<A,B> e)
           
Pair(Pair<A,B> p)
          Contructs a pair holding the objects of the given pair.
 
Method Summary
 boolean equals(Object obj)
           
 A getFirst()
           
 A getKey()
           
 B getSecond()
           
 B getValue()
           
 int hashCode()
           
static
<K,V> Pair<K,V>
pair()
          utility method to create pairs with implicit parameterization
static
<K,V> Pair<K,V>
pair(K key, V val)
          utility method to create pairs with implicit parameterization
 void setFirst(A first)
           
 void setSecond(B second)
           
static
<K,V> HashMap<K,V>
toHashMap(List<Pair<K,V>> pairs)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair()
Contructs a pair holding two null values.


Pair

public Pair(A a,
            B b)
Contructs a pair holding the given objects.


Pair

public Pair(Pair<A,B> p)
Contructs a pair holding the objects of the given pair.


Pair

public Pair(Map.Entry<A,B> e)
Method Detail

toHashMap

public static <K,V> HashMap<K,V> toHashMap(List<Pair<K,V>> pairs)

pair

public static <K,V> Pair<K,V> pair(K key,
                                   V val)
utility method to create pairs with implicit parameterization

Type Parameters:
K -
V -
Parameters:
key -
val -
Returns:

pair

public static <K,V> Pair<K,V> pair()
utility method to create pairs with implicit parameterization

Type Parameters:
K -
V -
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getFirst

public A getFirst()

setFirst

public void setFirst(A first)

getSecond

public B getSecond()

setSecond

public void setSecond(B second)

getValue

public B getValue()

getKey

public A getKey()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Molindo GmbH. All Rights Reserved.