Cursor (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.utils.btree

## Class Cursor<K,V extends K>

- java.lang.Object
- - org.apache.cassandra.utils.btree.Path
  - - org.apache.cassandra.utils.btree.Cursor<K,V>

- Type Parameters:
    `V` -
  All Implemented Interfaces:
    java.util.Iterator<V>

      public final class Cursor<K,V extends K>
      extends Path
      implements java.util.Iterator<V>

  An extension of Path which provides a public interface for iterating over or counting a subrange of the tree

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Cursor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `count()`
    `boolean` | `hasNext()`
    `V` | `next()`
    `void` | `remove()`
    `void` | `reset(java.lang.Object[] btree, boolean forwards)` Reset this cursor for the provided tree, to iterate over its entire range
    `void` | `reset(java.lang.Object[] btree, java.util.Comparator<K> comparator, K lowerBound, boolean inclusiveLowerBound, K upperBound, boolean inclusiveUpperBound, boolean forwards)` Reset this cursor for the provided tree, to iterate between the provided start and end
    `void` | `reset(java.lang.Object[] btree, java.util.Comparator<K> comparator, K lowerBound, K upperBound, boolean forwards)` Reset this cursor for the provided tree, to iterate between the provided start and end

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

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

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### Constructor Detail

    - #### Cursor

          public Cursor()

  - ### Method Detail

    - #### reset

          public void reset(java.lang.Object[] btree,
                            boolean forwards)

      Reset this cursor for the provided tree, to iterate over its entire range
      Parameters:
        `btree` - the tree to iterate over
        `forwards` - if false, the cursor will start at the end and move backwards

    - #### reset

          public void reset(java.lang.Object[] btree,
                            java.util.Comparator<K> comparator,
                            K lowerBound,
                            K upperBound,
                            boolean forwards)

      Reset this cursor for the provided tree, to iterate between the provided start and end
      Parameters:
        `btree` - the tree to iterate over
        `comparator` - the comparator that defines the ordering over the items in the tree
        `lowerBound` - the first item to include, inclusive
        `upperBound` - the last item to include, exclusive
        `forwards` - if false, the cursor will start at the end and move backwards

    - #### reset

          public void reset(java.lang.Object[] btree,
                            java.util.Comparator<K> comparator,
                            K lowerBound,
                            boolean inclusiveLowerBound,
                            K upperBound,
                            boolean inclusiveUpperBound,
                            boolean forwards)

      Reset this cursor for the provided tree, to iterate between the provided start and end
      Parameters:
        `btree` - the tree to iterate over
        `comparator` - the comparator that defines the ordering over the items in the tree
        `lowerBound` - the first item to include
        `inclusiveLowerBound` - should include start in the iterator, if present in the tree
        `upperBound` - the last item to include
        `inclusiveUpperBound` - should include end in the iterator, if present in the tree
        `forwards` - if false, the cursor will start at the end and move backwards

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `java.util.Iterator<V extends K>`

    - #### next

          public V next()

      Specified by:
        `next` in interface `java.util.Iterator<V extends K>`

    - #### count

          public int count()

    - #### remove

          public void remove()

      Specified by:
        `remove` in interface `java.util.Iterator<V extends K>`

Copyright © 2018 The Apache Software Foundation