|
|||||||||
| 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
net.rim.device.api.ui.component.table.SortedTableModel
public class SortedTableModel
Maintain a sorted model according to one row column.
| Constructor Summary | ||
|---|---|---|
SortedTableModel(Object[][] elements,
Comparator comparator,
int sortedColumn)
Create a SortedTableModel that uses the given comparator and sorted column number. |
||
SortedTableModel(Comparator comparator,
int sortedColumn)
Create a SortedTableModel that uses the given comparator and sorted column number. |
||
| Method Summary | ||
|---|---|---|
protected boolean |
doAddMultipleRows(Object[] data)
SortedTableModel is unable to insert multiple rows. |
|
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 boolean |
doInsertMultipleRowsAt(int rowIndex,
Object[] data)
SortedTableModel is unable to insert multiple rows. |
|
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. |
|
Comparator |
getComparator()
Get the comparator that is being used to compare elements in the sorted column. |
|
int |
getSortColumn()
Get the column number that is being used to sort the table. |
|
boolean |
implementationSupportsBatchOperations()
SortedTableModel is unable to insert multiple contiguous rows,
as the row order will be changed on insert. |
|
| Methods inherited from class net.rim.device.api.ui.component.table.TableModel |
|---|
doAddColumn, doGetColumn, doGetElement, doGetRow, doInsertColumnAt, doRemoveColumnAt, doRemoveRowAt, doRemoveRowRangeAt, doSetElement, getNumberOfColumns, getNumberOfRows |
| 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 SortedTableModel(Comparator comparator,
int sortedColumn)
comparator - the comparator used to compare two items in the sorted column of the model.sortedColumn - the column number that is sorted using the comparator.
IllegalArgumentException - If comparator is passed in as null. Comparator must be defined
for object type.
public SortedTableModel(Object[][] elements,
Comparator comparator,
int sortedColumn)
elements - the initial data in the model that will be added to the table in sorted order.comparator - the comparator used to compare two items in the sorted column of the model.sortedColumn - the column number that is sorted using the comparator.
IllegalArgumentException - If comparator is passed in as null. Comparator must be defined
for object type.| Method Detail |
|---|
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 TableModeldata - The row data to be added to the model.
AbstractTableModel.doAddRow(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 TableModelrowIndex - Index at which to insert the column.data - Column of data to be inserted.
AbstractTableModel.doInsertRowAt(int, Object)public Comparator getComparator()
public int getSortColumn()
protected boolean doAddMultipleRows(Object[] data)
doAddMultipleRows in class TableModeldata - The rows of data to be added to the model.
AbstractTableModel.doAddMultipleRows(java.lang.Object[])
protected boolean doInsertMultipleRowsAt(int rowIndex,
Object[] data)
doInsertMultipleRowsAt in class TableModelrowIndex - Index of row in which to insert.data - Array of row data to insert
AbstractTableModel.doInsertMultipleRowsAt(int, java.lang.Object[])public boolean implementationSupportsBatchOperations()
SortedTableModel is unable to insert multiple contiguous rows,
as the row order will be changed on insert.
implementationSupportsBatchOperations in class TableModelTableModel.implementationSupportsBatchOperations()
|
|||||||||
| 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