E - the type to be compared.
Created: Sat May 21 16:30:58 2005public abstract class Comparators<E> extends Object
Comparators.| Modifier and Type | Class and Description |
|---|---|
private static class |
Comparators.AsListed<E>
Implements an ordering given by the list
Comparators.AsListed.seq. |
private static class |
Comparators.Cascade<E>
Represents a comparator which is a cascade of comparators:
Starting with the first comparator in
Comparators.Cascade.seq
asks the next comparator if the current one detects equality. |
| Constructor and Description |
|---|
Comparators() |
| Modifier and Type | Method and Description |
|---|---|
static <E> Comparator<E> |
getAsListed(List<E> seq)
Returns an ordering given by the list
Comparators.AsListed.seq. |
static <E> Comparator<E> |
getCascade(Collection<Comparator<E>> seq) |
static <E> Comparator<E> |
getInv(Comparator<E> cmp) |
static <E> Comparator<E> |
getNegative(Comparator<E> cmp) |
public static <E> Comparator<E> getNegative(Comparator<E> cmp)
public static <E> Comparator<E> getInv(Comparator<E> cmp)
public static <E> Comparator<E> getCascade(Collection<Comparator<E>> seq)
public static <E> Comparator<E> getAsListed(List<E> seq)
Comparators.AsListed.seq.
Elements not in the list are all minimal
and pairwise equal with respect to this comparator.
They are less than all elements in the list.
The ordering on the list is ascending.
CAUTION: This ordering is consistent with equals only
under certain conditions.
The other ordering axioms hold.
For more details see Comparators.AsListed.
Caution: changing the list, affects the comparator.
seq - a list which determines the ordering.NullPointerException - if seq is null.Copyright © 2012–2018 Simuline Organization (l2r). All rights reserved.