|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectCSVFile
CSVFileWriter
public class CSVFileWriter
CSVFileWriter is a class derived from CSVFile used to format some fields into a new CSV file.
| Field Summary | |
|---|---|
protected java.io.PrintWriter |
out
The print writer linked to the CSV file to be written. |
| Fields inherited from class CSVFile |
|---|
DEFAULT_FIELD_SEPARATOR, DEFAULT_TEXT_QUALIFIER, fieldSeparator, textQualifier |
| Constructor Summary | |
|---|---|
CSVFileWriter(java.lang.String outputFileName)
CSVFileWriter constructor just need the name of the CSV file that will be written. |
|
CSVFileWriter(java.lang.String outputFileName,
char sep)
CSVFileWriter constructor with a given field separator. |
|
CSVFileWriter(java.lang.String outputFileName,
char sep,
char qual)
CSVFileWriter constructor with given field separator and text qualifier. |
|
| Method Summary | |
|---|---|
void |
close()
Close the output CSV file. |
void |
writeFields(java.util.Vector<java.lang.String> fields)
Join the fields and write them as a new line to the CSV file. |
| Methods inherited from class CSVFile |
|---|
getFieldSeparator, getTextQualifier, setFieldSeparator, setTextQualifier |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.PrintWriter out
| Constructor Detail |
|---|
public CSVFileWriter(java.lang.String outputFileName)
throws java.io.IOException
outputFileName - The name of the CSV file to be opened for writing
java.io.IOException - If an error occurs while creating the file
public CSVFileWriter(java.lang.String outputFileName,
char sep)
throws java.io.IOException
outputFileName - The name of the CSV file to be opened for readingsep - The field separator to be used; overwrites the default one
java.io.IOException - If an error occurs while creating the file
public CSVFileWriter(java.lang.String outputFileName,
char sep,
char qual)
throws java.io.IOException
outputFileName - The name of the CSV file to be opened for readingsep - The field separator to be used; overwrites the default onequal - The text qualifier to be used; overwrites the default one
java.io.IOException - If an error occurs while creating the file| Method Detail |
|---|
public void close()
throws java.io.IOException
java.io.IOException - If an error occurs while closing the filepublic void writeFields(java.util.Vector<java.lang.String> fields)
fields - The vector of strings containing the fields
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||