org.meshcms.util
Class ReverseComparator

java.lang.Object
  extended byorg.meshcms.util.ReverseComparator
All Implemented Interfaces:
java.util.Comparator, java.io.Serializable

public class ReverseComparator
extends java.lang.Object
implements java.util.Comparator, java.io.Serializable

Allows to sort in reversed ordering. If a Comparator is not supplied, the order will be the reversed natural ordering.

See Also:
Serialized Form

Constructor Summary
ReverseComparator()
          Creates a new instance of ReverseComparator without specifying a base Comparator
ReverseComparator(java.util.Comparator comparator)
          Creates a new instance of ReverseComparator to reverse the specified Comparator
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object 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()
Creates a new instance of ReverseComparator without specifying a base Comparator


ReverseComparator

public ReverseComparator(java.util.Comparator comparator)
Creates a new instance of ReverseComparator to reverse the specified Comparator

Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator