java.lang.Object
net.metanotion.util.skiplist.SkipIterator<K,V>
Type Parameters:
K - type of keys maintained by this iterator
V - type of values returned by this iterator
All Implemented Interfaces:
Iterator<V>, ListIterator<V>
Direct Known Subclasses:
IBSkipIterator

public class SkipIterator<K extends Comparable<? super K>, V>extends Object implements ListIterator<V>
A basic iterator for a skip list. This is not a complete ListIterator, in particular, since the skip list is a map and is therefore indexed by Comparable objects instead of int's, nextIndex and previousIndex methods are not really relevant. To be clear, this is an iterator through values. To get the key, call nextKey() BEFORE calling next().
  • Field Details

    • ss

      protected SkipSpan<K extends Comparable<? super K>, V> ss
      The current span being iterated over.
    • index

      protected int index
      Current index position.
  • Constructor Details

    • SkipIterator

      protected SkipIterator()
      Constructor for subclass use.
    • SkipIterator

      public SkipIterator(SkipSpan<K,V> ss, int index)
      Rejects a null span, then starts iterating at the given index.
      Parameters:
      ss - the span to iterate over
      index - the zero-based entry index to start iterating from
  • Method Details