com.scooterframework.orm.sqldataexpress.object
Class TableData

java.lang.Object
  extended by com.scooterframework.orm.sqldataexpress.object.TableData
All Implemented Interfaces:
java.io.Serializable

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

TableData class contains table data which consists of both header and body. The header, represented by RowInfo, is the meta data about the columns. The body is a list of RowData objects.

See Also:
Serialized Form

Constructor Summary
TableData()
          Constructor
 
Method Summary
 void addRow(RowData row)
          adds a row
 java.util.List<RowData> getAllRows()
          returns all rows as a list of RowData objects.
 java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getAllRowsAsMap()
          returns all rows as a list of Map.
 java.util.List<RowData> getBody()
          gets body
 int getColumnSize()
          returns columnSize
 java.lang.Object[] getData(int rowIndex)
          returns a row as a object.
 java.lang.Object getFirstObject()
          returns first value of first row
 RowData getFirstRow()
          returns first row
 RowInfo getHeader()
          gets header info
 RowData getRow(int rowIndex)
          returns a row as a RowData object.
 java.util.Map<java.lang.String,java.lang.Object> getRowAsMap(int rowIndex)
          returns a row as a Map.
 TableInfo getTableInfo()
          returns table meta data
 java.lang.String getTableName()
          gets table name
 int getTableSize()
          returns table size
 void removeRow(int rowIndex)
          removes a row
 void setHeader(RowInfo rowInfo)
          sets header info
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableData

public TableData()
Constructor

Method Detail

getTableInfo

public TableInfo getTableInfo()
returns table meta data


getTableName

public java.lang.String getTableName()
gets table name


getBody

public java.util.List<RowData> getBody()
gets body


getAllRowsAsMap

public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getAllRowsAsMap()
returns all rows as a list of Map.


getAllRows

public java.util.List<RowData> getAllRows()
returns all rows as a list of RowData objects.


getRow

public RowData getRow(int rowIndex)
returns a row as a RowData object. The first row's index is 0, the second row's is 1, ...


addRow

public void addRow(RowData row)
adds a row


removeRow

public void removeRow(int rowIndex)
removes a row


getRowAsMap

public java.util.Map<java.lang.String,java.lang.Object> getRowAsMap(int rowIndex)
returns a row as a Map. If the rowIndex is out of bound, returns an empty Map. rowIndex: 0, 1, 2, ...


getData

public java.lang.Object[] getData(int rowIndex)
returns a row as a object. The first row's index is 0, the second row's is 1, ...


getFirstRow

public RowData getFirstRow()
returns first row


getFirstObject

public java.lang.Object getFirstObject()
returns first value of first row


getHeader

public RowInfo getHeader()
gets header info


setHeader

public void setHeader(RowInfo rowInfo)
sets header info


getColumnSize

public int getColumnSize()
returns columnSize


getTableSize

public int getTableSize()
returns table size


toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
String