|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jdsl.core.ref.ComparatorReverser
Takes a Comparator
and reverses the
ordering with respect to which the elements are compared.
Constructor Summary | |
ComparatorReverser(Comparator cmp)
|
Method Summary | |
int |
compare(java.lang.Object a,
java.lang.Object b)
A C-style comparison function that returns a negative value if the first object is less than the second, a positive value if the second object is less, and 0 if the two objects are equal. |
boolean |
isComparable(java.lang.Object obj)
Allows a container (or any client) to find out whether an object is a member of the ordered set over which this comparator is defined. |
boolean |
isEqualTo(java.lang.Object a,
java.lang.Object b)
Tests the two parameter objects in the set over which the comparator is defined for equality. |
boolean |
isGreaterThan(java.lang.Object a,
java.lang.Object b)
Tests the strict order of two objects in the set over which this comparator is defined. |
boolean |
isGreaterThanOrEqualTo(java.lang.Object a,
java.lang.Object b)
Tests non-strict order of two objects in the universe over which this comparator is defined. |
boolean |
isLessThan(java.lang.Object a,
java.lang.Object b)
Tests the strict order of two objects in the set over which this comparator is defined. |
boolean |
isLessThanOrEqualTo(java.lang.Object a,
java.lang.Object b)
Tests non-strict order of two objects in the universe over which this comparator is defined. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ComparatorReverser(Comparator cmp)
c
- The comparator to be reversed.Method Detail |
public int compare(java.lang.Object a, java.lang.Object b)
Comparator
compare
in interface Comparator
compare(Object,Object)
call to the slave comparator; so if the other comparator
guarantees some number with an absolute value greater than one,
that value will be preservedpublic boolean isComparable(java.lang.Object obj)
EqualityComparator
isComparable
in interface EqualityComparator
jdsl.core.api.EqualityComparator
o
- Any java.lang.Objectpublic boolean isEqualTo(java.lang.Object a, java.lang.Object b)
EqualityComparator
isEqualTo
in interface EqualityComparator
jdsl.core.api.EqualityComparator
a
- First Object to compareb
- Second Object to comparejava.lang.ClassCastException
- If either object passed in as a parameter
is not a member of the set over which the comparator is defined.public boolean isGreaterThan(java.lang.Object a, java.lang.Object b)
Comparator
isGreaterThan
in interface Comparator
jdsl.core.api.Comparator
a
- First Object to compareb
- Second Object to comparejava.lang.ClassCastException
- If either object passed in as a parameter
is not a member of the set over which the comparator is defined.public boolean isGreaterThanOrEqualTo(java.lang.Object a, java.lang.Object b)
Comparator
isGreaterThanOrEqualTo
in interface Comparator
jdsl.core.api.Comparator
a
- First Object to compareb
- Second Object to comparejava.lang.ClassCastException
- If either object passed in as a parameter
is not a member of the set over which the comparator is defined.public boolean isLessThan(java.lang.Object a, java.lang.Object b)
Comparator
isLessThan
in interface Comparator
jdsl.core.api.Comparator
a
- First Object to compareb
- Second Object to comparejava.lang.ClassCastException
- If either object passed in as a parameter
is not a member of the set over which the comparator is defined.public boolean isLessThanOrEqualTo(java.lang.Object a, java.lang.Object b)
Comparator
isLessThanOrEqualTo
in interface Comparator
jdsl.core.api.Comparator
a
- First Object to compareb
- Second Object to comparejava.lang.ClassCastException
- If either object passed in as a parameter
is not a member of the set over which the comparator is defined.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |