Interface Cursor<T>

Type Parameters:
T -
All Superinterfaces:
AutoCloseable, Closeable, CloseableIterator<T>, Iterator<T>
All Known Implementing Classes:
ConvertingCursor, KeyBoundCursor, ScanCursor

public interface Cursor<T> extends CloseableIterator<T>
Cursor abstraction to scan over the keyspace or elements within a data structure using a variant of a SCAN command.

Using a Java 8 java.util.stream.Stream allows to apply additional filters and limits to the underlying Cursor.

Make sure to close the cursor when done as this allows implementations to clean up any resources they need to keep open to iterate over elements (eg. by using a try-with-resource statement).

Since:
1.4
Author:
Christoph Strobl, Mark Paluch
  • Method Details

    • getId

      Returns the reference cursor.
      Returns:
      the reference cursor.
      Since:
      3.2.1
    • getCursorId

      @Deprecated(since="3.3.0") long getCursorId()
      Deprecated.
      since 3.3.0, use getId() instead as the cursorId can exceed Long.MAX_VALUE.
      Get the reference cursor.
      NOTE: the id might change while iterating items.
      Returns:
    • isClosed

      boolean isClosed()
      Returns:
      true if cursor closed.
    • getPosition

      long getPosition()
      Returns:
      the current position of the cursor.