IRISLIB database
AbstractListOfObj Class Reference

A list collection represents a list of data type elements, each of which is associated with a numeric position in the list. More...

Inheritance diagram for AbstractListOfObj:
Collaboration diagram for AbstractListOfObj:

Public Member Functions

_.Library.String Find (_.Library.ObjectIdentity element, _.Library.Integer key)
 A list collection represents a list of data type elements, each of which is associated with a numeric position in the list. More...
 
_.Library.String FindObjectId (_.Library.String id, _.Library.Integer key)
 Starting from, but not including, position key, FindObjectId finds. More...
 
_.Library.String FindOref (_.Library.RegisteredObject oref, _.Library.Integer key, _.Library.String id)
 Starting from, but not including, location key,. More...
 
_.Library.RegisteredObject GetAt (_.Library.Integer key)
 Finds and returns the value of the element at position. More...
 
_.Library.RegisteredObject GetNext (_.Library.Integer key)
 Finds and returns the value of the element at the position after key More...
 
_.Library.ObjectIdentity GetObjectAt (_.Library.Integer key, _.Library.Integer force)
 Finds and returns the OID value referring to the object at position. More...
 
_.Library.String GetObjectIdAt (_.Library.Integer key, _.Library.Integer force)
 Finds and returns the ID value referring to the object at position. More...
 
_.Library.String GetObjectIdNext (_.Library.Integer key)
 Finds and returns the ID value referring to the object at the position after key More...
 
_.Library.String GetObjectIdPrevious (_.Library.Integer key)
 Finds and returns the ID value referring to the object at the position before key More...
 
_.Library.ObjectIdentity GetObjectNext (_.Library.Integer key)
 Finds and returns the OID value referring to the object at the position after key More...
 
_.Library.ObjectIdentity GetObjectPrevious (_.Library.Integer key)
 Finds and returns the OID value referring to the object at the position before key More...
 
_.Library.RegisteredObject GetPrevious (_.Library.Integer key)
 Finds and returns the value of the element at the position before key More...
 
_.Library.Status Insert (_.Library.RegisteredObject element)
 Inserts an element with value element at the end of the list. More...
 
_.Library.Status InsertAt (_.Library.RegisteredObject element, _.Library.Integer key)
 Inserts an element with value element at position key. More...
 
_.Library.Status InsertObject (_.Library.ObjectIdentity oid)
 Inserts an element with OID value oid at the end of the list. More...
 
_.Library.Status InsertObjectAt (_.Library.ObjectIdentity oid, _.Library.Integer key)
 Inserts an element with OID value oid at position key. More...
 
_.Library.Status InsertObjectId (_.Library.String id)
 Inserts an element with ID value id at the end of the list. More...
 
_.Library.Status InsertObjectIdAt (_.Library.String id, _.Library.Integer key)
 Inserts an element with ID value id at position key. More...
 
_.Library.ObjectIdentity RemoveAt (_.Library.Integer key, _.Library.Boolean success)
 Removes the element at position key in the list. More...
 
_.Library.Status SetAt (_.Library.RegisteredObject element, _.Library.Integer key)
 Sets the value of the element at position key to element. More...
 
_.Library.Status SetObjectAt (_.Library.ObjectIdentity oid, _.Library.Integer key)
 Sets the OID value of the element at position key to oid. More...
 
_.Library.Status SetObjectIdAt (_.Library.String id, _.Library.Integer key)
 Sets the ID value of the element at position key to id. More...
 
- Public Member Functions inherited from AbstractList
_.Library.Status Clear ()
 Clears the contents of the list. More...
 
_.Library.Integer Count ()
 Returns the number of elements contained in the list.
 
_.Library.String Find (_.Library.RawString element, _.Library.Integer key)
 Starting from, but not including, position key, Find finds. More...
 
_.Library.Status Insert (_.Library.RawString element)
 Inserts an element with value element at the end of the list. More...
 
_.Library.Status InsertAt (_.Library.RawString element, _.Library.Integer key)
 Inserts an element with value element at position key. More...
 
_.Library.Status InsertList (_.Library.RawString inslist)
 Inserts a list with value inslist at the end of the list. More...
 
_.Library.Status InsertOrdered (_.Library.RawString element)
 Inserts an element with value element into the list at the correct ordered. More...
 
_.Library.Integer Next (_.Library.Integer key)
 Finds and returns the index value of the element at the location following key in the list. More...
 
_.Library.Integer Previous (_.Library.Integer key)
 Finds and returns the index value of the element at the location preceding key in the list. More...
 
_.Library.RawString RemoveAt (_.Library.Integer key)
 Removes the element at position key in the list. More...
 
_.Library.Status SetAt (_.Library.RawString element, _.Library.Integer key)
 Sets the value of the element at position key to element. More...
 
- Public Member Functions inherited from AbstractIterator
_.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

- Static Public Member Functions inherited from AbstractList
_.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 list 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...
 

Detailed Description

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 <CLASS>Collection.AbstractList</CLASS> class provides the basic functionality of the
various list collection classes.

The non-abstract list classes derived from <CLASS>AbstractList</CLASS> include <CLASS>ListOfDataTypes</CLASS>, <CLASS>ListOfObjects</CLASS>, <CLASS>Collection.ListOfObj</CLASS> and <CLASS>Collection.ListOfDT</CLASS>.

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),!

Member Function Documentation

