|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.util.Comparators
public class Comparators
| Constructor Summary | |
|---|---|
Comparators()
|
|
| Method Summary | ||
|---|---|---|
static
|
chain(java.util.Comparator<? super T>... c)
|
|
static
|
chain(java.util.Comparator<? super T> c1,
java.util.Comparator<? super T> c2)
Returns a new Comparator which is the result of chaining the
given Comparators. |
|
static
|
chain(java.util.List<java.util.Comparator<? super T>> c)
Returns a new Comparator which is the result of chaining the
given Comparators. |
|
static
|
nullSafeComparator(T one,
T two)
Returns a consistent ordering over two elements even if one of them is null (as long as compareTo() is stable, of course). |
|
static
|
reverse(java.util.Comparator<? super T> c)
Returns a new Comparator which is the reverse of the
given Comparator. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Comparators()
| Method Detail |
|---|
public static <T> java.util.Comparator<T> chain(java.util.Comparator<? super T> c1,
java.util.Comparator<? super T> c2)
Comparator which is the result of chaining the
given Comparators. If the first Comparator
considers two objects unequal, its result is returned; otherwise, the
result of the second Comparator is returned. Facilitates
sorting on primary and secondary keys.
public static <T> java.util.Comparator<T> chain(java.util.List<java.util.Comparator<? super T>> c)
Comparator which is the result of chaining the
given Comparators. Facilitates sorting on multiple keys.
public static <T> java.util.Comparator<T> chain(java.util.Comparator<? super T>... c)
public static <T> java.util.Comparator<T> reverse(java.util.Comparator<? super T> c)
Comparator which is the reverse of the
given Comparator.
public static <T extends java.lang.Comparable<? super T>> int nullSafeComparator(T one,
T two)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||