org.apache.wink.common.model.csv
Class CsvTable

java.lang.Object
  extended by org.apache.wink.common.model.csv.CsvTable
All Implemented Interfaces:
CsvDeserializer, CsvSerializer

public class CsvTable
extends java.lang.Object
implements CsvSerializer, CsvDeserializer

Represents a CSV table with multiple rows. If the table is initialized with a header, then the header will be the first row.


Constructor Summary
CsvTable()
          Creates a new CsvTable without a header
CsvTable(java.lang.String... header)
          Creates a new CsvTable with the specified header.
 
Method Summary
 void addEntity(java.lang.String[] descriptor)
          Add a single row to the CSV
 void addRow(java.lang.String... row)
          Add a row to the table.
 java.util.Iterator<java.lang.String[]> getEntities()
          Return an iterator over the rows of the CSV as a String[].
 java.util.List<java.lang.String[]> getRows()
          Get the live list of rows contained in this table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvTable

public CsvTable()
Creates a new CsvTable without a header


CsvTable

public CsvTable(java.lang.String... header)
Creates a new CsvTable with the specified header.

Parameters:
header - the header of the table
Method Detail

addRow

public void addRow(java.lang.String... row)
Add a row to the table. This is a shortcut for getRows().add(row)

Parameters:
row - the row to add

getRows

public java.util.List<java.lang.String[]> getRows()
Get the live list of rows contained in this table.

If the table contains a header, it will be the first element of the list.

Returns:
the live list of rows contained in this table

getEntities

public java.util.Iterator<java.lang.String[]> getEntities()
Description copied from interface: CsvSerializer
Return an iterator over the rows of the CSV as a String[].

Specified by:
getEntities in interface CsvSerializer
Returns:
Iterator iterator over the rows

addEntity

public void addEntity(java.lang.String[] descriptor)
Description copied from interface: CsvDeserializer
Add a single row to the CSV

Specified by:
addEntity in interface CsvDeserializer
Parameters:
descriptor - the row to add


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.