jpaul.DataStructs
Class Pair<A,B>
java.lang.Object
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
Constructor Summary |
Pair(A a,
B b)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
left
public final A left
right
public final B right
Pair
public Pair(A a,
B b)
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