org.unisens
Interface SignalEntry

All Superinterfaces:
java.lang.Cloneable, Entry, MeasurementEntry, TimedEntry

public interface SignalEntry
extends MeasurementEntry

A SignalEntry represents continuously sampled data with a fixed sample rate.

Author:
Joerg Ottenbacher, Radi Nedkov, Malte Kirst

Method Summary
 void append(java.lang.Object data)
          Appends rows of data at the end of this SignalEntry.
 java.lang.Object read(int length)
          Reads data from a data file beginning at the current position of the file pointer.
 java.lang.Object read(long pos, int length)
          Reads rows of data from a data file beginning at a given position.
 double[][] readScaled(int length)
          Reads data from a data file beginning at the current position of the file pointer.
 double[][] readScaled(long pos, int length)
          Reads data from a data file beginning at a given position.
 
Methods inherited from interface org.unisens.MeasurementEntry
getAdcResolution, getAdcZero, getBaseline, getChannelCount, getChannelNames, getDataType, getLsbValue, getUnit, setAdcProperties, setAdcResolution, setAdcZero, setBaseline, setChannelNames, setDataType, setLsbValue, setUnit
 
Methods inherited from interface org.unisens.TimedEntry
getCount, getSampleRate, resetPos, setSampleRate
 
Methods inherited from interface org.unisens.Entry
addCustomAttribute, clone, close, createBinFileFormat, createCsvFileFormat, createCustomFileFormat, createXmlFileFormat, getComment, getContentClass, getCustomAttributes, getFileFormat, getId, getName, getSource, getSourceId, getUnisens, rename, setComment, setContentClass, setFileFormat, setName, setSource, setSourceId, setUnisens
 

Method Detail

read

java.lang.Object read(long pos,
                      int length)
                      throws java.io.IOException
Reads rows of data from a data file beginning at a given position. The data is returned as object [length][channelCount], where channelCount is the number of channels in this SignalEntry

Parameters:
pos - the position to start from
length - the number of rows to read
Returns:
the data as object [length][channelCount]
Throws:
java.io.IOException

read

java.lang.Object read(int length)
                      throws java.io.IOException
Reads data from a data file beginning at the current position of the file pointer. The data is returned as object [length][channelCount], where channelCount is the number of channels in this SignalEntry

Parameters:
length - the number of rows to read
Returns:
the data as object [length][channelCount]
Throws:
java.io.IOException

readScaled

double[][] readScaled(long pos,
                      int length)
                      throws java.io.IOException
Reads data from a data file beginning at a given position. The data is returned as double [length][channelCount], where channelCount is the number of channels in this SignalEntry. The data values are scaled according to baseline and lsbValue. value = (ADCout - baseline) * lsbValue.

Parameters:
pos - the position to start from
length - the number of rows to read
Returns:
the scaled data as double [length][channelCount]
Throws:
java.io.IOException

readScaled

double[][] readScaled(int length)
                      throws java.io.IOException
Reads data from a data file beginning at the current position of the file pointer. The data is returned as double [length][channelCount], where channelCount is the number of channels in this SignalEntry. The data values are scaled according to baseline and lsbValue. value = (ADCout - baseline) * lsbValue.

Parameters:
length - the number of rows to read
Returns:
the scaled data as double [length][channelCount]
Throws:
java.io.IOException

append

void append(java.lang.Object data)
            throws java.io.IOException,
                   java.lang.IllegalArgumentException
Appends rows of data at the end of this SignalEntry.

Parameters:
data - the data to add as object [length][channelCount]
Throws:
java.io.IOException
java.lang.IllegalArgumentException