SingletonIterator class | misc.t[1969]

A SingletonIterator is an implementation of the Iterator interface for singleton values. This allows 'foreach' to be used with arbitrary objects, or even primitive values. The effect of iterating over a singleton value with 'foreach' using this iterator is simply to invoke the loop once with the loop variable set to the singleton value.

`class SingletonIterator : object`

Superclass Tree (in declaration order)

`SingletonIterator`
`object`

Subclass Tree

(none)

Global Objects

(none)

Summary of Properties

`more_ val_`

Summary of Methods

`construct getCurVal getKey getNext isNextAvailable resetIterator`

Properties

`more_` | `misc.t[1999]`

do we have any more values to fetch?

`val_` | `misc.t[1996]`

the singleton value we're "iterating" over

Methods

`construct (val)` | `misc.t[1971]`

construction: save the singleton value that we're "iterating" over

`getCurVal ( )` | `misc.t[1993]`

get the current value

`getKey ( )` | `misc.t[1990]`

get the current key; we have no keys, so use a fake key of nil

`getNext ( )` | `misc.t[1974]`

get the next value

`isNextAvailable ( )` | `misc.t[1984]`

is another item available?

`resetIterator ( )` | `misc.t[1987]`

reset: restore the flag that says the value is available

Adv3Lite Library Reference Manual
Generated on 08/12/2025 from adv3Lite version 2.2.2