Loading...
Searching...
No Matches
SqlUtil::AbstractListContainer Class Reference

abstract container class that throws an exception if an unknown key is accessed More...

`#include <SqlUtil.qm.dox.h>`

## Public Member Functions

| add (auto val)
| adds the given value to the list
| constructor (softlist nl)
| creates the object with the list<auto> argument passed
bool | empty ()
| returns True if the container is empty, False if not
abstract auto | get (softint i)
| returns the value of the given element in the contained list if it exists, otherwise throws an `ELEMENT-ERROR` exception
abstract string | getElementName ()
| must return the name of the contained element
list< auto > | getList ()
| returns the list contained by this object
Qore::ListIterator | iterator ()
| Returns a ListIterator object for the contained list.
int | size ()
| Returns the number of elements in the contained list.
auto | take (int i)
| removes the given element from the contained list and returns the value
bool | val ()
| Returns False if the contained list is empty, True if not.

## Detailed Description

abstract container class that throws an exception if an unknown key is accessed

## Member Function Documentation

## get()

abstract auto SqlUtil::AbstractListContainer::get | ( | softint | i | ) |

returns the value of the given element in the contained list if it exists, otherwise throws an `ELEMENT-ERROR` exception

Example:
  auto v = c.get(2);

Parameters

  i | the index of the element to access

Returns
  the value of the given index in the contained list if it exists

Exceptions

  ELEMENT-ERROR | the given element does not exist in the contained list

## iterator()

Qore::ListIterator SqlUtil::AbstractListContainer::iterator | ( |  | ) |

Returns a ListIterator object for the contained list.

Example:
  map printf("+ %s: %y\n", $1), h.iterator();

Returns
  a HashIterator object for the contained hash

## size()

int SqlUtil::AbstractListContainer::size | ( |  | ) |

Returns the number of elements in the contained list.

Example:
  int num = l.size();

Returns
  the number of elements in the contained list

## val()

bool SqlUtil::AbstractListContainer::val | ( |  | ) |

Returns False if the contained list is empty, True if not.

Example:
  bool b = l.val();

The opposite of empty()

Returns
  False if the contained list is empty, True if not