stella.sensor
Class DerivativeDataEvent

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
                      extended by stella.sensor.PredictiveDataEvent
                          extended by stella.sensor.SmoothDataEvent
                              extended by stella.sensor.DerivativeDataEvent
All Implemented Interfaces:
Serializable, PostingEvent

public class DerivativeDataEvent
extends SmoothDataEvent

Adds the derivative values to the data event. If the ConvertToPhysical instance used by this data event also supports conversion of derivatives via implementing the PhysicalDerivative interface, the toString() method uses it for formatting. Only in the latter case, the getDerivativePhysical... methods return meaningful quantities.

See Also:
Serialized Form

Field Summary
private  Double derivativemax
          The maximum derivative value if used as an average of data.
private  Double derivativemin
          The minimum derivative value if used as an average of data.
private  Double derivativeraw
          The raw derivative value.
private  NumberFormat derivformat
          A formatter for the raw measurements.
 
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
DerivativeDataEvent(DataEvent de)
          Constructs a new derivativeive data event from a generic data event.
DerivativeDataEvent(Object src)
          Constructs a new derivativeive data event without any values specified.
 
Method Summary
protected  String formatPhysicalDerivative(Double meas)
          Formats a physical reading according to the RawDataEvent.rawconvert rule.
protected  String formatRawDerivative(Double meas)
          Formats a raw reading according to the RawDataEvent.rawformat rule.
 NumberFormat getDerivativeFormat()
          gets the raw-data formatter.
 double getDerivativeMax()
          Returns the maximum raw derivative value as a primitive double or nan if undefined.
 double getDerivativeMin()
          Returns the minimum raw derivative value as a primitive double or nan if undefined.
 double getDerivativePhysical()
          Returns the derivative measurement in physically meaningful quantities or NaN if undefined.
 double getDerivativePhysicalMax()
          Returns the maximum derivative measurement in physically meaningful quantities or NaN if undefined.
 double getDerivativePhysicalMin()
          Returns the minimum derivative measurement in physically meaningful quantities or NaN if undefined.
 double getDerivativeRaw()
          Returns the raw derivative value as a primitive double or nan if undefined.
 String getFormattedDerivativeMax()
          Returns the derivative minimum as a string, formatted according to the raw formatter.
 String getFormattedDerivativeMin()
          Returns the derivative minimum as a string, formatted according to the raw formatter.
 String getFormattedDerivativePhysical()
          Returns the physical derivative formatted to its converter's format.
 String getFormattedDerivativePhysicalMax()
          Returns the physical derivative maximum formatted to its converter's format.
 String getFormattedDerivativePhysicalMin()
          Returns the physical derivative minimum formatted to its converter's format.
 String getFormattedDerivativeRaw()
          Returns the derivative raw as a string, formatted according to the raw formatter.
 void setDerivativeFormat(NumberFormat forderiv)
          Sets the raw-data formatter.
 void setDerivativeMinMax(double min, double max)
          Sets the minimum and maximum of the derivative raw value.
 void setDerivativeRaw(double derivative)
          Sets the derivative value as a primitive double.
 String toString()
          Adds the derivativeive values to the string representation.
 
Methods inherited from class stella.sensor.SmoothDataEvent
getFormattedSmoothMax, getFormattedSmoothMin, getFormattedSmoothPhysical, getFormattedSmoothPhysicalMax, getFormattedSmoothPhysicalMin, getFormattedSmoothRaw, getSmoothMax, getSmoothMin, getSmoothPhysical, getSmoothPhysicalMax, getSmoothPhysicalMin, getSmoothRaw, setSmoothMinMax, setSmoothRaw
 
Methods inherited from class stella.sensor.PredictiveDataEvent
getFormattedPredictMax, getFormattedPredictMin, getFormattedPredictPhysical, getFormattedPredictPhysicalMax, getFormattedPredictPhysicalMin, getFormattedPredictRaw, getPredictMax, getPredictMin, getPredictPhysical, getPredictPhysicalMax, getPredictPhysicalMin, getPredictRaw, getValueString, setPredictMinMax, setPredictRaw
 
