T - the type of the first element.S - the type of the second element.public final class Pair<T extends Comparable<T>,S extends Comparable<S>> extends Object implements Comparable<Pair<T,S>>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Pair<T,S> otherPair)
Compare this pair to another pair for lexicographic ordering.
|
boolean |
equals(Object o) |
T |
first() |
int |
hashCode() |
static <T extends Comparable<T>,S extends Comparable<S>> |
newPair(T first,
S second) |
S |
second() |
String |
toString() |
public static <T extends Comparable<T>,S extends Comparable<S>> Pair<T,S> newPair(T first, S second)
public T first()
public S second()
public int compareTo(@NonNull
Pair<T,S> otherPair)
compareTo in interface Comparable<Pair<T extends Comparable<T>,S extends Comparable<S>>>otherPair - the pair to compare this one to.Comparable.compareTo(Object) contract.