Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [%SYS] >  [%Collection] >  [ListOfDT]
Private  Storage   

class %Collection.ListOfDT extends %Collection.AbstractListOfDT, Super

The %Collection.ListOfDT 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. You can use a list object as follows:

	Set list=##class(%ListOfDataTypes).%New()
	; add items to the list
	Do list.Insert("Harpo")
	Do list.Insert("Groucho")
	Do list.Insert("Chico")
	Do list.Insert("Karl")
	; iterate over contents of list
	For i=1:1:list.Count()  Write list.GetAt(i),!
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 can not be used as 'stand alone' collections, for this use the %ListOfDataTypes.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 22


Summary

Properties
ElementClassType ElementType LiteralBehavior OrefStorage
Owner ReadOnly Size Storage
StreamLocation

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%Disconnect %DispatchClassMethod %DispatchGetModified %DispatchGetProperty
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%Extends %GetParameter %IsA %IsModified
%IsNull %New %NormalizeObject %ObjectModified
%OriginalNamespace %PackageName %RemoveFromSaveSet %SerializeObject
%SetModified %ValidateObject BuildValueArray Clear
Count DeSerialize DisplayToLogical FDBMSToLogical
Find GetAt GetNext GetPrevious
Insert InsertAt InsertList InsertOrdered
IsDefined LogicalToDisplay LogicalToFDBMS LogicalToOdbc
Next OdbcToLogical Previous RemoveAt
Serialize SetAt SizeGet SizeSet

Subclasses
%Collection.MV.ListOfDT

Properties

• property Size as %Integer [ Calculated ];
Size is the number of elements contained in the list.

Methods

• final method Count() as %Integer
Returns the number of elements contained in the list.
• method DeSerialize(serialized As %String(MAXLEN="")) as %Status
Deserialize from string created with Serialize back to collection
• classmethod DisplayToLogical(val As %String = "", delim As %String = {$char(13, 10)}, class As %String = "", method As %String = "") as %String
Converts the value of an incoming delimited string to a serialized state using the value of the delim argument as a delimiter.
• classmethod FDBMSToLogical(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.
• 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.

• final method GetAt(key As %Integer = 0) as %String
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.

• 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.

• 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.

• 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.

• 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.
• 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.

• 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.

• method IsDefined(key As %Integer) as %Boolean
Returns true (1) if a value is defined at location key, otherwise false (0).
• classmethod LogicalToDisplay(val As %String = "", delim As %String = {$char(13, 10)}, class As %String = "", method As %String = "") as %String
Converts the serial state of this list object to a delimited string using the value of the %delim argument as a delimiter.
• classmethod LogicalToFDBMS(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.
• final method Next(key As %Integer = 0) as %Integer
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).
• final method Previous(key As %Integer = 0) as %Integer
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.
• 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.

• method Serialize(force As %Integer = 0) as %String
Serialize() constructs a serialized form of the collection as a string
• 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.

• method SizeGet() as %Integer
This is a Get accessor method for the Size property.
• abstract method SizeSet(newvalue As %Integer) as %Status
This is a Set accessor method for the Size property.


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.