net.sf.jmatchparser.util.csv
Class AbstractCSVWriter

java.lang.Object
  extended by net.sf.jmatchparser.util.csv.AbstractCSVWriter
Direct Known Subclasses:
CSVReaderBuilder, CSVWriter, FixedWidthCSVWriter, PropertiesCSVWriter, XMLCSVWriter

public abstract class AbstractCSVWriter
extends Object

Abstract base class to read data from several CSV-like file formats.


Constructor Summary
AbstractCSVWriter()
           
 
Method Summary
abstract  void close()
          Close this CSV writer.
abstract  void flush()
          Flush this CSV writer.
<T> void
write(Map<T,String> recordMap, T[] headers)
          Write an "indirect" record, consisting of a Map of headers to values, and a header list.
abstract  void write(String... record)
          Write a record (line) into this CSV file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCSVWriter

public AbstractCSVWriter()
Method Detail

flush

public abstract void flush()
                    throws IOException
Flush this CSV writer.

Throws:
IOException

close

public abstract void close()
                    throws IOException
Close this CSV writer.

Throws:
IOException

write

public abstract void write(String... record)
                    throws IOException
Write a record (line) into this CSV file.

Throws:
IOException

write

public final <T> void write(Map<T,String> recordMap,
                            T[] headers)
                 throws IOException
Write an "indirect" record, consisting of a Map of headers to values, and a header list. Values that do not exist in the map are assumed to be empty.

Parameters:
recordMap - map to map headers to values
headers - headers
Throws:
IOException


Copyright © 2011. All Rights Reserved.