Methods inherited from class stella.sensor.CumulativeDataEvent
getDateString, getFormattedPhysicalMax, getFormattedPhysicalMin, getFormattedRawMax, getFormattedRawMin, getMinMaxString, getN, getPhysicalMax, getPhysicalMin, getRawMax, getRawMin, setN, setRawMinMax
 
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

derivativeraw

private Double derivativeraw
The raw derivative value.


derivativemax

private Double derivativemax
The maximum derivative value if used as an average of data.


derivativemin

private Double derivativemin
The minimum derivative value if used as an average of data.


derivformat

private NumberFormat derivformat
A formatter for the raw measurements.

Constructor Detail

DerivativeDataEvent

public DerivativeDataEvent(Object src)
Constructs a new derivativeive data event without any values specified.

Parameters:
src - The event source.

DerivativeDataEvent

public DerivativeDataEvent(DataEvent de)
Constructs a new derivativeive data event from a generic data event. All relevant fields are copied.

Method Detail

setDerivativeFormat

public void setDerivativeFormat(NumberFormat forderiv)
Sets the raw-data formatter.


getDerivativeFormat

public NumberFormat getDerivativeFormat()
gets the raw-data formatter.


setDerivativeRaw

public void setDerivativeRaw(double derivative)
Sets the derivative value as a primitive double.


getDerivativeRaw

public double getDerivativeRaw()
Returns the raw derivative value as a primitive double or nan if undefined.


getFormattedDerivativeRaw

public String getFormattedDerivativeRaw()
Returns the derivative raw as a string, formatted according to the raw formatter. If the raw-formatter is null, Double.toString is used.


setDerivativeMinMax

public void setDerivativeMinMax(double min,
                                double max)
Sets the minimum and maximum of the derivative raw value. Useful only if generated from multiple data.


getDerivativeMin

public double getDerivativeMin()
Returns the minimum raw derivative value as a primitive double or nan if undefined.


getFormattedDerivativeMin

public String getFormattedDerivativeMin()
Returns the derivative minimum as a string, formatted according to the raw formatter. If the raw-formatter is null, Double.toString is used.


getDerivativeMax

public double getDerivativeMax()
Returns the maximum raw derivative value as a primitive double or nan if undefined.


getFormattedDerivativeMax

public String getFormattedDerivativeMax()
Returns the derivative minimum as a string, formatted according to the raw formatter. If the raw-formatter is null, Double.toString is used.


getDerivativePhysical

public double getDerivativePhysical()
Returns the derivative measurement in physically meaningful quantities or NaN if undefined.


getFormattedDerivativePhysical

public String getFormattedDerivativePhysical()
Returns the physical derivative formatted to its converter's format.


getDerivativePhysicalMin

public double getDerivativePhysicalMin()
Returns the minimum derivative measurement in physically meaningful quantities or NaN if undefined. Note that the minimum is not calculated at its corresponding raw-reading, but rather on the average reading. It is either inpracticable to use the raw minimum as the base, as there is no clue if the minimal derivative happened at the minimum value.


getFormattedDerivativePhysicalMin

public String getFormattedDerivativePhysicalMin()
Returns the physical derivative minimum formatted to its converter's format.


getDerivativePhysicalMax

public double getDerivativePhysicalMax()
Returns the maximum derivative measurement in physically meaningful quantities or NaN if undefined. Note that the maximum is not calculated at its corresponding raw-reading, but rather on the average reading. It is either inpracticable to use the raw maximum as the base, as there is no clue if the maximal derivative happened at the maximum value.


getFormattedDerivativePhysicalMax

public String getFormattedDerivativePhysicalMax()
Returns the physical derivative maximum formatted to its converter's format.


toString

public String toString()
Adds the derivativeive values to the string representation.

Overrides:
toString in class SmoothDataEvent

formatRawDerivative

protected String formatRawDerivative(Double meas)
Formats a raw reading according to the RawDataEvent.rawformat rule. If the measurement is NaN or null, nan is included in the string.

See Also:
RawDataEvent.formatPhysical(java.lang.Double)

formatPhysicalDerivative

protected String formatPhysicalDerivative(Double meas)
Formats a physical reading according to the RawDataEvent.rawconvert rule. If the measurement is NaN or null, the empty string is returned.

Parameters:
meas - The raw measurement value.
See Also:
RawDataEvent.formatRaw(java.lang.Double)