public interface IlvFlatSetModel extends IlvObjectModelWithColumns, IlvBatchable
The data consists of an unordered set of objects, each having a value for a given set of attributes. The attributes are called columns; in this perspective, the objects correspond to rows of a table.
The columns have some metainformation, like the column number, name, value type, and so on.
In implementations of this model that are only connected to the
JViews Chart component, you can implement the setValueAt
and
setDoubleAt
methods as empty: these methods are not
invoked by the JViews Charts view.
IlvDataColumnInfo
,
IlvAbstractFlatSetModel
,
IlvDefaultFlatSetModel
,
FlatSetModelEvent
,
FlatSetModelListener
Modifier and Type | Field and Description |
---|---|
static int |
BEFORE_COLUMN_REMOVED_MASK
When returned by
getSupportedEventsMask() ,
this bit mask denotes that a
FlatSetModelEvent.Type.BEFORE_COLUMN_REMOVED
event is guaranteed to be fired before every
FlatSetModelEvent.Type.COLUMN_REMOVED
event. |
static int |
BEFORE_DATA_CHANGE_MASK
When returned by
getSupportedEventsMask() ,
this bit mask denotes that a
FlatSetModelEvent.Type.BEFORE_DATA_CHANGE
event is guaranteed to be fired before every
FlatSetModelEvent.Type.DATA_CHANGED
event. |
static int |
BEFORE_OBJECTS_REMOVED_MASK
When returned by
getSupportedEventsMask() ,
this bit mask denotes that a
FlatSetModelEvent.Type.BEFORE_OBJECTS_REMOVED
event is guaranteed to be fired before every
FlatSetModelEvent.Type.OBJECTS_REMOVED
event. |
Modifier and Type | Method and Description |
---|---|
void |
addFlatSetModelListener(FlatSetModelListener listener)
Adds a listener.
|
void |
endBatch()
Terminates a group of modifications.
|
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. |
Collection |
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.
|
Object |
getValueAt(Object object,
int columnIndex)
Returns the value for the attribute number
columnIndex
in the given object. |
void |
removeFlatSetModelListener(FlatSetModelListener listener)
Removes a listener.
|
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 . |
void |
startBatch()
Starts a group of modifications.
|
static final int BEFORE_DATA_CHANGE_MASK
getSupportedEventsMask()
,
this bit mask denotes that a
FlatSetModelEvent.Type.BEFORE_DATA_CHANGE
event is guaranteed to be fired before every
FlatSetModelEvent.Type.DATA_CHANGED
event.getSupportedEventsMask()
,
Constant Field Valuesstatic final int BEFORE_OBJECTS_REMOVED_MASK
getSupportedEventsMask()
,
this bit mask denotes that a
FlatSetModelEvent.Type.BEFORE_OBJECTS_REMOVED
event is guaranteed to be fired before every
FlatSetModelEvent.Type.OBJECTS_REMOVED
event.getSupportedEventsMask()
,
Constant Field Valuesstatic final int BEFORE_COLUMN_REMOVED_MASK
getSupportedEventsMask()
,
this bit mask denotes that a
FlatSetModelEvent.Type.BEFORE_COLUMN_REMOVED
event is guaranteed to be fired before every
FlatSetModelEvent.Type.COLUMN_REMOVED
event.getSupportedEventsMask()
,
Constant Field ValuesCollection getObjects()
int getColumnCount()
Valid column indices range from 0 to getColumnCount()-1
(inclusive).
getColumnCount
in interface IlvModelWithColumns
Object getValueAt(Object object, int columnIndex)
columnIndex
in the given object.getValueAt
in interface IlvObjectModelWithColumns
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.void setValueAt(Object value, Object object, int columnIndex)
columnIndex
in the given object to the given value
.setValueAt
in interface IlvObjectModelWithColumns
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.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 IlvObjectModelWithColumns
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.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.
setDoubleAt
in interface IlvObjectModelWithColumns
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.IlvDataColumnInfo getColumn(int columnIndex)
getColumn
in interface IlvModelWithColumns
columnIndex
- The column.void startBatch()
startBatch
in interface IlvBatchable
void endBatch()
endBatch
in interface IlvBatchable
void addFlatSetModelListener(FlatSetModelListener listener)
void removeFlatSetModelListener(FlatSetModelListener listener)
int getSupportedEventsMask()
It is always safe to implement this method by returning 0.
If a given model does not support the events that you need, you can
wrap the model in an IlvBufferFlatSetModel
: the wrapped model will
support all events.
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.