org.apache.directory.mavibot.btree

## Interface Cursor<K>

- Type Parameters:
    `K` - The type for the Key
  All Known Subinterfaces:
    ValueCursor<V>
  All Known Implementing Classes:
    EmptyValueCursor

      public interface Cursor<K>

  A Cursor is used to fetch elements in a BTree and is returned by the
  Author:
    Apache Directory Project
  See Also:
    `method. The cursor must be closed when the user is done with it.

    `

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `AFTER_LAST`
    `static int` | `BEFORE_FIRST` Static value for the beforeFrst and afterLast positions

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterLast()` Places the cursor at the end of the last position
    `void` | `beforeFirst()` moves the cursor to the same position that was given at the time of instantiating the cursor.
    `void` | `close()` Closes the cursor, thus releases the associated transaction
    `boolean` | `hasNext()` Tells if the cursor can return a next element
    `boolean` | `hasPrev()` Tells if the cursor can return a previous element

- - ### Field Detail

    - #### BEFORE_FIRST

          static final int BEFORE_FIRST

      Static value for the beforeFrst and afterLast positions
      See Also:
        Constant Field Values

    - #### AFTER_LAST

          static final int AFTER_LAST

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### hasNext

          boolean hasNext()
                          throws EndOfFileExceededException,
                                 IOException

      Tells if the cursor can return a next element
      Returns:
        true if there are some more elements
      Throws:
        `IOException`
        `EndOfFileExceededException`

    - #### hasPrev

          boolean hasPrev()
                          throws EndOfFileExceededException,
                                 IOException

      Tells if the cursor can return a previous element
      Returns:
        true if there are some more elements
      Throws:
        `IOException`
        `EndOfFileExceededException`

    - #### close

          void close()

      Closes the cursor, thus releases the associated transaction

    - #### beforeFirst

          void beforeFirst()
                           throws IOException

      moves the cursor to the same position that was given at the time of instantiating the cursor. For example, if the cursor was created using browse() method, then beforeFirst() will place the cursor before the 0th position. If the cursor was created using browseFrom(K), then calling beforeFirst() will reset the position to the just before the position where K is present.
      Throws:
        `IOException`

    - #### afterLast

          void afterLast()
                         throws IOException

      Places the cursor at the end of the last position
      Throws:
        `IOException`

Copyright © 2012–2015 Apache Mavibot Project Parent. All rights reserved.