public class IlvDefaultFlatTableModel extends IlvBasicFlatTableModel implements Cloneable
IlvFlatTableModel
interface.
It stores the data values and the column info objects locally in this instance.
BEFORE_COLUMN_REMOVED_MASK, BEFORE_DATA_CHANGE_MASK, BEFORE_ROWS_REMOVED_MASK
Constructor and Description |
---|
IlvDefaultFlatTableModel()
Creates an empty model with zero rows and zero columns.
|
IlvDefaultFlatTableModel(int numRows,
IlvDataColumnInfo[] columns)
Creates a model with the given number of rows and the given
columns.
|
IlvDefaultFlatTableModel(int numRows,
int numColumns)
Creates a model with the given number of rows and columns.
|
Modifier and Type | Method and Description |
---|---|
void |
addRow()
Adds a row to the end of the model.
|
void |
addRow(Object[] rowData)
Adds a row to the end of the model.
|
Object |
clone()
Returns a copy of this object.
|
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 |
insertRow(int rowIndex)
Adds a row to the model at a given index.
|
void |
insertRow(int rowIndex,
Object[] rowData)
Adds a row to the model at a given index.
|
void |
insertRows(int rowIndex,
int count)
Adds some rows to the model at a given index.
|
void |
removeRow(int rowIndex)
Removes a row from the model.
|
void |
removeRows(int rowIndex,
int count)
Removes some rows from the model.
|
protected boolean |
setDoubleAtInternal(double value,
int rowIndex,
int columnIndex,
boolean forReal)
Does the equivalent of a
setDoubleAt() . |
void |
setRowCount(int rowCount)
Sets the number of rows in the model.
|
protected boolean |
setValueAtInternal(Object value,
int rowIndex,
int columnIndex,
boolean forReal)
Does the equivalent of a
setValueAt() . |
addColumn, addColumn, addColumn, createColumnStorage, disconnect, dispose, fireModelEvent, getColumn, getColumnCount, getColumns, insertColumn, insertColumn, insertColumn, isColumnComputed, removeColumn, setColumn, setColumnCount, setColumns, setDoubleAt, setValueAt
addFlatTableModelListener, convertToDouble, endBatch, removeFlatTableModelListener, startBatch
public IlvDefaultFlatTableModel()
public IlvDefaultFlatTableModel(int numRows, int numColumns)
public IlvDefaultFlatTableModel(int numRows, IlvDataColumnInfo[] columns)
public int getRowCount()
Valid row indices range from 0 to getRowCount()-1
(inclusive).
getRowCount
in interface IlvFlatTableModel
public Object getValueAt(int rowIndex, int columnIndex)
columnIndex
and
rowIndex
.getValueAt
in interface IlvFlatTableModel
public 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.
getDoubleAt
in interface IlvFlatTableModel
protected boolean setValueAtInternal(Object value, int rowIndex, 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 IlvBasicFlatTableModel
protected boolean setDoubleAtInternal(double value, int rowIndex, 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 IlvBasicFlatTableModel
public int getSupportedEventsMask()
This implementation returns
BEFORE_DATA_CHANGE_MASK | BEFORE_ROWS_REMOVED_MASK | BEFORE_COLUMN_REMOVED_MASK
.
It may need to be overridden in subclasses.
getSupportedEventsMask
in interface IlvFlatTableModel
getSupportedEventsMask
in class IlvBasicFlatTableModel
IlvFlatTableModel.BEFORE_DATA_CHANGE_MASK
,
IlvFlatTableModel.BEFORE_ROWS_REMOVED_MASK
,
IlvFlatTableModel.BEFORE_COLUMN_REMOVED_MASK
public void setRowCount(int rowCount)
rowCount
and greater are discarded.rowCount
- The new number of rows.public void addRow()
public void addRow(Object[] rowData)
rowData
- The initial data of this row, must be an array of
getColumnCount()
elements.public void insertRow(int rowIndex)
rowIndex
- The new row desired index, must be >= 0 and
<= getRowCount()
.public void insertRows(int rowIndex, int count)
rowIndex
- The first new row desired index, must be >= 0 and
<= getRowCount()
.count
- The number of rows to be inserted.public void insertRow(int rowIndex, Object[] rowData)
rowIndex
- The new row desired index, must be >= 0 and
<= getRowCount()
.rowData
- The initial data of this row, must be an array of
getColumnCount()
elements.public void removeRow(int rowIndex)
rowIndex
- The row index, must be >= 0 and
< getRowCount()
.public void removeRows(int rowIndex, int count)
rowIndex
- The first old row index, must be >= 0 and
<= getRowCount()
- count.count
- The number of rows to be removed.public Object clone()
clone
in class IlvBasicFlatTableModel
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.