dh.java.util.collection
Class Comparators
java.lang.Object
dh.java.util.collection.Comparators
public class Comparators
- extends Object
Method Summary |
static
|
hashOrder()
Returns a comparator which order given Collections regarding to their
size. |
static
|
sizeOrder()
Returns a comparator which order given Collections regarding to their
size. |
static
|
wrap(Comparator<E> comparator)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SIZE_ORDER
private static final Comparator<Collection<Object>> SIZE_ORDER
- Orders Collections regarding to their size (immutable).
- See Also:
Collection.size()
,
sizeOrder()
HASH_ORDER
private static final Comparator<Object> HASH_ORDER
- Orders Objects regarding to their hash code (immutable).
- See Also:
Object.hashCode()
,
hashOrder()
Comparators
public Comparators()
sizeOrder
public static final <A extends Collection<?>> Comparator<A> sizeOrder()
- Returns a comparator which order given Collections regarding to their
size.
Although this method is type-safe, the implementation of this method will
not create a separate
Comparator
object for each call.
- See Also:
SIZE_ORDER
hashOrder
public static final <A> Comparator<A> hashOrder()
- Returns a comparator which order given Collections regarding to their
size.
Although this method is type-safe, the implementation of this method will
not create a separate
Comparator
object for each call.
- See Also:
HASH_ORDER
wrap
public static <E> Comparator<EquivalenceClass<E>> wrap(Comparator<E> comparator)
Copyright © 2006 Jonas Jacobi and Dennis Heidsiek. All Rights Reserved.