|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDataRow
An IDataRow
is a storage independent representation of one row of
data. It contains the column definitions and the values for each column.
IRowDefinition
,
IDataPage
,
IDataBook
Method Summary | |
---|---|
void |
addControl(IControl pControl)
Adds the given IControl to this IDataRow as control. |
void |
cancelEditingControls()
Informs all registered controls that they should
cancel any pending editing operation and revert to the values in this
IDataRow . |
int |
compareTo(IDataRow pDataRow,
SortDefinition pSortDefinition)
Compares this IDataRow with the given IDataRow , by
considering the given SortDefinition and comparing the values of
both rows according to the SortDefinition . |
IDataRow |
createDataRow(java.lang.String[] pColumnNames)
Creates and returns a new IDataRow which only contains the
specified columns and their values. |
IDataRow |
createEmptyDataRow(java.lang.String[] pColumnNames)
Creates and returns a new empty IDataRow which only contains the
specified columns without any values. |
IDataRow |
createEmptyRow(java.lang.String[] pColumnNames)
Deprecated. since 2.5, use createEmptyDataRow(String[]) instead. |
boolean |
equals(IDataRow pDataRow,
java.lang.String[] pColumnNames)
Compares this IDataRow with the given IDataRow for
equality, but only compares the values in the column whose names are
given, ignoring all not given columns. |
DataRowHandler |
eventValuesChanged()
Gets the DataRowHandler for the values changed event. |
DataRowHandler |
eventValuesChanged(java.lang.String pColumnName)
Gets the DataRowHandler for the values changed event for the
specified column. |
IControl[] |
getControls()
Gets all registered IControl s as array. |
IRowDefinition |
getRowDefinition()
Gets the IRowDefinition that is used. |
java.lang.Object |
getValue(int pColumnIndex)
Returns the value of the column by index. |
java.lang.Object |
getValue(java.lang.String pColumnName)
Returns the value of the named column. |
java.lang.String |
getValueAsString(java.lang.String pColumnName)
Returns the value of the named column converted to a String . |
java.lang.Object[] |
getValues(java.lang.String[] pColumnNames)
Gets the values from all specified columns as an Object array. |
java.lang.String[] |
getValuesAsString(java.lang.String[] pColumnNames)
Gets the values from all specified columns and converts them to a String array. |
void |
notifyRepaintControls()
Informs all registered controls that there are new
values and that they must redraw themselves. |
void |
removeControl(IControl pControl)
Removes the given IControl to this IDataRow as control. |
void |
saveEditingControls()
Informs all registered controls that they should
save their values. |
void |
setValue(java.lang.String pColumnName,
java.lang.Object pValue)
Sets the value of the named column. |
void |
setValues(java.lang.String[] pColumnNames,
java.lang.Object[] pValues)
Sets all columns of the given names to the given values. |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
IRowDefinition getRowDefinition()
IRowDefinition
that is used.
The IRowDefinition
contains all the information about the
columns.
IRowDefinition
that is used.java.lang.Object getValue(int pColumnIndex) throws ModelException
pColumnIndex
- the column index.
ModelException
- if the column index is out of bounds.getValue(String)
java.lang.Object getValue(java.lang.String pColumnName) throws ModelException
pColumnName
- the name of the column.
ModelException
- if there is no column with the given name.getValue(int)
java.lang.String getValueAsString(java.lang.String pColumnName) throws ModelException
String
.
pColumnName
- the name of the column.
String
.
ModelException
- if there is no column with the given name.getValue(int)
,
getValue(String)
,
IDataType.convertToString(Object)
void setValue(java.lang.String pColumnName, java.lang.Object pValue) throws ModelException
After the value has changed the value
changed event
and value changed (by
name) event
are invoked and fired. Afterwards all registered
IControl
s are notified of the change by invoking
IControl.notifyRepaint()
.
pColumnName
- the column name.pValue
- the new value for the named column.
ModelException
- if there is no column with the given name or the
given value can not be converted to the IDataType
of
the column.eventValuesChanged()
,
eventValuesChanged(String)
,
IDataType.convertToTypeClass(Object)
java.lang.Object[] getValues(java.lang.String[] pColumnNames) throws ModelException
Object
array.
Note that the returned Object
array does not represent an
internal state of the IDataRow
. Modifying the array does not
change the IDataRow
.
pColumnNames
- the names of the columns from which to get the
values. Can be null
for all columns (which is equal to
IRowDefinition.getColumnNames()
.
Object
array.
ModelException
- if there is no column with one of the specified
names.getValue(int)
,
getValue(String)
java.lang.String[] getValuesAsString(java.lang.String[] pColumnNames) throws ModelException
String
array.
Note that the returned String
array does not represent an
internal state of the IDataRow
. Modifying the array does not
change the IDataRow
.
pColumnNames
- the names of the columns from which to get the
values. Can be null
for all columns.
String
array.
ModelException
- if there is no column with one of the specified
names.getValueAsString(String)
,
getValues(String[])
,
IDataType.convertToString(Object)
void setValues(java.lang.String[] pColumnNames, java.lang.Object[] pValues) throws ModelException
The String
array which represents the column names is directly
mapped to the Object
array which holds the values. So they must
be equal in length.
After the value has changed the value
changed event
and value changed (by
name) event
are invoked and fired. Afterwards all registered
IControl
s are notified of the change by invoking
IControl.notifyRepaint()
.
pColumnNames
- a String
array of the column names. Can be
null
for all columns (which is equal to
IRowDefinition.getColumnNames()
.pValues
- a Object
array of values to set in the
corresponding columns.
ModelException
- if there is no column with one of the specified
names or if any of the values could not be converted to the
IDataType
of the column.eventValuesChanged()
,
eventValuesChanged(String)
,
setValue(String, Object)
,
IDataType.convertToTypeClass(Object)
int compareTo(IDataRow pDataRow, SortDefinition pSortDefinition)
IDataRow
with the given IDataRow
, by
considering the given SortDefinition
and comparing the values of
both rows according to the SortDefinition
.
It reacts for the most part like a "normal" compareTo
would,
except that it takes SortDefinition.isAscending()
into
consideration, and if it is false
the result will be negated.
pDataRow
- the @link DataRow} to compare with.pSortDefinition
- the SortDefinition
to us for the
comparison.
IDataRow
is less than, equal to, or greater than the
specified IDataRow
.boolean equals(IDataRow pDataRow, java.lang.String[] pColumnNames)
IDataRow
with the given IDataRow
for
equality, but only compares the values in the column whose names are
given, ignoring all not given columns.
pDataRow
- the IDataRow
to compare with this IDataRow
pColumnNames
- a String
array of the names of the columns to
compare.
true
if they are found equal.IDataRow createDataRow(java.lang.String[] pColumnNames) throws ModelException
IDataRow
which only contains the
specified columns and their values.
pColumnNames
- a String
array of column names. Can be
null
for all columns (which is equal to
IRowDefinition.getColumnNames()
.
IDataRow
which only contains the specified columns
and their values.
ModelException
- if new IDataRow
could not be constructed.@Deprecated IDataRow createEmptyRow(java.lang.String[] pColumnNames) throws ModelException
createEmptyDataRow(String[])
instead.
IDataRow
which only contains the
specified columns without any values.
pColumnNames
- a String
array of column names. Can be
null
for all columns (which is equal to
IRowDefinition.getColumnNames()
.
IDataRow
which only contains the specified
columns without any values.
ModelException
- if new IDataRow
could not be constructed.IDataRow createEmptyDataRow(java.lang.String[] pColumnNames) throws ModelException
IDataRow
which only contains the
specified columns without any values.
pColumnNames
- a String
array of column names. Can be
null
for all columns (which is equal to
IRowDefinition.getColumnNames()
.
IDataRow
which only contains the specified
columns without any values.
ModelException
- if new IDataRow
could not be constructed.void addControl(IControl pControl)
IControl
to this IDataRow
as control.
The registered IControl
will be notified of changes in this
IDataRow
.
pControl
- the IControl
to add.removeControl(IControl)
,
getControls()
void removeControl(IControl pControl)
IControl
to this IDataRow
as control.
pControl
- the IControl
to remove.addControl(IControl)
,
getControls()
IControl[] getControls()
IControl
s as array.
IControl
s as array.DataRowHandler eventValuesChanged()
DataRowHandler
for the values changed event.
The values changed event is fired every time a value changes in this
IDataRow
.
DataRowHandler
for the values changed event.eventValuesChanged(String)
,
setValue(String, Object)
,
setValues(String[], Object[])
DataRowHandler eventValuesChanged(java.lang.String pColumnName)
DataRowHandler
for the values changed event for the
specified column.
The values changed event is fired every time a value changes in this
IDataRow
.
pColumnName
- the name of the column.
DataRowHandler
for the values changed event for
the specified column.eventValuesChanged()
,
setValue(String, Object)
,
setValues(String[], Object[])
void notifyRepaintControls()
registered controls
that there are new
values and that they must redraw themselves. For this purpose the
IControl.notifyRepaint()
method is invoked on all registered
IControl
s.
IControl.notifyRepaint()
void saveEditingControls() throws ModelException
registered controls
that they should
save their values. For this purpose the IControl.saveEditing()
method is invoked on all registered IControl
s.
ModelException
- if saving of any of the registered
IControl
s fails.IControl.notifyRepaint()
void cancelEditingControls()
registered controls
that they should
cancel any pending editing operation and revert to the values in this
IDataRow
. For this purpose the IControl.cancelEditing()
method is invoked on all registered IControl
s.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |