java.io.BufferedReader DataSetReader
A FileReader object used for reading the data set.
Implementation of methods
openDataSet
FileReader
object and initialize it with Filename
received as a parameter
DataSetReader
with the FileReader
object.
IOExceptions
, and throw an DTWFileIOException
. Output the IOException
to System.err
.
DataSetReader.readLine()
and adding to a counter until EOF.
loadRecord
DataSetReader
by calling DataSetReader.reset()
.
num
in DataSetReader
by calling DataSetReader.readLine()
DataSetReader.readLine()
and store the return value in a String
object.
String
and store the values in a float array.
DTWFileIOException
with descriptive Message. Output the IOException
to System.err
.
closeDataSet
DataSetReader.close()
.
DTWFileIOException
in case an error occurs. Output the IOException
to System.err
.
BufferedReader(FileReader(Filename))
.
Vector
.
DTWDataVector
object's name
float
table.
DTWDataVector
.
newVector.add(newDTWDataVector)
.
DTWDataVector
array of size newVector.size()
.
newVector
items to the DTWDataVector
array.
DataObject.addTemplates( newDataVector )
;
DTWFileIOException
in case of an error. Output the IOException
to System.err
.
BufferedWriter(FileWriter(Filename))
.
DTWDataVector
array by DataObject.getTemplates()
method.
newDTWDataVector.length()
times.
BufferedWriter.write( name
endline )+.
newDTWDataVector.values[]
table to the file with each element separated with a space.
DTWFileIOException
in case of an error. Output the IOException
to System.err
.
loadObservation
BufferedReader(FileReader(Filename))
.
DTWDataVector
object.
BufferedReader
object and store it as DTWDataVector.name
.
BufferedReader
.
DTWDataVector.values
.
DataObject.setObservation( newDTWDataVector )
.
DTWFileIOException
in case of an error. Output the IOException
to System.err
.
saveObservation
BufferedWriter(FileWriter(Filename))
.
DataObject.getObservationName()
to the file.
DataObject.getObservation()
to the file as a series of float numbers converted to strings separated with spaces.
DTWFileIOException
in case of an error. Output the IOException
to System.err
.
BufferedWriter(FileWriter(Filename))
.
BufferedWriter.write()
method.
DataObject
class using getDTWEnv
method. Save the return value to file with BufferedWriter.write()
method.
DataObject.getObservationName()
. Save the return value to the file.
DataObject.getResults()
method.
DataObject.Templates.length()
times.
DataObject.getTemplateName(Results[i].getTIndex())
to the file.
Results[i].getDtwDistance()
to the file.
DTWFileIOException
in case of an error. Output the IOException
to System.err
.