public abstract class AbstractTimer extends AbstractEvent implements java.lang.Comparable<AbstractEvent>
Constructor and Description |
---|
AbstractTimer() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AbstractEvent o)
Start a new timer for the node n using the absoluteTime.
|
abstract void |
fire()
Fire a new timer event.
|
void |
handle()
This method is for internal use only.
|
void |
startRelative(double relativeTime,
Node n)
Start a new relative timer to the Node n.
|
void |
startTimer(double relativeTime)
Start a new timer using a relative timer.
|
getFireTime, getID, getNode, setFireTime, setNode
public abstract void fire()
public void handle()
handle
in class AbstractEvent
public final void startTimer(double relativeTime)
relativeTime
- - the time that will be increased to the current timer
to fire the event.public final void startRelative(double relativeTime, Node n)
relativeTime
- - the time that will be increased to the current timern
- - the node where the event will be treatedpublic int compareTo(AbstractEvent o)
compareTo
in interface java.lang.Comparable<AbstractEvent>
compareTo
in class AbstractEvent
absoluteTime
- - the exact time when the event should occurrn
- - the node who will fire the timer