edu.stanford.nlp.util
Class Pair.ByFirstPairComparator<T1,T2>
java.lang.Object
edu.stanford.nlp.util.Pair.ByFirstPairComparator<T1,T2>
- Type Parameters:
T1
- T2
-
- All Implemented Interfaces:
- java.util.Comparator<Pair<T1,T2>>
- Enclosing class:
- Pair<T1,T2>
public static class Pair.ByFirstPairComparator<T1,T2>
- extends java.lang.Object
- implements java.util.Comparator<Pair<T1,T2>>
Compares a Pair
to another Pair
according to the first object of the pair only
This function will work providing
the first element of the Pair
is comparable, otherwise will throw a
ClassCastException
- Author:
- jonathanberant
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
Pair.ByFirstPairComparator
public Pair.ByFirstPairComparator()
compare
public int compare(Pair<T1,T2> pair1,
Pair<T1,T2> pair2)
- Specified by:
compare
in interface java.util.Comparator<Pair<T1,T2>>
Stanford NLP Group