sophware.home.util
Class Timer

java.lang.Object
  extended by sophware.home.lang.StateObject
      extended by sophware.home.lang.BinaryObject
          extended by sophware.home.util.Timer
All Implemented Interfaces:
java.io.Serializable, Named, MacroStep

public class Timer
extends BinaryObject
implements Named, MacroStep, java.io.Serializable

Timer is "on" when started and turns itself "off" when the timer expires.

Version:
1.0, 02/17/06
Author:
Russell Soph
See Also:
Serialized Form

Field Summary
 
Fields inherited from class sophware.home.lang.BinaryObject
OFF, ON
 
Constructor Summary
Timer(java.lang.String name, int duration)
          Creates a Timer with the name and duration
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 void execute()
          MacroStep implementation
 java.lang.String getName()
          Get name
 void start()
          Start the timer
 void stop()
          Stop the timer
 
Methods inherited from class sophware.home.lang.BinaryObject
isOn, setOn, stateEquals
 
Methods inherited from class sophware.home.lang.StateObject
addStateChangeListener, fireStateChange, removeStateChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer(java.lang.String name,
             int duration)
Creates a Timer with the name and duration

Parameters:
name - name of this timer
duration - of timer in seconds
Method Detail

getName

public java.lang.String getName()
Get name

Specified by:
getName in interface Named
Returns:
the name of the timer

start

public void start()
Start the timer


stop

public void stop()
Stop the timer


execute

public void execute()
MacroStep implementation

Specified by:
execute in interface MacroStep
See Also:
MacroStep

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object