up: I     index Zimbu documentation

INTERFACE I.KeyIterable<Tkey, Titem> @public



Interface allowing a class to be iterated over, with a key.

Sketch of how this is used:

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

$KeyIterator() I.KeyIterator<Tkey, Titem> @public  Returns a key iterator.

members (alphabetically)


FUNC $KeyIterator() I.KeyIterator<Tkey, Titem> @abstract @public


Returns a key 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