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
 java.lang.Object clone()
          Returns a clone of this Data object.
 long getCollectTime()
          Returns the time in milliseconds at which the audio data is collected.
 long getFirstSampleNumber()
          Returns the position of the first sample in the original data.
 int getSampleRate()
          Returns the sample rate of the data.
 java.lang.String toString()
          Returns a string that describes this DoubleData.
 
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.


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()
Returns a string that describes this DoubleData.

Overrides:
toString in class OVector
Returns:
a string that describes this DoubleData

getSampleRate

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

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.

Returns:
the position of the first sample in the original data

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 java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of this Data object.

Overrides:
clone in class java.lang.Object
Returns:
a clone of this data object
Throws:
java.lang.CloneNotSupportedException