edu.cmu.sphinx.frontend
Class DoubleData

java.lang.Object
  extended by edu.cmu.sphinx.util.machlearn.OVector
      extended by edu.cmu.sphinx.frontend.DoubleData
All Implemented Interfaces:
Data, java.io.Serializable, java.lang.Cloneable

public class DoubleData
extends OVector
implements Data

A Data object that holds data of primitive type double.

See Also:
Serialized Form

Constructor Summary
DoubleData(double[] values)
          Constructs a new Data object with values only.
DoubleData(double[] values, int sampleRate, long collectTime, long firstSampleNumber)
          Constructs a Data object with the given values, collect time, and first sample number.
 
Method Summary
 DoubleData clone()
           
 long getCollectTime()
          Returns the time in milliseconds at which the audio data is collected.
 long getFirstSampleNumber()
           
 int getSampleRate()
           
 java.lang.String toString()
           
 
Methods inherited from class edu.cmu.sphinx.util.machlearn.OVector
dimension, equals, getValues, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleData

public DoubleData(double[] values)
Constructs a new Data object with values only. All other internal fields like sampling rate etc. are initialized to -1.

Parameters:
values -

DoubleData

public DoubleData(double[] values,
                  int sampleRate,
                  long collectTime,
                  long firstSampleNumber)
Constructs a Data object with the given values, collect time, and first sample number.

Parameters:
values - the data values
sampleRate - the sample rate of the data
collectTime - the time at which this data is collected
firstSampleNumber - the position of the first sample in the original data
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class OVector
Returns:
a string that describes the data.

getSampleRate

public int getSampleRate()
Returns:
the sample rate of the data.

getFirstSampleNumber

public long getFirstSampleNumber()
Returns:
the position of the first sample in the original data. The very first sample number is zero.

getCollectTime

public long getCollectTime()
Returns the time in milliseconds at which the audio data is collected.

Returns:
the difference, in milliseconds, between the time the audio data is collected and midnight, January 1, 1970

clone

public DoubleData clone()
                 throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException