be.ac.ulg.montefiore.run.jahmm.io
Class ObservationVectorReader

java.lang.Object
  extended by be.ac.ulg.montefiore.run.jahmm.io.ObservationReader<ObservationVector>
      extended by be.ac.ulg.montefiore.run.jahmm.io.ObservationVectorReader

public class ObservationVectorReader
extends ObservationReader<ObservationVector>

Reads an ObservationVector up to (and including) a semi-colon.

The format of this observation is an opening bracket ([) followed by the components of the vector separated by spaces or tabs. Each component is a number (following the format [+-]?[0123456789]+[.]?[0123456789]*).

For example, reading

[76 45. -2.23];
creates an observation such as the one generated by new ObservationVector(new double[] {76., 45., -2.23});


Constructor Summary
ObservationVectorReader()
          Constructs a reader of ObservationVector.
ObservationVectorReader(int dimension)
          Constructs a reader of ObservationVector.
 
Method Summary
 ObservationVector read(java.io.StreamTokenizer st)
          An ObservationInteger reader, as explained in ObservationReader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservationVectorReader

public ObservationVectorReader()
Constructs a reader of ObservationVector.


ObservationVectorReader

public ObservationVectorReader(int dimension)
Constructs a reader of ObservationVector. Verifies the dimension of the observations read.

Parameters:
dimension - The dimension of each observation.
Method Detail

read

public ObservationVector read(java.io.StreamTokenizer st)
                       throws java.io.IOException,
                              FileFormatException
An ObservationInteger reader, as explained in ObservationReader.

Specified by:
read in class ObservationReader<ObservationVector>
Parameters:
st - A stream tokenizer.
Returns:
An ObservationInteger.
Throws:
java.io.IOException
FileFormatException


Copyright © 2004,2005 Jean-Marc François.