Interface CloseableIterator<E>

Type Parameters:
E - the iterator element type.
All Superinterfaces:
java.lang.AutoCloseable, java.util.Iterator<E>
All Known Implementing Classes:
FunctionIterator

public interface CloseableIterator<E>
extends java.util.Iterator<E>, java.lang.AutoCloseable
A CloseableIterator is intended to be used when it may hold resources (such as file or socket handles). This allows implementations to clean up any resources they need to keep open to iterate over elements.
Since:
4.3.15
  • Method Summary

    Modifier and Type Method Description
    void close()  

    Methods inherited from interface java.util.Iterator

    forEachRemaining, hasNext, next, remove
  • Method Details

    • close

      void close()
      Specified by:
      close in interface java.lang.AutoCloseable