Interface SequentialCursor<K,​V>

  • Type Parameters:
    K - Type of the record's key
    V - Type of the record's value
    All Superinterfaces:
    AutoCloseable, Closeable
    All Known Subinterfaces:
    Cursor<K,​V>
    All Known Implementing Classes:
    EmptyCursor

    public interface SequentialCursor<K,​V>
    extends Closeable
    Cursor extended with navigation methods.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void close()  
      default void delete()
      Deletes the record on which this cursor is currently positioned.
      K getKey()
      Returns the key of the record on which this cursor is currently positioned.
      default V getValue()
      Returns the value of the record on which this cursor is currently positioned.
      default boolean isValid()
      Check whether this cursor is currently pointing to a valid record.
      boolean next()
      Moves this cursor to the next record in the tree.
    • Method Detail

      • next

        boolean next()
        Moves this cursor to the next record in the tree.

        No data is available before calling next() on a new cursor.

        Returns:
        true if the cursor has moved to the next record, false if no next record exists leaving cursor in undefined state.
      • isValid

        default boolean isValid()
        Check whether this cursor is currently pointing to a valid record.

        Before calling isValid() the cursor must be positioned by calling next().

        Returns:
        true if the cursor is pointing to a valid entry, false if cursor is not pointing to a valid entry
      • getValue

        default V getValue()
                    throws NoSuchElementException
        Returns the value of the record on which this cursor is currently positioned.
        Returns:
        the current record's value.
        Throws:
        NoSuchElementException - if the cursor is not valid.