Qore Programming Language Reference Manual
1.8.0
|
Methods in this pseudo-class can be executed on lists. More...
Public Member Methods | |
bool | complexType () |
returns True if the list has a Hash With Declared Value Type, False if not More... | |
bool | contains (auto arg) |
Returns True if the list contains arg, False if it does not. More... | |
bool | empty () |
Returns True if the list is empty (size = 0), False if not. More... | |
auto | first () |
Returns the first entry in the list. More... | |
AbstractIterator | iterator () |
Returns a ListIterator object for the list. More... | |
string | join (string str) |
Creates a string from the list and a separator string given as an argument. More... | |
auto | last () |
Returns the last entry in the list. More... | |
int | lsize () |
Returns the number of elements in the list. More... | |
AbstractIterator | rangeIterator (auto val) |
Returns a RangeIterator object for the list elements. More... | |
int | size () |
Returns the number of elements in the list. More... | |
bool | sizep () |
Returns True since lists can return a non-zero size. More... | |
int | typeCode () |
Returns Qore::NT_LIST. More... | |
bool | val () |
Returns False if the list is empty (size = 0), True if not. More... | |
Public Member Methods inherited from <value> | |
bool | callp () |
Returns False; this method is reimplemented in other types and will return True if the given expression is a callable value (ie closures or call references) More... | |
bool | complexType () |
returns True if the value has a complex type, False if not More... | |
bool | empty () |
Returns True; this method will be reimplemented in container types where it may return False. More... | |
string | fullType (*bool with_namespaces) |
returns the full type name which differs from the simple type name in case of complex types and objects More... | |
bool | intp () |
Returns False; this method is reimplemented in other types and will return True if the given expression can be converted to an integer. More... | |
AbstractIterator | iterator () |
Returns an iterator object for the value; the default iterator object returned is SingleValueIterator. More... | |
int | lsize () |
Returns 1; the return value of this method should give the list size of the value, which is normally 1 for non-lists (except for NOTHING where the size will be 0) and the number of the elements in the list for lists; this method will be reimplemented in other types where it may return other values. More... | |
int | size () |
Returns zero; this method will be reimplemented in container types where it may return a non-zero value. More... | |
bool | sizep () |
Returns True if the type can return a non-zero size (True for containers including binary objects and strings, False for everything else) More... | |
bool | strp () |
Returns False; this method is reimplemented in other types and will return True if the given expression can be converted to a string. More... | |
bool | toBool () |
Returns the boolean representation of the value; the default is False. More... | |
float | toFloat () |
Returns the floating-point representation of the value; the default is 0.0. More... | |
int | toInt () |
Returns the integer representation of the value; the default is 0. More... | |
number | toNumber () |
Returns the arbitrary-precision numeric representation of the value; the default is 0. More... | |
string | toString () |
Returns the string representation of the value; the default is an empty string. More... | |
string | type () |
Returns the string type for the value. More... | |
int | typeCode () |
Returns the type code for the value. More... | |
bool | val () |
Returns False; this method is reimplemented in other types and will return True if the given expression has a non-empty value. More... | |
Methods in this pseudo-class can be executed on lists.
bool <list>::complexType | ( | ) |
returns True if the list has a Hash With Declared Value Type, False if not
bool <list>::contains | ( | auto | arg | ) |
Returns True if the list contains arg, False if it does not.
This call uses "soft" comparisons (where types may be converted). The computational complexity is O(n)
(n = the length of the list).
arg | any value to check its presence in the list |
bool <list>::empty | ( | ) |
auto <list>::first | ( | ) |
Returns the first entry in the list.
AbstractIterator <list>::iterator | ( | ) |
Returns a ListIterator object for the list.
Creates a string from the list and a separator string given as an argument.
Each element in the list will be converted to a string if necessary to be concatenated to the return value string; additionally if any string argument has a different character encoding than str, then it will be converted to str's character encoding before concatentation to the return value string
str | the separator string |
ENCODING-CONVERSION-ERROR | this exception could be thrown if the string arguments have different character encodings and an error occurs during encoding conversion |
auto <list>::last | ( | ) |
Returns the last entry in the list.
int <list>::lsize | ( | ) |
AbstractIterator <list>::rangeIterator | ( | auto | val | ) |
Returns a RangeIterator object for the list elements.
val | an optional value to be returned instead of the default integer value |
int <list>::size | ( | ) |
Returns the number of elements in the list.
bool <list>::sizep | ( | ) |
Returns True since lists can return a non-zero size.
int <list>::typeCode | ( | ) |
bool <list>::val | ( | ) |
Returns False if the list is empty (size = 0), True if not.
The opposite of <list>::empty()