org.apache.commons.collections.comparators
Class ReverseComparator
java.lang.Object
org.apache.commons.collections.comparators.ReverseComparator
- Comparator, Serializable
public class ReverseComparator
extends java.lang.Object
implements Comparator, Serializable
Reverses the order of another comparator.
$Id: ReverseComparator.java,v 1.8.2.1 2004/05/22 12:14:04 scolebourne Exp $ReverseComparator() - Creates a comparator that compares objects based on the inverse of their
natural ordering.
|
ReverseComparator(Comparator comparator) - Creates a reverse comparator that inverts the comparison
of the passed in comparator.
|
ReverseComparator
public ReverseComparator()
Creates a comparator that compares objects based on the inverse of their
natural ordering. Using this Constructor will create a ReverseComparator
that is functionaly identical to the Comparator returned by
java.util.Collections.reverseOrder().
java.util.Collections.reverseOrder()
ReverseComparator
public ReverseComparator(Comparator comparator)
Creates a reverse comparator that inverts the comparison
of the passed in comparator. If you pass in a null,
the ReverseComparator defaults to reversing the
natural order, as per
java.util.Collections.reverseOrder().
comparator
- Comparator to reverse
compare
public int compare(Object o1,
Object o2)
Copyright © 2001-2004 Apache Software Foundation. Documenation generated ${TODAY}.