|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.model.mem.DataRow
public class DataRow
An DataRow is a list of table column's.
The DataRow is also a storage independent row.
Example:
// construct a RowDefinition
RowDefinition rdRowDefinition = new RowDefinition();
// construct some ColumnDefinitions
ColumnDefinition cdId = new ColumnDefinition("id");
ColumnDefinition cdName = new ColumnDefinition("name");
rdRowDefinition.addColumnDefinition(cdId);
rdRowDefinition.addColumnDefinition(cdName);
// construct DataRow
DataRow drDataRow = new DataRow(rdRowDefinition);
drDataRow.setValue("id", new BigDecimal(1));
drDataRow.setValue("name", "The name");
IDataRow,
RowDefinition,
RemoteDataBook,
MemDataPage,
Serialized Form| Field Summary | |
|---|---|
protected Object[] |
oaStorage
The storage for this DataRow. |
protected IRowDefinition |
rdRowDefinition
The RowDefinition of this DataRow. |
| Constructor Summary | |
|---|---|
|
DataRow()
Constructs a DataRow without a new instance of IRowDefinition. |
|
DataRow(IRowDefinition pRowDefinition)
Constructs a DataRow with a given IRowDefinition. |
protected |
DataRow(IRowDefinition pRowDefinition,
Object[] pData)
Constructs a DataRow with a given IRowDefinition
and initialize it a copy of the Object[]<> data. |
| Method Summary | |
|---|---|
void |
addControl(IControl pControl)
Adds a IControl to the IDataRow. |
void |
cancelEditingControls()
Its invokes for each IComponent the cancelEditing() method. |
int |
compareTo(IDataRow pDataRow)
|
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. |
boolean |
equals(Object pObject)
|
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[]. |
int |
hashCode()
|
protected void |
invokeCancelEditingControls()
Its invokes for each IComponent the cancelEditing() method. |
protected void |
invokeRepaintListeners()
Its invokes for each IComponent the notifyRepaint() method. |
protected void |
invokeSaveEditingControls()
Its invokes for each IComponent the saveEditing() method. |
void |
notifyRepaintControls()
Its invokes for each IComponent the notifyRepaint() method. |
void |
removeControl(IControl pControl)
Removes the IControl from the IDataRow. |
void |
saveEditingControls()
Its invokes for each IComponent the saveEditing() method. |
void |
setDefaultValues()
Sets the Default Values from the RowDefinition to the DataRow. |
void |
setValue(String pColumnName,
Object pValue)
Sets the value of the named column in this IDataRow. |
protected void |
setValueDRInternal(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. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected IRowDefinition rdRowDefinition
RowDefinition of this DataRow.
protected Object[] oaStorage
DataRow.
| Constructor Detail |
|---|
public DataRow()
DataRow without a new instance of IRowDefinition.
public DataRow(IRowDefinition pRowDefinition)
DataRow with a given IRowDefinition.
pRowDefinition - the IRowDefinition
protected DataRow(IRowDefinition pRowDefinition,
Object[] pData)
DataRow with a given IRowDefinition
and initialize it a copy of the Object[]<> data.
pRowDefinition - the IRowDefinitionpData - the Object[]<> with data of the DataRow.| Method Detail |
|---|
public IRowDefinition getRowDefinition()
IRowDefinition of the IDataRow.
getRowDefinition in interface IDataRowIRowDefinition of the IDataRow.
public Object getValue(int pColumnIndex)
throws ModelException
getValue in interface IDataRowpColumnIndex - the column index
ModelException - if the column index is not in this IDataRow
public Object getValue(String pColumnName)
throws ModelException
getValue in interface IDataRowpColumnName - the name of the column
ModelException - if the ColumnDefinition name is not in this IDataRow
public String getValueAsString(String pColumnName)
throws ModelException
String.
getValueAsString in interface IDataRowpColumnName - the name of the column
String.
ModelException - if the ColumnDefinition name is not in this IDataRow
public void setValue(String pColumnName,
Object pValue)
throws ModelException
IDataRow.
setValue in interface IDataRowpColumnName - the column namepValue - the new value for the column in this IDataRow
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
public Object[] getValues(String[] pColumnNames)
throws ModelException
IDataRow.
getValues in interface IDataRowpColumnNames - a String[] of column names
IDataRow
ModelException - if the ColumnDefinition name is not in this IDataRow
public String[] getValuesAsString(String[] pColumnNames)
throws ModelException
String[].
getValuesAsString in interface IDataRowpColumnNames - the names of the columns
String[].
ModelException - if one the ColumnDefinition name is not in this IDataRow
public void setValues(String[] pColumnNames,
Object[] pValues)
throws ModelException
Object[]
to the this IDataRow.String[].
setValues in interface IDataRowpColumnNames - a String[] of column namespValues - a Object[] of values to set in the corresponding columns of the IDataRow
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
public IDataRow createDataRow(String[] pColumnNames)
throws ModelException
IDataRow with only a subset of specified
column names.
createDataRow in interface IDataRowpColumnNames - a String[] of column names
IDataRow with only a subset of specified
column names.
ModelException - if the IDataRow couldn't constructed
public IDataRow createEmptyRow(String[] pColumnNames)
throws ModelException
IDataRow with only a subset of column's,
specified by a String[] of column names.
createEmptyRow in interface IDataRowpColumnNames - a String[] of column names
ModelException - if the IDataRow couldn't constructedpublic boolean equals(Object pObject)
equals in class Objectpublic int compareTo(IDataRow pDataRow)
compareTo in interface Comparable<IDataRow>
public int compareTo(IDataRow pDataRow,
SortDefinition pSortDefinition)
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.
compareTo in interface IDataRowpDataRow - the DataRow to compare with this IDataRowpSortDefinition - the SortDefinition to us in the compare
IDataRow
is less than, equal to, or greater than the specified DataRow.
public boolean equals(IDataRow pDataRow,
String[] pColumnNames)
IDataRow, but it only compares the
specified columns.
equals in interface IDataRowpDataRow - the DataRow to compare with this IDataRowpColumnNames - a String[] of column names to compare
public void addControl(IControl pControl)
IControl to the IDataRow.IDataRow has changed, restored or stored.
addControl in interface IDataRowpControl - the IControlIControlpublic void removeControl(IControl pControl)
IControl from the IDataRow.
removeControl in interface IDataRowpControl - the IControlIControlpublic IControl[] getControls()
IControl's from the IDataRow.
getControls in interface IDataRowIControl's from the IDataRow.public DataRowHandler eventValuesChanged()
eventValuesChanged in interface IDataRowpublic String toString()
toString in class Objectpublic int hashCode()
hashCode in class Object
protected void setValueDRInternal(String pColumnName,
Object pValue)
throws ModelException
IDataRow.
pColumnName - the column namepValue - the new value for the column in this IDataRow
ModelException - if the column name is not in this IDataRow
or the pValue is not convertible/too large to/for the IDataType
of the columnpublic void notifyRepaintControls()
IComponent the notifyRepaint() method.
public void saveEditingControls()
throws ModelException
IComponent the saveEditing() method.
ModelException - if saving the editors fails.public void cancelEditingControls()
IComponent the cancelEditing() method.
protected void invokeRepaintListeners()
IComponent the notifyRepaint() method.
protected void invokeSaveEditingControls()
throws ModelException
IComponent the saveEditing() method.
ModelException - if saving the editors fails.protected void invokeCancelEditingControls()
IComponent the cancelEditing() method.
public void setDefaultValues()
throws ModelException
ModelException - if the set value fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||