Class Cursor<K,V>

java.lang.Object
org.dizitart.no2.mvstore.compat.v1.mvstore.Cursor<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
Iterator<K>

public class Cursor<K,V> extends Object implements Iterator<K>
A cursor to iterate over elements in ascending order.
  • Constructor Details

    • Cursor

      public Cursor(Page root, K from)
    • Cursor

      public Cursor(Page root, K from, K to)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<K>
    • next

      public K next()
      Specified by:
      next in interface Iterator<K>
    • getKey

      public K getKey()
      Get the last read key if there was one.
      Returns:
      the key or null
    • getValue

      public V getValue()
      Get the last read value if there was one.
      Returns:
      the value or null
    • skip

      public void skip(long n)
      Skip over that many entries. This method is relatively fast (for this map implementation) even if many entries need to be skipped.
      Parameters:
      n - the number of entries to skip
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<K>