nl.lxtreme.ols.api.data
Class BaseDataSet<DATA extends BaseData<DATA>>

java.lang.Object
  extended by nl.lxtreme.ols.api.data.BaseDataSet<DATA>
Type Parameters:
DATA - the actual data entity of this base data set.

public class BaseDataSet<DATA extends BaseData<DATA>>
extends Object

Provides a base data set implementation.


Constructor Summary
BaseDataSet(int aStartOfDecodeIdx, int aEndOfDecodeIdx, AcquisitionResult aData)
          Creates a new BaseDataSet.
 
Method Summary
protected  void addData(DATA aData)
          Adds data to this dataset.
 List<DATA> getData()
          Returns the (decoded) data in this data set.
 int getEndOfDecode()
          Returns the sample (array) index on which the decoding is stopped.
 int getSampleRate()
           
 int getStartOfDecode()
          Returns the sample (array) index on which the decoding is started.
 double getTime(int aSampleIdx)
          Returns the time-value for the given sample index, taking the (optional) trigger position into consideration.
 boolean isEmpty()
          Returns whether this data set is empty or not.
protected  int size()
          Returns the current size of this data set.
protected  void sort()
          Sorts the data according to the Comparable implementation of DATA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDataSet

public BaseDataSet(int aStartOfDecodeIdx,
                   int aEndOfDecodeIdx,
                   AcquisitionResult aData)
Creates a new BaseDataSet.

Parameters:
aStartOfDecodeIdx - the sample index denoting the start of this data set;
aEndOfDecodeIdx - the sample index denoting the end of this data set;
aData - the actual acquisition results used in this data set.
Method Detail

getData

public final List<DATA> getData()
Returns the (decoded) data in this data set.

Returns:
the data, never null.

getEndOfDecode

public final int getEndOfDecode()
Returns the sample (array) index on which the decoding is stopped.

Returns:
a sample (array) index, >= 0.

getSampleRate

public final int getSampleRate()
Returns:
the sampleRate

getStartOfDecode

public final int getStartOfDecode()
Returns the sample (array) index on which the decoding is started.

Returns:
a sample (array) index, >= 0.

getTime

public final double getTime(int aSampleIdx)
Returns the time-value for the given sample index, taking the (optional) trigger position into consideration.

Parameters:
aSampleIdx - the sample index to return as (absolute) time value.
Returns:
a real time value, never null.

isEmpty

public final boolean isEmpty()
Returns whether this data set is empty or not.

Returns:
true if this data set is empty, false otherwise.

addData

protected final void addData(DATA aData)
Adds data to this dataset.

Parameters:
aData - the data to add, cannot be null.

size

protected final int size()
Returns the current size of this data set.

Returns:
a data set size, >= 0.

sort

protected void sort()
Sorts the data according to the Comparable implementation of DATA.



Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.