stella.parameter
Class AbstractSwitch
java.lang.Object
util.PropertyContainer
stella.parameter.AbstractParameter
stella.parameter.AbstractTrigger
stella.parameter.SimpleTrigger
stella.parameter.AbstractSwitch
- All Implemented Interfaces:
- Cloneable, Parameter, Switch, Trigger, ExitCleaning, Initializable, PropertyBearing, Reloadable
- Direct Known Subclasses:
- OneWireMultiSwitch, OneWireSwitch, RS485Switch
public abstract class AbstractSwitch
- extends SimpleTrigger
- implements Switch
An abstract implementation for a switch. All trigger methods are inherited
from the simple switch class.
|
Field Summary |
private TimerTask |
forcedoff
This timer task is used to switch off after a certain time-out. |
|
Constructor Summary |
protected |
AbstractSwitch(Map prop)
Constructs a new abstract switch. |
|
Method Summary |
protected abstract boolean |
off()
This method does the actual setting of the switch to off. |
protected abstract boolean |
on()
This method does the actual setting of the switch to on. |
boolean |
turnOff()
Turns the switch off. |
boolean |
turnOn(long timeout)
Turns the switch on. |
| Methods inherited from class stella.parameter.AbstractParameter |
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString |
| Methods inherited from class util.PropertyContainer |
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, isNew, keyCreate, keyCreate, parseObject, reload, reload, removeProperty, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from interface util.PropertyBearing |
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getLocalized, getProperties, getProperty, getResource, getResourceAsStream, getResources, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
forcedoff
private TimerTask forcedoff
- This timer task is used to switch off after a certain time-out.
AbstractSwitch
protected AbstractSwitch(Map prop)
- Constructs a new abstract switch.
turnOn
public boolean turnOn(long timeout)
- Turns the switch on. Diverts to the abstract method
on() for
actual switching. Does maximum time keeping.
- Specified by:
turnOn in interface Switch
- Parameters:
timeout - The maximum time the switch should be on (ms), zero for
unlimited.
- Returns:
- True, if switch was successfully turned on.
turnOff
public boolean turnOff()
- Turns the switch off. Diverts to the abstract method
off() for
actual switching. If a switch-off timer task was active, it is canceled.
- Specified by:
turnOff in interface Switch
- Returns:
- True, if switch was successfully turned off.
on
protected abstract boolean on()
- This method does the actual setting of the switch to on.
- Returns:
- True if successful.
off
protected abstract boolean off()
- This method does the actual setting of the switch to off.
- Returns:
- True if successful.