java.lang.Object
org.ematgine.utils.concurrent.TimeDaemon.TaskNode
- All Implemented Interfaces:
- java.lang.Comparable
- Enclosing class:
- TimeDaemon
- protected static class TimeDaemon.TaskNode
- extends java.lang.Object
- implements java.lang.Comparable
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
command
final java.lang.Runnable command
period
final long period
timeToRun_
private long timeToRun_
cancelled_
private boolean cancelled_
TimeDaemon.TaskNode
TimeDaemon.TaskNode(long w,
java.lang.Runnable c,
long p)
TimeDaemon.TaskNode
TimeDaemon.TaskNode(long w,
java.lang.Runnable c)
setCancelled
void setCancelled()
getCancelled
boolean getCancelled()
setTimeToRun
void setTimeToRun(long w)
getTimeToRun
long getTimeToRun()
compareTo
public int compareTo(java.lang.Object other)
- Description copied from interface:
java.lang.Comparable
- Compares this object with another, and returns a numerical result based
on the comparison. If the result is negative, this object sorts less
than the other; if 0, the two are equal, and if positive, this object
sorts greater than the other. To translate this into boolean, simply
perform
o1.compareTo(o2) <op> 0, where op
is one of <, <=, =, !=, >, or >=.
You must make sure that the comparison is mutual, ie.
sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) (where sgn() is
defined as -1, 0, or 1 based on the sign). This includes throwing an
exception in either direction if the two are not comparable; hence,
compareTo(null) should always throw an Exception.
You should also ensure transitivity, in two forms:
x.compareTo(y) > 0 && y.compareTo(z) > 0 implies
x.compareTo(z) > 0; and x.compareTo(y) == 0
implies x.compareTo(z) == y.compareTo(z).
- Specified by:
compareTo in interface java.lang.Comparable