|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.util.Comparators
public final class Comparators
General purpose comparators.
Method Summary | ||
---|---|---|
static
|
forCollections()
Returns a comparator for arbitrary collections of comparable elements. |
|
static
|
forLists()
Returns a comparator for lists of comparable elements. |
|
static
|
forSortedSets()
Returns a comparator for sorted sets of comparable elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T extends java.lang.Comparable<T>> java.util.Comparator<java.util.List<T>> forLists()
If both lists have the same length and equal elements in the sense of
Comparable.compareTo(T)
, then the comparator returns 0.
T
- The type of elements in both lists.
public static <T extends java.lang.Comparable<T>> java.util.Comparator<java.util.SortedSet<T>> forSortedSets()
T
- The type of elements in both sets.
public static <T extends java.lang.Comparable<T>> java.util.Comparator<java.util.Collection<T>> forCollections()
TreeSet
, LinkedHashSet
or queues.
Do not use it with HashSet
.
T
- The type of elements in both collections.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |