public interface IlvFlatTableModel extends IlvModelWithColumns, IlvBatchable
The data has the form of a table. Each row represents a record or real-world object, and each column represents an attribute of this record or object.
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
,
IlvAbstractFlatTableModel
,
IlvDefaultFlatTableModel
,
FlatTableModelEvent
,
FlatTableModelListener
Modifier and Type | Field and Description |
---|---|
static int |
BEFORE_COLUMN_REMOVED_MASK
When returned by
getSupportedEventsMask() ,
this bit mask denotes that a
FlatTableModelEvent.Type.BEFORE_COLUMN_REMOVED
event is guaranteed to be fired before every
FlatTableModelEvent.Type.COLUMN_REMOVED
event. |
static int |
BEFORE_DATA_CHANGE_MASK
When returned by
getSupportedEventsMask() ,
this bit mask denotes that a
FlatTableModelEvent.Type.BEFORE_DATA_CHANGE
event is guaranteed to be fired before every
FlatTableModelEvent.Type.DATA_CHANGED
event. |
static int |
BEFORE_ROWS_REMOVED_MASK
When returned by
getSupportedEventsMask() ,
this bit mask denotes that a
FlatTableModelEvent.Type.BEFORE_ROWS_REMOVED
event is guaranteed to be fired before every
FlatTableModelEvent.Type.ROWS_REMOVED
event. |
Modifier and Type | Method and Description |
---|---|
void |
addFlatTableModelListener(FlatTableModelListener 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(int rowIndex,
int columnIndex)
Returns the value for the cell at
columnIndex and
rowIndex , as a numeric value. |
int |
getRowCount()
Returns the number of rows in the 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(int rowIndex,
int columnIndex)
Returns the value for the cell at
columnIndex and
rowIndex . |
void |
removeFlatTableModelListener(FlatTableModelListener listener)
Removes a listener.
|
void |
setDoubleAt(double value,
int rowIndex,
int columnIndex)
Sets the value in the cell at
columnIndex and
rowIndex to the given value . |
void |
setValueAt(Object value,
int rowIndex,
int columnIndex)
Sets the value in the cell at
columnIndex and
rowIndex 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
FlatTableModelEvent.Type.BEFORE_DATA_CHANGE
event is guaranteed to be fired before every
FlatTableModelEvent.Type.DATA_CHANGED
event.getSupportedEventsMask()
,
Constant Field Valuesstatic final int BEFORE_ROWS_REMOVED_MASK
getSupportedEventsMask()
,
this bit mask denotes that a
FlatTableModelEvent.Type.BEFORE_ROWS_REMOVED
event is guaranteed to be fired before every
FlatTableModelEvent.Type.ROWS_REMOVED
event.getSupportedEventsMask()
,
Constant Field Valuesstatic final int BEFORE_COLUMN_REMOVED_MASK
getSupportedEventsMask()
,
this bit mask denotes that a
FlatTableModelEvent.Type.BEFORE_COLUMN_REMOVED
event is guaranteed to be fired before every
FlatTableModelEvent.Type.COLUMN_REMOVED
event.getSupportedEventsMask()
,
Constant Field Valuesint getRowCount()
Valid row indices range from 0 to getRowCount()-1
(inclusive).
int getColumnCount()
Valid column indices range from 0 to getColumnCount()-1
(inclusive).
getColumnCount
in interface IlvModelWithColumns
Object getValueAt(int rowIndex, int columnIndex)
columnIndex
and
rowIndex
.void setValueAt(Object value, int rowIndex, int columnIndex)
columnIndex
and
rowIndex
to the given value
.value
- The new value.rowIndex
- The row containing the cell whose value is to be changed.columnIndex
- The column containing the cell whose value is to be
changed.double getDoubleAt(int rowIndex, int columnIndex)
columnIndex
and
rowIndex
, as a numeric value.
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.
void setDoubleAt(double value, int rowIndex, int columnIndex)
columnIndex
and
rowIndex
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.rowIndex
- The row containing the cell whose value is to be changed.columnIndex
- The column containing the cell 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 addFlatTableModelListener(FlatTableModelListener listener)
void removeFlatTableModelListener(FlatTableModelListener 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 IlvBufferFlatTableModel
: the wrapped model will
support all events.
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.