%Collection.AbstractListOfObj
class %Collection.AbstractListOfObj extends %Collection.AbstractList
A list collection represents a list of data type elements, each of which is associated with a numeric position in the list. The first element in the list is stored at position 1.The %Collection.AbstractList class provides the basic functionality of the various list collection classes.
The non-abstract list classes derived from %AbstractList include %ListOfDataTypes, %ListOfObjects, %Collection.ListOfObj and %Collection.ListOfDT. 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),!
Method Inventory
- Find()
- FindObjectId()
- FindOref()
- GetAt()
- GetNext()
- GetObjectAt()
- GetObjectIdAt()
- GetObjectIdNext()
- GetObjectIdPrevious()
- GetObjectNext()
- GetObjectPrevious()
- GetPrevious()
- Insert()
- InsertAt()
- InsertObject()
- InsertObjectAt()
- InsertObjectId()
- InsertObjectIdAt()
- RemoveAt()
- SetAt()
- SetObjectAt()
- SetObjectIdAt()
Methods
Find returns the position of the found element or null string ("") if no element was found.
Find returns the position of the found element or null string ("") if no element was found.
If key is a null string (""), the search starts at the beginning of the array.
FindOref returns the key associated with the found element or null string ("") if no element is found. Unswizzled references are compared to oref.%Oid() and if equal, swizzling will occur.
GetAt returns the value of the element at location key or null string ("") if no element is found.
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.
Returns the value of the element at location key or null string ("") if no element is found.
Returns the value of the element at location key or null string ("") if no element is found.
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.
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.
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.
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.
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.
Returns a %Status value indicating success or failure.
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.Returns a %Status value indicating success or failure.
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 <= index <= Count() + 1
Returns a %Status value indicating success or failure.Returns a %Status value indicating success or failure.
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 <= index <= Count() + 1
Returns a %Status value indicating success or failure.RemoveAt returns the value of the removed element or null string ("") if no element was removed. It also has a success output argument that returns true if the item was removed and false if it was not.
Returns a %Status value indicating success or failure.
Returns a %Status value indicating success or failure.
Returns a %Status value indicating success or failure.