Interface DataIterator

All Superinterfaces:
Iterator<Map.Entry<byte[],​byte[]>>

public interface DataIterator
extends Iterator<Map.Entry<byte[],​byte[]>>
An Iterator over entries in a DataStore
  • Method Summary

    Modifier and Type Method Description
    boolean hasPrev()  
    Map.Entry<byte[],​byte[]> peekNext()
    Returns the next element in the iteration, without advancing the iteration.
    Map.Entry<byte[],​byte[]> peekPrev()  
    Map.Entry<byte[],​byte[]> prev()  
    void seek​(byte[] keyPrefix)
    Repositions the iterator to the next entry whose key begins with the keyPrefix
    void seekToFirst()
    Repositions the iterator so is is at the beginning of the DataStore.
    void seekToLast()
    Repositions the iterator so it is at the end of of the DataStore.

    Methods inherited from interface java.util.Iterator

    forEachRemaining, hasNext, next, remove
  • Method Details

    • seek

      void seek​(byte[] keyPrefix)
      Repositions the iterator to the next entry whose key begins with the keyPrefix
      Parameters:
      keyPrefix - - the prefix of the key to seek
    • seekToFirst

      void seekToFirst()
      Repositions the iterator so is is at the beginning of the DataStore.
    • peekNext

      Map.Entry<byte[],​byte[]> peekNext()
      Returns the next element in the iteration, without advancing the iteration.
      Returns:
      Map.Entry<byte[], byte[]> - the next element in the iteration, without advancing the iteration.
    • hasPrev

      boolean hasPrev()
      Returns:
      boolean - true if there is a previous entry in the iteration.
    • prev

      Map.Entry<byte[],​byte[]> prev()
      Returns:
      Map.Entry<byte[], byte[]> - the previous element in the iteration and rewinds the iteration.
    • peekPrev

      Map.Entry<byte[],​byte[]> peekPrev()
      Returns:
      Map.Entry<byte[], byte[]> - the previous element in the iteration, without rewinding the iteration.
    • seekToLast

      void seekToLast()
      Repositions the iterator so it is at the end of of the DataStore.