|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.oakgrovesystems.util.CSV
This class represents the Comma Separated Value (CSV) object. This class provides methods to access the CSV data as well as methods to modify the data viz., addRow and removeRow methods.
Field Summary | |
static int |
HEADER
The Row number of the header row (if header is applicable) |
Constructor Summary | |
CSV()
|
Method Summary | |
void |
addRow(java.util.ArrayList rowToken)
This method adds a row, at the end of the existing matrix, to the CSV object |
java.util.ArrayList |
getColumn(int columnNumber)
This method returns the column from the CSV matrix |
java.util.ArrayList[] |
getCSVData()
This method returns the complete CSV matrix |
java.util.ArrayList |
getHeader()
This method returns the first row of the CSV matrix |
java.util.ArrayList |
getRow(int rowNumber)
This method returns the specified row of the CSV matrix |
int |
getTotalRows()
This method returns the total number of rows in the CSV object |
static com.oakgrovesystems.util.CSV |
parse(java.io.Reader reader)
This method is the final parsing bolck for parsing CSV values |
void |
removeRow(int rowNumber)
This method removes a row, if it exists, from the CSV object |
void |
setCSVData(java.util.ArrayList[] finalTokens)
This method sets the data for this object. |
java.lang.String |
toString()
This method overrides the default toString() method to return the CSV matrix as CSV text |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int HEADER
Constructor Detail |
public CSV()
Method Detail |
public void setCSVData(java.util.ArrayList[] finalTokens)
finalTokens
- This is an array of ArrayList values. Each
ArrayList contains the values for each row.public void addRow(java.util.ArrayList rowToken)
rowToken
- The ArrayList containing the row valuespublic void removeRow(int rowNumber)
rowNumber
- The row number of the row to be removedpublic int getTotalRows()
public java.util.ArrayList getHeader()
public java.util.ArrayList getRow(int rowNumber)
rowNumber
- The row number of the CSV matrix
public java.util.ArrayList[] getCSVData()
public java.util.ArrayList getColumn(int columnNumber)
columnNumber
- The column number of the CSV matrix
public java.lang.String toString()
toString
in class java.lang.Object
public static com.oakgrovesystems.util.CSV parse(java.io.Reader reader) throws java.io.IOException
reader
- This method reads the CSV values from a Reader object
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |