org.mmbase.util
Class CVSReader

java.lang.Object
  extended byorg.mmbase.util.CVSReader

Deprecated. not used. maybe move to 'tools' application

public class CVSReader
extends Object

Class for reading and parsing the contents of a CVS (comma value seperated) file.

Version:
$Id: CVSReader.java,v 1.11 2005/10/05 10:44:00 michiel Exp $
Author:
Daniel Ockeloen, Pierre van Rooden (javadocs)

Field Summary
protected  Hashtable name2pos
          Deprecated. The CVS file header, which contains the column names.
protected  Vector rows
          Deprecated. The content of the CVS file body (the records or rows).
 
Constructor Summary
CVSReader(String filename)
          Deprecated. Constructor for the CVS Reader.
 
Method Summary
 String getElement(int row, int col)
          Deprecated. Returns the element at the given row and column.
 String getElement(int row, String colname)
          Deprecated. Returns the element at the given row and with the given column name.
 String loadFile(String filename)
          Deprecated. Reads the content of a file.
 void readCVS(String filename)
          Deprecated. Reads the contents of a CVS file and extracts the header and body content.
 int size()
          Deprecated. 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

name2pos

protected Hashtable name2pos
Deprecated. 
The CVS file header, which contains the column names. The header is represented by a Hashtable of name-values where name is a column name and value the index of that column.


rows

protected Vector rows
Deprecated. 
The content of the CVS file body (the records or rows). Each entry in 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

CVSReader

public CVSReader(String filename)
Deprecated. 
Constructor for the CVS Reader.

Parameters:
filename - The CVS file to read
Method Detail

readCVS

public void readCVS(String filename)
Deprecated. 
Reads the contents of a CVS file and extracts the header and body content. The body content of the CVS file is stored in the name2pos field, the body content in the rows field.


loadFile

public String loadFile(String filename)
Deprecated. 
Reads the content of a file.

Parameters:
filename - path and name of the file to read
Returns:
the content of the file as a string

getElement

public String getElement(int row,
                         int col)
Deprecated. 
Returns the element at the given row and column.

Parameters:
row - the element row
col - the element column
Returns:
the element as a String.

getElement

public String getElement(int row,
                         String colname)
Deprecated. 
Returns the element at the given row and with the given column name.

Parameters:
row - the element row
colname - the element columnname
Returns:
the element as a String.

size

public int size()
Deprecated. 
Returns the number of rows in the CVS body.



MMBase build 1.8.1.20060716