Interface CloseableIterable<E>

  • All Superinterfaces:
    java.lang.AutoCloseable, java.lang.Iterable<E>

    public interface CloseableIterable<E>
    extends java.lang.AutoCloseable, java.lang.Iterable<E>
    Interface that provides semantics of a Iterable and AutoCloseable interfaces. This is useful when you have data that must be iterated on and may hold resources in the underlying implementation that must be closed.

    The close method will close any existing iterators that may be open to free resources

    Since:
    7.0
    Author:
    wburns
    • Method Detail

      • close

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

        CloseableIterator<E> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<E>