A
- Type of first itemB
- Type of second itempublic final class Pair<A,B> extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <U,V> Pair<U,V> |
create(U u,
V v)
Convenient constructor method
|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
static <T> Pair<T,T> |
sort(Pair<T,T> p)
Sorts a single-typed pair so
a <= b . |
static <T> java.util.List<T> |
toList(Pair<T,T> p)
Converts a single-typed pair to a list.
|
java.lang.String |
toString() |
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public static <T> java.util.List<T> toList(Pair<T,T> p)
T
- type of both elementsp
- pairpublic static <T> Pair<T,T> sort(Pair<T,T> p)
a <= b
.T
- type of both elementsp
- pairp
public java.lang.String toString()
toString
in class java.lang.Object