jpaul.DataStructs
Class Pair<A,B>

java.lang.Object
  extended by jpaul.DataStructs.Pair<A,B>
All Implemented Interfaces:
java.io.Serializable

public final class Pair<A,B>
extends java.lang.Object
implements java.io.Serializable

Pair is an immutable pair of two values.

Version:
$Id: Pair.java,v 1.7 2006/03/14 02:29:31 salcianu Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu
See Also:
Serialized Form

Field Summary
 A left
           
 B right
           
 
Constructor Summary
Pair(A a, B b)
           
 
Method Summary
 boolean equals(java.lang.Object o2)
           
 int hashCode()
           
static
<A,B> Function<Pair<A,B>,A>
leftProj()
           
static
<A,B> Function<Pair<A,B>,B>
rightProj()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

left

public final A left

right

public final B right
Constructor Detail

Pair

public Pair(A a,
            B b)
Method Detail

hashCode

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

equals

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

toString

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

leftProj

public static <A,B> Function<Pair<A,B>,A> leftProj()

rightProj

public static <A,B> Function<Pair<A,B>,B> rightProj()


Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu