dk.brics.string.util
Class Pair<A,B>
java.lang.Object
dk.brics.string.util.Pair<A,B>
public final class Pair<A,B>
- extends Object
A generic, immutable pair of two objects. Implements equals and hashCode.
Constructor Summary |
Pair(A first,
B second)
|
Method Summary |
boolean |
equals(Object obj)
|
A |
getFirst()
|
B |
getSecond()
|
int |
hashCode()
|
static
|
make(A a,
B b)
Convenience method for creating a new pair, since generic arguments may be inferred
by a static method call but not by a constructor call. |
Pair
public Pair(A first,
B second)
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
getFirst
public A getFirst()
getSecond
public B getSecond()
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
make
public static <A,B> Pair<A,B> make(A a,
B b)
- Convenience method for creating a new pair, since generic arguments may be inferred
by a static method call but not by a constructor call.
Copyright © 2003-2009 Anders Møller, Aske Simon Christensen, Asger Feldthaus.