%Library.ArrayOfObjects
serial class %Library.ArrayOfObjects extends %Collection.AbstractArrayOfObj, %Library.SerialObject
For information on this class, see Working with Collections.
The %ArrayOfObjects class represents an array of references to objects, each of which is associated with a unique key value. Keys can have any value, string or numeric. The objects referred to must be registered. They can be either persistent objects or non-id objects.Internally, an %ArrayOfObjects object contains two arrays: one for holding the OID values for the objects referred to (or their serialized state in the case of an array of non-id objects); and another for holding the OREF values for any objects that have been explicitly referred to, and hence "swizzled" into memory. Swizzling (loading an object into memory and generating an OREF value for it) happens automatically whenever the user refers to an object within the array.
For example, if array is an %ArrayOfObjects object containing an array of Doctor objects (that is an array of OID values for Doctor objects stored in the database) then the following code fragment will automatically load the Doctor object associated with the key "Primary" into memory and generate an OREF value referring to the in-memory version of the Doctor object. This OREF value can then be used to access the properties and methods of the Doctor object:
Set doc=array.GetAt("Primary") Write doc.Name
Alternatively, we could use cascading dot syntax:
Set name=array.GetAt("Primary").Name
When the %ArrayOfObjects object is closed (removed from memory), it will close (call %Close on) all of the references it has swizzled into memory. These classes can be used 'standalone' to store a collection.
Property Inventory
Method Inventory
- %AddToSaveSet()
- %SerializeObject()
- %UnSwizzleAt()
- BuildValueArray()
- Clear()
- Count()
- Define()
- Find()
- FindObjectId()
- GetAt()
- GetNext()
- GetObjectAt()
- GetObjectIdAt()
- GetObjectIdNext()
- GetObjectIdPrevious()
- GetObjectNext()
- GetObjectPrevious()
- GetPrevious()
- IsDefined()
- Next()
- Previous()
- RemoveAt()
- SetAt()
- SetObjectAt()
- SetObjectIdAt()
Parameters
Properties
Methods
This method is not meant to be called directly. It is called by %Save and by %GetSwizzleObject.
Returns a %Status value indicating success or failure.
Returns a %Status value indicating success or failure.
Returns a %Status value indicating success or failure.
Please use IsDefined() instead.
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.
Find returns the position of the found element or null string ("") if no element was found.
GetAt returns the OREF value of the element associated with key or null string ("") if no element is found.
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.
GetObjectAt returns the OID value of the element associated with key or null string ("") if no element is found.
GetObjectIdAt returns the ID value of the element associated with key or null string ("") if no element is found.
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.
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.
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.
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.
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.
RemoveAt returns the OID 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.
Inherited Members
Inherited Methods
- %AddToSyncSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %Delete()
- %DeleteId()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %GetSwizzleObject()
- %IsA()
- %IsModified()
- %IsNull()
- %New()
- %NormalizeObject()
- %ObjectIsNull()
- %ObjectModified()
- %OnBeforeAddToSync()
- %OnDetermineClass()
- %Open()
- %OpenId()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %ResolveConcurrencyConflict()
- %SetModified()
- %SyncObjectIn()
- %SyncTransport()
- %ValidateObject()
- FindOref()
- LogicalToOdbc()
- OdbcToLogical()