org.isam.exehda.services
Class Collector.MonitoringData

java.lang.Object
  |
  +--org.isam.exehda.services.Collector.MonitoringData
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
Collector

public static class Collector.MonitoringData
extends java.lang.Object
implements java.io.Serializable

Helper class to store and manipulate monitoring data in an efficient way.

See Also:
Serialized Form

Constructor Summary
Collector.MonitoringData(CellInformationBase.ResourceName sname)
          Creates a new MonitoringData instance.
 
Method Summary
 void copy(Collector.MonitoringData d)
           
 java.lang.Class getDataType()
          Returns the type of the data stored in this MonitoringData object.
 double getDouble()
          Returns this data as a double value.
 int getInt()
          Returns this data as an int value.
 long getLong()
          Returns this data as a long value.
 CellInformationBase.ResourceName getSensor()
          Returns the name of the sensor to which this data is linked (formelly, the sensor who produced this data).
 java.lang.String getString()
          Returns this data as a String.
 long getTimeStamp()
          Returns a time stamp describing the last time this data was modified.
 void setDouble(double v)
          Sets this data value as a double value
 void setInt(int v)
          Sets this data value as an int value.
 void setLong(long v)
          Sets this data value as a long value.
 void setString(java.lang.String s)
          Sets this data vaue as a String.
 void setTimeStamp(long ts)
          Set this data last modification time-stamp.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Collector.MonitoringData

public Collector.MonitoringData(CellInformationBase.ResourceName sname)
Creates a new MonitoringData instance.

Method Detail

getSensor

public CellInformationBase.ResourceName getSensor()
Returns the name of the sensor to which this data is linked (formelly, the sensor who produced this data).

Returns:
a ResourceName value

getTimeStamp

public long getTimeStamp()
Returns a time stamp describing the last time this data was modified.

Returns:
millis since 1970
See Also:
java.lang.System.currentTimeMillis()

getInt

public int getInt()
Returns this data as an int value. Conversion may take place if int is not the original data format.

Returns:
this data as an int value

getLong

public long getLong()
Returns this data as a long value. Conversion may take place if long is not the original data format.

Returns:
this data as a long value

getDouble

public double getDouble()
Returns this data as a double value. Conversion may take place if double is not the original data format.

Returns:
this data as a double value

getString

public java.lang.String getString()
Returns this data as a String. Conversion may take place if String is not the original data format.

Returns:
this data as a String

getDataType

public java.lang.Class getDataType()
Returns the type of the data stored in this MonitoringData object.

Returns:
a Class value; Void.TYPE if this object was not yet initialized.

setTimeStamp

public void setTimeStamp(long ts)
Set this data last modification time-stamp.

Parameters:
ts - millis since 1970

setInt

public void setInt(int v)
Sets this data value as an int value.

Parameters:
v - new value

setLong

public void setLong(long v)
Sets this data value as a long value.

Parameters:
v - new value

setDouble

public void setDouble(double v)
Sets this data value as a double value

Parameters:
v - new value

setString

public void setString(java.lang.String s)
Sets this data vaue as a String.

Parameters:
s - new value.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

copy

public void copy(Collector.MonitoringData d)