
FIRST - first typeSECOND - second typepublic static class PairUtil.CompareByFirst<FIRST,SECOND> extends Object implements Comparator<Pair<? extends FIRST,? extends SECOND>>
| Modifier and Type | Field and Description |
|---|---|
private Comparator<? super FIRST> |
comparator
A comparator for type P.
|
| Constructor and Description |
|---|
PairUtil.CompareByFirst(Comparator<? super FIRST> comparator)
Provides a comparator for an
Pair based on the given Comparator
for type P. |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Pair<? extends FIRST,? extends SECOND> o1,
Pair<? extends FIRST,? extends SECOND> o2)
To Objects of type
Pair are compared based on the comparison of
their property using the current PairUtil.comparator(). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequalsprivate Comparator<? super FIRST> comparator
public PairUtil.CompareByFirst(Comparator<? super FIRST> comparator)
Pair based on the given Comparator
for type P.comparator - a Comparator for type P to base the
comparison of an Pair onpublic int compare(Pair<? extends FIRST,? extends SECOND> o1, Pair<? extends FIRST,? extends SECOND> o2)
Pair are compared based on the comparison of
their property using the current PairUtil.comparator().compare in interface Comparator<Pair<? extends FIRST,? extends SECOND>>o1 - First objecto2 - Second objectComparator.compare(T, T)