javatools.filehandlers
Class CSVFile

java.lang.Object
  extended by javatools.filehandlers.CSVFile
All Implemented Interfaces:
java.io.Closeable

public class CSVFile
extends java.lang.Object
implements java.io.Closeable

This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools). It is licensed under the Creative Commons Attribution License (see http://creativecommons.org/licenses/by/3.0) by the YAGO-NAGA team (see http://mpii.de/yago-naga). The class allows writing data to a CSV file.


Constructor Summary
CSVFile(java.io.File f)
           
CSVFile(java.io.File f, boolean append)
           
CSVFile(java.io.File f, boolean append, java.util.List<java.lang.String> columns)
           
CSVFile(java.io.File f, boolean append, java.lang.String... columns)
           
CSVFile(java.io.File f, boolean append, java.lang.String separator, java.util.List<java.lang.String> columns)
           
CSVFile(java.io.File f, java.util.List<java.lang.String> columns)
           
CSVFile(java.io.File f, java.lang.String... columns)
           
CSVFile(java.lang.String f)
           
CSVFile(java.lang.String f, boolean append)
           
CSVFile(java.lang.String f, boolean append, java.util.List<java.lang.String> columns)
           
CSVFile(java.lang.String f, boolean append, java.lang.String... columns)
           
CSVFile(java.lang.String f, java.util.List<java.lang.String> columns)
           
CSVFile(java.lang.String f, java.lang.String... columns)
           
 
Method Summary
 void close()
          Closes the file
static void main(java.lang.String[] args)
          Test method
 void neverQuote(boolean q)
          Sets quoting on/off (off by default)
 void setQuoting(boolean q)
          Sets optional quoting on/off (off by default)
 void write(java.util.List<? extends java.lang.Object> columns)
          Writes the columns to the file
 void write(java.lang.Object... columns)
          Writes the columns to the file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVFile

public CSVFile(java.io.File f,
               boolean append,
               java.lang.String separator,
               java.util.List<java.lang.String> columns)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.io.File f,
               boolean append,
               java.util.List<java.lang.String> columns)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.io.File f,
               boolean append,
               java.lang.String... columns)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.io.File f,
               boolean append)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.lang.String f,
               boolean append)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.io.File f)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.lang.String f)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.lang.String f,
               boolean append,
               java.util.List<java.lang.String> columns)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.lang.String f,
               boolean append,
               java.lang.String... columns)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.lang.String f,
               java.util.List<java.lang.String> columns)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.lang.String f,
               java.lang.String... columns)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.io.File f,
               java.util.List<java.lang.String> columns)
        throws java.io.IOException
Throws:
java.io.IOException

CSVFile

public CSVFile(java.io.File f,
               java.lang.String... columns)
        throws java.io.IOException
Throws:
java.io.IOException
Method Detail

setQuoting

public void setQuoting(boolean q)
Sets optional quoting on/off (off by default)


neverQuote

public void neverQuote(boolean q)
Sets quoting on/off (off by default)


write

public void write(java.util.List<? extends java.lang.Object> columns)
           throws java.io.IOException
Writes the columns to the file

Throws:
java.io.IOException

write

public void write(java.lang.Object... columns)
           throws java.io.IOException
Writes the columns to the file

Throws:
java.io.IOException

close

public void close()
Closes the file

Specified by:
close in interface java.io.Closeable

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test method

Throws:
java.lang.Exception