public class IlvFlatTableToFlatListModel extends IlvDefaultFlatListModel
IlvFlatListModel, based on an
IlvFlatTableModel. Every row in the
IlvFlatTableModel becomes an element in the
IlvFlatListModel.
Note: This model supports adding and removing objects if and only if the
underlying IlvFlatTableModel is an instance of
IlvDefaultFlatTableModel.
BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_OBJECTS_REMOVED_MASK| Constructor and Description |
|---|
IlvFlatTableToFlatListModel(IlvFlatTableModel model)
Creates a model backed by a given
IlvFlatTableModel, with the same
columns. |
IlvFlatTableToFlatListModel(IlvFlatTableModel model,
IlvDataColumnInfo[] columns)
Creates a model backed by a given
IlvFlatTableModel, with the given columns. |
IlvFlatTableToFlatListModel(IlvFlatTableModel model,
IlvDataColumnInfo[] columns,
int eventsMaskHint)
Creates a model backed by a given
IlvFlatTableModel, with the given columns. |
IlvFlatTableToFlatListModel(IlvFlatTableModel model,
int eventsMaskHint)
Creates a model backed by a given
IlvFlatTableModel, with the same
columns. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all the objects from the model.
|
Object |
clone()
Returns a copy of this object.
|
protected ilog.views.chart.datax.flat.internal.storage.IlvColumnStorage |
createColumnStorage(IlvDataColumnInfo column)
Creates the backing storage for a column value.
|
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. |
List |
getObjects()
Returns the objects in this model.
|
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.
|
IlvFlatTableModel |
getUnderlyingModel()
Returns the underlying model.
|
Object |
getValueAt(Object object,
int columnIndex)
Returns the value for the attribute number
columnIndex
in the given object. |
void |
insertColumn(int columnIndex,
IlvDataColumnInfo column)
Adds a column to the model at a given index.
|
void |
insertColumn(int columnIndex,
IlvDataColumnInfo column,
double[] data)
Adds a column with given data to the model at a given index.
|
void |
insertColumn(int columnIndex,
IlvDataColumnInfo column,
Object[] data)
Adds a column with given data to the model at a given index.
|
void |
insertObject(Object object,
int index)
Adds an object to the model at a given index.
|
void |
insertObject(Object object,
Object[] data,
int index)
Adds an object to the model at a given index.
|
void |
insertObjects(Object[] objects,
int index)
Adds some objects to the model at a given index.
|
void |
removeColumn(int columnIndex)
Removes a column from the model.
|
void |
removeObject(Object object)
Removes an object from the model.
|
void |
removeObjects(Object[] objects,
int firstIndex)
Removes some consecutive objects from the model.
|
void |
setColumn(int i,
IlvDataColumnInfo column)
Replaces or adds a column.
|
void |
setColumnCount(int columnCount)
Sets the number of columns in the model.
|
void |
setColumns(List<IlvDataColumnInfo> columns)
Sets the list of columns.
|
protected boolean |
setDoubleAtInternal(double value,
Object object,
int columnIndex,
boolean forReal)
Does the equivalent of a
setDoubleAt(). |
void |
setObjects(Collection objects)
Replaces the set of objects in the model.
|
protected boolean |
setValueAtInternal(Object value,
Object object,
int columnIndex,
boolean forReal)
Does the equivalent of a
setValueAt(). |
addObject, addObject, getIndexOf, getObjectAt, internalObjectsAdd, internalObjectsRemove, internalObjectsSet, isColumnComputed, setDoubleAt, setValueAtaddColumn, addColumn, addColumn, fireModelEvent, getColumn, getColumnCount, getColumnsaddFlatListModelListener, convertToDouble, endBatch, removeFlatListModelListener, startBatchpublic IlvFlatTableToFlatListModel(IlvFlatTableModel model)
IlvFlatTableModel, with the same
columns.
Note: No rows can be added when this constructor is used.
model - The underlying model.public IlvFlatTableToFlatListModel(IlvFlatTableModel model, int eventsMaskHint)
IlvFlatTableModel, with the same
columns.
Note: No rows can be added when this constructor is used.
model - The underlying model.eventsMaskHint - Desired events mask. This is just a hint; there is
no guarantee that the event types designated by the
mask are supported by this model.public IlvFlatTableToFlatListModel(IlvFlatTableModel model, IlvDataColumnInfo[] columns)
IlvFlatTableModel, with the given columns.
Note: No rows can be added when this constructor is used.
model - The underlying model.columns - The initial list of columns of this model.public IlvFlatTableToFlatListModel(IlvFlatTableModel model, IlvDataColumnInfo[] columns, int eventsMaskHint)
IlvFlatTableModel, with the given columns.
Note: No rows can be added when this constructor is used.
model - The underlying model.columns - The initial list of columns of this model.eventsMaskHint - Desired events mask. This is just a hint; there is
no guarantee that the event types designated by the
mask are supported by this model.public List getObjects()
getObjects in interface IlvFlatListModelgetObjects in class IlvDefaultFlatListModelpublic Object getValueAt(Object object, int columnIndex)
columnIndex
in the given object.getValueAt in interface IlvFlatListModelgetValueAt in interface IlvObjectModelWithColumnsgetValueAt in class IlvDefaultFlatListModelobject - 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 IlvDefaultFlatListModelpublic 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 IlvFlatListModelgetDoubleAt in interface IlvObjectModelWithColumnsgetDoubleAt in class IlvDefaultFlatListModelobject - 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 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 IlvDefaultFlatListModelpublic int getSupportedEventsMask()
This implementation returns
BEFORE_OBJECTS_REMOVED_MASK | BEFORE_COLUMN_REMOVED_MASK,
intersected with the eventsMaskHint constructor argument.
It may need to be overridden in subclasses.
getSupportedEventsMask in interface IlvFlatListModelgetSupportedEventsMask in class IlvDefaultFlatListModelIlvFlatListModel.BEFORE_DATA_CHANGE_MASK,
IlvFlatListModel.BEFORE_OBJECTS_REMOVED_MASK,
IlvFlatListModel.BEFORE_COLUMN_REMOVED_MASKpublic void setObjects(Collection objects)
UnsupportedOperationException.setObjects in class IlvDefaultFlatListModelpublic void insertObject(Object object, int index)
insertObject in class IlvDefaultFlatListModelindex - The object desired index. It must be >= 0 and
<= getObjects().size().public void insertObjects(Object[] objects, int index)
insertObjects in class IlvDefaultFlatListModelindex - The first index of the new object. It must be >= 0 and
<= getObjects().size().public void insertObject(Object object, Object[] data, int index)
insertObject in class IlvDefaultFlatListModeldata - The initial data of this object. It must be an array of
getColumnCount() elements.index - The index of the new object. It must be >= 0 and
<= getObjects().size().public void removeObject(Object object)
removeObject in class IlvDefaultFlatListModelpublic void removeObjects(Object[] objects, int firstIndex)
removeObjects in class IlvDefaultFlatListModelobjects - The objects that were at indices firstIndex, ...,
firstIndex+objects.length-1 of
getObjects().iterator().public void clear()
clear in class IlvDefaultFlatListModelprotected ilog.views.chart.datax.flat.internal.storage.IlvColumnStorage createColumnStorage(IlvDataColumnInfo column)
IlvDefaultFlatListModelnull if the methods
getValueAt and getDoubleAt do not need
backing store.createColumnStorage in class IlvDefaultFlatListModelpublic void setColumnCount(int columnCount)
IlvBasicFlatListModelcolumnCount and greater are discarded.setColumnCount in class IlvBasicFlatListModelcolumnCount - The new number of columns.public void insertColumn(int columnIndex,
IlvDataColumnInfo column)
IlvBasicFlatListModelinsertColumn in class IlvBasicFlatListModelcolumnIndex - The new column desired index, must be >= 0 and
<= getColumnCount()column - The metainformation of this column.public void insertColumn(int columnIndex,
IlvDataColumnInfo column,
Object[] data)
IlvBasicFlatListModelinsertColumn in class IlvBasicFlatListModelcolumnIndex - The new column desired index, must be >= 0 and
<= getColumnCount().column - The metainformation of this column.data - The initial data of this column. This should be an array
of at least getObjects().size() elements. Not used
if the column is a computed column.public void insertColumn(int columnIndex,
IlvDataColumnInfo column,
double[] data)
IlvBasicFlatListModelinsertColumn in class IlvBasicFlatListModelcolumnIndex - the new column desired index, must be >= 0 and
<= getColumnCount().column - The metainformation of this column.data - The initial data of this column. This should be an array
of at least getObjects().size() elements. Not used
if the column is a computed column.public void removeColumn(int columnIndex)
IlvBasicFlatListModelremoveColumn in class IlvBasicFlatListModelcolumnIndex - The column index, must be >= 0 and
< getColumnCount().public void setColumns(List<IlvDataColumnInfo> columns)
IlvBasicFlatListModelsetColumns in class IlvBasicFlatListModelcolumns - A list of IlvDataColumnInfo.public void setColumn(int i,
IlvDataColumnInfo column)
IlvBasicFlatListModelremoveColumn(i) followed by
insertColumn(i, column).setColumn in class IlvBasicFlatListModelcolumn - An IlvDataColumnInfo.public IlvFlatTableModel getUnderlyingModel()
IlvFlatTableModel passed to the constructor.public void dispose()
Note: After calling this function, this model is no longer functional.
dispose in class IlvDefaultFlatListModelpublic void disconnect()
Note: After calling this function, and after some changes occurred in the underlying model, this model is no longer functional.
disconnect in class IlvBasicFlatListModelpublic Object clone()
clone in class IlvDefaultFlatListModel© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.