compareTo method
- Pair<
T1, T2> other
Compares this pair lexicographically with other.
It first compares the first elements. If they are equal, it compares
the second elements.
Implementation
int compareTo(Pair<T1, T2> other) {
int firstComparison = first.compareTo(other.first);
if (firstComparison != 0) return firstComparison;
return second.compareTo(other.second);
}