org.apache.directory.mavibot.btree

## Class EmptyTupleCursor<K,V>

- java.lang.Object
- - org.apache.directory.mavibot.btree.TupleCursor<K,V>
  - - org.apache.directory.mavibot.btree.EmptyTupleCursor<K,V>

- Type Parameters:
    `K` - The type for the Key
    `V` - The type for the stored value

      public class EmptyTupleCursor<K,V>
      extends TupleCursor<K,V>

  A Cursor which is used when we have no element to return
  Author:
    Apache Directory Project

- - ### Field Summary

    - ### Fields inherited from class org.apache.directory.mavibot.btree.TupleCursor

      `depth, stack, transaction`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmptyTupleCursor()` Creates a new instance of EmptyTupleCursor.

  - ### 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()`
    `long` | `getCreationDate()` Get the creation date
    `long` | `getRevision()` Always -1L for an empty cursor
    `boolean` | `hasNext()` Always return false.
    `boolean` | `hasNextKey()` Always false
    `boolean` | `hasPrev()` Always false
    `boolean` | `hasPrevKey()` Always false
    `Tuple<K,V>` | `next()` Always throws a NoSuchElementException.
    `Tuple<K,V>` | `nextKey()` Always throws a NoSuchElementException.
    `Tuple<K,V>` | `prev()` Always throws a NoSuchElementException.
    `Tuple<K,V>` | `prevKey()` Always throws a NoSuchElementException.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### EmptyTupleCursor

          public EmptyTupleCursor()

      Creates a new instance of EmptyTupleCursor. It will never return any result

  - ### Method Detail

    - #### afterLast

          public void afterLast()
                         throws IOException

      Change the position in the current cursor to set it after the last key
      Overrides:
        `afterLast` in class `TupleCursor<K,V>`
      Throws:
        `IOException`

    - #### beforeFirst

          public void beforeFirst()
                           throws IOException

      Change the position in the current cursor before the first key
      Overrides:
        `beforeFirst` in class `TupleCursor<K,V>`
      Throws:
        `IOException`

    - #### hasNext

          public boolean hasNext()

      Always return false.
      Overrides:
        `hasNext` in class `TupleCursor<K,V>`
      Returns:
        Always false

    - #### next

          public Tuple<K,V> next()
                          throws NoSuchElementException

      Always throws a NoSuchElementException.
      Overrides:
        `next` in class `TupleCursor<K,V>`
      Returns:
        Nothing
      Throws:
        `NoSuchElementException` - There is no element in a EmptyTupleCursor

    - #### nextKey

          public Tuple<K,V> nextKey()
                             throws NoSuchElementException

      Always throws a NoSuchElementException.
      Overrides:
        `nextKey` in class `TupleCursor<K,V>`
      Returns:
        Nothing
      Throws:
        `NoSuchElementException` - There is no element in a EmptyTupleCursor

    - #### hasNextKey

          public boolean hasNextKey()

      Always false
      Overrides:
        `hasNextKey` in class `TupleCursor<K,V>`
      Returns:
        false

    - #### hasPrev

          public boolean hasPrev()

      Always false
      Overrides:
        `hasPrev` in class `TupleCursor<K,V>`
      Returns:
        false

    - #### prev

          public Tuple<K,V> prev()
                          throws NoSuchElementException

      Always throws a NoSuchElementException.
      Overrides:
        `prev` in class `TupleCursor<K,V>`
      Returns:
        Nothing
      Throws:
        `NoSuchElementException` - There is no element in a EmptyTupleCursor

    - #### prevKey

          public Tuple<K,V> prevKey()
                             throws NoSuchElementException

      Always throws a NoSuchElementException.
      Overrides:
        `prevKey` in class `TupleCursor<K,V>`
      Returns:
        Nothing
      Throws:
        `NoSuchElementException` - There is no element in a EmptyTupleCursor

    - #### hasPrevKey

          public boolean hasPrevKey()

      Always false
      Overrides:
        `hasPrevKey` in class `TupleCursor<K,V>`
      Returns:
        false

    - #### close

          public void close()

      Overrides:
        `close` in class `TupleCursor<K,V>`

    - #### getCreationDate

          public long getCreationDate()

      Get the creation date
      Overrides:
        `getCreationDate` in class `TupleCursor<K,V>`
      Returns:
        The creation date for this cursor

    - #### getRevision

          public long getRevision()

      Always -1L for an empty cursor
      Overrides:
        `getRevision` in class `TupleCursor<K,V>`
      Returns:
        -1L

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `TupleCursor<K,V>`
      See Also:
        `Object.toString()`

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