|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mbari.io.DelimitedFile
Read a delimited text file into a double array. The text file should only contain values that can be converted to double values (i.e no columns of dates like 22-Sep-1968).
MBARI provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of the Monterey Bay Aquarium Research Institute to assist in its use, correction, modification, or enhancement. This information should not be published or distributed to third parties without specific written permission from MBARI.
| Field Summary | |
protected java.lang.String[] |
columnNames
|
protected double[][] |
data
|
| Constructor Summary | |
DelimitedFile(java.io.File file)
Create a DelimitedFileReader and intialize memory. |
|
DelimitedFile(java.lang.String filename)
Create a DelimitedFileReader. |
|
| Method Summary | |
java.lang.String[] |
getColumnNames()
|
java.lang.String |
getCommentTag()
|
double[][] |
getData()
Accesor method to access the data in the flat file |
double |
getDatum(int row,
int column)
|
java.lang.String |
getDelimiter()
|
java.io.File |
getFile()
Accesor method to get the file read by the FlatFileReader |
java.lang.String |
getFilename()
Deprecated. 07 Feb 2002; use getFile() instead |
boolean |
getHasColumnNames()
|
int |
getNumOfColumns()
Method to get the number of columns in the data array |
int |
getNumOfRows()
Method to get the number of rows in the data array |
static void |
main(java.lang.String[] args)
For debugging |
void |
read()
This method does the actual reading of the data file. |
void |
readFile()
Deprecated. 08 Feb 2002; use read() instead |
void |
setCommentTag(java.lang.String newCommentTag)
|
void |
setDelimiter(java.lang.String newDelimiter)
|
void |
setHasColumnNames(boolean newHasColumnNames)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected double[][] data
protected java.lang.String[] columnNames
| Constructor Detail |
public DelimitedFile(java.lang.String filename)
throws java.io.IOException
filename - Name of file to read
public DelimitedFile(java.io.File file)
throws java.io.IOException
file - File object representing the file to be read| Method Detail |
public void readFile()
throws java.io.IOException
java.io.IOException
public void read()
throws java.io.IOException
java.io.IOExceptionpublic double[][] getData()
public java.lang.String getFilename()
public java.io.File getFile()
public double getDatum(int row,
int column)
public int getNumOfRows()
public int getNumOfColumns()
public void setHasColumnNames(boolean newHasColumnNames)
public boolean getHasColumnNames()
public void setDelimiter(java.lang.String newDelimiter)
public java.lang.String getDelimiter()
public java.lang.String[] getColumnNames()
public void setCommentTag(java.lang.String newCommentTag)
public java.lang.String getCommentTag()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||