public class IlvFlatSetToTreeSetModel extends IlvAbstractTreeSetModel
IlvTreeSetModel
, based on an
IlvFlatSetModel
and an IlvPartitionerFactory
that
is used to give a tree structure to the set of objects.BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_OBJECTS_REMOVED_MASK, DURING_OBJECTS_REMOVED_MASK
Constructor and Description |
---|
IlvFlatSetToTreeSetModel(IlvFlatSetModel model,
IlvPartitioner partitioner)
Creates an
IlvTreeSetModel from an
IlvFlatSetModel and a partitioner. |
IlvFlatSetToTreeSetModel(IlvFlatSetModel model,
IlvPartitioner[] partitioners)
Creates an
IlvTreeSetModel from an
IlvFlatSetModel and a list of partitioners. |
IlvFlatSetToTreeSetModel(IlvFlatSetModel model,
IlvPartitioner[] partitioners,
int eventsMaskHint)
Creates an
IlvTreeSetModel from an
IlvFlatSetModel and a list of partitioners. |
IlvFlatSetToTreeSetModel(IlvFlatSetModel model,
IlvPartitionerFactory partitionerFactory)
Creates an
IlvTreeSetModel from an
IlvFlatSetModel and a partitioner factory. |
IlvFlatSetToTreeSetModel(IlvFlatSetModel model,
IlvPartitionerFactory[] partitionerFactories)
Creates an
IlvTreeSetModel from an
IlvFlatSetModel and a list of partitioner factories. |
IlvFlatSetToTreeSetModel(IlvFlatSetModel model,
IlvPartitionerFactory[] partitionerFactories,
int eventsMaskHint)
Creates an
IlvTreeSetModel from an
IlvFlatSetModel and a list of partitioner factories. |
IlvFlatSetToTreeSetModel(IlvFlatSetModel model,
IlvPartitionerFactory partitionerFactory,
int eventsMaskHint)
Creates an
IlvTreeSetModel from an
IlvFlatSetModel and a partitioner factory. |
IlvFlatSetToTreeSetModel(IlvFlatSetModel model,
IlvPartitioner partitioner,
int eventsMaskHint)
Creates an
IlvTreeSetModel from an
IlvFlatSetModel and a partitioner. |
Modifier and Type | Method and Description |
---|---|
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.
|
Collection |
getChildren(Object parent)
Returns the set of children objects of a given object in this model.
|
IlvDataColumnInfo |
getColumn(int columnIndex)
Returns metainformation about a column.
|
int |
getColumnCount()
Returns the number of columns in the model.
|
double |
getDoubleAt(Object object,
int columnIndex)
Returns the value for the attribute number
columnIndex
in the given object. |
Object |
getParent(Object object)
Returns the parent object of a given object, or
null if
it is the root. |
TreePath |
getPath(Object object)
Returns the path from the root to the given object.
|
Object |
getRoot()
Returns the root object in this model, or
null if the model
is empty. |
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. |
void |
setDoubleAt(double value,
Object object,
int columnIndex)
Sets the value for the attribute number
columnIndex
in the given object to the given value . |
void |
setValueAt(Object value,
Object object,
int columnIndex)
Sets the value for the attribute number
columnIndex
in the given object to the given value . |
addTreeSetModelListener, clone, convertToDouble, endBatch, fireModelEvent, postOrderIterator, preOrderIterator, removeTreeSetModelListener, startBatch
public IlvFlatSetToTreeSetModel(IlvFlatSetModel model, IlvPartitioner[] partitioners)
IlvTreeSetModel
from an
IlvFlatSetModel
and a list of partitioners.
Note: It is not useful to pass the same partitioner more than once. Instead, use different partitioners or a recursive partitioner.
model
- The underlying model.partitioners
- The partitioning criteria.public IlvFlatSetToTreeSetModel(IlvFlatSetModel model, IlvPartitioner[] partitioners, int eventsMaskHint)
IlvTreeSetModel
from an
IlvFlatSetModel
and a list of partitioners.
Note: It is not useful to pass the same partitioner more than once. Instead, use different partitioners or a recursive partitioner.
model
- The underlying model.partitioners
- The partitioning criteria.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 IlvFlatSetToTreeSetModel(IlvFlatSetModel model, IlvPartitionerFactory[] partitionerFactories)
IlvTreeSetModel
from an
IlvFlatSetModel
and a list of partitioner factories.
Note: It is not useful to pass the same partitioner factory more than once. Instead, use different partitioner factories or factory for a recursive partitioner.
model
- The underlying model.partitionerFactories
- The partitioning criteria.public IlvFlatSetToTreeSetModel(IlvFlatSetModel model, IlvPartitionerFactory[] partitionerFactories, int eventsMaskHint)
IlvTreeSetModel
from an
IlvFlatSetModel
and a list of partitioner factories.
Note: It is not useful to pass the same partitioner factory more than once. Instead, use different partitioner factories or factory for a recursive partitioner.
model
- The underlying model.partitionerFactories
- The partitioning criteria.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 IlvFlatSetToTreeSetModel(IlvFlatSetModel model, IlvPartitioner partitioner)
IlvTreeSetModel
from an
IlvFlatSetModel
and a partitioner.model
- The underlying model.partitioner
- A partitioning criterion.public IlvFlatSetToTreeSetModel(IlvFlatSetModel model, IlvPartitioner partitioner, int eventsMaskHint)
IlvTreeSetModel
from an
IlvFlatSetModel
and a partitioner.model
- The underlying model.partitioner
- A partitioning criterion.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 IlvFlatSetToTreeSetModel(IlvFlatSetModel model, IlvPartitionerFactory partitionerFactory)
IlvTreeSetModel
from an
IlvFlatSetModel
and a partitioner factory.model
- The underlying model.partitionerFactory
- A partitioning criterion.public IlvFlatSetToTreeSetModel(IlvFlatSetModel model, IlvPartitionerFactory partitionerFactory, int eventsMaskHint)
IlvTreeSetModel
from an
IlvFlatSetModel
and a partitioner factory.model
- The underlying model.partitionerFactory
- A partitioning criterion.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 Object getRoot()
null
if the model
is empty.public Collection getChildren(Object parent)
public TreePath getPath(Object object)
getPath
in interface IlvTreeSetModel
getPath
in class IlvAbstractTreeSetModel
object
- An object in the model.TreePath
whose first component is
getRoot()
and whose last component is the given
object.public int getColumnCount()
Valid column indices range from 0 to getColumnCount()-1
(inclusive).
public IlvDataColumnInfo getColumn(int columnIndex)
columnIndex
- The column.public Object getValueAt(Object object, int columnIndex)
columnIndex
in the given object.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.
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 void setValueAt(Object value, Object object, int columnIndex)
columnIndex
in the given object to the given value
.value
- The new value.object
- The object (row) in which the value is to be changed.columnIndex
- The column denoting the attribute whose value is to be
changed.public void setDoubleAt(double value, Object object, int columnIndex)
columnIndex
in the given object to the given value
.
This method should only be used for columns whose type is Double. For other types of columns, this method will do a conversion to the column type, which may be inefficient or inaccurate or raise exceptions.
value
- The new value.object
- The object (row) in which the value is to be changed.columnIndex
- The column denoting the attribute whose value is to be
changed.public int getSupportedEventsMask()
This implementation returns a mask that corresponds to the one of the
underlying model, combined with DURING_OBJECTS_REMOVED_MASK
,
intersected with the eventsMaskHint constructor argument.
It may need to be overridden in subclasses.
getSupportedEventsMask
in interface IlvTreeSetModel
getSupportedEventsMask
in class IlvAbstractTreeSetModel
IlvTreeSetModel.BEFORE_DATA_CHANGE_MASK
,
IlvTreeSetModel.BEFORE_OBJECTS_REMOVED_MASK
,
IlvTreeSetModel.BEFORE_COLUMN_REMOVED_MASK
public Object getParent(Object object)
null
if
it is the root.public void dispose()
Note: After calling this function, this model is no longer functional.
public void disconnect()
Note: After calling this function, and after some changes occurred in the underlying model or to the partitioners, this model is no longer functional.
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.