safehome.device
Class DeviceWinDoorSensor

java.lang.Object
  extended by safehome.device.DeviceAbstractSensor
      extended by safehome.device.DeviceWinDoorSensor
All Implemented Interfaces:
interfaceSensor

public class DeviceWinDoorSensor
extends DeviceAbstractSensor
implements interfaceSensor


Field Summary
 
Fields inherited from class safehome.device.DeviceAbstractSensor
head_MotionDetector, head_WinDoorSensor, newIdSequence_MotionDetector, newIdSequence_WinDoorSensor, next, safeHomeSensorTest, sensorID
 
Constructor Summary
DeviceWinDoorSensor()
           
 
Method Summary
 void disable()
          Disables the sensor.
 void enable()
          Enables the sensor to detect intrusion.
 int getID()
          Returns a sensor ID.
 void intrude()
          Note: This method is public as a virtual device implementation side effect.
 boolean isEnabled()
          Tests the sensor is enabled or not.
 boolean read()
          Reads the status of the sensor.
 void release()
          Note: This method is public as a virtual device implementation side effect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceWinDoorSensor

public DeviceWinDoorSensor()
Method Detail

intrude

public void intrude()
Description copied from class: DeviceAbstractSensor
Note: This method is public as a virtual device implementation side effect. Do not call.

Specified by:
intrude in class DeviceAbstractSensor

release

public void release()
Description copied from class: DeviceAbstractSensor
Note: This method is public as a virtual device implementation side effect. Do not call.

Specified by:
release in class DeviceAbstractSensor

getID

public int getID()
Description copied from interface: interfaceSensor
Returns a sensor ID. A sensor ID is unique in a same type. The sensor's ID will be given sequentially when a new sensor object is allocated. It starts from 1 and increases by 1

Specified by:
getID in interface interfaceSensor
Returns:
a sensor ID

read

public boolean read()
Description copied from interface: interfaceSensor
Reads the status of the sensor.

Specified by:
read in interface interfaceSensor
Returns:
true if door is open. Otherwise, false.

enable

public void enable()
Description copied from interface: interfaceSensor
Enables the sensor to detect intrusion.

Specified by:
enable in interface interfaceSensor

disable

public void disable()
Description copied from interface: interfaceSensor
Disables the sensor. The disabled sensor does not detect intrusion.

Specified by:
disable in interface interfaceSensor

isEnabled

public boolean isEnabled()
Description copied from interface: interfaceSensor
Tests the sensor is enabled or not.

Specified by:
isEnabled in interface interfaceSensor
Returns:
true if the sensor is enabled. Otherwise, false.