public class IlvPropertyBasedFlatSetModel extends IlvDefaultFlatSetModel
IlvFlatSetModel
interface which stores the objects and the column info objects locally
in this instance. The values are assumed to be properties of the objects.BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_OBJECTS_REMOVED_MASK
Constructor and Description |
---|
IlvPropertyBasedFlatSetModel(Collection objects,
IlvPropertyConnector propaccess,
IlvDataColumnInfo[] columns)
Creates a model with the given objects and the given columns.
|
IlvPropertyBasedFlatSetModel(IlvPropertyConnector propaccess)
Creates an empty model, with zero columns.
|
IlvPropertyBasedFlatSetModel(IlvPropertyConnector propaccess,
IlvDataColumnInfo[] columns)
Creates an empty model, with the given columns.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a copy of this object.
|
void |
disconnect()
Drops references to objects to help garbage collection.
|
void |
dispose()
Cleans up this model and drops references to objects to
help garbage collection.
|
double |
getDoubleAt(Object object,
int columnIndex)
Returns the value for the attribute number
columnIndex
in the given object. |
int |
getSupportedEventsMask()
Returns a bit mask denoting the optional kinds of events that are guaranteed
to be sent by this model to the registered listeners.
|
Object |
getValueAt(Object object,
int columnIndex)
Returns the value for the attribute number
columnIndex
in the given object. |
protected boolean |
setDoubleAtInternal(double value,
Object object,
int columnIndex,
boolean forReal)
Does the equivalent of a
setDoubleAt() . |
protected boolean |
setValueAtInternal(Object value,
Object object,
int columnIndex,
boolean forReal)
Does the equivalent of a
setValueAt() . |
addObject, addObject, addObjects, clear, getObjects, removeObject, removeObjects, setDoubleAt, setObjects, setValueAt
addColumn, addColumn, addColumn, fireModelEvent, getColumn, getColumnCount, getColumns, insertColumn, insertColumn, insertColumn, removeColumn, setColumn, setColumnCount, setColumns
addFlatSetModelListener, convertToDouble, endBatch, removeFlatSetModelListener, startBatch
public IlvPropertyBasedFlatSetModel(IlvPropertyConnector propaccess)
public IlvPropertyBasedFlatSetModel(IlvPropertyConnector propaccess, IlvDataColumnInfo[] columns)
public IlvPropertyBasedFlatSetModel(Collection objects, IlvPropertyConnector propaccess, IlvDataColumnInfo[] columns)
public Object getValueAt(Object object, int columnIndex)
columnIndex
in the given object.getValueAt
in interface IlvFlatSetModel
getValueAt
in interface IlvObjectModelWithColumns
getValueAt
in class IlvDefaultFlatSetModel
object
- The object (row) in which the value is to be looked up.columnIndex
- The column denoting the attribute whose value is to be
looked up.public double getDoubleAt(Object object, int columnIndex)
columnIndex
in the given object.
This method should only be used for columns whose type is
Double. For other types of columns, this method will do a conversion
from the object returned by getValueAt
, which may be
inefficient or inaccurate or raise exceptions.
getDoubleAt
in interface IlvFlatSetModel
getDoubleAt
in interface IlvObjectModelWithColumns
getDoubleAt
in class IlvDefaultFlatSetModel
object
- The object (row) in which the value is to be looked up.columnIndex
- The column denoting the attribute whose value is to be
looked up.protected boolean setValueAtInternal(Object value, Object object, int columnIndex, boolean forReal)
setValueAt()
. Instead of notifying it simply returns
a boolean
indicating whether notification should be done.
If forReal is false
, the value is not actually set, but the
method still returns the same Boolean, specifying whether the given value is
different from the previous one.
setValueAtInternal
in class IlvDefaultFlatSetModel
protected boolean setDoubleAtInternal(double value, Object object, int columnIndex, boolean forReal)
setDoubleAt()
. Instead of notifying it simply returns
a boolean
indicating whether notification should be done.
If forReal is false
, the value is not actually set, but the
method still returns the same Boolean, specifying whether the given value is
different from the previous one.
setDoubleAtInternal
in class IlvDefaultFlatSetModel
public int getSupportedEventsMask()
This implementation returns
BEFORE_OBJECTS_REMOVED_MASK | BEFORE_COLUMN_REMOVED_MASK
.
It may need to be overridden in subclasses.
getSupportedEventsMask
in interface IlvFlatSetModel
getSupportedEventsMask
in class IlvDefaultFlatSetModel
IlvFlatSetModel.BEFORE_DATA_CHANGE_MASK
,
IlvFlatSetModel.BEFORE_OBJECTS_REMOVED_MASK
,
IlvFlatSetModel.BEFORE_COLUMN_REMOVED_MASK
public void dispose()
Note: after calling this function, this model is no longer functional.
dispose
in class IlvDefaultFlatSetModel
public void disconnect()
Note: After calling this function, and after some changes occurred in the underlying columns or in the contained objects, this model is no longer functional.
disconnect
in class IlvBasicFlatSetModel
public Object clone()
clone
in class IlvDefaultFlatSetModel
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.