Qore Programming Language Reference Manual
0.8.7
|
Methods in this pseudo-class can be executed on hash values. More...
Public Member Functions | |
HashListIterator | contextIterator () |
Returns a HashListIterator object for the hash. | |
bool | empty () |
Returns True if the hash has no keys, False if it does. | |
*string | firstKey () |
Returns the first key name in the hash or NOTHING if the hash has no keys. | |
any | firstValue () |
Returns the value assigned to the first key in the hash if any or NOTHING if the hash has no keys. | |
bool | hasKey (softstring key) |
Returns True if the key exists in the hash (may or may not be assigned a value), False if not. | |
bool | hasKeyValue (softstring key) |
Returns True if the key exists and is assigned to a value, False if not. | |
AbstractIterator | iterator () |
Returns a HashIterator object for the hash. | |
HashKeyIterator | keyIterator () |
Returns a HashKeyIterator object for the hash. | |
list | keys () |
Returns a list of key names of the hash. | |
*string | lastKey () |
Returns the last key name in the hash or NOTHING if the hash has no keys. | |
any | lastValue () |
Returns the value assigned to the last key in the hash if any or NOTHING if the hash has no keys. | |
HashPairIterator | pairIterator () |
Returns a HashPairIterator object for the hash. | |
int | size () |
Returns the number of keys in the hash. | |
int | typeCode () |
Returns Qore::NT_HASH. | |
bool | val () |
Returns False if the hash has no keys, True if it does. | |
list | values () |
Returns a list of values of the hash. | |
![]() | |
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) | |
bool | empty () |
Returns True; this method will be reimplemented in container types where it may return False. | |
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. | |
AbstractIterator | iterator () |
Returns an iterator object for the value; the default iterator object returned is SingleValueIterator. | |
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. | |
int | size () |
Returns zero; this method will be reimplemented in container types where it may return a non-zero value. | |
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. | |
bool | toBool () |
Returns the boolean representation of the value; the default is False. | |
float | toFloat () |
Returns the floating-point representation of the value; the default is 0.0. | |
int | toInt () |
Returns the integer representation of the value; the default is 0. | |
string | toString () |
Returns the string representation of the value; the default is an empty string. | |
string | type () |
Returns the string type for the value. | |
int | typeCode () |
Returns the type code for the value. | |
bool | val () |
Returns False; this method is reimplemented in other types and will return True if the given expression has a value. | |
Methods in this pseudo-class can be executed on hash values.
HashListIterator <hash>::contextIterator | ( | ) |
Returns a HashListIterator object for the hash.
bool <hash>::empty | ( | ) |
*string <hash>::firstKey | ( | ) |
Returns the first key name in the hash or NOTHING if the hash has no keys.
any <hash>::firstValue | ( | ) |
Returns the value assigned to the first key in the hash if any or NOTHING if the hash has no keys.
bool <hash>::hasKey | ( | softstring | key | ) |
Returns True if the key exists in the hash (may or may not be assigned a value), False if not.
key | the key name to check |
bool <hash>::hasKeyValue | ( | softstring | key | ) |
Returns True if the key exists and is assigned to a value, False if not.
key | the key name to check |
AbstractIterator <hash>::iterator | ( | ) |
Returns a HashIterator object for the hash.
HashKeyIterator <hash>::keyIterator | ( | ) |
Returns a HashKeyIterator object for the hash.
list <hash>::keys | ( | ) |
Returns a list of key names of the hash.
*string <hash>::lastKey | ( | ) |
Returns the last key name in the hash or NOTHING if the hash has no keys.
any <hash>::lastValue | ( | ) |
Returns the value assigned to the last key in the hash if any or NOTHING if the hash has no keys.
HashPairIterator <hash>::pairIterator | ( | ) |
Returns a HashPairIterator object for the hash.
int <hash>::size | ( | ) |
Returns the number of keys in the hash.
The opposite of <hash>::val()
int <hash>::typeCode | ( | ) |
Returns Qore::NT_HASH.
bool <hash>::val | ( | ) |
Returns False if the hash has no keys, True if it does.
The opposite of <hash>::empty()
list <hash>::values | ( | ) |
Returns a list of values of the hash.