javax.rad.model
Interface IDataRow

All Superinterfaces:
Comparable<IDataRow>
All Known Subinterfaces:
IChangeableDataRow, IDataBook
All Known Implementing Classes:
ChangeableDataRow, DataRow, MemDataBook, RemoteDataBook

public interface IDataRow
extends Comparable<IDataRow>

An IDataRow is a list of columns.
The IDataRow is also storage independent row.

See Also:
IRowDefinition, IDataBook, IDataPage

Method Summary
 void addControl(IControl pControl)
          Adds a IControl to the IDataRow.
 int compareTo(IDataRow pDataRow, SortDefinition pSortDefinition)
          It compares the drDataRow with this IDataRow and it uses the columns and order information (asc, desc) in the SortDefintion.
 IDataRow createDataRow(String[] pColumnNames)
          Returns a cloned IDataRow with only a subset of specified column names.
 IDataRow createEmptyRow(String[] pColumnNames)
          Returns a new empty IDataRow with only a subset of column's, specified by a String[] of column names.
 boolean equals(IDataRow pDataRow, String[] pColumnNames)
          Compares the drDataRow with this IDataRow, but it only compares the specified columns.
 DataRowHandler eventValuesChanged()
          Gets the EventHandler for values changed event.
 IControl[] getControls()
          Returns all IControl's from the IDataRow.
 IRowDefinition getRowDefinition()
          Returns the IRowDefinition of the IDataRow.
 Object getValue(int pColumnIndex)
          Returns the value of the column by index.
 Object getValue(String pColumnName)
          Returns the value of the named column.
 String getValueAsString(String pColumnName)
          Returns the value of the named column as String.
 Object[] getValues(String[] pColumnNames)
          Returns a Object[] of values from the specified columns in this IDataRow.
 String[] getValuesAsString(String[] pColumnNames)
          Returns the values of the named columns as String[].
 void removeControl(IControl pControl)
          Removes the IControl from the IDataRow.
 void setValue(String pColumnName, Object pValue)
          Sets the value of the named column in this IDataRow.
 void setValues(String[] pColumnNames, Object[] pValues)
          Sets the column's values from the pValues Object[] to the this IDataRow.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getRowDefinition

IRowDefinition getRowDefinition()
Returns the IRowDefinition of the IDataRow.

Returns:
the IRowDefinition of the IDataRow.

getValue

Object getValue(int pColumnIndex)
                throws ModelException
Returns the value of the column by index.

Parameters:
pColumnIndex - the column index
Returns:
the value of the column.
Throws:
ModelException - if the column index is not in this IDataRow

getValue

Object getValue(String pColumnName)
                throws ModelException
Returns the value of the named column.

Parameters:
pColumnName - the name of the column
Returns:
the value of the named column.
Throws:
ModelException - if the ColumnDefinition name is not in this IDataRow

getValueAsString

String getValueAsString(String pColumnName)
                        throws ModelException
Returns the value of the named column as String.

Parameters:
pColumnName - the name of the column
Returns:
the value of the named column as String.
Throws:
ModelException - if the ColumnDefinition name is not in this IDataRow

setValue

void setValue(String pColumnName,
              Object pValue)
              throws ModelException
Sets the value of the named column in this IDataRow.

Events:
After the value is changed, the IDataRowListener.changed(this, new String[] { pColumnName }, drOldRow) method is called.
After the value is changed, all registered IControls get called the notifyRepaint() method.

Parameters:
pColumnName - the column name
pValue - the new value for the column in this IDataRow
Throws:
ModelException - if the ColumnDefinition name is not in this IDataRow or the pValue is not convertible/too large to/for the IDataType of the column

getValues

Object[] getValues(String[] pColumnNames)
                   throws ModelException
Returns a Object[] of values from the specified columns in this IDataRow.

Parameters:
pColumnNames - a String[] of column names
Returns:
a Object[] of values from the specified columns in this IDataRow
Throws:
ModelException - if the ColumnDefinition name is not in this IDataRow

getValuesAsString

String[] getValuesAsString(String[] pColumnNames)
                           throws ModelException
Returns the values of the named columns as String[].

Parameters:
pColumnNames - the names of the columns
Returns:
the values of the named columns as String[].
Throws:
ModelException - if one the ColumnDefinition name is not in this IDataRow

setValues

void setValues(String[] pColumnNames,
               Object[] pValues)
               throws ModelException
Sets the column's values from the pValues Object[] to the this IDataRow.
It finds the corresponding target column over the column name in the pColumnNames String[].

Events:
After the value is changed, the IDataRowListener.changed(this, pColumnNames, drOldRow) method is called.
After the value is changed, all registered IControls get called the notifyRepaint() method.

Parameters:
pColumnNames - a String[] of column names
pValues - a Object[] of values to set in the corresponding columns of the IDataRow
Throws:
ModelException - if the ColumnDefinition name is not in this IDataRow or the pValue is not convertible/too large to/for the DataType of the column

compareTo

int compareTo(IDataRow pDataRow,
              SortDefinition pSortDefinition)
It compares the drDataRow with this IDataRow and it uses the columns and order information (asc, desc) in the SortDefintion. It reacts like a normal compareTo with specific columns, but if in the SortDefinition the order is descending for a columns it multiplies the result with -1. -> invert the result.

Parameters:
pDataRow - the DataRow to compare with this IDataRow
pSortDefinition - the SortDefinition to us in the compare
Returns:
a negative integer, zero, or a positive integer as this IDataRow is less than, equal to, or greater than the specified DataRow.

equals

boolean equals(IDataRow pDataRow,
               String[] pColumnNames)
Compares the drDataRow with this IDataRow, but it only compares the specified columns.

Parameters:
pDataRow - the DataRow to compare with this IDataRow
pColumnNames - a String[] of column names to compare
Returns:
true if equals.

createDataRow

IDataRow createDataRow(String[] pColumnNames)
                       throws ModelException
Returns a cloned IDataRow with only a subset of specified column names.

Parameters:
pColumnNames - a String[] of column names
Returns:
a cloned IDataRow with only a subset of specified column names.
Throws:
ModelException - if the IDataRow couldn't constructed

createEmptyRow

IDataRow createEmptyRow(String[] pColumnNames)
                        throws ModelException
Returns a new empty IDataRow with only a subset of column's, specified by a String[] of column names.

Parameters:
pColumnNames - a String[] of column names
Returns:
a new empty IDataRow with only a subset of columns, specified by a String[] of column names.
Throws:
ModelException - if the IDataRow couldn't constructed

addControl

void addControl(IControl pControl)
Adds a IControl to the IDataRow.
The registered IControl methods will be called if IDataRow has changed, restored or stored.

Parameters:
pControl - the IControl
See Also:
IControl

removeControl

void removeControl(IControl pControl)
Removes the IControl from the IDataRow.

Parameters:
pControl - the IControl
See Also:
IControl

getControls

IControl[] getControls()
Returns all IControl's from the IDataRow.

Returns:
all IControl's from the IDataRow.

eventValuesChanged

DataRowHandler eventValuesChanged()
Gets the EventHandler for values changed event.

Returns:
the EventHandler for values changed events.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.