Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.ematgine.utils.concurrent
Class TimeDaemon.TaskNode  view TimeDaemon.TaskNode download TimeDaemon.TaskNode.java

java.lang.Object
  extended byorg.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


Field Summary
private  boolean cancelled_
           
(package private)  java.lang.Runnable command
           
(package private)  long period
           
private  long timeToRun_
           
 
Constructor Summary
(package private) TimeDaemon.TaskNode(long w, java.lang.Runnable c)
           
(package private) TimeDaemon.TaskNode(long w, java.lang.Runnable c, long p)
           
 
Method Summary
 int compareTo(java.lang.Object other)
          Compares this object with another, and returns a numerical result based on the comparison.
(package private)  boolean getCancelled()
           
(package private)  long getTimeToRun()
           
(package private)  void setCancelled()
           
(package private)  void setTimeToRun(long w)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

command

final java.lang.Runnable command

period

final long period

timeToRun_

private long timeToRun_

cancelled_

private boolean cancelled_
Constructor Detail

TimeDaemon.TaskNode

TimeDaemon.TaskNode(long w,
                    java.lang.Runnable c,
                    long p)

TimeDaemon.TaskNode

TimeDaemon.TaskNode(long w,
                    java.lang.Runnable c)
Method Detail

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