org.weborganic.berlioz.util
Class Pair<T,V>

java.lang.Object
  extended by org.weborganic.berlioz.util.Pair<T,V>
Type Parameters:
T - The type of the first constituent of the key
V - The type of the second constituent of the key

public class Pair<T,V>
extends Object

An implementation of an object that can be used as a fast key made of two objects for lookup in sets and map.

This is an immutable object.

Since:
Berlioz 0.8.2
Version:
Berlioz 0.8.2 - 29 June 2011
Author:
Christophe Lauret

Constructor Summary
Pair(T a, V b)
          Creates a new scoped path.
 
Method Summary
 boolean equals(Object o)
           
 T first()
           
 int hashCode()
           
 V second()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pair

public Pair(T a,
            V b)
Creates a new scoped path.

Parameters:
a - The first constituent of the key
b - The second constituent of the key
Method Detail

equals

public final boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

first

public final T first()
Returns:
The first constituent of the key.

second

public final V second()
Returns:
The second constituent of the key.