Interface EnumerableSource<T>
- Type Parameters:
T- the element type of the source
- All Known Subinterfaces:
DeferredEnumerableSource<T>
public interface EnumerableSource<T>
Represents an unknown length iterable source which can be moved forward synchronously and obtain the current item via a simple call.
No hasNext and next duplication. C# IEnumerator is way better in this regard.
- Since:
- 4.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncurrent()Returns the current item ifnextSync()returnedtruethe previous call.booleannextSync()Synchronously obtains the next item or returnsfalseif no more items.
-
Method Details
-
nextSync
Synchronously obtains the next item or returnsfalseif no more items. -
current
T current()Returns the current item ifnextSync()returnedtruethe previous call.Calling before the first or after exhaustion of the source is an undefined behavior
- Returns:
- the current item
-