|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectModel
jhomenet.commons.hw.HomenetHardware
jhomenet.commons.hw.device.Device
public abstract class Device
The device class is used as a container for holding information related to devices. Devices are defined as sensors that are used to control other objects, such as switches.
ID: $Id: Device.java 1081 2005-12-22 16:40:22Z dhirwinjr $
| Field Summary | |
|---|---|
protected State |
desiredState
The desired state of the device. |
static java.lang.String |
PROPERTYNAME_CURRENTSTATE
|
| Fields inherited from class jhomenet.commons.hw.HomenetHardware |
|---|
hardwareAddr, hardwareSetupDescription, PROPERTYNAME_CHANNELDESC, PROPERTYNAME_HWSETUPDESC |
| Constructor Summary | |
|---|---|
Device(Device device)
|
|
Device(java.lang.String hardwareAppDescription,
java.lang.Integer numChannels)
|
|
Device(java.lang.String hardwareAddr,
java.lang.String hardwareSetupDescription,
java.lang.String hardwareAppDescription,
java.lang.Integer numChannels)
The default constructor the Device object. |
|
| Method Summary | |
|---|---|
abstract void |
execute()
Execute the device based on the desired state. |
java.util.Set<State> |
getAvailableStates()
Get the list of available states. |
State |
getCurrentState()
Get the current state. |
protected abstract void |
initializeStates(java.util.Set<State> availableStates)
Initialize the list of states. |
protected void |
setCurrentState(State state)
Set the current state of the device. |
void |
setDesiredState(State state)
Set the desired state. |
| Methods inherited from class jhomenet.commons.hw.HomenetHardware |
|---|
addHardwareListener, copy, equals, getAppHardwareDescription, getChannel, getChannelDescription, getChannels, getHardwareAddr, getHardwareClassname, getHardwareSetupDescription, getId, getNumChannels, hashCode, initializeHardware, removeHardwareListener, setChannelDescription, setHardwareSetupDescription, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROPERTYNAME_CURRENTSTATE
protected State desiredState
| Constructor Detail |
|---|
public Device(java.lang.String hardwareAddr,
java.lang.String hardwareSetupDescription,
java.lang.String hardwareAppDescription,
java.lang.Integer numChannels)
hardwareAddr - hardwareSetupDescription - hardwareAppDescription - numChannels -
public Device(java.lang.String hardwareAppDescription,
java.lang.Integer numChannels)
hardwareAppDescription - numChannels - public Device(Device device)
device - | Method Detail |
|---|
protected abstract void initializeStates(java.util.Set<State> availableStates)
public final java.util.Set<State> getAvailableStates()
public void setDesiredState(State state)
state - The desired statepublic State getCurrentState()
protected void setCurrentState(State state)
state - public abstract void execute()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||