|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.moskito.core.timing.timer.TimerServiceImpl
public class TimerServiceImpl
This class implements a basic timer. The timer sleeps unified time, then checks if any consumer want to have a "tick". Each consumer can specify the number of "ticks" in which interval they want to be called.
| Nested Class Summary | |
|---|---|
(package private) class |
TimerServiceImpl.TimerObject
The Holder class for the information of upcoming events. |
| Field Summary | |
|---|---|
private static TimerServiceImpl |
instance
|
private List<TimerServiceImpl.TimerObject> |
objects
|
(package private) boolean |
running
|
(package private) int |
sleepTime
|
(package private) Thread |
thread
The ticker-thread. |
| Constructor Summary | |
|---|---|
private |
TimerServiceImpl()
|
| Method Summary | |
|---|---|
void |
addConsumer(ITimerConsumer object,
int amount)
Adds a feature to the Consumer attribute of the CIPTimer object |
void |
deInit()
Description of the Method |
static TimerServiceImpl |
getInstance()
|
void |
init()
Description of the Method |
void |
removeConsumer(ITimerConsumer object)
Description of the Method |
void |
removeConsumer(ITimerConsumer object,
int amount)
Description of the Method |
void |
run()
Main processing method for the CIPTimer object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static TimerServiceImpl instance
int sleepTime
private List<TimerServiceImpl.TimerObject> objects
volatile boolean running
Thread thread
| Constructor Detail |
|---|
private TimerServiceImpl()
| Method Detail |
|---|
public static TimerServiceImpl getInstance()
public void init()
public void deInit()
public void addConsumer(ITimerConsumer object,
int amount)
addConsumer in interface ITimerServiceobject - The feature to be added to the Consumer attributeamount - The feature to be added to the Consumer attribute
public void removeConsumer(ITimerConsumer object,
int amount)
removeConsumer in interface ITimerServiceobject - Description of Parameteramount - Description of Parameterpublic void removeConsumer(ITimerConsumer object)
removeConsumer in interface ITimerServiceobject - Description of Parameterpublic void run()
run in interface Runnable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||