|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sale.StepTimer
This is a rather simple implementation of the Timer interface.
It requires a Time object to work with. Every increasing of the timer has to be explicitly triggered by the goAhead() method.
Field Summary | |
protected ListenerHelper |
m_lhListeners
The listeners registered with this timer. |
protected Time |
m_tTime
The current Time. |
Constructor Summary | |
StepTimer()
Create a new timer wich uses an instance of Step as the time object. |
|
StepTimer(Time tTimeObject)
Create a new timer wich uses the given Time object. |
Method Summary | |
void |
addTimerListener(TimerListener tlListener)
Add a TimerListener which will receive TimerEvents triggered by this timer. |
protected void |
fireGoneAhead()
Fire a goneAhead event. |
protected void |
fireIntervalSet()
Fire an intervalSet event. |
protected void |
fireTimeSet()
Fire a timeSet event. |
Object |
getInterval()
Get the current interval. |
Object |
getTime()
Get the current time. |
Comparable |
getTimeStamp()
Create and return a fresh time stamp. |
void |
goAhead()
Increase the time by the current interval. |
void |
removeTimerListener(TimerListener tlListener)
Remove the given TimerListener. |
void |
setInterval(Object oInterval)
Set the interval to be used by the goAhead() method. |
void |
setTime(Object oTime)
Set the time and fire a timeSet event. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Time m_tTime
protected ListenerHelper m_lhListeners
Constructor Detail |
public StepTimer()
public StepTimer(Time tTimeObject)
tTimeObject
- the time object to useMethod Detail |
public void setTime(Object oTime) throws IllegalArgumentException
timeSet
event.
The time has to be in a format that can be processed by the Time object.
oTime
- the time to setpublic Object getTime()
Time
object.public void setInterval(Object oInterval)
The given interval has to be of a proper type to be used with the time object's goAhead() method.
oInterval
- the interval to be usedpublic Object getInterval()
public void addTimerListener(TimerListener tlListener)
tlListener
- the listener to be registered.public void removeTimerListener(TimerListener tlListener)
tlListener
- the listener to be deregistered.public void goAhead() throws IllegalArgumentException
If no interval has been set yet, the interval given by the Time.getDefaultInterval()
method
of the time object is used.
public Comparable getTimeStamp()
protected void fireTimeSet()
timeSet
event.protected void fireIntervalSet()
intervalSet
event.protected void fireGoneAhead()
goneAhead
event.
|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |