SalesPoint Framework v3.0

sale
Class AutoTimer

java.lang.Object
  |
  +--sale.StepTimer
        |
        +--sale.AutoTimer

public class AutoTimer
extends StepTimer

A timer that has the functionality of the StepTimer and additionally can increase the time automatically.

Hooks:
Select Timer Type
Since:
v2.0
Version:
2.0 11/06/1999
Author:
Stephan Gambke
See Also:
Serialized Form

Fields inherited from class sale.StepTimer
m_lhListeners, m_tTime
 
Constructor Summary
AutoTimer()
          Create a new AutoTimer with a Step as time object and a delay of 10 seconds.
AutoTimer(Time tTime)
          Create a new AutoTimer with the given time object and a delay of 10 seconds.
AutoTimer(Time tTime, long lDelay)
          Create a new AutoTimer with the given time object and delay.
 
Method Summary
 long getDelay()
          Get the current delay between timer ticks in milliseconds.
 void goAhead()
          Increase the time by the current interval.
 void setDelay(long lMilliSecs)
          Set the delay between timer ticks.
 void start()
          Set the timer running.
 void stop()
          Stop the timer.
 
Methods inherited from class sale.StepTimer
addTimerListener, fireGoneAhead, fireIntervalSet, fireTimeSet, getInterval, getTime, getTimeStamp, removeTimerListener, setInterval, setTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoTimer

public AutoTimer()
Create a new AutoTimer with a Step as time object and a delay of 10 seconds. The timer is initially not running.

AutoTimer

public AutoTimer(Time tTime)
Create a new AutoTimer with the given time object and a delay of 10 seconds. The timer is initially not running.
Parameters:
tTime - the time object to be used

AutoTimer

public AutoTimer(Time tTime,
                 long lDelay)
Create a new AutoTimer with the given time object and delay. The timer is initially not running.
Parameters:
tTime - the time object to use
lDelay - the delay in milliseconds between the increasing steps
Method Detail

goAhead

public void goAhead()
             throws IllegalArgumentException
Increase the time by the current interval.

If no interval has yet been set, the interval given by the Time.getDefaultInterval() method of the time object is used.

If the AutoTimer is running, the time is increased and the delay restartet.

Override:
Never.
Throws:
IllegalArgumentException - if the interval does not meet the time object's class or format requirements.
Overrides:
goAhead in class StepTimer

start

public void start()
           throws IllegalArgumentException
Set the timer running. If the timer is already running, nothing happens.

The first timer tick occurs at once.

Override:
Never.

stop

public void stop()
Stop the timer.
Override:
Never.

setDelay

public void setDelay(long lMilliSecs)
Set the delay between timer ticks.

If the AutoTimer is currently running, the new delay takes effect after the next tick.

Override:
Never.
Parameters:
lMilliSecs - the delay in milliseconds. Must be > 0.

getDelay

public long getDelay()
Get the current delay between timer ticks in milliseconds.
Returns:
a long value representing the delay

SalesPoint Framework v3.0