CellIterator (Lucene 10.5.1 spatial-extras API)
Description: declaration: package: org.apache.lucene.spatial.prefix.tree, class: CellIterator

Package org.apache.lucene.spatial.prefix.tree

# Class CellIterator

java.lang.Object
org.apache.lucene.spatial.prefix.tree.CellIterator

All Implemented Interfaces:
  `Iterator<Cell>`

Direct Known Subclasses:
  `NumberRangePrefixTree.NRCell`, `PackedQuadPrefixTree.PrefixTreeIterator`

public abstract class CellIterator extends Object implements Iterator<Cell>
An Iterator of SpatialPrefixTree Cells. The order is always sorted without duplicates.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Cell`
  `nextCell`
  `protected Cell`
  `thisCell`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CellIterator()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Cell`
  `next()`
  `Cell`
  `nextFrom(Cell fromCell)`
  Gets the next cell that is >= `fromCell`, compared using non-leaf bytes.
  `void`
  `remove()`
  This prevents sub-cells (those underneath the current cell) from being iterated to, if applicable, otherwise a NO-OP.
  `Cell`
  `thisCell()`
  Returns the cell last returned from `next()`.

  ### 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, hasNext`

- ## Field Details

  - ### nextCell

    protected Cell nextCell

  - ### thisCell

    protected Cell thisCell

- ## Constructor Details

  - ### CellIterator

    public CellIterator()

- ## Method Details

  - ### thisCell

    public Cell thisCell()
    Returns the cell last returned from `next()`. It's cleared by hasNext().

  - ### nextFrom

    public Cell nextFrom(Cell fromCell)
    Gets the next cell that is >= `fromCell`, compared using non-leaf bytes. If it returns null then the iterator is exhausted.

  - ### remove

    public void remove()
    This prevents sub-cells (those underneath the current cell) from being iterated to, if applicable, otherwise a NO-OP.
    Specified by:
      `remove` in interface `Iterator<Cell>`

  - ### next

    public Cell next()
    Specified by:
      `next` in interface `Iterator<Cell>`