Class BufferedMOTableModel.RowBufferIterator

java.lang.Object
org.snmp4j.agent.mox.BufferedMOTableModel.RowBufferIterator
All Implemented Interfaces:
Iterator<R>
Enclosing class:
BufferedMOTableModel<R extends org.snmp4j.agent.mo.MOTableRow>

protected class BufferedMOTableModel.RowBufferIterator extends Object implements Iterator<R>
The RowBufferIterator implements the iterator needed by the MOTableModel to traverse the model's rows.
Since:
2.2
Version:
3.0
Author:
Frank Fock
  • Constructor Details

    • RowBufferIterator

      public RowBufferIterator(org.snmp4j.smi.OID lowerBound)
      Creates the iterator with the specified start row.
      Parameters:
      lowerBound - the lower bound index (inclusive) of the first row to return. If null is specified, the first row will be returned by first call of next().
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<R extends org.snmp4j.agent.mo.MOTableRow>
    • next

      public R next()
      Specified by:
      next in interface Iterator<R extends org.snmp4j.agent.mo.MOTableRow>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<R extends org.snmp4j.agent.mo.MOTableRow>
    • fetchNextBufferRow

      protected BufferedMOTableModel<R>.BufferedMOTableRow<R> fetchNextBufferRow(org.snmp4j.smi.OID lowerBound, BufferedMOTableModel<R>.BufferedMOTableRow<R> predecessor, boolean includeLowerBound)
      Fetches the next buffered row following the given lower bound. If a valid successor is already present in the buffer it is returned as a buffer hit, otherwise the backend table is queried and the buffer is updated accordingly.
      Parameters:
      lowerBound - the OID after (or at, depending on includeLowerBound) which the next row is searched.
      predecessor - the buffered row that immediately precedes the searched row, or null if unknown.
      includeLowerBound - if true, a row whose index equals lowerBound is eligible to be returned, otherwise only rows with an index greater than lowerBound are considered.
      Returns:
      the next buffered row, or null if no such row exists.