Qore Programming Language Reference Manual
1.7.0
|
This class a basic iterator class for objects. More...
Public Member Methods | |
constructor (object o) | |
Creates the object iterator object. More... | |
constructor () | |
Creates an empty object iterator object. More... | |
copy () | |
Creates a copy of the ObjectIterator object, iterating the same object as the original and in the same position. More... | |
Public Member Methods inherited from Qore::HashIterator | |
constructor (hash< auto > h) | |
Creates the hash iterator object. More... | |
constructor () | |
Creates an empty hash iterator object. More... | |
copy () | |
Creates a copy of the HashIterator object, iterating the same object as the original and in the same position. More... | |
bool | empty () |
returns True if the hash is empty; False if not More... | |
bool | first () |
returns True if on the first element of the hash More... | |
string | getKey () |
returns the current key value or throws an INVALID-ITERATOR exception if the iterator is invalid More... | |
auto | getKeyValue () |
returns the current value of the current hash key being iterated or throws an INVALID-ITERATOR exception if the iterator is invalid More... | |
auto | getValue () |
returns the current key value or throws an INVALID-ITERATOR exception if the iterator is invalid More... | |
hash< auto > | getValuePair () |
returns a hash with the current key and value (a hash with 2 keys: "key" and "value" ) or throws an INVALID-ITERATOR exception if the iterator is invalid More... | |
bool | last () |
returns True if on the last element of the hash More... | |
bool | next () |
Moves the current position to the next element in the hash; returns False if there are no more elements; if the iterator is not pointing at a valid element before this call, the iterator will be positioned on the first element in the hash if the hash is not empty. More... | |
bool | prev () |
Moves the current position to the previous element in the hash; returns False if there are no more elements; if the iterator is not pointing at a valid element before this call, the iterator will be positioned on the last element in the hash if the hash is not empty. More... | |
reset () | |
Reset the iterator instance to its initial state. More... | |
bool | valid () |
returns True if the iterator is currently pointing at a valid element, False if not More... | |
This class a basic iterator class for objects.
Call ObjectIterator::next() to iterate through the object; do not use the iterator if ObjectIterator::next() returns False. An object can be iterated in reverse order by calling ObjectIterator::prev() instead of ObjectIterator::next()
ITERATOR-THREAD-ERROR
to be thrown.Qore::ObjectIterator::constructor | ( | ) |
Creates an empty object iterator object.
Qore::ObjectIterator::constructor | ( | object | o | ) |
Creates the object iterator object.
o | the object to iterate |
Qore::ObjectIterator::copy | ( | ) |
Creates a copy of the ObjectIterator object, iterating the same object as the original and in the same position.