com.objex.panywhere.data
Class TableData

java.lang.Object
  extended by com.objex.panywhere.Data
      extended by com.objex.panywhere.data.TableData
All Implemented Interfaces:
java.io.Serializable

public class TableData
extends Data

Custom data that is linked to a complex data dictionary field that has subfields and rows.

See Also:
Serialized Form

Nested Class Summary
static class TableData.Row
          A row representing the data for an actual row in the user's database.
 
Constructor Summary
TableData()
          Creates a new instance of TableData
 
Method Summary
 void addRow(int ai_rrn, TableData.Row a_row)
          Add a new Row at the specified RRN
 java.util.Map<java.lang.Integer,TableData.Row> getDataValue()
           
 TableData.Row getRow(int ai_rrn)
           
 int getRowCount()
           
 java.util.Map<java.lang.Integer,TableData.Row> getRows()
           
 Data getValueAt(int row, int fieldid)
           
 void setRows(java.util.Map<java.lang.Integer,TableData.Row> aRows)
          Set the new map of rows for the TableData.
 void setValueAt(int rrn, int fieldid, Data a_sub_data, boolean ab_newrec)
          Sets new value for row (rrn) and subfield "fieldid" to new value of "a_sub_data).
 
Methods inherited from class com.objex.panywhere.Data
getFieldid, getFieldname, getValue, setFieldid, setFieldname, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableData

public TableData()
Creates a new instance of TableData

Method Detail

getDataValue

public java.util.Map<java.lang.Integer,TableData.Row> getDataValue()
Returns:
A map of table data rows representing data for this table field. The key is the row number while the value is the TableData.Row object representing the row in a database table

getValueAt

public Data getValueAt(int row,
                       int fieldid)
Returns:
A data value at row "row" and subfield "fieldid". Null may be returned if no row and/or subfield exists in this TableData

getRowCount

public int getRowCount()
Returns:
The number of rows in this table data

setValueAt

public void setValueAt(int rrn,
                       int fieldid,
                       Data a_sub_data,
                       boolean ab_newrec)
Sets new value for row (rrn) and subfield "fieldid" to new value of "a_sub_data). If row does not exist, a new row will be added otherwise the value for the Row currently at row RRN will be updated.

Parameters:
a_sub_data - The new data to be added for Row with specified RRN and fieldid
rrn - The RRN at which the data is to be added. RRN uniquely identifies the Row in the TableData
ab_newrec - Flag for whether or not the record for which this value is being added must be marked as a new record. Records marked as "newrec" can be used to distinguish between records you retrieved out of the database
and those that were added by the client.
fieldid - The fieldid of the colum for which that data is being set

getRows

public java.util.Map<java.lang.Integer,TableData.Row> getRows()
Returns:
A map of table data rows representing data for this table field. The key is the row number while the value is the TableData.Row object representing the row in a database table

setRows

public void setRows(java.util.Map<java.lang.Integer,TableData.Row> aRows)
Set the new map of rows for the TableData. The map key is the row number while the map value is the TableData.Row object representing the row in a database table

Parameters:
aRows - The new map of rows for the TableData.

addRow

public void addRow(int ai_rrn,
                   TableData.Row a_row)
Add a new Row at the specified RRN

Parameters:
ai_rrn - The unique row number at which the row must be added
a_row - The new data Row to be added

getRow

public TableData.Row getRow(int ai_rrn)
Parameters:
ai_rrn - The unique row number for Row to be retrieved.
Returns:
The table Row at row number "ai_rrn". If no row is available for this rrn, NULL is returned