public class DefaultMOMutableTableModel<R extends MOTableRow> extends DefaultMOTableModel<R> implements MOMutableTableModel<R>
Modifier and Type | Class and Description |
---|---|
class |
DefaultMOMutableTableModel.FilteredRowIterator |
Modifier and Type | Field and Description |
---|---|
protected MOTableRowFactory<R> |
rowFactory |
columnCount, rows
Constructor and Description |
---|
DefaultMOMutableTableModel() |
Modifier and Type | Method and Description |
---|---|
void |
addMOTableModelListener(MOTableModelListener l) |
R |
addRow(R row)
Adds a row to the table.
|
void |
clear()
Removes all rows.
|
void |
clear(MOTableRowFilter<R> filter)
Remove all rows that do not match the given filter criteria
from the model.
|
R |
createRow(org.snmp4j.smi.OID index,
org.snmp4j.smi.Variable[] values)
Create a new row and return it.
|
protected void |
fireTableModelChanged(MOTableModelEvent event) |
void |
freeRow(R row)
Frees resources associated with the supplied row which is to be deleted.
|
MOTableRowFactory<R> |
getRowFactory()
Gets the factory instance used for creating rows for this model.
|
List<MOTableRow> |
getRows(org.snmp4j.smi.OID lowerBound,
org.snmp4j.smi.OID upperBoundEx)
Returns a lexicographic ordered list of the rows in the specified index
range.
|
List<R> |
getRows(org.snmp4j.smi.OID lowerBound,
org.snmp4j.smi.OID upperBoundEx,
MOTableRowFilter<R> filter)
Returns a lexicographic ordered list of the rows in the specified index
range that match the supplied filter.
|
Iterator<R> |
iterator(MOTableRowFilter<R> filter)
Returns an iterator over all rows in this table that pass the
given filter.
|
void |
removeMOTableModelListener(MOTableModelListener l) |
R |
removeRow(org.snmp4j.smi.OID index)
Removes the row with the specified index from the table and returns it.
|
void |
removeRows(org.snmp4j.smi.OID lowerBoundIncl,
org.snmp4j.smi.OID upperBoundExcl) |
void |
setColumnCount(int columnCount) |
<F extends MOTableRowFactory<R>> |
setRowFactory(F rowFactory)
Sets the factory instance to be used for creating rows for this model.
|
containsRow, dump, firstIndex, firstRow, getColumnCount, getRow, getRowCount, isEmpty, iterator, lastIndex, lastRow, tailIterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsRow, firstIndex, firstRow, getColumnCount, getRow, getRowCount, isEmpty, iterator, lastIndex, lastRow, tailIterator
protected MOTableRowFactory<R extends MOTableRow> rowFactory
public MOTableRowFactory<R> getRowFactory()
MOMutableTableModel
getRowFactory
in interface MOMutableTableModel<R extends MOTableRow>
null
if
row creation is not possible due to a missing factory.public List<MOTableRow> getRows(org.snmp4j.smi.OID lowerBound, org.snmp4j.smi.OID upperBoundEx)
lowerBound
- the lower bound index (inclusive) for the rows in the returned list.upperBoundEx
- the upper bound index (exclusive) for the rows in the returned list.List
of rows of this table model in the specified index range. Modifications
to the list will not affect the underlying table model, although
modifications to the row elements will.public List<R> getRows(org.snmp4j.smi.OID lowerBound, org.snmp4j.smi.OID upperBoundEx, MOTableRowFilter<R> filter)
lowerBound
- the lower bound index (inclusive) for the rows in the returned list.upperBoundEx
- the upper bound index (exclusive) for the rows in the returned list.filter
- the filter to exclude rows in the range from the returnedList
of rows of this table model in the specified index range. Modifications
to the list will not affect the underlying table model, although
modifications to the row elements will.public R removeRow(org.snmp4j.smi.OID index)
MOMutableTableModel
removeRow
in interface MOMutableTableModel<R extends MOTableRow>
index
- the row index of the row to remove.null
if the table did not contain such
a row.public void removeRows(org.snmp4j.smi.OID lowerBoundIncl, org.snmp4j.smi.OID upperBoundExcl)
public void clear()
MOMutableTableModel
clear
in interface MOMutableTableModel<R extends MOTableRow>
public void clear(MOTableRowFilter<R> filter)
clear
in interface MOMutableTableModel<R extends MOTableRow>
filter
- the MOTableRowFilter
that filters out the rows to
delete.public Iterator<R> iterator(MOTableRowFilter<R> filter)
filter
- a MOTableRowFilter instance that defines the rows to return.public R createRow(org.snmp4j.smi.OID index, org.snmp4j.smi.Variable[] values) throws UnsupportedOperationException
addRow(R)
method.
If this mutable table does not support row creation, it should
throw an UnsupportedOperationException
.createRow
in interface MOTableRowFactory<R extends MOTableRow>
index
- the index OID for the new row.values
- the values to be contained in the new row.MOTableRow
.UnsupportedOperationException
- if the specified row cannot be created.public <F extends MOTableRowFactory<R>> void setRowFactory(F rowFactory)
MOMutableTableModel
setRowFactory
in interface MOMutableTableModel<R extends MOTableRow>
F
- an instance of the MOTableRowFactory
interface.rowFactory
- a MOTableRowFactory
instance or null
to
disable row creation.public void setColumnCount(int columnCount)
public void freeRow(R row)
MOTableRowFactory
freeRow
in interface MOTableRowFactory<R extends MOTableRow>
row
- a MOTableRow that has been created using this factory and is now to
be deleted (removed from the associated table).public void addMOTableModelListener(MOTableModelListener l)
public void removeMOTableModelListener(MOTableModelListener l)
protected void fireTableModelChanged(MOTableModelEvent event)
public R addRow(R row)
MOMutableTableModel
addRow
in interface MOMutableTableModel<R extends MOTableRow>
addRow
in class DefaultMOTableModel<R extends MOTableRow>
row
- the MOTableRow
instance to add.null
if it
did not have one.Copyright © 2020 SNMP4J.org. All rights reserved.