|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jagg.ComparableComparator<T>
public class ComparableComparator<T extends java.lang.Comparable<? super T>>
This adapter class compares Comparables
. It compares its
objects exactly like T
's compareTo
method (which
exists because T
is Comparable
).
Constructor Summary | |
---|---|
ComparableComparator()
|
Method Summary | |
---|---|
int |
compare(T o1,
T o2)
Compares the given objects to determine order. |
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 ComparableComparator()
Method Detail |
---|
public int compare(T o1, T o2)
Compares the given objects to determine order. Fulfills the
Comparator
contract by returning a negative integer, 0, or a
positive integer if o1
is less than, equal to, or greater
than o2
.
Nulls compare equal to each other, and a null compares greater than non-nulls.
compare
in interface java.util.Comparator<T extends java.lang.Comparable<? super T>>
o1
- The left-hand-side object to compare.o2
- The right-hand-side object to compare.
o1
is less than, equal to, or greater than o2
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |