org.graffiti.util
Class ReverseComparator<T>

java.lang.Object
  extended by org.graffiti.util.ReverseComparator<T>
All Implemented Interfaces:
Comparator<T>

public class ReverseComparator<T>
extends Object
implements Comparator<T>

ReverseComparator<T> imposes an ordering which is the reversed ordering imposed by the Comparator<T> object that is passed on construction.


Constructor Summary
ReverseComparator(Comparator<T> comparator)
          Creates a new ReverseComparator<T>.
 
Method Summary
 int compare(T t1, T t2)
          Compares two objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ReverseComparator

public ReverseComparator(Comparator<T> comparator)
Creates a new ReverseComparator<T>.

Parameters:
comparator - the comparator that imposes the reversed ordering this comparator imposes.
Method Detail

compare

public int compare(T t1,
                   T t2)
Compares two objects.

Specified by:
compare in interface Comparator<T>
Parameters:
t1 - the first object being compared.
t2 - the second object being compared.


Generated at 2012-05-30 11:00:14 PM CEST