Package jadex.platform.service.clock
Class Timer
- java.lang.Object
-
- jadex.platform.service.clock.Timer
-
- All Implemented Interfaces:
ITimer,java.io.Serializable
- Direct Known Subclasses:
TickTimer
public class Timer extends java.lang.Object implements ITimer, java.io.Serializable
A timer for being notified at a specified timepoint.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTimer(long time, IClock clock, ITimedObject to)Create a new timer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancel the timer.longgetNotificationTime()Get the next absolute alarm timepoint.protected intgetNumber()Get the number.ITimedObjectgetTimedObject()Get the timed object.voidsetNotificationTime(long time)Change notification time.
-
-
-
Field Detail
-
count
protected static int count
The instance count.
-
time
protected long time
The time delta before the alarm.
-
clock
protected IClock clock
The clock.
-
to
protected ITimedObject to
The timed object.
-
number
protected int number
The instance number.
-
-
Constructor Detail
-
Timer
protected Timer(long time, IClock clock, ITimedObject to)Create a new timer.
-
-
Method Detail
-
getNotificationTime
public long getNotificationTime()
Get the next absolute alarm timepoint.- Specified by:
getNotificationTimein interfaceITimer- Returns:
- The next timepoint.
-
getTimedObject
public ITimedObject getTimedObject()
Get the timed object.- Specified by:
getTimedObjectin interfaceITimer- Returns:
- The timed object.
-
setNotificationTime
public void setNotificationTime(long time)
Change notification time.- Specified by:
setNotificationTimein interfaceITimer- Parameters:
The- notification time.
-
getNumber
protected int getNumber()
Get the number.- Returns:
- The number.
-
-