public class TimerSimulated
extends java.lang.Object
implements java.lang.Cloneable
The time units for the timer are the simulator clock ticks, instead of actual time units, such as seconds.
Modifier and Type | Field and Description |
---|---|
TimedComponent |
callback
The callback object that will be called when this timer expires.
|
private double |
time
The future time when this timer will expire.
|
int |
type
Type of the timer, to help the component distinguish between multiple running timers.
|
Constructor and Description |
---|
TimerSimulated(TimedComponent callback_,
int type_,
double time_)
Note: The constructor should check that
time_
is indeed in the future, but we currently don't check that... |
public TimedComponent callback
private double time
public int type
public TimerSimulated(TimedComponent callback_, int type_, double time_)
Note: The constructor should check that time_
is indeed in the future, but we currently don't check that...
callback_
- callback object to call when this timer expirestype_
- timer type, in case the component is running multiple timerstime_
- future time when this timer will firepublic java.lang.Object clone()
clone
in class java.lang.Object
public double getTime()
public void setTime(double time)
time
- the time to set