live.dto
Class Thread.ComparatorByTimeEnded
java.lang.Object
live.dto.Thread.ThreadComparator
live.dto.Thread.ComparatorByTimeEnded
- All Implemented Interfaces:
- Comparator
- Enclosing class:
- Thread
- public static class Thread.ComparatorByTimeEnded
- extends Thread.ThreadComparator
This comparator orders threads by the ending value. Because not all
threads have an ending value (because they haven't ended and we can't yet
see into the future), will sort all threads that are still ongoing as
less than all threads that have ended. It breaks ties with the time
started.
(In other words, sorting with this puts all ongoing threads before all
complete threads, with the ongoing threads sorted by time started and
complete threads by time ended.)
Method Summary |
int |
compare(Thread t1,
Thread t2)
Compares two threads by subtracting the time ended
for each |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Thread.ComparatorByTimeEnded
public Thread.ComparatorByTimeEnded()
compare
public int compare(Thread t1,
Thread t2)
- Compares two threads by subtracting the time ended
for each
- Specified by:
compare
in class Thread.ThreadComparator
- Parameters:
t1
- First threadt2
- Second thread
- Returns:
- int Difference in starting times between the two threads, returns
-1 if thread1 isn't ended and 1 if thread2 isn' ended
- See Also:
Comparator.compare(java.lang.Object, java.lang.Object)
Copyright © 2005