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

java.lang.Object
  extended by at.tuwien.ifs.feature.extraction.audio.output.AbstractDataWriter
      extended by at.tuwien.ifs.feature.extraction.audio.output.ARFFFormatWriter

public class ARFFFormatWriter
extends AbstractDataWriter

Copyright Vienna University of Technology

Version:
$Id: SOMLibFormatWriter.java 173 2010-06-17 16:28:05Z mayer $
Author:
Rudolf Mayer

Field Summary
private  int numVectors
           
private  java.lang.String realFileName
           
private  java.util.ArrayList<java.lang.String> tmpLabels
           
private  java.util.ArrayList<java.lang.StringBuilder> tmpVectors
           
private  boolean writeLabels
           
 
Fields inherited from class at.tuwien.ifs.feature.extraction.audio.output.AbstractDataWriter
baseDirectory, classAssignmentResolver, dataTypeID, featureVectorLength, fileName, formatDouble, formatFloat, gzipped, nl, outFile
 
Constructor Summary
ARFFFormatWriter(java.lang.String outFileName, boolean gzipped, boolean writeLabels)
          Constructor for ARFFFormatWriter.
 
Method Summary
 void close()
           
private  void writeData()
           
private  void writeHeader()
           
 void writeVector(FeatureVectorData featureVector)
           
 
Methods inherited from class at.tuwien.ifs.feature.extraction.audio.output.AbstractDataWriter
checkVectorDim, initDecimalFormats, setBaseDirectory, setClassAssignmentResolver, setDataType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

realFileName

private final java.lang.String realFileName

numVectors

private int numVectors

writeLabels

private boolean writeLabels

tmpVectors

private java.util.ArrayList<java.lang.StringBuilder> tmpVectors

tmpLabels

private java.util.ArrayList<java.lang.String> tmpLabels
Constructor Detail

ARFFFormatWriter

public ARFFFormatWriter(java.lang.String outFileName,
                        boolean gzipped,
                        boolean writeLabels)
                 throws java.io.IOException
Constructor for ARFFFormatWriter. if the outFileName ends with ".gz" gzip compression will be enabled.

Parameters:
outFileName - the output filename
gzipped - set true to force gzip compression
Throws:
java.io.IOException
Method Detail

writeHeader

private void writeHeader()
                  throws java.io.IOException
Throws:
java.io.IOException

writeData

private void writeData()
                throws java.io.IOException
Throws:
java.io.IOException

writeVector

public void writeVector(FeatureVectorData featureVector)
                 throws java.io.IOException
Specified by:
writeVector in class AbstractDataWriter
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Overrides:
close in class AbstractDataWriter
Throws:
java.io.IOException