futils
Class CsvParser

java.lang.Object
  extended by futils.CsvParser

public class CsvParser
extends java.lang.Object

CsvParser Class


Constructor Summary
CsvParser(java.lang.String s)
          Parse the string into an array of string, breaking up along the comma delimiter.
CsvParser(java.lang.String s, char delimiter)
          Use the delimiter to perform the parsing.
 
Method Summary
static double[] getArrayOfDoublesFromAFile()
          locally catch any exceptions and return null if exceptions occur.
static double[] getArrayOfDoublesFromAFile(java.io.File f)
           
 java.lang.String[] getTokens()
          getTokens Method
static void main(java.lang.String[] args)
           
static void print(java.lang.String[] s)
           
static void testCsdParser()
           
static void testCsvParser()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvParser

public CsvParser(java.lang.String s)
Parse the string into an array of string, breaking up along the comma delimiter. The delimiters are removed when you get the tokens.

Parameters:
s -

CsvParser

public CsvParser(java.lang.String s,
                 char delimiter)
Use the delimiter to perform the parsing. Defaults to a comma.

Parameters:
delimiter -
Method Detail

getTokens

public java.lang.String[] getTokens()
getTokens Method

Returns:
String[] tokens

testCsdParser

public static void testCsdParser()

testCsvParser

public static void testCsvParser()

print

public static void print(java.lang.String[] s)

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

getArrayOfDoublesFromAFile

public static double[] getArrayOfDoublesFromAFile()
locally catch any exceptions and return null if exceptions occur.

Returns:
an array of doubles parsed from a file.

getArrayOfDoublesFromAFile

public static double[] getArrayOfDoublesFromAFile(java.io.File f)
                                           throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException