+list + / += Iterable
+CLI app started
This commit is contained in:
1 parent
939e391a20
commit
6ef94fff65
14 files changed
+271
-82
No files matched your search
@@ -0,0 +1,29 @@
|
||||
# Iterator interface
|
||||
|
||||
Iterators are representing the [Iterable] entity, to access its contents
|
||||
sequentially.
|
||||
|
||||
To implement the iterator you need to implement only two abstract methods:
|
||||
|
||||
## Abstract methods
|
||||
|
||||
### hasNext(): Bool
|
||||
|
||||
Should return `true` if call to `next()` will return valid next element.
|
||||
|
||||
### next(): Obj
|
||||
|
||||
Should return next object in the iterated entity. If there is no next method,
|
||||
must throw `ObjIterationFinishedError`.
|
||||
|
||||
## Usage
|
||||
|
||||
Iterators are returned when implementing [Iterable] interface.
|
||||
|
||||
## Implemented for classes:
|
||||
|
||||
- [List], [Range]
|
||||
|
||||
[List]: List.md
|
||||
[Range]: Range.md
|
||||
[Iterable]: Iterable.md
|
||||
Reference in new issue
Block a user