Skip to main content

%Library.AbstractSet

Abstract Set defines a set interface. Members of a Set can be anonymous or named.

This interface does not define how the set is implemented and maintained.

Method Inventory

Methods

method %DispatchMethod(methodName As %String, args...)
Inherited description: Is used to implement an unknown method call. It is also used to resolve an unknown multidimensional property reference (to get the value of a property) because that syntax is identical to a method call.
abstract method add(value As %Any) as %Library.AbstractSet

add value to the set.

It is left to the implementation to decide whether duplicates are allowed (multiset) or not (proper set).

parameters:

  • value: value to add to the set

returns:

  • oref referencing the modified set

throws:

  • exception

method addAll(values As %Library.AbstractSet) as %Library.DynamicArray
add() all values[n] where 0≤n≤ size(values)

parameters:

  • values: array of values to add to the set

returns:

  • oref referencing the modified set

throws:

  • exception

method apply(expression As %Library.Any, passing As %Library.AbstractSet) as %Library.AbstractSet
return an array of members matching the provided ASQ expression (abstract set query)
abstract method clear()
remove all elements of the current set, throws an exception if this operation is not supported or the set cannot be cleared.
abstract method contains(key As %DataType) as %Boolean
return true if the key is currently an element of the set, false otherwise.
method containsAll(array As %Library.DynamicArray) as %Boolean
return true if the set contains() all key[n] where 0≤n≤ size(array)
abstract method get(key As %DataType) as %Library.Any
get the element identified by key
abstract method iterator() as %Iterator
return an iterator over the elements of this set
abstract method put(key As %DataType, value As %Library.Any) as %Library.AbstractSet

put the value into the set with the element name (id) of key. If an element with this key is already present in the set then that element's value is replaced by value

parameters:

  • key: key to put into the set
  • value: value to put into the set

returns:

  • oref referencing the modified set

throws:

  • exception

abstract method putAll(keys As %Library.AbstractSet, values As %Library.AbstractSet) as %Library.AbstractSet

put all {keys[n], values[n]} elements where 0≤n≤ size(keys) into the set

parameters:

  • keys: array of keys to put into the set
  • values: array of values to put into the set

returns:

  • oref referencing the modified set

throws:

  • exception

abstract method putAllIfAbsent(keys As %Library.AbstractSet, values As %Library.AbstractSet) as %Library.AbstractSet

put all {keys[n], values[n]} elements where 0≤n≤ size(keys) and keys[n] is not already associated with a value in the set.

parameters:

  • keys: array of keys to be put into the set
  • values: array of values to be put into the set

returns:

  • oref referencing the modified set

throws:

  • exception

abstract method putIfAbsent(key As %DataType, value As %Library.Any) as %Library.AbstractSet

put the {key, value} element into the set. If contains(key) is false or get(key) is null then put(key,value)

parameters:

  • key: key to put into the set
  • value: value to put into the set
returns:
  • oref referencing the modified set

throws:

  • exception

abstract method remove(key As %DataType) as %Library.Any

remove the element identified by key from the set

parameters:

  • key: key of element to be removed from the set

returns:

  • the removed element or null if that element doesn't exist

throws:

  • exception

abstract method removeAll(keys As %Library.DynamicArray) as %Library.DynamicArray

remove all elements identified by keys[n] where 0≤n≤ size(keys) from the set

parameters:

  • keys: array of keys to be removed from the set

returns:

  • array of removed elements (null element if key doesn't exist)

throws:

  • exception

abstract method removeIf(expression As %RawString) as %Library.DynamicArray
remove all of the elements matching the expression

parameters:

  • expression: elements matching expression are to be removed

returns:

  • array of removed elements (null element if key doesn't exist)

throws:

  • exception

abstract method rename(currentKey As %DataType, newKey As %DataType) as %DataType
replace the key of the element identified by currentKey with newKey

parameters:

  • currentKey - current key of the element to be renamed
  • newKey - new key to assign to the element
returns:
  • the current key if the element exists, null otherwise

throws:

  • exception

abstract method replace(key As %DataType, value As %Library.Any) as %Library.Any
replace the value of the element identified by key with value

parameters:

  • key - key of the element to be replaced
  • value - new value of the element
returns:
  • return the previous value of the element

throws:

  • exception

abstract method replaceAll(keys As %Library.DynamicArray, values As %Library.DynamicArray) as %Library.DynamicArray
replace all {keys[n], values[n]} members, return an array containing the replaced values

parameters:

  • keys: array of keys of the elements to be replaced
  • values: array of values of the elements

returns:

  • array of previous element values

throws:

  • exception

abstract method size() as %Integer
return the number of members in the current set
abstract method toDao() as %DynamicAbstractObject
>

The toDao() method casts the set to a DAO.

abstract method toString() as %String
>

The toString() method returns the contents of a set as a string.

Inherited Members

Inherited Methods

Subclasses

FeedbackOpens in a new tab