jhomenet.hw.device
Class LightSwitchDevice

java.lang.Object
  extended by Model
      extended by jhomenet.hw.HomenetHardware
          extended by jhomenet.hw.device.Device
              extended by jhomenet.hw.device.LightSwitchDevice
All Implemented Interfaces:
java.io.Serializable, Hardware

public class LightSwitchDevice
extends Device

Version:
$Revision: 1.8 $ Filename: $Source: /cvsroot/jhomenet/files/src/jhomenet/hw/device/LightSwitchDevice.java,v $ Description:
Author:
$Author: dhirwinjr $

Field Summary
static State OFF
          Define the device's available states.
static State ON
          Define the device's available states.
 
Fields inherited from class jhomenet.hw.device.Device
desiredState, PROPERTYNAME_CURRENTSTATE, states
 
Fields inherited from class jhomenet.hw.HomenetHardware
configuration, driver, errorTracker, hardwareDescription, hardwareId, PROPERTYNAME_CONFIGURATION, PROPERTYNAME_SETUPDESC, setupDescription
 
Constructor Summary
LightSwitchDevice()
          Constructor.
LightSwitchDevice(java.lang.String hardwareID, java.lang.String description)
          Default constructor.
 
Method Summary
 void execute()
          Execute the device based on the desired state.
protected  void initializeHardwareDescription()
          Set the hardware description.
protected  void initializeStates()
          Initialize the list of states.
 boolean isOn()
          Check whether the device is currently on.
 
Methods inherited from class jhomenet.hw.device.Device
getCurrentState, getStates, setCurrentState, setDesiredState, toString
 
Methods inherited from class jhomenet.hw.HomenetHardware
equals, getConfiguration, getConfiguration, getDriverHardwareDescription, getDriverName, getErrorCount, getHardwareClassname, getHardwareDescription, getHardwareId, getSetupDescription, initializeHardware, isRegistered, setConfiguration, setConfiguration, setDriver, setHardwareId, setSetupDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ON

public static final State ON
Define the device's available states.


OFF

public static final State OFF
Define the device's available states.

Constructor Detail

LightSwitchDevice

public LightSwitchDevice(java.lang.String hardwareID,
                         java.lang.String description)
Default constructor.

Parameters:
hardwareID - The light switch hardware ID
description - A description of the light switch hardware.

LightSwitchDevice

public LightSwitchDevice()
Constructor.

Method Detail

initializeStates

protected void initializeStates()
Description copied from class: Device
Initialize the list of states.

Specified by:
initializeStates in class Device
See Also:
Device.initializeStates()

initializeHardwareDescription

protected void initializeHardwareDescription()
Description copied from class: HomenetHardware
Set the hardware description.

Specified by:
initializeHardwareDescription in class HomenetHardware
See Also:
HomenetHardware.initializeHardwareDescription()

execute

public void execute()
Description copied from class: Device
Execute the device based on the desired state.

Specified by:
execute in class Device
See Also:
Device.execute()

isOn

public boolean isOn()
Check whether the device is currently on.

Returns:
Whether the device is on


Copyright © 2004-2005 David Irwin. All Rights Reserved.