Qore SqlUtil Module Reference  1.6
SqlUtil::AbstractListContainer Class Referenceabstract

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

Inherits Serializable.

Public Member Methods

 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 More...
 
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. More...
 
int size ()
 Returns the number of elements in the contained list. More...
 
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. More...
 

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)
pure virtual

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
ithe index of the element to access
Returns
the value of the given index in the contained list if it exists
Exceptions
ELEMENT-ERRORthe 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