Skip to main content

%Collection.ArrayOfDT

Class %Collection.ArrayOfDT Extends (%Collection.AbstractArrayOfDT, Super) [ Inheritance = right, System = 2 ]

For information on this class, see Working with Collections.

The %Collection.ArrayOfDataTypes class represents an array of literal (i.e., data type) elements, each of which is associated with a unique key value. Keys can have any value, string or numeric. These %Collection classes can only be used when you have a collection property of another object as they rely on storing the data inside the parent object, they cannot be used as 'standalone' collections, for this use the %ArrayOfDataTypes.

Methods

Count

Method Count() As %Integer

Returns the number of elements contained in the array.

IsDefined

Method IsDefined(key As %String) As %Boolean [ CodeMode = expression ]

Returns true (1) if a value is defined at location key, otherwise false (0).

Define

Method Define(key As %String) As %Boolean [ CodeMode = expression, Deprecated ]

This method is deprecated.

Please use IsDefined instead.

Find

Method Find(element As %String, key As %String) As %String

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.

GetAt

Method GetAt(key As %String = "") As %String

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.

GetNext

Method GetNext(ByRef key As %String) As %String

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.

GetPrevious

Method GetPrevious(ByRef key As %String) As %String

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.

Next

Method Next(key As %String = "") As %String [ CodeMode = expression ]

Finds and returns the key value of the element at the location following key in the array. If key is a null string (""), then Next returns the key value for the first element in the array.

Previous

Method Previous(key As %String = "") As %String [ CodeMode = expression ]

Finds and returns the key value of the element at the location preceding key in the array. If key is a null string (""), then Previous returns the key value for the last element in the array.

RemoveAt

Method RemoveAt(key As %String) As %String

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.

SetAt

Method SetAt(element As %String, key As %String) As %Status

Sets the value of the element associated with key to element.

Returns a %Status value indicating success or failure.

Serialize

Method Serialize(force As %Integer = 0) As %String(MAXLEN="")

Serialize() constructs a serialized form of the collection as a string

DeSerialize

Method DeSerialize(serialized As %String(MAXLEN="")) As %Status

LogicalToDisplay

ClassMethod LogicalToDisplay(val As %String = "", delim As %String = {$c(13,10)}, class As %String = "", method As %String = "") As %String

Converts the serial state of this array object to a delimited string using delim as a delimiter.

DisplayToLogical

ClassMethod DisplayToLogical(val As %String = "", delim As %String = {$c(13,10)}, class As %String = "", method As %String = "") As %String

Converts the value of an incoming delimited string to a serialized state using delim as a delimiter.