de.erichseifert.gral.io.data
Class CSVReader

java.lang.Object
  extended by de.erichseifert.gral.io.IOCapabilitiesStorage
      extended by de.erichseifert.gral.io.data.AbstractDataReader
          extended by de.erichseifert.gral.io.data.CSVReader
All Implemented Interfaces:
DataReader

public class CSVReader
extends AbstractDataReader

Class that reads a DataSource from a CSV-file. By default the semicolon character will be used for separating columns.

See Also:
RFC 4180

Constructor Summary
CSVReader(String mimeType)
          Creates a new CSVReader with the specified MIME type.
 
Method Summary
 DataSource read(InputStream input, Class<? extends Number>... types)
          Returns a DataSource that was imported.
 
Methods inherited from class de.erichseifert.gral.io.data.AbstractDataReader
getMimeType, getSetting, setSetting
 
Methods inherited from class de.erichseifert.gral.io.IOCapabilitiesStorage
getCapabilities
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVReader

public CSVReader(String mimeType)
Creates a new CSVReader with the specified MIME type.

Parameters:
mimeType - MIME type of the file format to be read.
Method Detail

read

public DataSource read(InputStream input,
                       Class<? extends Number>... types)
                throws IOException,
                       ParseException
Description copied from interface: DataReader
Returns a DataSource that was imported.

Parameters:
input - Input to be read.
types - Number types for the columns of the DataSource.
Returns:
DataSource Imported data.
Throws:
IOException - when experiencing an error during file operations.
ParseException - when the file format is not valid.


Copyright © 2009-2010. All Rights Reserved.