|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jdsl.core.ref.AbstractComparator
|
+--jdsl.core.ref.ComparableComparator
Implementation of JDSL's Comparator interface in terms of the JDK's Comparable interface. Compares any two Comparables, regardless of their actual type.
| Constructor Summary | |
ComparableComparator()
|
|
| Method Summary | |
int |
compare(java.lang.Object x1,
java.lang.Object x2)
Invokes the compareTo method of x1 on
x2. |
boolean |
isComparable(java.lang.Object o)
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. |
| Methods inherited from class jdsl.core.ref.AbstractComparator |
isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jdsl.core.api.Comparator |
isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo |
| Methods inherited from interface jdsl.core.api.EqualityComparator |
isEqualTo |
| Constructor Detail |
public ComparableComparator()
| Method Detail |
public int compare(java.lang.Object x1,
java.lang.Object x2)
throws java.lang.ClassCastException
compareTo method of x1 on
x2.compare in interface Comparatorcompare in class AbstractComparatorx1 - A Comparable to which x2 will
be compared.x2 - An Object which will be compared to
x1java.lang.ClassCastException - if x1 is
null or not a ComparableComparablepublic boolean isComparable(java.lang.Object o)
EqualityComparatorisComparable in interface EqualityComparatoro - Object you propose to compare with this comparatorComparableComparable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||