FIRST
- first typeSECOND
- second typepublic static class PairUtil.CompareBySecond<FIRST,SECOND> extends Object implements Comparator<Pair<? extends FIRST,? extends SECOND>>
Modifier and Type | Field and Description |
---|---|
private Comparator<? super SECOND> |
comparator
A comparator for type P.
|
Constructor and Description |
---|
PairUtil.CompareBySecond(Comparator<? super SECOND> 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, wait
equals
private Comparator<? super SECOND> comparator
public PairUtil.CompareBySecond(Comparator<? super SECOND> 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)