Skip to main content

%Library.ArrayOfDataTypes

serial class %Library.ArrayOfDataTypes extends %Collection.AbstractArrayOfDT, %Library.SerialObject

For information on this class, see Working with Collections.

The %ArrayOfDataTypes class represents an array of literal (i.e., data type) elements, each of which is associated with a unique key value. Keys can have any value, string or numeric.

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

Property Inventory

Method Inventory

Parameters

parameter ELEMENTTYPE = %String;
The type (class name) of the elements stored in the collection.

Properties

property Data as %String [ MultiDimensional ];
Data is a private property used to hold the contents of the array.
Property methods: DataDisplayToLogical(), DataGet(), DataIsValid(), DataLogicalToDisplay(), DataLogicalToOdbc(), DataNormalize(), DataSet()
property ElementType as %String (MAXLEN = 256) [ InitialExpression = ..#ELEMENTTYPE ];
The type (classname:propertyname) of the elements stored in the collection.
Property methods: ElementTypeDisplayToLogical(), ElementTypeGet(), ElementTypeIsValid(), ElementTypeLogicalToDisplay(), ElementTypeLogicalToOdbc(), ElementTypeNormalize(), ElementTypeSet()

Methods

method %ValidateObject(force As %Library.Integer, checkserial As %Library.Integer = 1) as %Status
Inherited description:

This method validates an object.

The %Save() method of a persistent class calls this method before filing any objects in the database. The %ValidateObject() of a referencing object can call it. You can also call it explicitly at any time.

%ValidateObject() does the following:

  1. If present, it will call a user-supplied %OnValidateObject() method.
  2. It checks if any required property values are missing.
  3. If the PROPERTYVALIDATION class parameter is set to ValidateOnSave, it validates each non-null property value by calling the property method IsValid on each literal property and the %ValidateObject method for each object-valued embedded object property (properties whose type extend %SerialObject).
  4. If checkserial is 1, it forces the checking of any embedded object properties by calling their %ValidateObject method after swizzling this property.
  5. If checkserial is 2, it forces the checking of any collections of serial types by iterating over those collections and calling their %ValidateObject() method after swizzling this property, in addition to the validation that occurs when checkserial is 1.

%ValidateObject() returns a %Status indicating success or error. It is up to the caller to process the error value.

%ValidateObject() does not validate object-valued reference properties (properties whose type extends %Persistent) due to the possibility of circular dependencies between objects. The %Save() method of a persistent class automatically detects and handles circular references between objects. If you require the validation of reference properties, you can override this method in a subclass or call %Save() directly.

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.

method Clear() as %Status
Clears the contents of the array.

Returns a %Status value indicating success or failure.

method Count() as %Integer
Returns the number of elements contained in the array.
final method Define(key As %String) as %Boolean
This method is deprecated.

Please use IsDefined() instead.

method Find(element As %String, key As %String) as %String
Starting from, but not including, location key, finds the next element in the array with value equal to element.

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.

final method GetAt(key As %String = "") as %String
Finds and returns the value of the element associated with key.

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

method GetNext(ByRef key As %String) as %String
Finds and returns the value of the element at the location after key in the array. If key is a null string (""), it returns the value of the first element in 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.

method GetPrevious(ByRef key As %String) as %String
Finds and returns the value of the element at the location before key in the array. If key is a null string (""), it returns the value of the last element in 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.

final method IsDefined(key As %String) as %Boolean
Returns true (1) if a value is defined at location key, otherwise false (0).
classmethod LogicalToOdbc(val As %Library.String = "", delim As %Library.String = ",", class As %Library.String = "", method As %Library.String = "") as %String
Converts the serial state of this array object to a delimited string using the value of the ODBCDELIMITER parameter as a delimiter.
Finds and returns the key value of the element at the location following key in the array. If key is a null string (""), then Next returns the key value for the first element in the array.
classmethod OdbcToLogical(val As %Library.String = "", delim As %Library.String = ",", class As %Library.String = "", method As %Library.String = "") as %String
Converts the value of an incoming delimited string to a serialized state using the value of the ODBCDELIMITER parameter as a delimiter.
Finds and returns the key value of the element at the location preceding key in the array. If key is a null string (""), then Next() returns the key value for the last element in the array.
method RemoveAt(key As %String) as %String
Removes the element associated with key in the array.

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

method SetAt(element As %String, key As %String) as %Status
Sets the value of the element associated with key to element.

Returns a %Status value indicating success or failure.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab