Skip to main content

%Library.ListOfDataTypes

Class %Library.ListOfDataTypes Extends (%Collection.AbstractListOfDT, %SerialObject) [ ClassType = serial, OdbcType = VARCHAR, StorageStrategy = Custom, System = 2 ]

For information on this class, see Working with Collections.

The %ListOfDataTypes class represents a list of literal (i.e., data type) values. each of which is associated with a numeric position in the list. The first element in the list is stored at position 1.

Refer to %Collection.AbstractList for a description of the various array methods. These classes can be used 'standalone' to store a collection.

Parameters

ELEMENTTYPE;

Parameter ELEMENTTYPE;

The type (classname:propertyname) of the elements stored in the collection.

Properties

ElementType

Property ElementType As %RawString [ InitialExpression = {..#ELEMENTTYPE} ];

The type (classname:propertyname) of the elements stored in the collection.

Data

Property Data As %RawString [ MultiDimensional ];

Data is a private property used to hold the contents of the list.

Size

Property Size As %Integer [ InitialExpression = 0 ];

Size is the number of elements contained in the list.

Methods

SizeSet

Method SizeSet(newvalue As %Integer) As %Status [ Private ]

Clear

Method Clear() As %Status

Clears the contents of the list.

Returns a %Status value indicating success or failure.

Count

Method Count() As %Integer [ CodeMode = expression, Final ]

Returns the number of elements contained in the list.

Find

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

Starting from, and including, position key, Find finds the next element in the list with value equal to element. If key is a null string, Find starts at the beginning of the list.

Find returns the position of the found element or null string ("") if no element was found.

GetNext

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

Finds and returns the value of the element at the position after key in the list. If key is a null string (""), it returns the value of the first element in the list.

The value of key, which is passed by reference, is updated to the position value of the returned element or null string ("") if key is at the end of the list.

GetPrevious

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

Finds and returns the value of the element at the position before key in the list. If key is a null string (""), it returns the value of the last element in the list.

The value of key, which is passed by reference, is updated to the position value of the returned element or null string ("") if key is at the beginning of the list.

Insert

Method Insert(element As %String) As %Status

Inserts an element with value element at the end of the list.

Returns a %Status value indicating success or failure.

InsertAt

Method InsertAt(element As %String, key As %Integer) As %Status

Inserts an element with value element at position key.

To make room for the new element, the elements previously at or following position key are moved up by one position.

key must be in the following range: 1 <= key <= Count() + 1 Returns a %Status value indicating success or failure.

InsertList

Method InsertList(inslist As %String) As %Status

Inserts a list with value inslist at the end of the list.

Returns a %Status value indicating success or failure.

InsertOrdered

Method InsertOrdered(element As %String) As %Status

Inserts an element with value element into the list at the correct ordered position. The elements in the list are shifted to accommodate the new element as necessary.

Returns a %Status value indicating success or failure.

Next

Method Next(key As %Integer = 0) As %Integer [ CodeMode = expression, Final ]

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

Previous

Method Previous(key As %Integer = 0) As %Integer [ CodeMode = expression, Final ]

Finds and returns the index value of the element at the location preceding key in the list. If key is a null string (""), then Next returns the position of the last element in the list.

RemoveAt

Method RemoveAt(key As %Integer) As %String

Removes the element at position key in the list. The elements following position key are moved to fill in the resulting gap.

RemoveAt returns the value of the removed element or null string ("") if no element was removed.

SetAt

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

Sets the value of the element at position key to element.

Returns a %Status value indicating success or failure.

%ValidateObject

Method %ValidateObject(force As %Integer) As %Status

BuildValueArray

ClassMethod BuildValueArray(serialized As %Binary, array As %Binary) As %Status

Constructs array(key)=value for each element in the serialval value.

Returns a %Status value indicating success or failure.

%GetSerial

Method %GetSerial(force As %Integer = 0) As %String [ Private ]

%SetSerial

Method %SetSerial(serialized As %String) As %Status [ Private ]

LogicalToOdbc

ClassMethod LogicalToOdbc(val As %String = "") As %String [ CodeMode = generator ]

Converts the serial state of this list object to a delimited string using the value of the ODBCDELIMITER parameter as a delimiter.

OdbcToLogical

ClassMethod OdbcToLogical(val As %String = "") As %String [ CodeMode = generator ]

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

LogicalToDisplay

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

Converts the serial state of this list object to a delimited string using the value of the %delim argument as a delimiter.

DisplayToLogical

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

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

GetAt

Method GetAt(key As %Integer = 0) As %String [ CodeMode = expression, Final ]

Finds and returns the value of the element at position key in the list.

GetAt returns the value of the element at location key or null string ("") if no element is found.