Skip to content

Aggregate

Márk Török edited this page Jul 15, 2020 · 3 revisions

Aggregate

create

It creates a new aggregate.
Precondition : it requires the name of the aggregate
Example : aggregate create fruits
Note : The created aggregate will be in the global scope. Under the hood it is an associative array.

add

It add an element to aggregate.
Precondition : it requires the name of the aggregate and the element.
Example : aggregate add fruits apple

erase

Removes all elements from aggregate.
Precondition : it requires the name of the aggregate.
Example : aggregate erase fruits

size

Returns the number of elements in the aggregate.
Precondition : it requires the name of the aggregate.
Example : aggregate size fruits

remove

Removes an element from the aggregate.
Precondition : it requires the name of the aggregate and the element.
Example : aggregate remove fruits apple

elements

Returns the elements contained in the aggregate.
Precondition : it requires the name of the aggregate.
Example : aggregate elements fruits

union

Creates the union aggregate with elements from two input aggregates.
Precondition : it requires the name of the two input aggregates and the name of the output aggregate.
Example : aggregate contains fruits vegetables union_set

intersection

Creates the intersection aggregate with elements from two input aggregates.
Precondition : it requires the name of the two input aggregates and the name of the output aggregate.
Example : aggregate intersection fruits vegetables intersection_set

difference

Creates the difference aggregate with elements from two input aggregates.
Precondition : it requires the name of the two input aggregates and the name of the output aggregate.
Example : aggregate difference fruits vegetables difference_set

equal

Test whether the first aggregate equals with the second aggregate
Precondition : it requires the name of the two input aggregates.
Example : aggregate equal fruits vegetables

subset

Test whether every element in first aggregate is in second aggregate
Precondition : it requires the name of the two input aggregates.
Example : aggregate difference fruits vegetables

empty

Returns whether the aggregate is empty.
Precondition : it requires the name of the aggregate.
Example : aggregate empty fruits

destroy

It destroys the aggregate.
Precondition : it requires the name of the aggregate.
Example : aggregate destroy fruits

Clone this wiki locally