public abstract class BufferedMOMutableTableModel<R extends MOTableRow> extends BufferedMOTableModel<R> implements MOMutableTableModel<R>, MOTableRowListener<R>
BufferedMOTableModel.getMaxBufferSize()
rows fetched from the backend.
Rows are removed from the buffer either when they are older than BufferedMOTableModel.getBufferTimeoutNanoSeconds()
or
if the maximum number of buffered rows is reached.
Updates, row creations and removals are directly processed by the backend. Thus, updates are not buffered by this table model although the internal buffer reflects the changes.
IMPORTANT: The table model needs to be informed about row changes by calling the rowChanged(MOTableRowEvent)
method of the implemented MOTableRowListener
interface. This is typically done by
adding this model as row listener with
DefaultMOTable.addMOTableRowListener(MOTableRowListener)
but it can also be called
manually.
If you need to be sure that every row change is automatically processed by the backend through this
BufferedMOMutableTableModel then you will have to implement and use your own MOTableRow
implementation created by your own MOTableRowFactory
. That row implementation has then
to call the rowChanged(MOTableRowEvent)
of this table model after each change.
BufferedMOTableModel.BufferedMOTableRow<R extends MOTableRow>, BufferedMOTableModel.RowBufferIterator
bufferedChunksList, bufferedRows, bufferHits, bufferMisses, bufferTimeoutNanoSeconds, chunkSize, columnCount, firstRow, lastRow, maxBufferSize, rowFactory
Modifier | Constructor and Description |
---|---|
protected |
BufferedMOMutableTableModel(MOTableRowFactory<R> rowFactory)
Creates a BufferedMOMutableTableModel with the specified
MOTableRowFactory . |
Modifier and Type | Method and Description |
---|---|
R |
addRow(R row) |
protected abstract void |
bulkDeleteRows(List<OID> indexList)
Removes the rows with a row index that matches an entry in the supplied index list.
|
void |
clear() |
void |
clear(MOTableRowFilter<R> filter) |
protected abstract void |
deleteAllRows()
Removes all rows in the table.
|
protected abstract void |
deleteRow(OID index)
Deletes a single row.
|
protected abstract void |
insertRow(OID index,
Variable[] values)
Inserts a non-existing row.
|
R |
removeRow(OID index)
Removes a row from the table.
|
void |
rowChanged(MOTableRowEvent event) |
protected abstract void |
writeRow(OID index,
Variable[] values)
Updates/writes the content of a row.
|
cleanupBuffer, containsRow, fetchNextRows, fetchRow, firstIndex, firstRow, getBufferHits, getBufferMisses, getBufferTimeoutNanoSeconds, getChunkSize, getColumnCount, getFirstBufferRow, getLastBufferRow, getMaxBufferSize, getRow, getRow, getRowCount, getRowFactory, getRowFromBuffer, isRowValid, iterator, lastIndex, lastRow, resetBuffer, setBufferTimeoutNanoSeconds, setChunkSize, setMaxBufferSize, setRowFactory, tailIterator, toString, updateBuffer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRowFactory, setRowFactory
containsRow, firstIndex, firstRow, getColumnCount, getRow, getRowCount, isEmpty, iterator, lastIndex, lastRow, tailIterator
createRow, freeRow
protected BufferedMOMutableTableModel(MOTableRowFactory<R> rowFactory)
MOTableRowFactory
.rowFactory
- the row factory to be used to create rows from backend data.public R addRow(R row)
addRow
in interface MOMutableTableModel<R extends MOTableRow>
public void clear()
clear
in interface MOMutableTableModel<R extends MOTableRow>
public void clear(MOTableRowFilter<R> filter)
clear
in interface MOMutableTableModel<R extends MOTableRow>
protected abstract void deleteAllRows()
protected abstract void bulkDeleteRows(List<OID> indexList)
indexList
- the row indexes of the rows to remove.protected abstract void insertRow(OID index, Variable[] values)
index
- the row index of the new row.values
- the values for the columns of the row.protected abstract void writeRow(OID index, Variable[] values)
index
- the row index of the existing row.values
- the new values for the columns in that row.protected abstract void deleteRow(OID index)
index
- the row index of the deleting row.public void rowChanged(MOTableRowEvent event)
rowChanged
in interface MOTableRowListener<R extends MOTableRow>
public R removeRow(OID index)
BufferedMOTableModel
UnsupportedOperationException
.removeRow
in interface MOMutableTableModel<R extends MOTableRow>
removeRow
in class BufferedMOTableModel<R extends MOTableRow>
index
- the index of the target row.null
if such a row does not exist.Copyright © 2016 SNMP4J.org. All rights reserved.