|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | 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. |
Time |
getTimeObject()
Returns the object that contains the 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()
Step
as the time object.
public StepTimer(Time tTimeObject)
Time
object.
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.
setTime
in interface Timer
oTime
- the time to set
IllegalArgumentException
- if the set time does not meet the time object's class or format
requirementsTimerListener.onTimeSet(sale.events.TimerEvent)
public Object getTime()
Time
object.
getTime
in interface Timer
public Time getTimeObject()
public void setInterval(Object oInterval)
goAhead()
method.
The given interval has to be of a proper type to be used with the time object's
goAhead()
method.
setInterval
in interface Timer
oInterval
- the interval to be usedTimerListener.onIntervalSet(sale.events.TimerEvent)
public Object getInterval()
getInterval
in interface Timer
public void addTimerListener(TimerListener tlListener)
TimerListener
which will receive
TimerEvents
triggered by this timer.
addTimerListener
in interface Timer
tlListener
- the listener to be registered.TimerListener
public void removeTimerListener(TimerListener tlListener)
TimerListener
.
removeTimerListener
in interface Timer
tlListener
- the listener to be deregistered.TimerListener
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.
goAhead
in interface Timer
IllegalArgumentException
- if the interval does not meet the time object's class or format
requirementsTimerListener.onGoneAhead(sale.events.TimerEvent)
public Comparable getTimeStamp()
getTimeStamp
in interface Timer
protected void fireTimeSet()
timeSet
event.
protected void fireIntervalSet()
intervalSet
event.
protected void fireGoneAhead()
goneAhead
event.
|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |