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 protected
Timer(long time, IClock clock, ITimedObject to)
Create a new timer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancel the timer.long
getNotificationTime()
Get the next absolute alarm timepoint.protected int
getNumber()
Get the number.ITimedObject
getTimedObject()
Get the timed object.void
setNotificationTime(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:
getNotificationTime
in interfaceITimer
- Returns:
- The next timepoint.
-
getTimedObject
public ITimedObject getTimedObject()
Get the timed object.- Specified by:
getTimedObject
in interfaceITimer
- Returns:
- The timed object.
-
setNotificationTime
public void setNotificationTime(long time)
Change notification time.- Specified by:
setNotificationTime
in interfaceITimer
- Parameters:
The
- notification time.
-
getNumber
protected int getNumber()
Get the number.- Returns:
- The number.
-
-