org.jutil.java.collections
Class InverseComparator

java.lang.Object
  |
  +--org.jutil.java.collections.ExtendedComparator
        |
        +--org.jutil.java.collections.InverseComparator
All Implemented Interfaces:
java.util.Comparator

public class InverseComparator
extends ExtendedComparator

DEPRECATED

An ExtendedComparator that inverts another Comparator.


Field Summary
static java.lang.String CVS_REVISION
          Deprecated.  
 
Constructor Summary
InverseComparator(java.util.Comparator comparator)
          Deprecated. Initialize a new InverseComparator with the given comparator.
 
Method Summary
 int compare(java.lang.Object first, java.lang.Object second)
          Deprecated. Return the inverse of the what the inverted comparator would return.
 java.util.Comparator getComparator()
          Deprecated. Return the comparator inverted by this.
 
Methods inherited from class org.jutil.java.collections.ExtendedComparator
ensureExtended, greater, max, min, notGreater, notSmaller, smaller
 
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
 

Field Detail

CVS_REVISION

public static final java.lang.String CVS_REVISION
Deprecated. 
Constructor Detail

InverseComparator

public InverseComparator(java.util.Comparator comparator)
Deprecated. 
Initialize a new InverseComparator with the given comparator.

Parameters:
comparator - The comparator to invert.

Specifications:
public behavior
requires comparator != null;
ensures getComparator() == comparator;
Method Detail

getComparator

public java.util.Comparator getComparator()
Deprecated. 
Return the comparator inverted by this.

Specifications:
public behavior
ensures \result != null;

compare

public int compare(java.lang.Object first,
                   java.lang.Object second)
Deprecated. 
Return the inverse of the what the inverted comparator would return.

Parameters:
first - The left-hand side object
second - The right-hand side object

Specifications:
     also
public behavior
ensures \result == -getComparator().compare(first,second);