|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcat.sensor.core.Sensor
This class represents a generic sensor in CAT. The sensor object has information such as id, type, whether it is remote, and a list of listeners who care about this sensors data.
Field Summary | |
(package private) boolean |
remote
True if the sensor is remote. |
private java.util.Vector |
senList
The list of listeners. |
(package private) java.lang.String |
sensorID
The sensor id. |
(package private) int |
sensorType
The sensor's type. |
Constructor Summary | |
Sensor(java.lang.String id)
This constructor initializes the Sensor object by setting the id. |
Method Summary | |
void |
addSensorListener(SensorListener s)
This method adds a listener to this Sensor. |
int |
countSensorListeners()
Returns the number of observers of this Observable object. |
void |
deleteSensorListener(SensorListener s)
This method removes a listener to this Sensor. |
void |
deleteSensorListeners()
This method removes all listeners to this Sensor. |
java.lang.String |
getID()
This method returns the id of the sensor. |
int |
getSensorType()
This method returns the type of the Sensor. |
boolean |
isRemote()
This method returns whether the sensor is remote or not. |
void |
notifySensorListeners(java.lang.Object event)
This method notifies all listeners of a Sensor data event. |
void |
setID(java.lang.String id)
This method sets the id of the sensor. |
void |
setRemote(boolean b)
This method sets whether the sensor is remote or not. |
void |
setSensorType(int type)
This method sets the type of the Sensor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.lang.String sensorID
int sensorType
boolean remote
private java.util.Vector senList
Constructor Detail |
public Sensor(java.lang.String id)
id
- The sensor's unique id.Method Detail |
public void setID(java.lang.String id)
id
- The sensor's unique id.public java.lang.String getID()
public void setSensorType(int type)
type
- The sensor's type.public int getSensorType()
public void setRemote(boolean b)
b
- True if the sensor is remote.public boolean isRemote()
public void addSensorListener(SensorListener s)
s
- listener.public void deleteSensorListener(SensorListener s)
s
- listener.public void deleteSensorListeners()
public void notifySensorListeners(java.lang.Object event)
event
- Sesnor data event.public int countSensorListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |