org.easycsv
Class CsvDataStore

java.lang.Object
  extended by org.easycsv.CsvDataStore
All Implemented Interfaces:
java.io.Serializable

public class CsvDataStore
extends java.lang.Object
implements java.io.Serializable

Version:
$LastChangedRevision: 14 $
Author:
Oliver J. Siegmar
See Also:
Serialized Form

Constructor Summary
CsvDataStore()
           
 
Method Summary
protected  void addDataRow(CsvRow dataRow)
          Adds a new row to the data store.
 void addHeader(java.lang.String header)
           
 void addRow(java.util.List<java.lang.String> row)
          Adds a new row to the data store.
 void addRow(java.lang.String... row)
          Adds a new row to the data store.
 java.util.List<CsvRow> getAsList()
           
 java.util.List<java.lang.String> getCol(int col)
           
 java.util.List<java.lang.String> getCol(java.lang.String colName)
           
 int getColCount()
          Returns the number of columns of the "longest" row
 java.lang.Integer getColPos(java.lang.String colName)
           
 java.util.List<CsvRow> getCols(int... cols)
           
 java.util.List<CsvRow> getCols(java.lang.String... cols)
           
 java.util.List<java.lang.String> getHeader()
          Returns all header fields as a List of Strings.
 java.util.List<java.util.Map<java.lang.String,java.lang.String>> getMapList()
           
 CsvRow getRow(int row)
           
 int getRowCount()
          Returns the number of rows of this list (excluding the header)
 boolean hasHeader(java.lang.String colName)
          Returns if the list contains a header with the specified name
 boolean isAllowDupesInHeader()
           
 boolean isCaseSensitiveHeader()
           
 void setAllowDupesInHeader(boolean allowDupesInHeader)
           
 void setCaseSensitiveHeader(boolean caseSensitiveHeader)
           
protected  void setDataRows(java.util.List<CsvRow> dataRows)
           
 void setHeader(java.util.List<java.lang.String> headers)
           
 void setHeader(java.lang.String... header)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CsvDataStore

public CsvDataStore()
Method Detail

isCaseSensitiveHeader

public boolean isCaseSensitiveHeader()

setCaseSensitiveHeader

public void setCaseSensitiveHeader(boolean caseSensitiveHeader)

isAllowDupesInHeader

public boolean isAllowDupesInHeader()

setAllowDupesInHeader

public void setAllowDupesInHeader(boolean allowDupesInHeader)

getColPos

public java.lang.Integer getColPos(java.lang.String colName)

hasHeader

public boolean hasHeader(java.lang.String colName)
Returns if the list contains a header with the specified name

Parameters:
colName - the name of the column that should be checked for existence
Returns:
if the header exists

getAsList

public java.util.List<CsvRow> getAsList()

getRow

public CsvRow getRow(int row)

getCol

public java.util.List<java.lang.String> getCol(int col)

getCol

public java.util.List<java.lang.String> getCol(java.lang.String colName)

getCols

public java.util.List<CsvRow> getCols(int... cols)
                               throws CsvException
Throws:
CsvException

getCols

public java.util.List<CsvRow> getCols(java.lang.String... cols)
                               throws CsvException
Throws:
CsvException

getMapList

public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getMapList()

setHeader

public void setHeader(java.util.List<java.lang.String> headers)
               throws CsvException
Throws:
CsvException

setHeader

public void setHeader(java.lang.String... header)
               throws CsvException
Throws:
CsvException

addHeader

public void addHeader(java.lang.String header)
               throws CsvException
Throws:
CsvException

getHeader

public java.util.List<java.lang.String> getHeader()
Returns all header fields as a List of Strings.

Returns:
the header

setDataRows

protected void setDataRows(java.util.List<CsvRow> dataRows)

addDataRow

protected void addDataRow(CsvRow dataRow)
Adds a new row to the data store.

Parameters:
row - the row to add
See Also:
addRow(List), addRow(String...)

addRow

public void addRow(java.util.List<java.lang.String> row)
Adds a new row to the data store.

Parameters:
row - the row to add
See Also:
addDataRow(CsvRow), addRow(String...)

addRow

public void addRow(java.lang.String... row)
Adds a new row to the data store.

Parameters:
row - the row to add
See Also:
addDataRow(CsvRow), addRow(List)

getRowCount

public int getRowCount()
Returns the number of rows of this list (excluding the header)

Returns:
the number of rows of this list

getColCount

public int getColCount()
Returns the number of columns of the "longest" row

Returns:
The number of columns of the "longest" row

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2005-2005-2006 null. All Rights Reserved.