Qore Programming Language Reference Manual 2.0.0
|
This class an iterator class for objects. More...
#include <QC_ObjectReverseIterator.dox.h>
Public Member Methods | |
constructor (object o) | |
Creates the object iterator object. | |
constructor () | |
Creates an empty iterator object. | |
copy () | |
Creates a copy of the ObjectReverseIterator object, iterating the same object as the original and in the same position. | |
bool | first () |
returns True if on the last element of the object | |
bool | last () |
returns True if on the first element of the object | |
bool | next () |
Moves the current position to the previous element in the object; 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 object if the object is not empty. | |
bool | prev () |
Moves the current position to the next element in the object; 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 object if the object is not empty. | |
Public Member Methods inherited from Qore::ObjectIterator | |
constructor (object o) | |
Creates the object iterator object. | |
constructor () | |
Creates an empty object iterator object. | |
copy () | |
Creates a copy of the ObjectIterator object, iterating the same object as the original and in the same position. | |
Public Member Methods inherited from Qore::HashIterator | |
constructor (hash< auto > h) | |
Creates the hash iterator object. | |
constructor () | |
Creates an empty hash iterator object. | |
copy () | |
Creates a copy of the HashIterator object, iterating the same object as the original and in the same position. | |
bool | empty () |
returns True if the hash is empty; False if not | |
bool | first () |
returns True if on the first element of the hash | |
string | getKey () |
returns the current key value or throws an INVALID-ITERATOR exception if the iterator is invalid | |
auto | getKeyValue () |
returns the current value of the current hash key being iterated or throws an INVALID-ITERATOR exception if the iterator is invalid | |
auto | getValue () |
returns the current key value or throws an INVALID-ITERATOR exception if the iterator is invalid | |
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 | |
bool | last () |
returns True if on the last element of the hash | |
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. | |
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. | |
reset () | |
Reset the iterator instance to its initial state. | |
bool | valid () |
returns True if the iterator is currently pointing at a valid element, False if not | |
Public Member Methods inherited from Qore::AbstractBidirectionalIterator | |
abstract bool | prev () |
Moves the current position to the previous element; returns False if there are no more elements. | |
Public Member Methods inherited from Qore::AbstractIterator | |
abstract auto | getValue () |
returns the current value | |
abstract bool | next () |
Moves the current position to the next element; returns False if there are no more elements. | |
abstract bool | valid () |
returns True if the iterator is currently pointing at a valid element, False if not | |
Public Member Methods inherited from Qore::AbstractQuantifiedIterator | |
abstract bool | empty () |
returns True if the object to iterate is empty; False if not | |
abstract bool | first () |
returns True if on the first element | |
abstract bool | last () |
returns True if on the last element | |
This class an iterator class for objects.
Call ObjectReverseIterator::next() to iterate through the object in reverse order; do not use the iterator if ObjectReverseIterator::next() returns False. An object can be iterated in reverse order by calling ObjectReverseIterator::prev() instead of ObjectReverseIterator::next()
ITERATOR-THREAD-ERROR
to be thrown.Qore::ObjectReverseIterator::constructor | ( | ) |
Creates an empty iterator object.
Qore::ObjectReverseIterator::constructor | ( | object | o | ) |
Creates the object iterator object.
o | the object to iterate |
Qore::ObjectReverseIterator::copy | ( | ) |
Creates a copy of the ObjectReverseIterator object, iterating the same object as the original and in the same position.
bool Qore::ObjectReverseIterator::first | ( | ) |
bool Qore::ObjectReverseIterator::last | ( | ) |
bool Qore::ObjectReverseIterator::next | ( | ) |
Moves the current position to the previous element in the object; 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 object if the object is not empty.
This method will return True again after it returns False once if the object is not empty, otherwise it will always return False. The iterator object should not be used after this method returns False
ITERATOR-THREAD-ERROR | this exception is thrown if this method is called from any thread other than the thread that created the object |
bool Qore::ObjectReverseIterator::prev | ( | ) |
Moves the current position to the next element in the object; 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 object if the object is not empty.
This method will return True again after it returns False once if object is not empty, otherwise it will always return False. The iterator object should not be used after this method returns False
ITERATOR-THREAD-ERROR | this exception is thrown if this method is called from any thread other than the thread that created the object |