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`
  Enclosing class:
    HnswGraph

      public static final 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`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `NodesIterator​(int size)` | Constructor for iterator based on the size
    `NodesIterator​(int[] nodes, int size)` | Constructor for iterator based on the nodes array up to the size

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `hasNext()` |
    `int` | `nextInt()` |
    `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

      `remove`

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

      `forEachRemaining, forEachRemaining, next`

- - ### Constructor Detail

    - #### NodesIterator

          public NodesIterator​(int[] nodes,
                               int size)

      Constructor for iterator based on the nodes array up to the size

    - #### NodesIterator

          public NodesIterator​(int size)

      Constructor for iterator based on the size

  - ### Method Detail

    - #### nextInt

          public int nextInt()

      Specified by:
        `nextInt` in interface `PrimitiveIterator.OfInt`

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<Integer>`

    - #### size

          public int size()

      The number of elements in this iterator *