Collection
- Last Updated: November 6, 2023
- 1 minute read
- Corticon
- Version 6.3
- Documentation
Corticon's Collection operators are as follows:
| Name and Syntax | Returns | Description | |
|---|---|---|---|
| Replace element(s) | |||
< < |
modifies a collection | replaces all elements in <Collection1> with
elements of <Collection2> or with
<Entity>, provided the new associations
are allowed by the Business Vocabulary. |
|
| Associate element(s) | |||
|
< < |
modifies a collection | Associates all elements of <Collection2> or
<Entity> with
<Collection1>. Every
<Collection> must be expressed as a
unique alias. |
|
| Disassociate element(s) | |||
<Collection1> -=
<Collection2> |
modifies a collection | Disassociates all elements of <Collection2>
from <Collection1>. Does not delete the
disassociated elements. Every <Collection>
must be expressed as a unique alias. |
|
| Is empty | |||
<Collection> ->isEmpty |
Boolean | Returns a value of true if <Collection>
contains no elements |
|
| Not empty | |||
<Collection> ->notEmpty |
Boolean | Returns a value of true if <Collection>
contains at least one element. |
|
| Exists | |||
<Collection>
->exists (<Expression>) |
Boolean | Returns a value of true if <Expression> holds
true for at least one element of <Collection> |
|
| For all | |||
<Collection>
->forAll (<Expression>) |
Boolean | Returns a value of true if every
<Expression> holds true for every
element of <Collection> |
|
| Sorted by | |||
<Collection>
->sortedBy (<Attribute>) |
converts a collection into a sequence |
Sequences the elements of < |
|
| Sorted by descending | |||
<Collection> ->sortedByDesc
(<Attribute>) |
converts a collection into a sequence | Sequences the elements of <Collection> in descending order, using the value of <Attribute> as the index. <Collection> must be expressed as a unique alias. |
|
| Iterate | |||
<Collection>
->iterate(<Expression>) |
Executes <Expression> for every element in
<Collection>. <Collection>
must be expressed as a unique alias. |
||
| Size of collection | |||
<Collection> ->size |
Integer | Returns the number of elements in
<Collection>.
<Collection> must be expressed as a unique
alias. |
|
| Sum | |||
<Collection.attribute> ->sum |
Number | Sums the values of the specified <attribute>
for all elements in <Collection>.
<attribute> must be a numeric data
type. |
|
| Average | |||
<Collection.attribute> ->avg |
Number | Averages all of the specified attributes in
<Collection>.
<Collection> must be expressed as a
unique alias. <attribute> must be a numeric
data type |
|
| Minimum | |||
<Collection.attribute> ->min |
Number | Returns the lowest value of <attribute> for
all elements in
<Collection>. <attribute>
must be a numeric data type |
|
| Maximum | |||
<Collection.attribute> ->max |
Number | Returns the highest value of <attribute> for all elements in
<Collection>. <attribute>
must be a numeric data type |
|
| toSet | |||
Collection.toSet |
String | Returns a single String that is the set of Strings in this collection. | |
| allContain(lookFor) | |||
Collection.allContain (lookFor:String) |
Boolean | Determines whether all the strings in this collection contain the lookFor String |
|
| uniqueCount | |||
Collection.uniqueCount |
Integer | Returns the count of the unique Strings in this collection. | |