com.sibvisions.rad.model.mem
Class ChangeableDataRow

java.lang.Object
  extended by com.sibvisions.rad.model.mem.DataRow
      extended by com.sibvisions.rad.model.mem.ChangeableDataRow
All Implemented Interfaces:
Serializable, Comparable<IDataRow>, IChangeableDataRow, IDataRow
Direct Known Subclasses:
MemDataBook

public class ChangeableDataRow
extends DataRow
implements IChangeableDataRow, Serializable

An IChangeableDataRow extends the IDataRow with support for the change state of the row, some supporting methods and an unique ID column.

See Also:
IDataRow, IDataPage, IDataBook, Serialized Form

Field Summary
protected static Integer DELETING
          Internal state for DELETING.
protected static Integer INSERTING
          Internal state for INSERTING.
protected static int INTERNAL_OFFSET
          Internal Offset in the AbstractStorage Array for the Inserting, etc.. states.
protected static Integer UPDATING
          Internal state for UPDATING.
 
Fields inherited from class com.sibvisions.rad.model.mem.DataRow
oaStorage, rdRowDefinition
 
Constructor Summary
protected ChangeableDataRow()
          Internal default constructor for the MemDataBook.
  ChangeableDataRow(IRowDefinition pRowDefinition)
          Constructs a DataRow with a given IRowDefinition.
protected ChangeableDataRow(IRowDefinition pRowDefinition, Object[] pData, IDataPage pDataPage, int pRowIndex)
          Constructs a DataRow with a given IRowDefinition and initialize it a copy of the Object[]<> data.
 
Method Summary
 IDataPage getDataPage()
          Returns the correspondingIDataPage of the IDataRow.
 IDataRow getOriginalRow()
          Returns the original row, before the first change is made.
 int getRowIndex()
          Returns the row index of the IDataRows in the IDataPage.
 Object getUID()
          Returns the internal unique identifier for a IChangeableDataRow, which isInserting().
 boolean isDeleting()
          Returns if this row is deleted.
 boolean isDetailChanged()
          Returns true if under this row in the detail DataBook one or more changed (isInserting/Updating/Deleting() == true) detail rows existing.
 boolean isInserting()
          Returns if this row is new.
 boolean isUpdating()
          Returns if this row is changed.
 String toString()
          
 
Methods inherited from class com.sibvisions.rad.model.mem.DataRow
addControl, compareTo, compareTo, createDataRow, createEmptyRow, equals, equals, eventValuesChanged, getControls, getRowDefinition, getValue, getValue, getValueAsString, getValues, getValuesAsString, hashCode, invokeCancelEditingControl, invokeRepaintListeners, invokeSaveEditingControl, removeControl, setValue, setValueDRInternal, setValues
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.model.IDataRow
addControl, compareTo, createDataRow, createEmptyRow, equals, eventValuesChanged, getControls, getRowDefinition, getValue, getValue, getValueAsString, getValues, getValuesAsString, removeControl, setValue, setValues
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

INTERNAL_OFFSET

protected static final int INTERNAL_OFFSET
Internal Offset in the AbstractStorage Array for the Inserting, etc.. states.

See Also:
Constant Field Values

INSERTING

protected static final Integer INSERTING
Internal state for INSERTING.


UPDATING

protected static final Integer UPDATING
Internal state for UPDATING.


DELETING

protected static final Integer DELETING
Internal state for DELETING.

Constructor Detail

ChangeableDataRow

protected ChangeableDataRow()
Internal default constructor for the MemDataBook.


ChangeableDataRow

public ChangeableDataRow(IRowDefinition pRowDefinition)
                  throws ModelException
Constructs a DataRow with a given IRowDefinition.

Parameters:
pRowDefinition - the IRowDefinition
Throws:
ModelException - if the IRowDefintion is null or empty

ChangeableDataRow

protected ChangeableDataRow(IRowDefinition pRowDefinition,
                            Object[] pData,
                            IDataPage pDataPage,
                            int pRowIndex)
                     throws ModelException
Constructs a DataRow with a given IRowDefinition and initialize it a copy of the Object[]<> data.

Parameters:
pRowDefinition - the IRowDefinition
pData - the Object[]<> with data of the DataRow.
pDataPage - the correspondingIDataPage of the IDataRow in the IDataBook
pRowIndex - the row index of the IDataRow in the IDataBook
Throws:
ModelException - if the RowDefinition is empty.
Method Detail

getDataPage

public IDataPage getDataPage()
Returns the correspondingIDataPage of the IDataRow. That returns != null only if the IDataRow is from a IDataBook

Specified by:
getDataPage in interface IChangeableDataRow
Returns:
the correspondingIDataPage of the IDataRow.

getRowIndex

public int getRowIndex()
Returns the row index of the IDataRows in the IDataPage. That returns != -1 only if the IDataRow is from a IDataPage

Specified by:
getRowIndex in interface IChangeableDataRow
Returns:
the row index of the IDataRows in the IDataPage.

getUID

public Object getUID()
Returns the internal unique identifier for a IChangeableDataRow, which isInserting().

Specified by:
getUID in interface IChangeableDataRow
Returns:
the internal unique identifier for a IChangeableDataRow, which isInserting().

isInserting

public boolean isInserting()
                    throws ModelException
Returns if this row is new.

Specified by:
isInserting in interface IChangeableDataRow
Returns:
if this row is new.
Throws:
ModelException - if a exception occurs during synchronize.

isUpdating

public boolean isUpdating()
                   throws ModelException
Returns if this row is changed.

Specified by:
isUpdating in interface IChangeableDataRow
Returns:
if this row is changed.
Throws:
ModelException - if a exception occurs during synchronize.

isDeleting

public boolean isDeleting()
                   throws ModelException
Returns if this row is deleted.

Specified by:
isDeleting in interface IChangeableDataRow
Returns:
if this row is deleted.
Throws:
ModelException - if a exception occurs during synchronize.

isDetailChanged

public boolean isDetailChanged()
                        throws ModelException
Returns true if under this row in the detail DataBook one or more changed (isInserting/Updating/Deleting() == true) detail rows existing.

Specified by:
isDetailChanged in interface IChangeableDataRow
Returns:
true if under this row in the detail DataBook one or more changed (isInserting/Updating/Deleting() == true) detail rows existing.
Throws:
ModelException - if a exception occurs during synchronize.

getOriginalRow

public IDataRow getOriginalRow()
                        throws ModelException
Returns the original row, before the first change is made.

Specified by:
getOriginalRow in interface IChangeableDataRow
Returns:
the original row, before the first change is made.
Throws:
ModelException - if the original row couldn't determined

toString

public String toString()

Overrides:
toString in class DataRow


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.