cat.sensor.soft
Class CallableSensor
java.lang.Object
cat.sensor.core.Sensor
cat.sensor.soft.CallableSensor
- All Implemented Interfaces:
- java.lang.Runnable, SensorListener
- public class CallableSensor
- extends Sensor
- implements SensorListener
This is a Soft Sensor. It is a sensor/service which takes input
from real physical sensors, and does some manipulation with the data
before passing it on as new sensor data.
This soft sensor listenes for sound, and if sound is below 46dB then
it outputs true.
Field Summary |
private java.util.Vector |
eventsQueue
The queue of incoming sensor data. |
Fields inherited from class cat.sensor.core.Sensor |
|
Constructor Summary |
CallableSensor(java.lang.String id)
This constructor sets the id of this sensor, and then starts the
thread to process any incoming sensor data that this sensor listens to. |
Method Summary |
void |
run()
Checks for any new sensor data and processes it to create new sensor
data which this sensor outputs. |
void |
update(java.lang.Object event)
Being an Observer, we must implement this method to get sensor events
from those that we observe. |
Methods inherited from class cat.sensor.core.Sensor |
addSensorListener, countSensorListeners, deleteSensorListener, deleteSensorListeners, getID, getSensorType, isRemote, notifySensorListeners, setID, setRemote, setSensorType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
eventsQueue
private java.util.Vector eventsQueue
- The queue of incoming sensor data.
CallableSensor
public CallableSensor(java.lang.String id)
- This constructor sets the id of this sensor, and then starts the
thread to process any incoming sensor data that this sensor listens to.
- Parameters:
id
- The unique id of this sensor.
run
public void run()
- Checks for any new sensor data and processes it to create new sensor
data which this sensor outputs.
- Specified by:
run
in interface java.lang.Runnable
update
public void update(java.lang.Object event)
- Being an Observer, we must implement this method to get sensor events
from those that we observe.
- Specified by:
update
in interface SensorListener
- Parameters:
event
- The incoming sensor event.