|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectModel
jhomenet.hw.HomenetHardware
jhomenet.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,v 1.14 2005/11/14 03:47:07 dhirwinjr Exp $
| Field Summary | |
|---|---|
protected State |
desiredState
The desired state of the device. |
static java.lang.String |
PROPERTYNAME_CURRENTSTATE
|
protected java.util.Set<State> |
states
Keep a list of the device's avaiable states. |
| Fields inherited from class jhomenet.hw.HomenetHardware |
|---|
configuration, driver, errorTracker, hardwareDescription, hardwareId, PROPERTYNAME_CONFIGURATION, PROPERTYNAME_SETUPDESC, setupDescription |
| Constructor Summary | |
|---|---|
Device()
Constructor. |
|
Device(java.lang.String hardwareID,
java.lang.String description)
The default constructor the Device object. |
|
| Method Summary | |
|---|---|
abstract void |
execute()
Execute the device based on the desired state. |
State |
getCurrentState()
Get the current state. |
java.util.Set<State> |
getStates()
Get the list of available states. |
protected abstract void |
initializeStates()
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. |
java.lang.String |
toString()
Get the string equivalent of the device. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Set<State> states
public static final java.lang.String PROPERTYNAME_CURRENTSTATE
protected State desiredState
| Constructor Detail |
|---|
public Device(java.lang.String hardwareID,
java.lang.String description)
hardwareID - description - public Device()
| Method Detail |
|---|
protected abstract void initializeStates()
public java.lang.String toString()
Object.toString()public java.util.Set<State> getStates()
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 | ||||||||