Produces the elements of a stream. For
example, this class has an Iterator
that produces the
integers from min
to max
:
class IntegerIterable(Integer min, Integer max) satisfies {Integer*} { iterator() => object satisfies Iterator<Integer> { variable value i = min; next() => i<=max then i++ else finished; }; }
An iterator is exhausted when next()
produces the
value finished
.
Iterable
no type hierarchy
no supertypes hierarchy
Methods | |
next | Source Codeshared formal Element|Finished next() The next element, or Repeated invocations of If an invocation of An iterator for a nonfinite stream may never produce
the value An iterator for a nonempty stream must produce at least
one value of type |
Inherited Methods |
Methods inherited from: Object |