|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.salespointframework.core.AutoTimer
public class AutoTimer
A timer that has the functionality of the StepTimer
and additionally
can increase the time automatically.
Field Summary | |
---|---|
(package private) long |
delay
delay between increase steps |
(package private) int |
interval
interval in ms by which the dates becomes increased |
(package private) java.lang.Thread |
thread
Time thread |
(package private) java.util.GregorianCalendar |
time
current date |
(package private) java.util.List<TimerListener> |
timerListeners
List of attached TimerListeners |
Constructor Summary | |
---|---|
AutoTimer()
Default Constructor. |
|
AutoTimer(java.util.GregorianCalendar time,
int interval,
boolean start)
Constructor |
Method Summary | |
---|---|
void |
addTimerListener(TimerListener tlListener)
Add a TimerListene to observer list |
protected void |
fireTimeChanged()
|
long |
getDelay()
|
java.lang.Object |
getInterval()
Get the current interval for calls to goAhead() . |
java.lang.Object |
getTime()
Get the current time. |
java.lang.Comparable |
getTimeStamp()
Create and return a fresh time stamp. |
void |
goAhead()
Increases the date by interval |
void |
goAhead(int millis)
increase the date by given ms |
void |
removeTimerListener(TimerListener tlListener)
Removes the given TimerListener from the observer list |
void |
setDelay(long delay)
Set the delay between increase steps |
void |
setInterval(java.lang.Object oInterval)
Set the interval, by which the date becomes increased on each step |
void |
setTime(java.lang.Object oTime)
Set the date |
void |
start()
Starts the timer |
void |
stop()
Stops the timer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.GregorianCalendar time
int interval
long delay
java.util.List<TimerListener> timerListeners
java.lang.Thread thread
Constructor Detail |
---|
public AutoTimer()
public AutoTimer(java.util.GregorianCalendar time, int interval, boolean start)
time
- the initial dateinterval
- increase interval. delay
also.start.
- if true, the timer starts immediatelyMethod Detail |
---|
public void start()
public void stop()
protected void fireTimeChanged()
public void addTimerListener(TimerListener tlListener)
addTimerListener
in interface Timer
tlListener
- the listener to be addedTimerListener
public java.lang.Object getInterval()
Timer
goAhead()
.
getInterval
in interface Timer
public java.lang.Object getTime()
Timer
This method should call the equivalent method of the Time
object.
getTime
in interface Timer
public java.lang.Comparable getTimeStamp()
Timer
This method should call the Time
object's getTimeStamp()
method passing a long
value representing the number of the time stamp in this time period.
getTimeStamp
in interface Timer
public void goAhead() throws java.lang.IllegalArgumentException
goAhead
in interface Timer
java.lang.IllegalArgumentException
- if the interval does not meet the time object's class or format
requirementsTimerListener.onGoneAhead(org.salespointframework.core.events.TimerEvent)
public long getDelay()
public void setDelay(long delay)
delay
- in mspublic void goAhead(int millis)
millis
- public void removeTimerListener(TimerListener tlListener)
removeTimerListener
in interface Timer
tlListener
- the listener to be removedTimerListener
public void setInterval(java.lang.Object oInterval)
setInterval
in interface Timer
oInterval
- the interval to be setTimerListener.onIntervalSet(org.salespointframework.core.events.TimerEvent)
public void setTime(java.lang.Object oTime) throws java.lang.IllegalArgumentException
setTime
in interface Timer
oTime
- the time to be set
java.lang.IllegalArgumentException
- if the time does not meet the time object's class or format
requirementsTimerListener.onTimeSet(org.salespointframework.core.events.TimerEvent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |