net.metanotion.io.block.index

## Class IBSkipIterator

- java.lang.Object
- - net.metanotion.util.skiplist.SkipIterator
  - - net.metanotion.io.block.index.IBSkipIterator

- All Implemented Interfaces:
    Iterator, ListIterator

      public class IBSkipIterator
      extends SkipIterator

  I2P Overridden to load the span when required and null out the keys and values when the iterator leaves the span. If the caller does not iterate all the way through, the last span will remain in memory.

- - ### Field Summary

    - ### Fields inherited from class net.metanotion.util.skiplist.SkipIterator

      `index, ss`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IBSkipIterator(SkipSpan ss, int index)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `next()`
    `Comparable` | `nextKey()` The key.
    `Object` | `previous()`

    - ### Methods inherited from class net.metanotion.util.skiplist.SkipIterator

      `add, hasNext, hasPrevious, nextIndex, previousIndex, remove, set`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IBSkipIterator

          public IBSkipIterator(SkipSpan ss,
                        int index)

  - ### Method Detail

    - #### next

          public Object next()

      Specified by:
        `next` in interface `Iterator`
      Specified by:
        `next` in interface `ListIterator`
      Overrides:
        `next` in class `SkipIterator`
      Returns:
        the next value, and advances the index
      Throws:
        `NoSuchElementException`
        `RuntimeException` - on IOE

    - #### nextKey

          public Comparable nextKey()

      The key. Does NOT advance the index.
      Overrides:
        `nextKey` in class `SkipIterator`
      Returns:
        the key for which the value will be returned in the subsequent call to next()
      Throws:
        `NoSuchElementException`
        `RuntimeException` - on IOE

    - #### previous

          public Object previous()

      Specified by:
        `previous` in interface `ListIterator`
      Overrides:
        `previous` in class `SkipIterator`
      Returns:
        the previous value, and decrements the index
      Throws:
        `NoSuchElementException`
        `RuntimeException` - on IOE