org.apache.tinkerpop.gremlin.structure.util

## Class DefaultCloseableIterator<T>

- java.lang.Object
- - org.apache.tinkerpop.gremlin.structure.util.DefaultCloseableIterator<T>

- All Implemented Interfaces:
    Closeable, AutoCloseable, Iterator<T>, CloseableIterator<T>

      public class DefaultCloseableIterator<T>
      extends Object
      implements CloseableIterator<T>

  A default implementation of `CloseableIterator` that simply wraps an existing `Iterator`. This implementation has a "do nothing" implementation of `CloseableIterator.close()`.
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Iterator<T>` | `iterator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultCloseableIterator(Iterator<T> iterator)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()`
    `T` | `next()`

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

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

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.structure.util.CloseableIterator

      `asCloseable, close, closeIterator`

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

      `forEachRemaining, remove`

- - ### Field Detail

    - #### iterator

          protected Iterator<T> iterator

  - ### Constructor Detail

    - #### DefaultCloseableIterator

          public DefaultCloseableIterator(Iterator<T> iterator)

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

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

    - #### next

          public T next()

      Specified by:
        `next` in interface `Iterator<T>`

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.