|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.util.CVSReader
Class for reading and parsing the contents of a CVS (comma value seperated) file.
| Field Summary | |
protected java.util.Hashtable |
name2pos
The CVS file header, which contains the column names. |
protected java.util.Vector |
rows
The content of the CVS file body (the records or rows). |
| Constructor Summary | |
CVSReader(java.lang.String filename)
Constructor for the CVS Reader. |
|
| Method Summary | |
java.lang.String |
getElement(int row,
int col)
Returns the element at the given row and column. |
java.lang.String |
getElement(int row,
java.lang.String colname)
Returns the element at the given row and with the given column name. |
java.lang.String |
loadFile(java.lang.String filename)
Reads the content of a file. |
void |
readCVS(java.lang.String filename)
Reads the contents of a CVS file and extracts the header and body content. |
int |
size()
Returns the number of rows in the CVS body. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Hashtable name2pos
Hashtable of name-values
where name is a column name and value the index of that column.
protected java.util.Vector rows
rows represents a line or record in the CVS body.
Each line is represented by a Vector of values. The position of those
values matches with teh columns from the header.
| Constructor Detail |
public CVSReader(java.lang.String filename)
filename - The CVS file to read| Method Detail |
public void readCVS(java.lang.String filename)
name2pos field,
the body content in the rows field.
public java.lang.String loadFile(java.lang.String filename)
filename - path and name of the file to read
public java.lang.String getElement(int row,
int col)
row - the element rowcol - the element column
public java.lang.String getElement(int row,
java.lang.String colname)
row - the element row
public int size()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||