Interface CloseableIterator<T>

Type Parameters:
T - the type of elements returned by this iterator
All Superinterfaces:
AutoCloseable, Iterator<T>
All Known Implementing Classes:
DBIterator

public interface CloseableIterator<T> extends Iterator<T>, AutoCloseable
An iterator that must be explicitly closed to release resources, such as open database cursors or file handles.
  • Method Details

    • empty

      static <T> CloseableIterator<T> empty()
      Returns an empty CloseableIterator.
      Type Parameters:
      T - the element type
      Returns:
      a CloseableIterator with no elements
    • close

      default void close()
      Specified by:
      close in interface AutoCloseable