|
|||||||||
| 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 |
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 |
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. |
|
| Methods inherited from class net.rim.device.api.ui.component.table.TableModel |
|---|
doAddColumn, doGetColumn, doGetElement, doGetRow, doInsertColumnAt, doRemoveColumnAt, doRemoveRowAt, doSetElement, getNumberOfColumns, getNumberOfRows |
| Methods inherited from class net.rim.device.api.ui.component.table.AbstractTableModel |
|---|
addColumn, addColumn, addRow, addRow, getColumn, getElement, getRow, insertColumnAt, insertColumnAt, insertRowAt, insertRowAt, removeColumnAt, removeColumnAt, removeRowAt, removeRowAt, 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)
AbstractTableModeladdRow()
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 TableModelAbstractTableModel.doAddRow(Object)
protected boolean doInsertRowAt(int rowIndex,
Object data)
AbstractTableModelinsertRowAt()
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 TableModeldata - Column of data to be inserted.
AbstractTableModel.doInsertRowAt(int, Object)public Comparator getComparator()
public int getSortColumn()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.