org.tfe.core
Class SensorList

java.lang.Object
  |
  +--org.tfe.core.SensorList
All Implemented Interfaces:
SensorObserver, java.io.Serializable

public class SensorList
extends java.lang.Object
implements java.io.Serializable, SensorObserver

See Also:
Serialized Form

Constructor Summary
SensorList()
          Creates new SensorList
 
Method Summary
 void add(Sensor sensor)
          Adds a Sensor to the SensorList.
 void addObserver(SensorListObserver observer)
           
 void deleteObserver(SensorListObserver observer)
           
 Sensor get(int index)
          Gets the Sensor at the specified index.
 Sensor get(java.lang.String name)
          Gets the Sensor with the specified name.
 java.lang.Object[] getKeys()
          Gets a listing of the sensors in the list.
 int getSensorCount()
          Gets the total number of Sensors in the SensorList.
 boolean hasSensor(Sensor sensor)
          Whether or not the specified Sensor is in the SensorList.
 boolean hasSensor(java.lang.String name)
          Whether or not the SensorList contains a Sensor with a specified name.
 void remove(Sensor sensor)
          Removes a specified Sensor from the list.
 void remove(java.lang.String name)
          Removes a Sensor with the specified hostname from the list.
 void sensorAlertAdded(java.lang.String sensorName, int alertID)
           
 void sensorAlertRemoved(java.lang.String sensorName)
           
 void sensorUpdated(java.lang.String name, Sensor newVal)
           
 java.lang.String toString()
          Gets a String representation of the Sensor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SensorList

public SensorList()
Creates new SensorList

Method Detail

add

public void add(Sensor sensor)
Adds a Sensor to the SensorList.

Parameters:
sensor - Sensor to be added to the list.

remove

public void remove(Sensor sensor)
Removes a specified Sensor from the list.

Parameters:
sensor - the Sensor to be removed.

remove

public void remove(java.lang.String name)
Removes a Sensor with the specified hostname from the list.

Parameters:
name - the name of the Sensor to be removed.

get

public Sensor get(int index)
Gets the Sensor at the specified index.

Parameters:
index - the index of the Sensor to be retrieved.
Returns:
the Sensor at the specified index, or null if the index is out of bounds.

get

public Sensor get(java.lang.String name)
Gets the Sensor with the specified name.

Parameters:
name - the name of the Sensor to retrieve.
Returns:
the Sensor with the specified name.

hasSensor

public boolean hasSensor(Sensor sensor)
Whether or not the specified Sensor is in the SensorList.

Parameters:
sensor - the Sensor that we're looking for.
Returns:
true if the Sensor is in the list, false if it is not.

hasSensor

public boolean hasSensor(java.lang.String name)
Whether or not the SensorList contains a Sensor with a specified name.

Parameters:
name - the name of the Sensor that we're looking for.
Returns:
true if the Sensor is in the list, false if it is not.

getSensorCount

public int getSensorCount()
Gets the total number of Sensors in the SensorList.

Returns:
integer value of the number of Sensors in the SensorList.

getKeys

public java.lang.Object[] getKeys()
Gets a listing of the sensors in the list.

Returns:
an array of Objects that are the names of the Sensors in this list.

toString

public java.lang.String toString()
Gets a String representation of the Sensor.

Overrides:
toString in class java.lang.Object

addObserver

public void addObserver(SensorListObserver observer)

deleteObserver

public void deleteObserver(SensorListObserver observer)

sensorAlertAdded

public void sensorAlertAdded(java.lang.String sensorName,
                             int alertID)
Specified by:
sensorAlertAdded in interface SensorObserver

sensorUpdated

public void sensorUpdated(java.lang.String name,
                          Sensor newVal)
Specified by:
sensorUpdated in interface SensorObserver

sensorAlertRemoved

public void sensorAlertRemoved(java.lang.String sensorName)
Specified by:
sensorAlertRemoved in interface SensorObserver