stella
Interface Switch

All Superinterfaces:
Initializable, Parameter, PropertyBearing, Trigger
All Known Implementing Classes:
AbstractRemoteSwitch, AbstractSwitch, CabinetSwitch, HumiditySwitch, JFrameParameter, LightSwitch, OneWireMultiSwitch, OneWireSwitch, RS485Switch, SimpleRemoteSwitch, SwitchSkeleton, SwitchStub

public interface Switch
extends Trigger

A switch is a more specific implementation of a trigger. It allows turning on and off via its two methods turnOn(long) and turnOff().


Field Summary
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Method Summary
 boolean turnOff()
          Turns the switch off.
 boolean turnOn(long maxtime)
          Turns the switch on.
 
Methods inherited from interface stella.Trigger
getElapsedToggleTime, getLastToggleTime, getTrigger, isTrue, setTrigger, toggleTrigger
 
Methods inherited from interface stella.Parameter
get, getFormatted, getName, getString, set
 
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
 
Methods inherited from interface util.Initializable
init
 

Method Detail

turnOn

boolean turnOn(long maxtime)
Turns the switch on. This might mean that hardwarewise a switch is turned, but may also be used only internally. Normally can devide to the Trigger.setTrigger(java.lang.Boolean) method.

Parameters:
maxtime - The maximum time the switch should be on (ms), zero for unlimited.
Returns:
True, if switch was successfully turned on.

turnOff

boolean turnOff()
Turns the switch off. This might mean that hardwarewise a switch is turned, but may also be used only internally. Normally can devide to the Trigger.setTrigger(java.lang.Boolean) method.

Returns:
True, if switch was successfully turned off.