|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlive.dto.Thread.ThreadComparator
This is a base class for the different comparator styles. See
ShowStatusAction for a use of this
and why it is necessary for clean code there.
| Field Summary | |
private int |
reverse
|
| Constructor Summary | |
Thread.ThreadComparator()
Makes a comparator that will not reverse its decision |
|
Thread.ThreadComparator(boolean reverseOrder)
Makes a comparator that will optionally reverse its decision |
|
| Method Summary | |
int |
compare(Object o1,
Object o2)
This makes sure that o1 and o2 are both threads, calls the abstract compare(Thread, Thread), and possibly reverses that decision. |
abstract int |
compare(Thread t1,
Thread t2)
This does the actual comparison. |
Thread.ThreadComparator |
setReverse(boolean reverseOrder)
Returns this so it can be chained easily, e.g. |
| 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 |
| Field Detail |
private int reverse
| Constructor Detail |
public Thread.ThreadComparator(boolean reverseOrder)
reverseOrder - Order in reverse of what it otherwise would?public Thread.ThreadComparator()
| Method Detail |
public Thread.ThreadComparator setReverse(boolean reverseOrder)
reverseOrder - Whether to reverse the output
public final int compare(Object o1,
Object o2)
compare(Thread, Thread), and possibly reverses that decision.
compare in interface Comparatoro1 - The first object to compareo2 - The second object to compare
Comparator.compare(java.lang.Object, java.lang.Object)
public abstract int compare(Thread t1,
Thread t2)
compare(Object, Object) calls this
and reverses the return itself.
t1 - The first thread to comparet2 - The second thread to compare
Comparator.compare(java.lang.Object, java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||