org.jscience.chemistry.vapor.util
Class CSVParser

java.lang.Object
  extended by org.jscience.chemistry.vapor.util.CSVParser

public class CSVParser
extends java.lang.Object

This class has methods to parse comma separated values and generate data structure for the same.


Constructor Summary
CSVParser()
           
 
Method Summary
static java.util.ArrayList parseCSV(java.lang.String csvString)
          This method takes a String of Comma seperated data (individual rows seperated by newline i.e.
static java.util.ArrayList parseCSVFile(java.lang.String fileName)
          This method parses the given file as a CSV and returns the arraylist of hashmaps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVParser

public CSVParser()
Method Detail

parseCSVFile

public static java.util.ArrayList parseCSVFile(java.lang.String fileName)
                                        throws java.io.IOException,
                                               java.io.FileNotFoundException
This method parses the given file as a CSV and returns the arraylist of hashmaps.

Parameters:
fileName - Name of the file
Returns:
ArrayList of HashMaps containing the fields of each row
Throws:
java.io.IOException - DOCUMENT ME!
java.io.FileNotFoundException - DOCUMENT ME!

parseCSV

public static java.util.ArrayList parseCSV(java.lang.String csvString)
This method takes a String of Comma seperated data (individual rows seperated by newline i.e. '\n' and returns an ArrayList of HashMaps containing the fields of each individual row.

Parameters:
csvString - String object containing data in CSV format
Returns:
ArrayList of HashMaps containing the fields of each row