Interface TidyIterable<X>

Type Parameters:
X -
All Superinterfaces:
Iterable<X>

public interface TidyIterable<X> extends Iterable<X>
A CleanIterable promises that the Iterator returned by the iterator() method also implements AutoClosable if that Iterator holds resources (just as open files) that need to be closed
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    forEach(Consumer<? super X> action)
    Overrides the default implementation such that the Iterator used internally will be closed at the end of this method if that Iterator implements AutoClosable

    Methods inherited from interface java.lang.Iterable

    iterator, spliterator
  • Method Details

    • forEach

      default void forEach(Consumer<? super X> action)
      Overrides the default implementation such that the Iterator used internally will be closed at the end of this method if that Iterator implements AutoClosable
      Specified by:
      forEach in interface Iterable<X>
      Parameters:
      action - The action to be performed for each element