stella.sensor
Class CumulativeDataEvent

java.lang.Object
  extended by java.util.EventObject
      extended by util.rmi.RmiEvent
          extended by stella.DataEvent
              extended by stella.sensor.RawDataEvent
                  extended by stella.sensor.CumulativeDataEvent
All Implemented Interfaces:
Serializable, PostingEvent
Direct Known Subclasses:
PredictiveDataEvent

public class CumulativeDataEvent
extends RawDataEvent

The data event that is used for shuffling a bunch of measurements into a single data event.

See Also:
Serialized Form

Field Summary
private  Integer n
          The number of individual data events used.
private  Double rawmax
          The maximum value of the raw data.
private  Double rawmin
          The minimum value of the raw data.
 
Fields inherited from class stella.DataEvent
FORMAT
 
Fields inherited from class util.rmi.RmiEvent
localHost, sourceName
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CumulativeDataEvent(DataEvent source)
          Constructs a new cumulative data event from a single data event.
CumulativeDataEvent(Object src)
          Constructs a new data event given only the data event source.
 
Method Summary
protected  String getDateString()
          Overrides the data string.
 String getFormattedPhysicalMax()
          Returns the physical maximum, formatted to the physical formatter.
 String getFormattedPhysicalMin()
          Returns the physical minimum, formatted to the physical formatter.
 String getFormattedRawMax()
          Returns the raw maximum, formatted to the raw formatter.
 String getFormattedRawMin()
          Returns the raw minimum, formatted to the raw formatter.
protected  String getMinMaxString(Double min, Double max)
          Constructs a line similar to
 int getN()
          Returns the number of measurements or zero if undefined.
 double getPhysicalMax()
          Returns the maximum of the measurements in physically meaningful quantities or NaN if undefined.
 double getPhysicalMin()
          Returns the minimum of the measurements in physically meaningful quantities or NaN if undefined.
 double getRawMax()
          Returns the maximum of the measurements or NaN if undefined.
 double getRawMin()
          Returns the minimum of the measurements or NaN if undefined.
 void setN(int nr)
          Sets the number of measurements.
 void setRawMinMax(double min, double max)
          Sets the sigma of the raw measurments.
 String toString()
          Adds min/max info to the string representation.
 
Methods inherited from class stella.sensor.RawDataEvent
formatPhysical, formatRaw, getFormattedPhysical, getFormattedPhysicalDeviation, getFormattedRaw, getFormattedRawDeviation, getPhysical, getPhysicalDeviation, getRaw, getRawConvert, getRawDeviation, getRawFormat, getRawString, getSigmaFormat, setRaw, setRawConvert, setRawDeviation, setRawFormat, setSigmaFormat
 
Methods inherited from class stella.DataEvent
getMeasurement, getTimeOfMeasure, isValid, setMeasurement, setTimeOfMeasure, setValid
 
Methods inherited from class util.rmi.RmiEvent
getHost, getSourceName, setSourceName
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

n

private Integer n
The number of individual data events used.


rawmax

private Double rawmax
The maximum value of the raw data.


rawmin

private Double rawmin
The minimum value of the raw data.

Constructor Detail

CumulativeDataEvent

public CumulativeDataEvent(Object src)
Constructs a new data event given only the data event source.


CumulativeDataEvent

public CumulativeDataEvent(DataEvent source)
Constructs a new cumulative data event from a single data event.

Method Detail

setRawMinMax

public void setRawMinMax(double min,
                         double max)
Sets the sigma of the raw measurments. Normally calculated from the standard deviation of the constituing data events.


getRawMax

public double getRawMax()
Returns the maximum of the measurements or NaN if undefined.


getFormattedRawMax

public String getFormattedRawMax()
Returns the raw maximum, formatted to the raw formatter.


getRawMin

public double getRawMin()
Returns the minimum of the measurements or NaN if undefined.


getFormattedRawMin

public String getFormattedRawMin()
Returns the raw minimum, formatted to the raw formatter.


getPhysicalMax

public double getPhysicalMax()
Returns the maximum of the measurements in physically meaningful quantities or NaN if undefined.


getFormattedPhysicalMax

public String getFormattedPhysicalMax()
Returns the physical maximum, formatted to the physical formatter.


getPhysicalMin

public double getPhysicalMin()
Returns the minimum of the measurements in physically meaningful quantities or NaN if undefined.


getFormattedPhysicalMin

public String getFormattedPhysicalMin()
Returns the physical minimum, formatted to the physical formatter.


setN

public void setN(int nr)
Sets the number of measurements. If the argument is less than zero, n is set to zero, indicating invalid setting.


getN

public int getN()
Returns the number of measurements or zero if undefined.


toString

public String toString()
Adds min/max info to the string representation.

Overrides:
toString in class RawDataEvent

getDateString

protected String getDateString()
Overrides the data string. If this data event has multiple data, the number of constituing data points is shown right after the date.

Overrides:
getDateString in class RawDataEvent

getMinMaxString

protected String getMinMaxString(Double min,
                                 Double max)
Constructs a line similar to
       min: raw (phys), max: raw (phys)
       
where raw is the raw reading, while phys is the physical quantity (if available). If no min/max info is available an empty string is returned.
This method uses the standard physical conversion utility and the raw-value format.

Parameters:
min - The minimum Double.
max - The minimum Double.