Package org.apache.lucene.util.hnsw

## Class HnswGraph.NodesIterator

- java.lang.Object
- - org.apache.lucene.util.hnsw.HnswGraph.NodesIterator

- All Implemented Interfaces:
    `Iterator<Integer>`, `PrimitiveIterator<Integer,​IntConsumer>`, `PrimitiveIterator.OfInt`
  Direct Known Subclasses:
    `HnswGraph.ArrayNodesIterator`, `HnswGraph.CollectionNodesIterator`
  Enclosing class:
    HnswGraph

      public abstract static class HnswGraph.NodesIterator
      extends Object
      implements PrimitiveIterator.OfInt

  Iterator over the graph nodes on a certain level, Iterator also provides the size – the total number of nodes to be iterated over.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface java.util.PrimitiveIterator

      `PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected int` | `size` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NodesIterator​(int size)` | Constructor for iterator based on the size

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `abstract int` | `consume​(int[] dest)` | Consume integers from the iterator and place them into the `dest` array.
    `static int[]` | `getSortedNodes​(HnswGraph.NodesIterator nodesOnLevel)` |
    `int` | `size()` | The number of elements in this iterator *

    - ### 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

      `hasNext, remove`

    - ### Methods inherited from interface java.util.PrimitiveIterator.OfInt

      `forEachRemaining, forEachRemaining, next, nextInt`

- - ### Field Detail

    - #### size

          protected final int size

  - ### Constructor Detail

    - #### NodesIterator

          public NodesIterator​(int size)

      Constructor for iterator based on the size

  - ### Method Detail

    - #### size

          public int size()

      The number of elements in this iterator *

    - #### consume

          public abstract int consume​(int[] dest)

      Consume integers from the iterator and place them into the `dest` array.
      Parameters:
        `dest` - where to put the integers
      Returns:
        The number of integers written to `dest`

    - #### getSortedNodes

          public static int[] getSortedNodes​(HnswGraph.NodesIterator nodesOnLevel)