org.apache.directory.mavibot.btree

## Class EmptyValueCursor<V>

- java.lang.Object
- - org.apache.directory.mavibot.btree.EmptyValueCursor<V>

- Type Parameters:
    `K` - The type for the Key
    `V` - The type for the stored value
  All Implemented Interfaces:
    Cursor<V>, ValueCursor<V>

      public class EmptyValueCursor<V>
      extends Object
      implements ValueCursor<V>

  A Cursor which is used when we have no value to return

  Author:
    Apache Directory Project

- - ### Field Summary

    - ### Fields inherited from interface org.apache.directory.mavibot.btree.Cursor

      `AFTER_LAST, BEFORE_FIRST`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmptyValueCursor(long revision)` Creates a new instance of Cursor, starting on a page at a given position.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterLast()` Change the position in the current cursor to set it after the last key
    `void` | `beforeFirst()` Change the position in the current cursor before the first key
    `void` | `close()` Closes the cursor, thus releases the associated transaction
    `long` | `getCreationDate()` Get the creation date
    `long` | `getRevision()` Get the current revision
    `boolean` | `hasNext()` Tells if the cursor can return a next element
    `boolean` | `hasNextKey()` Tells if the cursor can return a next key
    `boolean` | `hasPrev()` Tells if the cursor can return a previous element
    `boolean` | `hasPrevKey()` Tells if the cursor can return a previous key
    `V` | `next()` Find the next key/value
    `V` | `prev()` Find the previous key/value
    `int` | `size()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EmptyValueCursor

          public EmptyValueCursor(long revision)

      Creates a new instance of Cursor, starting on a page at a given position.
      Parameters:
        `transaction` - The transaction this operation is protected by
        `stack` - The stack of parent's from root to this page

  - ### Method Detail

    - #### afterLast

          public void afterLast()
                         throws IOException

      Change the position in the current cursor to set it after the last key
      Specified by:
        `afterLast` in interface `Cursor<V>`
      Throws:
        `IOException`

    - #### beforeFirst

          public void beforeFirst()
                           throws IOException

      Change the position in the current cursor before the first key
      Specified by:
        `beforeFirst` in interface `Cursor<V>`
      Throws:
        `IOException`

    - #### hasNext

          public boolean hasNext()
                          throws EndOfFileExceededException,
                                 IOException

      Tells if the cursor can return a next element
      Specified by:
        `hasNext` in interface `Cursor<V>`
      Returns:
        true if there are some more elements
      Throws:
        `IOException`
        `EndOfFileExceededException`

    - #### hasNextKey

          public boolean hasNextKey()
                             throws EndOfFileExceededException,
                                    IOException

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

    - #### hasPrev

          public boolean hasPrev()
                          throws EndOfFileExceededException,
                                 IOException

      Tells if the cursor can return a previous element
      Specified by:
        `hasPrev` in interface `Cursor<V>`
      Returns:
        true if there are some more elements
      Throws:
        `IOException`
        `EndOfFileExceededException`

    - #### hasPrevKey

          public boolean hasPrevKey()
                             throws EndOfFileExceededException,
                                    IOException

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

    - #### prev

          public V prev()
                 throws EndOfFileExceededException,
                        IOException

      Find the previous key/value
      Specified by:
        `prev` in interface `ValueCursor<V>`
      Returns:
        A Tuple containing the found key and value
      Throws:
        `EndOfFileExceededException`
        `IOException`

    - #### next

          public V next()
                 throws EndOfFileExceededException,
                        IOException

      Find the next key/value
      Specified by:
        `next` in interface `ValueCursor<V>`
      Returns:
        A Tuple containing the found key and value
      Throws:
        `EndOfFileExceededException`
        `IOException`

    - #### close

          public void close()

      Closes the cursor, thus releases the associated transaction
      Specified by:
        `close` in interface `Cursor<V>`

    - #### getCreationDate

          public long getCreationDate()

      Get the creation date
      Returns:
        The creation date for this cursor

    - #### getRevision

          public long getRevision()

      Get the current revision
      Returns:
        The revision this cursor is based on

    - #### size

          public int size()

      Specified by:
        `size` in interface `ValueCursor<V>`
      Returns:
        The number of elements stored in the cursor

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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