|
|||||||||
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
public abstract class AbstractTableModel
A model for table components. Implementations of AbstractTableModel provide a representation of the data to be displayed in the view, e.g. concrete data structures, or an adapter to data stores in an alternative structure. It should handle requests from the controller and subsequently notify the view of any changes via listeners.
Constructor Summary | ||
---|---|---|
AbstractTableModel()
Default constructor. |
Method Summary | ||
---|---|---|
void |
addColumn(Object data)
|
|
void |
addColumn(Object data,
boolean doNotifyListeners)
Add a column to the data model. |
|
void |
addRow(Object data)
|
|
void |
addRow(Object data,
boolean doNotifyListeners)
Add a row to the model. |
|
protected abstract 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 abstract 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 abstract Object |
doGetColumn(int columnIndex)
This method provides the ability to customize the logic behind getColumn()
so that a developer can specify this behavior while still ensuring that necessary
notification and exception handling overheads can occur as well. |
|
protected abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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. |
|
Object |
getColumn(int columnIndex)
Retrieves the array of elements at the specified column index. |
|
Object |
getElement(int rowIndex,
int columnIndex)
Retrieves the element at the specified row index and column index. |
|
abstract int |
getNumberOfColumns()
Get the number of columns in the table. |
|
abstract int |
getNumberOfRows()
Get the number of rows in the table. |
|
Object |
getRow(int rowIndex)
Retrieves the array of elements at the specified row index. |
|
void |
insertColumnAt(int columnIndex,
Object data)
|
|
void |
insertColumnAt(int columnIndex,
Object data,
boolean doNotifyListeners)
Inserts a column to the model at the specified index. |
|
void |
insertRowAt(int rowIndex,
Object data)
|
|
void |
insertRowAt(int rowIndex,
Object data,
boolean doNotifyListeners)
Inserts a row to the model at the specified index. |
|
void |
removeColumnAt(int columnIndex)
|
|
void |
removeColumnAt(int columnIndex,
boolean doNotifyListeners)
Deletes a column from the model at the specified index. |
|
void |
removeRowAt(int rowIndex)
|
|
void |
removeRowAt(int rowIndex,
boolean doNotifyListeners)
Deletes a row from the model at the specified index. |
|
void |
setElement(int rowIndex,
int columnIndex,
Object data)
|
|
void |
setElement(int rowIndex,
int columnIndex,
Object data,
boolean doNotifyListeners)
Sets the element at specified rowIndex and columnIndex. |
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 AbstractTableModel()
Method Detail |
---|
public final Object getColumn(int columnIndex) throws IllegalArgumentException
columnIndex
- Column index to retrieve the elements from.
IllegalArgumentException
- If the index is invalid.protected abstract Object doGetColumn(int columnIndex)
getColumn()
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 getColumn()
algorithm doesn’t change, while allowing
key behavior to be configurable.
columnIndex
- Column index to retreive the elements from.
public final Object getRow(int rowIndex) throws IllegalArgumentException
rowIndex
- Row index to retrieve the elements from.
IllegalArgumentException
- If the index is invalid.protected abstract 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.
rowIndex
- Row index to retrieve the elements from.
public final Object getElement(int rowIndex, int columnIndex) throws IllegalArgumentException
rowIndex
- Row index to retrieve the element from.columnIndex
- Column index to retrieve the elements from.
IllegalArgumentException
- If the row index or column index is invalid.protected abstract 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.
rowIndex
- Row index to retrieve the element from.columnIndex
- Column index to retrieve the elements from.
public abstract int getNumberOfColumns()
public abstract int getNumberOfRows()
public final void addColumn(Object data, boolean doNotifyListeners) throws IllegalArgumentException
AbstractTableModel.getNumberOfRows()
. If there is 1 row then data can be any object.
After the add is done the listeners are notified.
data
- The column data to be added to the model.doNotifyListeners
- True if listeners should be notified of changes. False otherwise.
IllegalArgumentException
- If data is null or has invalid row count.- Since:
- BlackBerry API 6.0.0
public final void addColumn(Object data) throws IllegalArgumentException
IllegalArgumentException
AbstractTableModel.addColumn(Object, boolean)
protected abstract 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.
data
- The column data to be added to the model.
public final void addRow(Object data, boolean doNotifyListeners) throws IllegalArgumentException
AbstractTableModel.getNumberOfColumns()
if there is 1 column then element can be any object.
After the add is done the listeners are notified.
data
- The row data to be added to the model.doNotifyListeners
- True if listeners should be notified of changes. False otherwise.
IllegalArgumentException
- If data is null or has invalid column count.- Since:
- BlackBerry API 6.0.0
public final void addRow(Object data) throws IllegalArgumentException
IllegalArgumentException
AbstractTableModel.addRow(Object, boolean)
protected abstract 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.
data
- The row data to be added to the model.
public final void removeColumnAt(int columnIndex, boolean doNotifyListeners) throws IllegalArgumentException
columnIndex
- Column index to delete the column at.
IllegalArgumentException
- If columnIndex
is invalid.public final void removeColumnAt(int columnIndex) throws IllegalArgumentException
IllegalArgumentException
AbstractTableModel.removeColumnAt(int, boolean)
protected abstract 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.
columnIndex
- The index of the column to be removed.
public final void removeRowAt(int rowIndex, boolean doNotifyListeners) throws IllegalArgumentException
columnIndex
- Row index to delete the row at.
IllegalArgumentException
- If rowIndex
is invalid.public final void removeRowAt(int rowIndex) throws IllegalArgumentException
IllegalArgumentException
AbstractTableModel.removeRowAt(int, boolean)
protected abstract 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.
rowIndex
- The index of the row to be removed.
public final void insertColumnAt(int columnIndex, Object data, boolean doNotifyListeners) throws IllegalArgumentException
columnIndex
- Index at which to insert the column.data
- Column of data to be inserted.doNotifyListeners
- True if listeners should be notified. False otherwise.
IllegalArgumentException
- If columnIndex
is invalid or data
is invalid.public final void insertColumnAt(int columnIndex, Object data) throws IllegalArgumentException
IllegalArgumentException
AbstractTableModel.insertColumnAt(int, Object, boolean)
protected abstract 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.
columnIndex
- Index at which to insert the column.data
- Column of data to be inserted.
public final void insertRowAt(int rowIndex, Object data, boolean doNotifyListeners) throws IllegalArgumentException
rowIndex
- Index at which to insert the row.data
- Row of data to be inserted.doNotifyListeners
- True if listeners should be notified. False otherwise.
IllegalArgumentException
- If rowIndex
is invalid or data
is invalid.public final void insertRowAt(int rowIndex, Object data) throws IllegalArgumentException
IllegalArgumentException
AbstractTableModel.insertRowAt(int, Object, boolean)
protected abstract 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.
columnIndex
- Index at which to insert the column.data
- Column of data to be inserted.
public final void setElement(int rowIndex, int columnIndex, Object data, boolean doNotifyListeners) throws IllegalArgumentException
rowIndex
- Index of row in which to insert.columnIndex
- Index of column in which to insert.data
- Element of data to insert.doNotifyListeners
- True if listeners should be notified. False otherwise.
IllegalArgumentException
- If rowIndex
is invalid or columnIndex
is invalid.public final void setElement(int rowIndex, int columnIndex, Object data) throws IllegalArgumentException
IllegalArgumentException
AbstractTableModel.setElement(int, int, Object, boolean)
protected abstract 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.
rowIndex
- Index of row in which to insert.columnIndex
- Index of column in which to insert.data
- Element of data to insert.
|
|||||||||
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.