stella.sensor
Class DataFactory

java.lang.Object
  extended by stella.sensor.DataFactory

public class DataFactory
extends Object

This class provides static factory methods for averaging various kinds of data events.


Field Summary
private static int MAXFLAG
          The flag with the highest value.
 
Constructor Summary
DataFactory()
           
 
Method Summary
static DataEvent average(List allevents)
          Averages over a list of data events to produce a single data event of the same type.
private static CumulativeDataEvent averageCumulativeDataEvent(List de)
          Averages over cumulative data events.
private static DerivativeDataEvent averageDerivativeDataEvent(List de)
          Averages over derivative data events.
private static PredictiveDataEvent averagePredictiveDataEvent(List de)
          Averages over predictive data events.
private static CumulativeDataEvent averageRawDataEvent(List de)
          Averages over raw data events.
private static SmoothDataEvent averageSmoothDataEvent(List de)
          Averages over smooth data events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXFLAG

private static final int MAXFLAG
The flag with the highest value. See WeatherEvent.

See Also:
Constant Field Values
Constructor Detail

DataFactory

public DataFactory()
Method Detail

average

public static final DataEvent average(List allevents)
Averages over a list of data events to produce a single data event of the same type. The first data event of the list is examined and according to its type this method forkes into different subroutines delivering the correct data event type. The time of measure of the new data event is the avaerage of the individual measurement times, the raw values are the averages of the appropriate individual raw values. A few remarks are necessarry to avoid malevolent use of this class:

See Also:
averageDerivativeDataEvent(java.util.List), averageSmoothDataEvent(java.util.List), averagePredictiveDataEvent(java.util.List), averageCumulativeDataEvent(java.util.List), averageRawDataEvent(java.util.List)

averageRawDataEvent

private static final CumulativeDataEvent averageRawDataEvent(List de)
Averages over raw data events. The return type is a CumulativeDataEvent. Min/max is set to the minimum/maximum of the individual data point. If the errors to the measurements are not defined, the standard deviation of the data points is used as an error estimate. The returned data event is valid if at least one averaged data event is valid.

Parameters:
de - A non-null, non-empty list of raw data events.

averageCumulativeDataEvent

private static final CumulativeDataEvent averageCumulativeDataEvent(List de)
Averages over cumulative data events. The return type is a CumulativeDataEvent. Min/max is set to the minimum/maximum of the individual data events, if defined, otherwise the data max/min is used. If the errors to the measurements are not defined, the standard deviation of the measurements is used as an error estimate.

Parameters:
de - A non-null, non-empty list of cumulative data events.

averagePredictiveDataEvent

private static final PredictiveDataEvent averagePredictiveDataEvent(List de)
Averages over predictive data events. The return type is a PredictiveDataEvent. Min/max is set to the minimum/maximum of the individual data events, if defined, otherwise the data max/min is used.

Parameters:
de - A non-null, non-empty list of predictive data events.

averageSmoothDataEvent

private static final SmoothDataEvent averageSmoothDataEvent(List de)
Averages over smooth data events. The return type is a SmoothDataEvent. Min/max is set to the minimum/maximum of the individual data events, if defined, otherwise the data max/min is used.

Parameters:
de - A non-null, non-empty list of smooth data events.

averageDerivativeDataEvent

private static final DerivativeDataEvent averageDerivativeDataEvent(List de)
Averages over derivative data events. The return type is a DerivativeDataEvent. Min/max is set to the minimum/maximum of the individual data events, if defined, otherwise the data max/min is used.

Parameters:
de - A non-null, non-empty list of smooth data events.