|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jdsl.core.ref.ComparatorExtender
Takes a java.util.Comparator
and adapts it to the
jdsl.core.api.Comparator
.
Constructor Summary | |
ComparatorExtender(java.util.Comparator comparator)
Constructs a new comparator which adapts the given java.util.Comparator . |
Method Summary | |
int |
compare(java.lang.Object x1,
java.lang.Object x2)
Adapts the comparator method of the underlying comparator. |
boolean |
isComparable(java.lang.Object o)
Tests if an object is comparator by asking the comparator if compare(o,o) |
boolean |
isEqualTo(java.lang.Object x1,
java.lang.Object x2)
Tests the two parameter objects in the set over which the comparator is defined for equality. |
boolean |
isGreaterThan(java.lang.Object x1,
java.lang.Object x2)
Tests the strict order of two objects in the set over which this comparator is defined. |
boolean |
isGreaterThanOrEqualTo(java.lang.Object x1,
java.lang.Object x2)
Tests non-strict order of two objects in the universe over which this comparator is defined. |
boolean |
isLessThan(java.lang.Object x1,
java.lang.Object x2)
Tests the strict order of two objects in the set over which this comparator is defined. |
boolean |
isLessThanOrEqualTo(java.lang.Object x1,
java.lang.Object x2)
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 ComparatorExtender(java.util.Comparator comparator)
java.util.Comparator
.Method Detail |
public int compare(java.lang.Object x1, java.lang.Object x2) throws java.lang.ClassCastException
compare
in interface Comparator
java.lang.ClassCastException
- if the underlying comparator throws a
ClassCastException
Comparator.compare(Object,Object)
public boolean isComparable(java.lang.Object o)
compare(o,o)
isComparable
in interface EqualityComparator
Comparator.compare(Object,Object)
public boolean isGreaterThan(java.lang.Object x1, java.lang.Object x2) throws java.lang.ClassCastException
Comparator
isGreaterThan
in interface Comparator
public boolean isLessThan(java.lang.Object x1, java.lang.Object x2) throws java.lang.ClassCastException
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 isEqualTo(java.lang.Object x1, java.lang.Object x2) throws java.lang.ClassCastException
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 isGreaterThanOrEqualTo(java.lang.Object x1, java.lang.Object x2) throws java.lang.ClassCastException
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 isLessThanOrEqualTo(java.lang.Object x1, java.lang.Object x2) throws java.lang.ClassCastException
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 |