up: I     index Zimbu documentation

INTERFACE I.Iterable<Titem> @public



Interface allowing a class to be iterated over.

Sketch of how this is used:

  CLASS Foo<Titem> IMPLEMENTS I.Iterable<Titem>
    List<Titem> $container
    FUNC $Iterator() I.Iterator
      RETURN FooIterator.NEW($container)
Defining $Iterator(), without explicitly adding the IMPLEMENTS, works to use the class with "FOR item IN".

$Iterator() I.Iterator<Titem> @public  Returns an iterator.

members (alphabetically)


FUNC $Iterator() I.Iterator<Titem> @abstract @public


Returns an iterator.

The returned iterator will iterate over the container in the state as it currently is. Changes to the container, other then calling methods on the iterator, have unpredictable effects.


      Copyright 2013 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0