smithers.files
Class CSVWriter

java.lang.Object
  extended by smithers.files.CSVWriter

public class CSVWriter
extends java.lang.Object

Writes data to a CSV file.


Constructor Summary
CSVWriter(java.lang.String fileName)
          Creates a CSVWriter which writes to the specified file.
 
Method Summary
 void addCell(java.lang.String contents)
          Adds a cell to the current row.
 void flush()
          Flushes the output stream.
 void writeRow()
          Outputs the current row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVWriter

public CSVWriter(java.lang.String fileName)
          throws java.io.IOException
Creates a CSVWriter which writes to the specified file.

Parameters:
fileName - the name of the file to write to
Throws:
java.io.IOException - if the file cannot be opened for any reason
Method Detail

addCell

public void addCell(java.lang.String contents)
Adds a cell to the current row.

Parameters:
contents - the contents of the cell

writeRow

public void writeRow()
              throws java.io.IOException
Outputs the current row.

Throws:
java.io.IOException - if an I/O error occurs

flush

public void flush()
           throws java.io.IOException
Flushes the output stream.

Throws:
java.io.IOException - if an I/O error occurs