ForwardCursor (Oracle - Berkeley DB Client-Server API)
Date: 2018-05-29

com.sleepycat.client.persist

## Interface ForwardCursor<V>

- All Superinterfaces:
    java.lang.Iterable<V>
  All Known Subinterfaces:
    EntityCursor<V>

      public interface ForwardCursor<V>
      extends java.lang.Iterable<V>

  Cursor operations limited to traversing forward. See `EntityCursor` for general information on cursors.

  `ForwardCursor` objects are not thread-safe. Cursors should be opened, used and closed by a single thread.

  WARNING: Cursors must always be closed to prevent resource leaks which could lead to the index becoming unusable or cause an `OutOfMemoryError`. To ensure that a cursor is closed in the face of exceptions, close it in a finally block.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes the cursor.
    `java.util.Iterator<V>` | `iterator()` Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized.
    `java.util.Iterator<V>` | `iterator(SLockMode lockMode)` Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized.
    `V` | `next()` Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range.
    `V` | `next(SLockMode lockMode)` Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range.

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Method Detail

    - #### next

          V next()
          throws SDatabaseException

      Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range. If the cursor is uninitialized, this method returns the first value.

      `SLockMode.DEFAULT` is used implicitly.

      Returns:
        the next value, or null if there are no more values in the cursor range.
      Throws:
        `SDatabaseException` - the base class for all BDB exceptions.

    - #### next

          V next(SLockMode lockMode)
          throws SDatabaseException

      Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range. If the cursor is uninitialized, this method returns the first value.
      Parameters:
        `lockMode` - the lock mode to use for this operation, or null to use `SLockMode.DEFAULT`.
      Returns:
        the next value, or null if there are no more values in the cursor range.
      Throws:
        `SDatabaseException` - the base class for all BDB exceptions.

    - #### iterator

          java.util.Iterator<V> iterator()

      Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized.

      `SLockMode.DEFAULT` is used implicitly.

      Specified by:
        `iterator` in interface `java.lang.Iterable<V>`
      Returns:
        the iterator.

    - #### iterator

          java.util.Iterator<V> iterator(SLockMode lockMode)

      Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized.
      Parameters:
        `lockMode` - the lock mode to use for all operations performed using the iterator, or null to use `SLockMode.DEFAULT`.
      Returns:
        the iterator.

    - #### close

          void close()
              throws SDatabaseException

      Closes the cursor.
      Throws:
        `SDatabaseException` - the base class for all BDB exceptions.

Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.