CloseableIteratorserves as a bridging data structure for the underlying data store specific results that can be wrapped in a Java 8
java.util.stream.Stream. This allows implementations to clean up any resources they need to keep open to iterate over elements.
|Modifier and Type||Method and Description|
Return a sequential
default Spliterator<T> spliterator()
Spliteratorover the elements provided by this
Iterator. Implementations should document characteristic values reported by the spliterator. Such characteristic values are not required to be reported if the spliterator reports
Spliterator.SIZEDand this collection contains no elements.
The default implementation should be overridden by subclasses that can return a more efficient spliterator. To
preserve expected laziness behavior for the
stream() method, spliterators should either have the
CONCURRENT, or be late-binding.
The default implementation does not report a size.
Iteratoras its source. The resulting stream calls
closed. The resulting
Streammust be closed after use, it can be declared as a resource in a
Streamover the elements in this
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.