|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.ui.component.table.DataModel
net.rim.device.api.ui.component.table.AbstractTableModel
net.rim.device.api.ui.component.table.TableModel
public class TableModel
Implementation of AbstractTableModel that allows storage of any kind of data and supports all access/mutate methods.
| Constructor Summary | ||
|---|---|---|
TableModel()
Creates a new data model with zero rows and zero columns. |
||
TableModel(Object[][] elements)
Creates a new table model using the provided elements as the data. |
||
| Method Summary | ||
|---|---|---|
protected boolean |
doAddColumn(Object data)
This method provides the ability to customize the logic behind addColumn()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
protected boolean |
doAddMultipleRows(Object[] data)
This method provides the ability to customize the logic behind addMultipleRows()
so that a developer can specify this behavior while still ensuring that necessary notification
and exception handling overheads can occur as well. |
|
protected boolean |
doAddRow(Object data)
This method provides the ability to customize the logic behind addRow()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
protected Object |
doGetColumn(int columnIndex)
Retrieves the array of elements at the specified column index. |
|
protected Object |
doGetElement(int rowIndex,
int columnIndex)
This method provides the ability to customize the logic behind getElement()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
protected Object |
doGetRow(int rowIndex)
This method provides the ability to customize the logic behind getRow()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
protected boolean |
doInsertColumnAt(int columnIndex,
Object data)
This method provides the ability to customize the logic behind insertColumnAt()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
protected boolean |
doInsertMultipleRowsAt(int rowIndex,
Object[] data)
This method provides the ability to customize the logic behind insertMultipleRowsAt()
so that a developer can specify this behavior while still ensuring that necessary notification
and exception handling overheads can occur as well. |
|
protected boolean |
doInsertRowAt(int rowIndex,
Object data)
This method provides the ability to customize the logic behind insertRowAt()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
protected boolean |
doRemoveColumnAt(int columnIndex)
This method provides the ability to customize the logic behind removeColumnAt()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
protected boolean |
doRemoveRowAt(int rowIndex)
This method provides the ability to customize the logic behind removeRowAt()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
protected boolean |
doRemoveRowRangeAt(int rowIndex,
int rowCount)
This method provides the ability to customize the logic behind removeRowAt()
so that a developer can specify this behavior while still ensuring that necessary notification
and exception handling overheads can occur as well. |
|
protected boolean |
doSetElement(int rowIndex,
int columnIndex,
Object data)
This method provides the ability to customize the logic behind setElement()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
int |
getNumberOfColumns()
Get the number of columns in the table. |
|
int |
getNumberOfRows()
Get the number of rows in the table. |
|
boolean |
implementationSupportsBatchOperations()
This implementation of AbstractTableModel fully supports batch operations. |
|
| Methods inherited from class net.rim.device.api.ui.component.table.AbstractTableModel |
|---|
addColumn, addColumn, addMultipleRows, addRow, addRow, getColumn, getElement, getRow, insertColumnAt, insertColumnAt, insertMultipleRowsAt, insertRowAt, insertRowAt, removeColumnAt, removeColumnAt, removeRowAt, removeRowAt, removeRowRangeAt, setElement, setElement |
| Methods inherited from class net.rim.device.api.ui.component.table.DataModel |
|---|
modelReset, notifyListeners, registerListener, unregisterListener |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TableModel()
public TableModel(Object[][] elements)
Notifications are not sent out for elements that are added through the constructor.
elements - Array of arrays representing a matrix to be inserted in
this data model.| Method Detail |
|---|
public boolean implementationSupportsBatchOperations()
AbstractTableModel fully supports batch operations.
implementationSupportsBatchOperations in class AbstractTableModelAbstractTableModel.addMultipleRows(Object[]),
AbstractTableModel.insertMultipleRowsAt(int, Object[]),
AbstractTableModel.removeRowRangeAt(int, int),
AbstractTableModel.implementationSupportsBatchOperations()protected Object doGetColumn(int columnIndex)
doGetColumn in class AbstractTableModelcolumnIndex - Column index to retrieve the elements from.
IllegalArgumentException - If the index is invalid.AbstractTableModel.doGetColumn(int)protected Object doGetRow(int rowIndex)
getRow()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. This way, the general
structure of the overall getRow() algorithm doesn’t change, while allowing
key behavior to be configurable.
doGetRow in class AbstractTableModelrowIndex - Row index to retrieve the elements from.
AbstractTableModel.doGetRow(int)
protected Object doGetElement(int rowIndex,
int columnIndex)
getElement()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. This way, the general
structure of the overall getElement() algorithm doesn’t change, while allowing
key behavior to be configurable.
doGetElement in class AbstractTableModelrowIndex - Row index to retrieve the element from.columnIndex - Column index to retrieve the elements from.
AbstractTableModel.doGetElement(int, int)public int getNumberOfColumns()
getNumberOfColumns in class AbstractTableModelAbstractTableModel.getNumberOfColumns()public int getNumberOfRows()
getNumberOfRows in class AbstractTableModelAbstractTableModel.getNumberOfRows()protected boolean doAddColumn(Object data)
addColumn()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. This way, the general
structure of the overall addColumn() algorithm doesn’t change, while allowing
key behavior to be configurable.
doAddColumn in class AbstractTableModeldata - The column data to be added to the model.
AbstractTableModel.addColumn(Object)protected boolean doAddRow(Object data)
addRow()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. This way, the general
structure of the overall addRow() algorithm doesn’t change, while allowing
key behavior to be configurable.
doAddRow in class AbstractTableModeldata - The row data to be added to the model.
AbstractTableModel.addRow(Object)
protected boolean doInsertColumnAt(int columnIndex,
Object data)
insertColumnAt()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. This way, the general
structure of the overall insertColumnAt() algorithm doesn’t change, while allowing
key behavior to be configurable.
doInsertColumnAt in class AbstractTableModelcolumnIndex - Index at which to insert the column.data - Column of data to be inserted.
AbstractTableModel.insertColumnAt(int, Object)
protected boolean doInsertRowAt(int rowIndex,
Object data)
insertRowAt()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. This way, the general
structure of the overall insertRowAt() algorithm doesn’t change, while allowing
key behavior to be configurable.
doInsertRowAt in class AbstractTableModelrowIndex - Index at which to insert the column.data - Column of data to be inserted.
AbstractTableModel.insertRowAt(int, Object)protected boolean doRemoveColumnAt(int columnIndex)
removeColumnAt()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. This way, the general
structure of the overall removeColumnAt() algorithm doesn’t change, while allowing
key behavior to be configurable.
doRemoveColumnAt in class AbstractTableModelcolumnIndex - The index of the column to be removed.
AbstractTableModel.removeColumnAt(int)protected boolean doRemoveRowAt(int rowIndex)
removeRowAt()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. This way, the general
structure of the overall removeRowAt() algorithm doesn’t change, while allowing
key behavior to be configurable.
doRemoveRowAt in class AbstractTableModelrowIndex - The index of the row to be removed.
AbstractTableModel.removeRowAt(int)
protected boolean doRemoveRowRangeAt(int rowIndex,
int rowCount)
removeRowAt()
so that a developer can specify this behavior while still ensuring that necessary notification
and exception handling overheads can occur as well. This way, the general structure of the overall
removeRowAt() algorithm doesn't change, while allowing key behavior to be configurable.
doRemoveRowRangeAt in class AbstractTableModelrowIndex - Index of row to be removed.rowCount - The number of rows to remove
AbstractTableModel.doRemoveRowRangeAt(int, int)
protected boolean doSetElement(int rowIndex,
int columnIndex,
Object data)
setElement()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. This way, the general
structure of the overall setElement() algorithm doesn’t change, while allowing
key behavior to be configurable.
doSetElement in class AbstractTableModelrowIndex - Index of row in which to insert.columnIndex - Index of column in which to insert.data - Element of data to insert.
AbstractTableModel.setElement(int, int, Object)protected boolean doAddMultipleRows(Object[] data)
addMultipleRows()
so that a developer can specify this behavior while still ensuring that necessary notification
and exception handling overheads can occur as well. This way, the general structure
of the overall addMultipleRows() algorithm doesn't change, while allowing
key behavior to be configurable.
The default behavior is not implemented.
If this method returns false, the base implementation will insert the rows with multiple
calls to addRow(). As such, implementations of doAddMultipleRows()
should ensure that rows are added atomically.
doAddMultipleRows in class AbstractTableModeldata - The rows of data to be added to the model.
AbstractTableModel.doAddMultipleRows(java.lang.Object[])
protected boolean doInsertMultipleRowsAt(int rowIndex,
Object[] data)
insertMultipleRowsAt()
so that a developer can specify this behavior while still ensuring that necessary notification
and exception handling overheads can occur as well. This way, the general structure of the overall
insertMultipleRowsAt() algorithm doesn't change, while allowing key behavior to be configurable.\
The default behaviour is not implemented.
If this method returns false, the base implementation will insert the rows with multiple
calls to insertRowAt(). As such, implementations of doInsertMultipleRowsAt()
should ensure that rows are added atomically.
doInsertMultipleRowsAt in class AbstractTableModelrowIndex - Index of row in which to insert.data - Array of row data to insert
AbstractTableModel.doInsertMultipleRowsAt(int, java.lang.Object[])
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal