An array collection represents an array of data type elements, each of which is associated with a unique key value. More...
Public Member Functions | |
_.Library.String | Find (_.Library.String element, _.Library.String key) |
An array collection represents an array of data type elements, each of which is associated with a unique key value. More... | |
_.Library.String | GetAt (_.Library.String key) |
Finds and returns the value of the element associated with key. More... | |
_.Library.String | GetNext (_.Library.String key) |
Finds and returns the value of the element at the location after key More... | |
_.Library.String | GetPrevious (_.Library.String key) |
Finds and returns the value of the element at the location before key More... | |
_.Library.String | RemoveAt (_.Library.String key) |
Removes the element associated with key in the array. More... | |
_.Library.Status | SetAt (_.Library.String element, _.Library.String key) |
Sets the value of the element associated with key to element. More... | |
![]() | |
_.Library.Status | Clear () |
Clears the contents of the array. More... | |
_.Library.Integer | Count () |
Returns the number of elements contained in the array. | |
_.Library.Boolean | Define (_.Library.String key) |
This method is deprecated. More... | |
_.Library.String | Find (_.Library.RawString element, _.Library.String key) |
Starting from, but not including, location key,. More... | |
_.Library.Boolean | IsDefined (_.Library.String key) |
Returns true (1) if a value is defined at location key,. More... | |
_.Library.String | Previous (_.Library.String key) |
Finds and returns the key value of the element at the location preceding key in the array. More... | |
_.Library.Status | SetAt (_.Library.RawString element, _.Library.String key) |
Sets the value of the element associated with key to element. More... | |
![]() | |
_.Library.RawString | GetAt (_.Library.RawString key) |
Definition of iterator methods that all our collections classes use to ensure consistency. More... | |
_.Library.RawString | GetNext (_.Library.RawString key) |
Finds and returns the value of the element at the location after key More... | |
_.Library.RawString | Next (_.Library.RawString key) |
Finds and returns the key value of the element at the location following key in the iteration. More... | |
Additional Inherited Members | |
![]() | |
_.Library.Status | BuildValueArray (_.Library.Binary serialized, _.Library.Binary array) |
Constructs array(key)=value for each element in the serialval value. More... | |
_.Library.String | LogicalToOdbc (_.Library.String val, _.Library.String delim, _.Library.String class, _.Library.String method) |
Converts the serial state of this array object to a delimited string. More... | |
_.Library.String | OdbcToLogical (_.Library.String val, _.Library.String delim, _.Library.String class, _.Library.String method) |
Converts the value of an incoming delimited string to a serialized state. More... | |
![]() | |
ELEMENTTYPE = None | |
The type (class name) of the elements stored in the collection. | |
An array collection represents an array of data type elements, each of which is associated with a unique key value.
Keys can have any value, string or numeric.
The <CLASS>Collection.AbstractArrayOfDT</CLASS> class provides the basic functionality of the
various array collection classes.
The non-abstract array classes derived from <CLASS>AbstractArrayOfDT</CLASS> include <CLASS>ArrayOfDataTypes</CLASS>, <CLASS>ArrayOfObjects</CLASS>, <CLASS>Collection.ArrayOfObj</CLASS> and <CLASS>Collection.ArrayOfDT</CLASS>.
You can use an array object as follows:
Set arr=##class(ArrayOfDataTypes).New()
; place items into the array Do arr.SetAt("red","color") Do arr.SetAt("large","size") Do arr.SetAt("expensive","price")
; iterate over contents of array Set key="" For Set value=arr.GetNext(.key) Quit:key="" Write key,":",value,!
_.Library.String Find | ( | _.Library.String | element, |
_.Library.String | key | ||
) |
An array collection represents an array of data type elements, each of which is associated with a unique key value.
Keys can have any value, string or numeric.
The <CLASS>Collection.AbstractArrayOfDT</CLASS> class provides the basic functionality of the
various array collection classes.
The non-abstract array classes derived from <CLASS>AbstractArrayOfDT</CLASS> include <CLASS>ArrayOfDataTypes</CLASS>, <CLASS>ArrayOfObjects</CLASS>, <CLASS>Collection.ArrayOfObj</CLASS> and <CLASS>Collection.ArrayOfDT</CLASS>.
You can use an array object as follows:
Set arr=##class(ArrayOfDataTypes).New()
; place items into the array Do arr.SetAt("red","color") Do arr.SetAt("large","size") Do arr.SetAt("expensive","price")
; iterate over contents of array Set key="" For Set value=arr.GetNext(.key) Quit:key="" Write key,":",value,!
Starting from, but not including, location key,
finds the next element in the array with value equal to element.
If key is a null string (""), the search starts at the beginning of the array.
Find returns the key associated with the found element or null string ("") if no element is found.
Reimplemented in ArrayOfDT.
_.Library.String GetAt | ( | _.Library.String | key | ) |
Finds and returns the value of the element associated with key.
GetAt returns the value of the element associated with key or null string ("") if no element is found.
Reimplemented in ArrayOfDT.
_.Library.String GetNext | ( | _.Library.String | key | ) |
Finds and returns the value of the element at the location after key
in the array. If key is a null string (""), it returns the value of the first element in the array.
The value of key, which is passed by reference, is updated to the key value of the returned element or null string ("") if key is at the end of the array.
Reimplemented in ArrayOfDT.
_.Library.String GetPrevious | ( | _.Library.String | key | ) |
Finds and returns the value of the element at the location before key
in the array. If key is a null string (""), it returns the value of the last element in the array.
The value of key, which is passed by reference, is updated to the key value of the returned element or null string ("") if key is at the beginning of the array.
Reimplemented from AbstractArray.
Reimplemented in ArrayOfDT.
_.Library.String RemoveAt | ( | _.Library.String | key | ) |
Removes the element associated with key in the array.
RemoveAt returns the value of the removed element or null string ("") if no element was removed.
Reimplemented from AbstractArray.
Reimplemented in ArrayOfDT.
_.Library.Status SetAt | ( | _.Library.String | element, |
_.Library.String | key | ||
) |
Sets the value of the element associated with key to element.
Returns a <CLASS>Status</CLASS> value indicating success or failure.
Reimplemented in ArrayOfDT.