|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jutil.java.collections.ExtendedComparator | +--org.jutil.java.collections.InverseComparator
An ExtendedComparator that inverts another Comparator.
Constructor Summary | |
InverseComparator(java.util.Comparator comparator)
public behavior pre comparator != null; post getComparator() == comparator; Initialize a new InverseComparator with the given comparator. |
Method Summary | |
int |
compare(java.lang.Object first,
java.lang.Object second)
public behavior post \result == -getComparator().compare(first, second); Return the inverse of the what the inverted comparator would return. |
java.util.Comparator |
getComparator()
public behavior post \result != null; 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 |
Constructor Detail |
public InverseComparator(java.util.Comparator comparator)
comparator
- The comparator to invert.Method Detail |
public java.util.Comparator getComparator()
public int compare(java.lang.Object first, java.lang.Object second)
first
- The left-hand side objectsecond
- The right-hand side object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |