at.tuwien.ifs.feature.extraction.audio.output
Class AbstractDataWriter

java.lang.Object
  extended by at.tuwien.ifs.feature.extraction.audio.output.AbstractDataWriter
Direct Known Subclasses:
ARFFFormatWriter, OSIRISFormatWriter, SOMLibFormatWriter, XMLFormatWriter

public abstract class AbstractDataWriter
extends java.lang.Object


Field Summary
protected  java.lang.String baseDirectory
           
protected  ClassAssignmentResolver classAssignmentResolver
           
protected  java.lang.String dataTypeID
           
protected  int featureVectorLength
           
protected  java.lang.String fileName
           
protected  java.text.DecimalFormat formatDouble
           
protected  java.text.DecimalFormat formatFloat
           
protected  boolean gzipped
           
protected  java.lang.String nl
           
protected  java.io.BufferedWriter outFile
           
 
Constructor Summary
AbstractDataWriter(java.lang.String outFileName)
           
AbstractDataWriter(java.lang.String outFileName, boolean gzipped)
           
 
Method Summary
protected  void checkVectorDim(int vectorDim)
           
 void close()
           
protected  void initDecimalFormats()
           
 void setBaseDirectory(java.lang.String baseDir)
          If the base directory is provided, it will be included in the header of the output files.
 void setClassAssignmentResolver(ClassAssignmentResolver classAssignmentResolver)
           
 void setDataType(java.lang.String dataType)
          If data type is set, e.g.
abstract  void writeVector(FeatureVectorData featureVector)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileName

protected final java.lang.String fileName

outFile

protected final java.io.BufferedWriter outFile

nl

protected java.lang.String nl

featureVectorLength

protected int featureVectorLength

dataTypeID

protected java.lang.String dataTypeID

baseDirectory

protected java.lang.String baseDirectory

formatFloat

protected java.text.DecimalFormat formatFloat

formatDouble

protected java.text.DecimalFormat formatDouble

gzipped

protected boolean gzipped

classAssignmentResolver

protected ClassAssignmentResolver classAssignmentResolver
Constructor Detail

AbstractDataWriter

public AbstractDataWriter(java.lang.String outFileName)
                   throws java.io.IOException
Throws:
java.io.IOException

AbstractDataWriter

public AbstractDataWriter(java.lang.String outFileName,
                          boolean gzipped)
                   throws java.io.IOException
Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

setDataType

public void setDataType(java.lang.String dataType)
If data type is set, e.g. the header line $DATA_TYPE will be included in the SOMLib vector file.

Parameters:
dataType - set data type ID, e.g. "audio-rp"

setBaseDirectory

public void setBaseDirectory(java.lang.String baseDir)
If the base directory is provided, it will be included in the header of the output files.

Parameters:
baseDir - base directory of files provided as fileLabel to the vectors

writeVector

public abstract void writeVector(FeatureVectorData featureVector)
                          throws java.io.IOException
Throws:
java.io.IOException

checkVectorDim

protected void checkVectorDim(int vectorDim)
                       throws java.io.IOException
Throws:
java.io.IOException

initDecimalFormats

protected void initDecimalFormats()

setClassAssignmentResolver

public void setClassAssignmentResolver(ClassAssignmentResolver classAssignmentResolver)