com.anwrt.hl.model
Class AwtDataContainer

java.lang.Object
  extended by com.anwrt.hl.model.AbstractContainer
      extended by com.anwrt.hl.model.AwtDataContainer

public class AwtDataContainer
extends AbstractContainer

Container for time stamped data. Data are stored into a List. When this container is added to the AwtDataManager a single AwtMessage will be created.
creation : 3 oct. 2008

Author:
David FRANCOIS

Constructor Summary
AwtDataContainer(java.lang.String relativePath)
          Default constructor
 
Method Summary
 boolean addPeriodicDeltas(java.lang.String dataName, int startTime, int period, double firstValue, java.util.List deltas)
          Add a list of periodic values to the the container.
 boolean addPeriodicValues(java.lang.String dataName, int startTime, int period, java.util.List values)
          Add a list of periodic values to the container.
 boolean addTimeStampedDeltas(java.lang.String dataName, int startTime, java.util.List timeDeltas, double firstValue, java.util.List deltas)
          Add a list of time stamped values to the container.
 boolean addTimeStampedValue(java.lang.String dataName, int time, java.lang.Object value)
          Add a single time stamped value to the container.
 boolean addTimeStampedValues(java.lang.String dataName, int startTime, java.util.List timeDeltas, java.util.List values)
          Add a list of time stamped values to the container.
 void empty()
          Clear all added data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AwtDataContainer

public AwtDataContainer(java.lang.String relativePath)
Default constructor

Parameters:
relativePath - The relative path of this container.
Method Detail

addTimeStampedValue

public boolean addTimeStampedValue(java.lang.String dataName,
                                   int time,
                                   java.lang.Object value)
Add a single time stamped value to the container. If the container previously contained a data with the same name, the old value is replaced.

Parameters:
dataName - name of the TimeStampedValue.
time - Acquisition time.
value - Value of the timeStampedValue.
Returns:
true if this the value is correctly added. Returns false if the container is lock and no more data can be added.

addTimeStampedValues

public boolean addTimeStampedValues(java.lang.String dataName,
                                    int startTime,
                                    java.util.List timeDeltas,
                                    java.util.List values)
Add a list of time stamped values to the container. If the container previously contained a data with the same name, the old value is replaced.

Parameters:
dataName - Name of the TimeStampedValue.
startTime - Time of the first value in seconds.
timeDeltas - List of relative time interval.
values - List of values, should be deltas length + 1.
Example: the following time stamped : {10000 100010 100020 10050} are coded as :
start time = 10000 deltas = {10 10 30}
Returns:
true if this the value is correctly added. Returns false if the container is lock and no more data can be added.

addPeriodicValues

public boolean addPeriodicValues(java.lang.String dataName,
                                 int startTime,
                                 int period,
                                 java.util.List values)
Add a list of periodic values to the container. If the container previously contained a data with the same name, the old value is replaced.

Parameters:
dataName - Name of the TimeStampedValue.
startTime - Time of the first value in seconds.
period - The period between two consecutive value.
values - List of values.
Example: the following time stamped : {10000 100010 100020 10030} are coded as :
start time = 10000 period = 10
Returns:
true if this the value is correctly added. Returns false if the container is lock and no more data can be added.

addTimeStampedDeltas

public boolean addTimeStampedDeltas(java.lang.String dataName,
                                    int startTime,
                                    java.util.List timeDeltas,
                                    double firstValue,
                                    java.util.List deltas)
Add a list of time stamped values to the container. Values must be a list of numbers. If the container previously contained a data with the same name, the old value is replaced.

Parameters:
dataName - name of the TimeStampedValue.
startTime - Time of the first value in seconds.
timeDeltas - Time delta in seconds between two consecutive values.
firstValue - First value.
deltas - List of numbers.

Example : the following values {200 210 180 200} are coded as :
FirstValue=200 Deltas={ 10 -30 +20 }
Returns:
true if this the value is correctly added. Returns false if the container is lock and no more data can be added.

addPeriodicDeltas

public boolean addPeriodicDeltas(java.lang.String dataName,
                                 int startTime,
                                 int period,
                                 double firstValue,
                                 java.util.List deltas)
Add a list of periodic values to the the container. If the container previously contained a data with the same name, the old value is replaced.

Parameters:
dataName - name of the PeriodicDeltas.
startTime - Time of the first value in seconds.
period - The period between two consecutive value.
firstValue - First value.
deltas - list of numbers.

Example : the following values {10200 10220 10240 10280} are coded as :
FirstValue=200 Period = 20 StartTime = 10000
Returns:
true if this the value is correctly added. Returns false if the container is lock and no more data can be added.

empty

public void empty()
Clear all added data.

Specified by:
empty in class AbstractContainer