ObjectType:iterator
Jump to navigation
Jump to search
Contents
Overview
iterator | |
Defined By | LavishScript |
Inherits | none |
Reduces To | NULL |
Variable Object Type | iterator |
Uses Sub-Types | no |
C/C++ Type | LSIterator * |
An iterator is a special type of object that allows iteration of the contents of another object, or other type of list associated with some object.
The available members and methods for an iterator object depend on the aforementioned contents or list being iterated. For example, a set has only keys, but a collection has keys and values.
Members
- ? Target: The iteration target object (such as a set or collection being iterated). The object type will be the original object type of the object
- ? Key: The current key in the iteration. The object type depends on the data being iterated.
- ? Value: The current value in the iteration. The object type depends on the data being iterated.
- bool IsValid: Determines if the iterator is valid, pointing to a valid iteration target and key/value
- bool Reversible: TRUE if the list being iterated also goes backwards, thus making the Previous method valid
- bool Constant: TRUE if the list will not allow you to set object values (i.e. the values are constant)
- bool RandomAccess: TRUE if the list allows random access (the iterator:Jump method)
Methods
- First: Sets the iterator position to the first element
- Last: Sets the iterator position to the last element
- Next: Sets the iterator position to the next element (continues iteration forward)
- Previous: Sets the iterator position to the previous element (continues iteration backward)
- SetValue[...]: Sets the value at the current iterator position
- Jump[...]: Jumps to a given element
See Also
LavishScript Object Types
- Text
- string - mutablestring - unistring
- Numbers
- byte - float - float64 - int - uint - int64
- Boolean (TRUE/FALSE)
- bool
- Pointers
- boolptr - byteptr - floatptr - float64ptr - intptr - uintptr - int64ptr - rgbptr - stringptr
- Containers
- objectcontainer - array - index - collection - queue - stack - set - variablescope
- JSON
- jsonobject - jsonarray - jsonvaluecontainer - jsonvalue
- Iteration
- iterator - jsoniterator
- Date/Time
- time
- File Handling
- filepath - file - filelist - filelistentry
- Tasks
- lavishmachine - Accessed via the Top-Level Object LMAC
- task - tasklibrary - taskmanager - tasktype - taskpulseargs - elmactaskstate