info.aduna.collections
Class ReverseComparator<T>

java.lang.Object
  extended by info.aduna.collections.ReverseComparator<T>
All Implemented Interfaces:
Comparator<T>

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

ReverseComparator reverses the result of another Comparator.


Constructor Summary
ReverseComparator(Comparator<T> other)
          Construct a new reverse comparator that reverses the result of the specified comparator.
 
Method Summary
 int compare(T o1, T o2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ReverseComparator

public ReverseComparator(Comparator<T> other)
Construct a new reverse comparator that reverses the result of the specified comparator.

Parameters:
other - the comparator to reverse
Method Detail

compare

public int compare(T o1,
                   T o2)
Specified by:
compare in interface Comparator<T>


Copyright © 1997-2008 Aduna. All Rights Reserved.