|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.encog.util.ReadCSV
public class ReadCSV
Read and parse CSV format files.
| Constructor Summary | |
|---|---|
ReadCSV(java.io.InputStream is,
boolean headers,
char delim)
Construct a CSV reader from an input stream. |
|
ReadCSV(java.lang.String filename,
boolean headers,
char delim)
Construct a CSV reader from a filename. |
|
| Method Summary | |
|---|---|
void |
close()
Close the file. |
static java.lang.String |
displayDate(java.util.Date date)
Format a date. |
static double[] |
fromCommas(java.lang.String str)
Get an array of double's from a string of comma separated text. |
java.lang.String |
get(int i)
Get the specified column as a string. |
java.lang.String |
get(java.lang.String column)
Get the column by its string name, as a string. |
int |
getColumnCount()
Get the column count. |
java.util.Date |
getDate(java.lang.String column)
Get the column as a date. |
double |
getDouble(int index)
Get the column as a double specified by index. |
double |
getDouble(java.lang.String column)
Get the specified column as a double. |
int |
getInt(java.lang.String col)
Obtain a column as an integer referenced by a string. |
boolean |
next()
Read the next line. |
static java.util.Date |
parseDate(java.lang.String when)
Parse a date. |
static void |
toCommas(java.lang.StringBuilder result,
double[] data)
Convert an array of doubles to a comma separated list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReadCSV(java.io.InputStream is,
boolean headers,
char delim)
is - The InputStream to read from.headers - Are headers present?delim - What is the delimiter.
public ReadCSV(java.lang.String filename,
boolean headers,
char delim)
filename - The filename.headers - The headers.delim - The delimiter.| Method Detail |
|---|
public static java.lang.String displayDate(java.util.Date date)
date - The date to format.
public static double[] fromCommas(java.lang.String str)
str - The string that contains a list of numbers.
public static java.util.Date parseDate(java.lang.String when)
when - The date string.
public static void toCommas(java.lang.StringBuilder result,
double[] data)
result - This string will have the values appended to it.data - The array of doubles to use.public void close()
public java.lang.String get(int i)
i - The column index, starting at zero.
public java.lang.String get(java.lang.String column)
column - The column name.
public int getColumnCount()
public java.util.Date getDate(java.lang.String column)
column - The column header name.
public double getDouble(int index)
index - The column index, starting at zero.
public double getDouble(java.lang.String column)
column - The column name that we want to get.
public int getInt(java.lang.String col)
col - The column header name being read.
public boolean next()
|
The Encog Project | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||