◆ Find()

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 <CLASS>Collection.AbstractList</CLASS> class provides the basic functionality of the
various list collection classes.

The non-abstract list classes derived from <CLASS>AbstractList</CLASS> include <CLASS>ListOfDataTypes</CLASS>, <CLASS>ListOfObjects</CLASS>, <CLASS>Collection.ListOfObj</CLASS> and <CLASS>Collection.ListOfDT</CLASS>.

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),!

Starting from, but not 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.

Reimplemented in ListOfObjCN, and ListOfObj.

◆ FindObjectId()

_.Library.String FindObjectId ( _.Library.String  id,
_.Library.Integer  key 
)

Starting from, but not including, position key, FindObjectId finds.

the next element in the list whose ObjectId equals id. 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.

Reimplemented in ListOfObj.

◆ FindOref()

Starting from, but not including, location key,.

finds the next element in the array whose Oref value equals oref.

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.

Reimplemented in ListOfObj.

◆ GetAt()

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.

Reimplemented from AbstractList.

Reimplemented in QueryHelper, ListOfStream, and ListOfObj.

◆ GetNext()

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.

Reimplemented from AbstractList.

Reimplemented in QueryHelper, and ListOfObj.

◆ GetObjectAt()

Finds and returns the OID value referring to the object at position.

key in the list.

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

Reimplemented in ListOfObj.

◆ GetObjectIdAt()

_.Library.String GetObjectIdAt ( _.Library.Integer  key,
_.Library.Integer  force 
)

Finds and returns the ID value referring to the object at position.

key in the list.

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

Reimplemented in ListOfObj.

◆ GetObjectIdNext()

_.Library.String GetObjectIdNext ( _.Library.Integer  key)

Finds and returns the ID value referring to the object at the position after key

in the list. If key is a null string (""), it returns the ID 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.

Reimplemented in ListOfObj.

◆ GetObjectIdPrevious()

_.Library.String GetObjectIdPrevious ( _.Library.Integer  key)

Finds and returns the ID value referring to the object at the position before key

in the list. If key is a null string (""), it returns the ID 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.

Reimplemented in ListOfObj.

◆ GetObjectNext()

Finds and returns the OID value referring to the object at the position after key

in the list. If key is a null string (""), it returns the OID 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.

Reimplemented in ListOfObj.

◆ GetObjectPrevious()

_.Library.ObjectIdentity GetObjectPrevious ( _.Library.Integer  key)

Finds and returns the OID value referring to the object at the position before key

in the list. If key is a null string (""), it returns the OID 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.

Reimplemented in ListOfObj.

◆ GetPrevious()

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.

Reimplemented from AbstractList.

Reimplemented in ListOfObj.

◆ Insert()

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

<p>Returns a <CLASS>%Status</CLASS> value indicating success or failure.

Reimplemented in ListOfStream, and ListOfObj.

◆ InsertAt()

Inserts an element with value element at position key.

<p>To make room for the new element, the elements previously at or following position 
<var>key</var> are moved up by one position.
<p><var>key</var> must be in the following range: 
<blockquote><code>
1 &lt= key &lt= Count() + 1
</blockquote></code>

Returns a <CLASS>%Status</CLASS> value indicating success or failure.

Reimplemented in ListOfStream, and ListOfObj.

◆ InsertObject()

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

<p>Returns a <CLASS>%Status</CLASS> value indicating success or failure.

Reimplemented in ListOfObj.

◆ InsertObjectAt()

_.Library.Status InsertObjectAt ( _.Library.ObjectIdentity  oid,
_.Library.Integer  key 
)

Inserts an element with OID value oid at position key.

<p>To make room for the new element, the elements previously at or following position 
<var>key</var> are moved up by one position.
<p><var>key</var> must be in the following range: 
<blockquote><code>
1 &lt= index &lt= Count() + 1
</blockquote></code>

Returns a <CLASS>%Status</CLASS> value indicating success or failure.

Reimplemented in ListOfObj.

◆ InsertObjectId()

_.Library.Status InsertObjectId ( _.Library.String  id)

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

<p>Returns a <CLASS>%Status</CLASS> value indicating success or failure.

Reimplemented in ListOfStream, and ListOfObj.

◆ InsertObjectIdAt()

_.Library.Status InsertObjectIdAt ( _.Library.String  id,
_.Library.Integer  key 
)

Inserts an element with ID value id at position key.

<p>To make room for the new element, the elements previously at or following position 
<var>key</var> are moved up by one position.
<p><var>key</var> must be in the following range: 
<blockquote><code>
1 &lt= index &lt= Count() + 1
</blockquote></code>

Returns a <CLASS>%Status</CLASS> value indicating success or failure.

Reimplemented in ListOfStream, and ListOfObj.

◆ RemoveAt()

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. It also has a success output argument that returns true if the item was removed and false if it was not.

Reimplemented in ListOfObj.

◆ SetAt()

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

Returns a <CLASS>Status</CLASS> value indicating success or failure.

Reimplemented in ListOfStream, and ListOfObj.

◆ SetObjectAt()

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

Returns a <CLASS>Status</CLASS> value indicating success or failure.

Reimplemented in ListOfObj.

◆ SetObjectIdAt()

_.Library.Status SetObjectIdAt ( _.Library.String  id,
_.Library.Integer  key 
)

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

Returns a <CLASS>Status</CLASS> value indicating success or failure.

Reimplemented in ListOfStream, and ListOfObj.