jjdh API

dh.java.util.collection
Class Comparators

java.lang.Object
  extended by dh.java.util.collection.Comparators

public class Comparators
extends Object


Field Summary
private static Comparator<Object> HASH_ORDER
          Orders Objects regarding to their hash code (immutable).
private static Comparator<Collection<Object>> SIZE_ORDER
          Orders Collections regarding to their size (immutable).
 
Constructor Summary
Comparators()
           
 
Method Summary
static
<A> Comparator<A>
hashOrder()
          Returns a comparator which order given Collections regarding to their size.
static
<A extends Collection<?>>
Comparator<A>
sizeOrder()
          Returns a comparator which order given Collections regarding to their size.
static
<E> Comparator<EquivalenceClass<E>>
wrap(Comparator<E> comparator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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()
Constructor Detail

Comparators

public Comparators()
Method Detail

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)

jjdh API

Copyright © 2006 Jonas Jacobi and Dennis Heidsiek. All Rights Reserved.