- java.lang.Object
-
- org.snmp4j.agent.mo.DefaultMOTableModel<R>
-
- All Implemented Interfaces:
MOTableModel<R>
- Direct Known Subclasses:
DefaultMOMutableTableModel
public class DefaultMOTableModel<R extends MOTableRow> extends Object implements MOTableModel<R>
-
-
Field Summary
Fields Modifier and Type Field Description protected intcolumnCountprotected SortedMap<org.snmp4j.smi.OID,R>rows
-
Constructor Summary
Constructors Constructor Description DefaultMOTableModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RaddRow(R row)booleancontainsRow(org.snmp4j.smi.OID index)Checks whether this table model contains a row with the specified index.voiddump(OutputStream os)Dumps a textual representation of the table model content to the specifiedOutputStream.org.snmp4j.smi.OIDfirstIndex()Returns the first row index in this model.RfirstRow()Returns the first row contained in this model.intgetColumnCount()Returns the number of columns currently in this table model.RgetRow(org.snmp4j.smi.OID index)Gets the row with the specified index.intgetRowCount()Returns the number of rows currently in this table model.booleanisEmpty()Returnstrueif the table model contains no rows.Iterator<R>iterator()Returns an iterator over the rows in this table model.org.snmp4j.smi.OIDlastIndex()Returns the last row index in this model.RlastRow()Returns the last row contained in this model.Iterator<R>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 Detail
-
rows
protected SortedMap<org.snmp4j.smi.OID,R extends MOTableRow> rows
-
columnCount
protected int columnCount
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
Description copied from interface:MOTableModelReturns the number of columns currently in this table model.- Specified by:
getColumnCountin interfaceMOTableModel<R extends MOTableRow>- Returns:
- the number of columns.
-
getRowCount
public int getRowCount()
Description copied from interface:MOTableModelReturns the number of rows currently in this table model.- Specified by:
getRowCountin interfaceMOTableModel<R extends MOTableRow>- Returns:
- the number of rows.
-
isEmpty
public boolean isEmpty()
Description copied from interface:MOTableModelReturnstrueif the table model contains no rows.- Specified by:
isEmptyin interfaceMOTableModel<R extends MOTableRow>- Returns:
trueif the table model contains no rows.
-
getRow
public R getRow(org.snmp4j.smi.OID index)
Description copied from interface:MOTableModelGets the row with the specified index.- Specified by:
getRowin interfaceMOTableModel<R extends MOTableRow>- Parameters:
index- the row index.- Returns:
- the
MOTableRowwith the specified index andnullif no such row exists.
-
firstIndex
public org.snmp4j.smi.OID firstIndex()
Description copied from interface:MOTableModelReturns the first row index in this model.- Specified by:
firstIndexin interfaceMOTableModel<R extends MOTableRow>- Returns:
- the first index OID of this model.
-
iterator
public Iterator<R> iterator()
Description copied from interface:MOTableModelReturns an iterator over the rows in this table model.- Specified by:
iteratorin interfaceMOTableModel<R extends MOTableRow>- Returns:
- an
IteratorreturningMOTableRowinstances.
-
firstRow
public R firstRow()
Description copied from interface:MOTableModelReturns the first row contained in this model.- Specified by:
firstRowin interfaceMOTableModel<R extends MOTableRow>- Returns:
- the
MOTableRowwith the smallest index ornullif the model is empty.
-
lastIndex
public org.snmp4j.smi.OID lastIndex()
Description copied from interface:MOTableModelReturns the last row index in this model.- Specified by:
lastIndexin interfaceMOTableModel<R extends MOTableRow>- Returns:
- the last index OID of this model.
-
lastRow
public R lastRow()
Description copied from interface:MOTableModelReturns the last row contained in this model.- Specified by:
lastRowin interfaceMOTableModel<R extends MOTableRow>- Returns:
- the
MOTableRowwith the greatest index ornullif the model is empty.
-
containsRow
public boolean containsRow(org.snmp4j.smi.OID index)
Description copied from interface:MOTableModelChecks whether this table model contains a row with the specified index.- Specified by:
containsRowin interfaceMOTableModel<R extends MOTableRow>- Parameters:
index- the index OID of the row to search.- Returns:
trueif this model has a row of with indexindexorfalseotherwise.
-
tailIterator
public Iterator<R> tailIterator(org.snmp4j.smi.OID lowerBound)
Description copied from interface:MOTableModelReturns an iterator on a view of the rows of this table model whose index values are greater or equallowerBound.- Specified by:
tailIteratorin interfaceMOTableModel<R extends MOTableRow>- Parameters:
lowerBound- the lower bound index (inclusive). IflowerBoundisnullthe returned iterator is the same as returned byMOTableModel.iterator().- Returns:
- an
Iteratorover the
-
dump
public void dump(OutputStream os) throws IOException
Dumps a textual representation of the table model content to the specifiedOutputStream.- Parameters:
os- anOutputStreamto write the model content to.- Throws:
IOException- if a write operation onosfails with an IO exception.- Since:
- 1.2.2
-
-