Interface GenericIterator.Iterable<T>
- All Superinterfaces:
Iterable<T>
,SplitableIterable<T>
- All Known Implementing Classes:
LeafNode
- Enclosing class:
GenericIterator<T>
Interface for collections that can be iterated over by GenericIterator using State objects
to track the progress of the iteration. These do not need to be thread safe.
-
Method Summary
Modifier and TypeMethodDescriptionint
iterateOverRange
(GenericIterator.State<T> parent, int offset, int limit) Create a State to iterate over the specified range of values if possible.default SplitableIterator
<T> iterator()
default IStreamable
<T> streamable
(int characteristics) Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.javimmutable.collections.SplitableIterable
forEachThrows, indexedForEach, indexedForEachThrows, reduce, reduceThrows
-
Method Details
-
iterateOverRange
@Nullable GenericIterator.State<T> iterateOverRange(@Nullable GenericIterator.State<T> parent, int offset, int limit) Create a State to iterate over the specified range of values if possible. Can return null if no more values are available. The range must be valid for the collection being iterated over. The returned State will return the parent as its result when iteration over the range is completed.- Parameters:
parent
- State to return to once the request iteration completesoffset
- starting point for iterationlimit
- stopping point for iteration- Returns:
- null or a valid state
-
iterableSize
int iterableSize() -
iterator
-
streamable
-