java.lang.Object
org.snmp4j.agent.mo.DefaultMOTableModel<R>
- All Implemented Interfaces:
MOTableModel<R>
- Direct Known Subclasses:
DefaultMOMutableTableModel
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsRow
(org.snmp4j.smi.OID index) Checks whether this table model contains a row with the specified index.void
dump
(OutputStream os) Dumps a textual representation of the table model content to the specifiedOutputStream
.org.snmp4j.smi.OID
Returns the first row index in this model.firstRow()
Returns the first row contained in this model.int
Returns the number of columns currently in this table model.getRow
(org.snmp4j.smi.OID index) Gets the row with the specified index.int
Returns the number of rows currently in this table model.boolean
isEmpty()
Returnstrue
if the table model contains no rows.iterator()
Returns an iterator over the rows in this table model.org.snmp4j.smi.OID
Returns the last row index in this model.lastRow()
Returns the last row contained in this model.tailIterator
(org.snmp4j.smi.OID lowerBound) Returns an iterator on a view of the rows of this table model whose index values are greater or equallowerBound
.
-
Field Details
-
rows
-
columnCount
protected int columnCount
-
-
Constructor Details
-
DefaultMOTableModel
public DefaultMOTableModel()
-
-
Method Details
-
addRow
-
getColumnCount
public int getColumnCount()Description copied from interface:MOTableModel
Returns the number of columns currently in this table model.- Specified by:
getColumnCount
in interfaceMOTableModel<R extends MOTableRow>
- Returns:
- the number of columns.
-
getRowCount
public int getRowCount()Description copied from interface:MOTableModel
Returns the number of rows currently in this table model.- Specified by:
getRowCount
in interfaceMOTableModel<R extends MOTableRow>
- Returns:
- the number of rows.
-
isEmpty
public boolean isEmpty()Description copied from interface:MOTableModel
Returnstrue
if the table model contains no rows.- Specified by:
isEmpty
in interfaceMOTableModel<R extends MOTableRow>
- Returns:
true
if the table model contains no rows.
-
getRow
Description copied from interface:MOTableModel
Gets the row with the specified index.- Specified by:
getRow
in interfaceMOTableModel<R extends MOTableRow>
- Parameters:
index
- the row index.- Returns:
- the
MOTableRow
with the specified index andnull
if no such row exists.
-
firstIndex
public org.snmp4j.smi.OID firstIndex()Description copied from interface:MOTableModel
Returns the first row index in this model.- Specified by:
firstIndex
in interfaceMOTableModel<R extends MOTableRow>
- Returns:
- the first index OID of this model.
-
iterator
Description copied from interface:MOTableModel
Returns an iterator over the rows in this table model.- Specified by:
iterator
in interfaceMOTableModel<R extends MOTableRow>
- Returns:
- an
Iterator
returningMOTableRow
instances.
-
firstRow
Description copied from interface:MOTableModel
Returns the first row contained in this model.- Specified by:
firstRow
in interfaceMOTableModel<R extends MOTableRow>
- Returns:
- the
MOTableRow
with the smallest index ornull
if the model is empty.
-
lastIndex
public org.snmp4j.smi.OID lastIndex()Description copied from interface:MOTableModel
Returns the last row index in this model.- Specified by:
lastIndex
in interfaceMOTableModel<R extends MOTableRow>
- Returns:
- the last index OID of this model.
-
lastRow
Description copied from interface:MOTableModel
Returns the last row contained in this model.- Specified by:
lastRow
in interfaceMOTableModel<R extends MOTableRow>
- Returns:
- the
MOTableRow
with the greatest index ornull
if the model is empty.
-
containsRow
public boolean containsRow(org.snmp4j.smi.OID index) Description copied from interface:MOTableModel
Checks whether this table model contains a row with the specified index.- Specified by:
containsRow
in interfaceMOTableModel<R extends MOTableRow>
- Parameters:
index
- the index OID of the row to search.- Returns:
true
if this model has a row of with indexindex
orfalse
otherwise.
-
tailIterator
Description copied from interface:MOTableModel
Returns an iterator on a view of the rows of this table model whose index values are greater or equallowerBound
.- Specified by:
tailIterator
in interfaceMOTableModel<R extends MOTableRow>
- Parameters:
lowerBound
- the lower bound index (inclusive). IflowerBound
isnull
the returned iterator is the same as returned byMOTableModel.iterator()
.- Returns:
- an
Iterator
over the
-
dump
Dumps a textual representation of the table model content to the specifiedOutputStream
.- Parameters:
os
- anOutputStream
to write the model content to.- Throws:
IOException
- if a write operation onos
fails with an IO exception.- Since:
- 1.2.2
-