\hypertarget{class_qore_1_1_hash_list_reverse_iterator}{}\doxysection{Qore\+::Hash\+List\+Reverse\+Iterator Class Reference} \label{class_qore_1_1_hash_list_reverse_iterator}\index{Qore::HashListReverseIterator@{Qore::HashListReverseIterator}} This class a reverse iterator class for hashes of lists as returned by \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a05b1d0d126d815b2d7578e5ce8b9a0de}{Qore\+::\+SQL\+::\+Datasource\+::select()}} and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_acafe45a0cf883bc51917e7a0bb8e77fd}{Qore\+::\+SQL\+::\+Datasource\+Pool\+::select()}}, both of which return hashes with keys giving column names where the key values are lists of column values. Inheritance diagram for Qore\+::Hash\+List\+Reverse\+Iterator\+: % FIG 0 \doxysubsection*{Public Member Functions} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a0f10d66d5ff1a71af9acd5bccdffb14c}{constructor}} (\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ h) \begin{DoxyCompactList}\small\item\em Creates the hash list iterator object. \end{DoxyCompactList}\item \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a52f5e1dc8737870b0d83b5dd99cdb787}{constructor}} () \begin{DoxyCompactList}\small\item\em Creates an empty hash list iterator object. \end{DoxyCompactList}\item \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a676c9db5c5063ad2ea85bd1487daa00f}{copy}} () \begin{DoxyCompactList}\small\item\em Creates a copy of the \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator}{Hash\+List\+Reverse\+Iterator}} object, iterating the same object as the original and in the same position. \end{DoxyCompactList}\item bool \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a3dfbb6e8ea42a650bd063403d4efa3be}{first}} () \begin{DoxyCompactList}\small\item\em returns \mbox{\hyperlink{basic_data_types_True}{True}} if on the first element being iterated in the list (ie the last element in the list) \end{DoxyCompactList}\item bool \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_aae133b11d7e847766be7aff7face0fa0}{last}} () \begin{DoxyCompactList}\small\item\em returns \mbox{\hyperlink{basic_data_types_True}{True}} if on the last element being iterated in the list (ie the first element in the list) \end{DoxyCompactList}\item auto \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a91644969a5b56f4159b00bcf4e7017a1}{member\+Gate}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} key) \begin{DoxyCompactList}\small\item\em This method allows the iterator to be dereferenced directly as a hash for the current row being iterated, as member\+Gate methods are called implicitly when an unknown member is accessed from outside the class. \end{DoxyCompactList}\item bool \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}{next}} () \begin{DoxyCompactList}\small\item\em Moves the current position to the next element in the result list; returns \mbox{\hyperlink{basic_data_types_False}{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 list if the list is not empty. \end{DoxyCompactList}\item bool \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a3bc985ec634ecd6d3501ad27e5c1461c}{prev}} () \begin{DoxyCompactList}\small\item\em Moves the current position to the previous element in the result list; returns \mbox{\hyperlink{basic_data_types_False}{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 list if the list is not empty. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection{Detailed Description} This class a reverse iterator class for hashes of lists as returned by \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a05b1d0d126d815b2d7578e5ce8b9a0de}{Qore\+::\+SQL\+::\+Datasource\+::select()}} and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_acafe45a0cf883bc51917e7a0bb8e77fd}{Qore\+::\+SQL\+::\+Datasource\+Pool\+::select()}}, both of which return hashes with keys giving column names where the key values are lists of column values. Like the \mbox{\hyperlink{class_qore_1_1_hash_list_iterator}{Qore\+::\+Hash\+List\+Iterator}} class, this class can be used as a more flexible alternative to the \mbox{\hyperlink{statements_context}{context statement}}, except this class will iterate the result list in reverse order. Call \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}{Hash\+List\+Reverse\+Iterator\+::next()}} to iterate through the lists of column values assigned to each hash key in reverse order; do not use the iterator if \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}{Hash\+List\+Reverse\+Iterator\+::next()}} returns \mbox{\hyperlink{basic_data_types_False}{False}}. A result list can be iterated in reverse order by calling \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a3bc985ec634ecd6d3501ad27e5c1461c}{Hash\+List\+Reverse\+Iterator\+::prev()}} instead of \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}{Hash\+List\+Reverse\+Iterator\+::next()}} \begin{DoxyParagraph}{Example\+: Hash\+List\+Reverse\+Iterator basic usge} \begin{DoxyCode}{0} \DoxyCodeLine{hash data = \{} \DoxyCodeLine{ \textcolor{stringliteral}{"{}column1"{}}: (1, 2, 3,),} \DoxyCodeLine{ \textcolor{stringliteral}{"{}column2"{}}: (\textcolor{stringliteral}{"{}a"{}}, \textcolor{stringliteral}{"{}b"{}}, \textcolor{stringliteral}{"{}c"{}},),} \DoxyCodeLine{ \textcolor{stringliteral}{"{}column3"{}}: \textcolor{stringliteral}{"{}constant"{}},} \DoxyCodeLine{\};} \DoxyCodeLine{} \DoxyCodeLine{HashListReverseIterator it(data);} \DoxyCodeLine{\textcolor{keywordflow}{while} (it.next()) \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}iter \%d: getValue: \%y; getKeyValue('column1'): \%y\(\backslash\)n"{}},} \DoxyCodeLine{ it.index(), it.getValue(), it.getKeyValue(\textcolor{stringliteral}{'column1'}));} \DoxyCodeLine{\}} \DoxyCodeLine{} \DoxyCodeLine{iter 0: getValue: \{column1: 3, column2: \textcolor{stringliteral}{"{}c"{}}, column3: \textcolor{stringliteral}{"{}constant"{}}\}; getKeyValue(\textcolor{stringliteral}{'column1'}): 3} \DoxyCodeLine{iter 1: getValue: \{column1: 2, column2: \textcolor{stringliteral}{"{}b"{}}, column3: \textcolor{stringliteral}{"{}constant"{}}\}; getKeyValue(\textcolor{stringliteral}{'column1'}): 2} \DoxyCodeLine{iter 2: getValue: \{column1: 1, column2: \textcolor{stringliteral}{"{}a"{}}, column3: \textcolor{stringliteral}{"{}constant"{}}\}; getKeyValue(\textcolor{stringliteral}{'column1'}): 1} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} \begin{DoxyItemize} \item A hash with all non-\/list values will be iterated as if each key value were a single element list \item A hash with mixed lists and single values will have the single values used as the repeating value for every element in the list (as in the above example), however all lists must be of the same size or a runtime exception will be raised \item A hash with empty lists and constants will not be iterated; in this case the constant values will be ignored; values with lists determine the number of times the data structure will be iterated \item In general, the \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator}{Hash\+List\+Reverse\+Iterator}} class is not designed to be accessed from multiple threads; it was created without locking for fast and efficient use when used from a single thread. For methods that would be unsafe to use in another thread, any use of such methods in threads other than the thread where the constructor was called will cause an {\ttfamily ITERATOR-\/\+THREAD-\/\+ERROR} to be thrown. \item \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator}{Hash\+List\+Reverse\+Iterator}} is functionally equivalent to \mbox{\hyperlink{class_qore_1_1_hash_list_iterator}{Hash\+List\+Iterator}}, but the effect of \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}{Hash\+List\+Reverse\+Iterator\+::next()}} and \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a3bc985ec634ecd6d3501ad27e5c1461c}{Hash\+List\+Reverse\+Iterator\+::prev()}} are the opposite of \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a3ceb133242d42f388bdf72ab8f2d5aac}{Hash\+List\+Iterator\+::next()}} and \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a6df21aadae44817005795b3b6190874a}{Hash\+List\+Iterator\+::prev()}}; that is \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}{Hash\+List\+Reverse\+Iterator\+::next()}} will iterate through the hash in reverse order, while \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a3bc985ec634ecd6d3501ad27e5c1461c}{Hash\+List\+Reverse\+Iterator\+::prev()}} iterates in forward order. Additionally the meanings of the return values for \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a3dfbb6e8ea42a650bd063403d4efa3be}{Hash\+List\+Reverse\+Iterator\+::first()}} and \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_aae133b11d7e847766be7aff7face0fa0}{Hash\+List\+Reverse\+Iterator\+::last()}} are swapped in respect to \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_aef0ec0e0df43f4f8f8ba5899a53674d1}{Hash\+List\+Iterator\+::first()}} and \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a1c2d63097f58f35538bb45138262959b}{Hash\+List\+Iterator\+::last()}}. \end{DoxyItemize} \end{DoxyNote} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{class_qore_1_1_hash_list_iterator}{Hash\+List\+Iterator}} \end{DoxySeeAlso} \doxysubsection{Member Function Documentation} \mbox{\Hypertarget{class_qore_1_1_hash_list_reverse_iterator_a52f5e1dc8737870b0d83b5dd99cdb787}\label{class_qore_1_1_hash_list_reverse_iterator_a52f5e1dc8737870b0d83b5dd99cdb787}} \index{Qore::HashListReverseIterator@{Qore::HashListReverseIterator}!constructor@{constructor}} \index{constructor@{constructor}!Qore::HashListReverseIterator@{Qore::HashListReverseIterator}} \doxysubsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily Qore\+::\+Hash\+List\+Reverse\+Iterator\+::constructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Creates an empty hash list iterator object. \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{*hash q = ds.select(\textcolor{stringliteral}{"{}select * from some\_table"{}});} \DoxyCodeLine{HashListReverseIterator i(q);} \end{DoxyCode} \end{DoxyParagraph} \mbox{\Hypertarget{class_qore_1_1_hash_list_reverse_iterator_a0f10d66d5ff1a71af9acd5bccdffb14c}\label{class_qore_1_1_hash_list_reverse_iterator_a0f10d66d5ff1a71af9acd5bccdffb14c}} \index{Qore::HashListReverseIterator@{Qore::HashListReverseIterator}!constructor@{constructor}} \index{constructor@{constructor}!Qore::HashListReverseIterator@{Qore::HashListReverseIterator}} \doxysubsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily Qore\+::\+Hash\+List\+Reverse\+Iterator\+::constructor (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$}]{h }\end{DoxyParamCaption})} Creates the hash list iterator object. \begin{DoxyParams}{Parameters} {\em h} & the hash of lists to iterate\\ \hline \end{DoxyParams} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{HashListReverseIterator i(h);} \end{DoxyCode} \end{DoxyParagraph} \mbox{\Hypertarget{class_qore_1_1_hash_list_reverse_iterator_a676c9db5c5063ad2ea85bd1487daa00f}\label{class_qore_1_1_hash_list_reverse_iterator_a676c9db5c5063ad2ea85bd1487daa00f}} \index{Qore::HashListReverseIterator@{Qore::HashListReverseIterator}!copy@{copy}} \index{copy@{copy}!Qore::HashListReverseIterator@{Qore::HashListReverseIterator}} \doxysubsubsection{\texorpdfstring{copy()}{copy()}} {\footnotesize\ttfamily Qore\+::\+Hash\+List\+Reverse\+Iterator\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Creates a copy of the \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator}{Hash\+List\+Reverse\+Iterator}} object, iterating the same object as the original and in the same position. \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{HashListReverseIterator ni = i.copy();} \end{DoxyCode} \end{DoxyParagraph} \mbox{\Hypertarget{class_qore_1_1_hash_list_reverse_iterator_a3dfbb6e8ea42a650bd063403d4efa3be}\label{class_qore_1_1_hash_list_reverse_iterator_a3dfbb6e8ea42a650bd063403d4efa3be}} \index{Qore::HashListReverseIterator@{Qore::HashListReverseIterator}!first@{first}} \index{first@{first}!Qore::HashListReverseIterator@{Qore::HashListReverseIterator}} \doxysubsubsection{\texorpdfstring{first()}{first()}} {\footnotesize\ttfamily bool Qore\+::\+Hash\+List\+Reverse\+Iterator\+::first (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}} returns \mbox{\hyperlink{basic_data_types_True}{True}} if on the first element being iterated in the list (ie the last element in the list) \begin{DoxyReturn}{Returns} \mbox{\hyperlink{basic_data_types_True}{True}} if on the first element being iterated in the list (ie the last element in the list) \end{DoxyReturn} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{} \DoxyCodeLine{ \textcolor{keywordflow}{if} (i.first())} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}START:\(\backslash\)n"{}});} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} Reimplemented from \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_aef0ec0e0df43f4f8f8ba5899a53674d1}{Qore\+::\+Hash\+List\+Iterator}}. \mbox{\Hypertarget{class_qore_1_1_hash_list_reverse_iterator_aae133b11d7e847766be7aff7face0fa0}\label{class_qore_1_1_hash_list_reverse_iterator_aae133b11d7e847766be7aff7face0fa0}} \index{Qore::HashListReverseIterator@{Qore::HashListReverseIterator}!last@{last}} \index{last@{last}!Qore::HashListReverseIterator@{Qore::HashListReverseIterator}} \doxysubsubsection{\texorpdfstring{last()}{last()}} {\footnotesize\ttfamily bool Qore\+::\+Hash\+List\+Reverse\+Iterator\+::last (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}} returns \mbox{\hyperlink{basic_data_types_True}{True}} if on the last element being iterated in the list (ie the first element in the list) \begin{DoxyReturn}{Returns} \mbox{\hyperlink{basic_data_types_True}{True}} if on the last element being iterated in the list (ie the first element in the list) \end{DoxyReturn} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{} \DoxyCodeLine{ \textcolor{keywordflow}{if} (i.last())} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}END.\(\backslash\)n"{}});} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} Reimplemented from \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a1c2d63097f58f35538bb45138262959b}{Qore\+::\+Hash\+List\+Iterator}}. \mbox{\Hypertarget{class_qore_1_1_hash_list_reverse_iterator_a91644969a5b56f4159b00bcf4e7017a1}\label{class_qore_1_1_hash_list_reverse_iterator_a91644969a5b56f4159b00bcf4e7017a1}} \index{Qore::HashListReverseIterator@{Qore::HashListReverseIterator}!memberGate@{memberGate}} \index{memberGate@{memberGate}!Qore::HashListReverseIterator@{Qore::HashListReverseIterator}} \doxysubsubsection{\texorpdfstring{memberGate()}{memberGate()}} {\footnotesize\ttfamily auto Qore\+::\+Hash\+List\+Reverse\+Iterator\+::member\+Gate (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{key }\end{DoxyParamCaption})} This method allows the iterator to be dereferenced directly as a hash for the current row being iterated, as member\+Gate methods are called implicitly when an unknown member is accessed from outside the class. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em key} & the column name for the value to retrieve\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} the current column value of the given row; the key value returned will be equal to the current list element for the given key, or, if the source key value is a constant (i.\+e. non-\/list) value, then this constant value will be returned directly \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}\%d: value: \%y"{}}, i.index(), i.value);} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em ITERATOR-\/\+THREAD-\/\+ERROR} & this exception is thrown if this method is called from any thread other than the thread that created the object \\ \hline {\em INVALID-\/\+ITERATOR} & the iterator is not pointing at a valid element \\ \hline {\em HASHLISTITERATOR-\/\+ERROR} & the hash key given has a value that is a list with a size that does not match the expected list size\\ \hline \end{DoxyExceptions} \begin{DoxyNote}{Note} equivalent to \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_addbc0527f145119b4766f40636deb7fd}{Hash\+List\+Iterator\+::get\+Key\+Value()}} when called explicitly \end{DoxyNote} \mbox{\Hypertarget{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}\label{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}} \index{Qore::HashListReverseIterator@{Qore::HashListReverseIterator}!next@{next}} \index{next@{next}!Qore::HashListReverseIterator@{Qore::HashListReverseIterator}} \doxysubsubsection{\texorpdfstring{next()}{next()}} {\footnotesize\ttfamily bool Qore\+::\+Hash\+List\+Reverse\+Iterator\+::next (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}} Moves the current position to the next element in the result list; returns \mbox{\hyperlink{basic_data_types_False}{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 list if the list is not empty. This method will return \mbox{\hyperlink{basic_data_types_True}{True}} again after it returns \mbox{\hyperlink{basic_data_types_False}{False}} once if list is not empty, otherwise it will always return \mbox{\hyperlink{basic_data_types_False}{False}}. The iterator object should not be used after this method returns \mbox{\hyperlink{basic_data_types_False}{False}} \begin{DoxyReturn}{Returns} \mbox{\hyperlink{basic_data_types_False}{False}} if there are no more elements in the result list (in which case the iterator object is invalid and should not be used); \mbox{\hyperlink{basic_data_types_True}{True}} if successful (meaning that the iterator object is valid) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} + row \%d: \%y\(\backslash\)n"{}}, i.index(), i.getValue());} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em ITERATOR-\/\+THREAD-\/\+ERROR} & this exception is thrown if this method is called from any thread other than the thread that created the object \\ \hline \end{DoxyExceptions} Reimplemented from \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a3ceb133242d42f388bdf72ab8f2d5aac}{Qore\+::\+Hash\+List\+Iterator}}. \mbox{\Hypertarget{class_qore_1_1_hash_list_reverse_iterator_a3bc985ec634ecd6d3501ad27e5c1461c}\label{class_qore_1_1_hash_list_reverse_iterator_a3bc985ec634ecd6d3501ad27e5c1461c}} \index{Qore::HashListReverseIterator@{Qore::HashListReverseIterator}!prev@{prev}} \index{prev@{prev}!Qore::HashListReverseIterator@{Qore::HashListReverseIterator}} \doxysubsubsection{\texorpdfstring{prev()}{prev()}} {\footnotesize\ttfamily bool Qore\+::\+Hash\+List\+Reverse\+Iterator\+::prev (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}} Moves the current position to the previous element in the result list; returns \mbox{\hyperlink{basic_data_types_False}{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 list if the list is not empty. This method will return \mbox{\hyperlink{basic_data_types_True}{True}} again after it returns \mbox{\hyperlink{basic_data_types_False}{False}} once if the list is not empty, otherwise it will always return \mbox{\hyperlink{basic_data_types_False}{False}}. The iterator object should not be used after this method returns \mbox{\hyperlink{basic_data_types_False}{False}} \begin{DoxyReturn}{Returns} \mbox{\hyperlink{basic_data_types_False}{False}} if there are no more elements in the result list (in which case the iterator object is invalid and should not be used); \mbox{\hyperlink{basic_data_types_True}{True}} if successful (meaning that the iterator object is valid) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{keywordflow}{while} (i.prev()) \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} + row \%d: \%y\(\backslash\)n"{}}, i.index(), i.getValue());} \DoxyCodeLine{\}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em ITERATOR-\/\+THREAD-\/\+ERROR} & this exception is thrown if this method is called from any thread other than the thread that created the object \\ \hline \end{DoxyExceptions} Reimplemented from \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a6df21aadae44817005795b3b6190874a}{Qore\+::\+Hash\+List\+Iterator}}.