All Classes Namespaces Functions Variables Groups Pages
Qore::AbstractQuantifiedIterator Class Referenceabstract

This class defines an abstract interface for iterators where the size of the object being iterated is known in advance. More...

Inheritance diagram for Qore::AbstractQuantifiedIterator:
[legend]

## Public Member Functions

abstract bool | empty ()
| returns True if the object to iterate is empty; False if not More...
abstract bool | first ()
| returns True if on the first element More...
abstract bool | last ()
| returns True if on the last element More...
Public Member Functions inherited from Qore::AbstractIterator
abstract any | getValue ()
| returns the current value More...
abstract bool | next ()
| Moves the current position to the next element; returns False if there are no more elements. More...
abstract bool | valid ()
| returns True if the iterator is currently pointing at a valid element, False if not More...

## Detailed Description

This class defines an abstract interface for iterators where the size of the object being iterated is known in advance.

## Member Function Documentation

abstract bool Qore::AbstractQuantifiedIterator::empty | ( |  | ) |

pure virtual

returns True if the object to iterate is empty; False if not

Returns
  True if the object to iterate is empty; False if not

Example:
  if ($i.empty())
  printf("object is empty\n");

Implemented in Qore::HashListIterator, Qore::HashIterator, Qore::ListHashIterator, and Qore::ListIterator.

abstract bool Qore::AbstractQuantifiedIterator::first | ( |  | ) |

pure virtual

returns True if on the first element

Returns
  True if on the first element

Example:
  while ($i.next()) {
  if ($i.first())
  printf("START:\n");
  }

Implemented in Qore::HashListIterator, Qore::HashIterator, Qore::ObjectReverseIterator, Qore::HashListReverseIterator, Qore::ListHashIterator, Qore::ListIterator, Qore::HashReverseIterator, Qore::ListHashReverseIterator, and Qore::ListReverseIterator.

abstract bool Qore::AbstractQuantifiedIterator::last | ( |  | ) |

pure virtual

returns True if on the last element

Returns
  True if on the last element

Example:
  while ($i.next()) {
  if ($i.last())
  printf("END.\n");
  }

Implemented in Qore::HashListIterator, Qore::HashIterator, Qore::ListHashIterator, Qore::ListIterator, Qore::ObjectReverseIterator, Qore::HashListReverseIterator, Qore::HashReverseIterator, Qore::ListHashReverseIterator, and Qore::ListReverseIterator.