Returns the concatenation of the given collection into the given sequence.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}.add(Sequence{'d', 'e'}) | Sequence{'a', 'b', 'c', 'd', 'e'} |
Sequence{'a', 'b', 'c'}.add(OrderedSet{'c', 'e'}) | Sequence{'a', 'b', 'c', 'c', 'e'} |
The service addAll has been replaced by "add" in order to have access to the operator "+" between to sequences
Language | Expression | Result |
---|---|---|
Acceleo 3 (MTL) | Sequence{'a', 'b', 'c'}.addAll(Sequence{'d', 'e'}) | Sequence{'a', 'b', 'c', 'd', 'e'} |
Acceleo 3 (MTL) | Sequence{'a', 'b', 'c'}.addAll(OrderedSet{'c', 'e'}) | Sequence{'a', 'b', 'c', 'c', 'e'} |
Returns the concatenation of the given collection into the current set.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}.add(OrderedSet{'c', 'b', 'f'}) | OrderedSet{'a', 'b', 'c', 'f'} |
The service addAll has been replaced by "add" in order to have access to the operator "+" between to sets
Language | Expression | Result |
---|---|---|
Acceleo 3 (MTL) | OrderedSet{'a', 'b', 'c'}.addAll(OrderedSet{'c', 'b', 'f'}) | OrderedSet{'a', 'b', 'c', 'f'} |
Gets the first element in the current collection for which the value returned by the lambda evaluates to "true".
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->any(str | str.size() = 1) | 'a' |
Returns a set representation of the specified collection. Returns the same object if it is a set already. This operation has the same behavior as "asSet()"
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->asOrderedSet() | OrderedSet{'a', 'b', 'c'} |
Sequence{'a', 'b', 'c'}->asOrderedSet() | OrderedSet{'a', 'b', 'c'} |
Returns a sequence representation of the specified collection. Returns the same object if it is already a sequence.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->asSequence() | Sequence{'a', 'b', 'c'} |
Sequence{'a', 'b', 'c'}->asSequence() | Sequence{'a', 'b', 'c'} |
Returns a set representation of the specified collection. Returns the same object if it is already a set.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->asSet() | OrderedSet{'a', 'b', 'c'} |
Sequence{'a', 'b', 'c', 'c', 'a'}->asSet() | OrderedSet{'a', 'b', 'c'} |
Returns the element at the specified position in the sequence.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->at(1) | 'a' |
Sequence{'a', 'b', 'c'}->at(2) | 'b' |
Returns a sequence containing the result of applying "lambda" on all elements contained in the current sequence, maintaining order.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->collect(str | str.toUpper()) | Sequence{'A', 'B', 'C'} |
Returns a set containing the result of applying "lambda" on all elements contained in the current set, maintaining order.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->collect(str | str.toUpper()) | OrderedSet{'A', 'B', 'C'} |
Returns the concatenation of the current sequence with the given collection.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}.concat(Sequence{'d', 'e'}) | Sequence{'a', 'b', 'c', 'd', 'e'} |
Language | Expression | Result |
---|---|---|
Acceleo 3 (MTL) | Sequence{'a', 'b', 'c'}.addAll(Sequence{'d', 'e'}) | Sequence{'a', 'b', 'c', 'd', 'e'} |
Counts the number of occurrences of the given object in the given sequence
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->count('d') | 0 |
Sequence{'a', 'b', 'c'}->count('a') | 1 |
Returns "1" if the current set contains the given object, "0" otherwise.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->count('d') | 0 |
OrderedSet{'a', 'b', 'c'}->count('a') | 1 |
Indicates if the given collection doesn't contain the given object.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->excludes('a') | false |
Sequence{'a', 'b', 'c'}->excludes('d') | true |
Indicates if no elements from the second collection are contained in the first collection
Expression | Result |
---|---|
Sequence{'a', 'b'}->excludesAll(OrderedSet{'f'}) | true |
Sequence{'a', 'b'}->excludesAll(OrderedSet{'a', 'f'}) | false |
Removes the given object from the current set.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->excluding('c') | OrderedSet{'a', 'b'} |
Removes the given object from the current sequence.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->excluding('c') | Sequence{'a', 'b'} |
Indicates if it exists an object from the given collection for which the given lambda evaluates to "true"
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->exists(str | str.size() > 5) | false |
Keeps only instances of the given EClassifier in the given sequence.
Expression | Result |
---|---|
Sequence{anEClass, anEAttribute, anEReference}->filter({ecore::EClass | ecore::EReference}) | Sequence{anEClass, anEReference} |
Sequence{anEClass, anEAttribute, anEPackage}->filter({ecore::EStructuralFeature | ecore::EPacakge}) | Sequence{anEAttribute, anEPackage} |
Keeps only instances of the given EClassifier in the given sequence.
Expression | Result |
---|---|
Sequence{anEClass, anEAttribute, anEReference}->filter(ecore::EClass) | Sequence{anEClass} |
Sequence{anEClass, anEAttribute}->filter(ecore::EStructuralFeature) | Sequence{anEAttribute} |
Keeps only instances of the given set of EClassifier from the given set.
Expression | Result |
---|---|
OrderedSet{anEClass, anEAttribute, anEReference}->filter({ecore::EClass | ecore::EReference}) | OrderedSet{anEClass, anEReference} |
OrderedSet{anEClass, anEAttribute, anEPackage}->filter({ecore::EStructuralFeature | ecore::EPacakge}) | OrderedSet{anEAttribute, anEPackage} |
Keeps only instances of the given EClassifier from the given set.
Expression | Result |
---|---|
OrderedSet{anEClass, anEAttribute, anEReference}->filter(ecore::EClass) | OrederedSet{anEClass} |
OrderedSet{anEClass, anEAttribute}->filter(ecore::EStructuralFeature) | OrederedSet{anEAttribute} |
Returns the first element of the specified Collection.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->first() | 'a' |
Indicates if all the objects from the given collection validate the given lamba
Expression | Result |
---|---|
Sequence{'a', 'b', 'ccc'}->forAll(str | str.size() = 1) | false |
Sequence{'a', 'b', 'c'}->forAll(str | str.size() = 1) | false |
Indicates if the given collection contains the given object.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->includes('a') | true |
Sequence{'a', 'b', 'c'}->includes('d') | false |
Indicates if all elements from the second collection are contained in the first collection
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->includesAll(OrderedSet{'a'}) | true |
Sequence{'a', 'b', 'c'}->includesAll(OrderedSet{'a', 'f'}) | false |
Adds the given object to the current sequence.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->including('d') | Sequence{'a', 'b', 'c', 'd'} |
Adds the given object to the current set.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->including('d') | OrderedSet{'a', 'b', 'c', 'd'} |
Returns the index of the given object in the given sequence ([1..size]).
Expression | Result |
---|---|
Sequence{1, 2, 3, 4}->indexOf(3) | 3 |
Inserts the given object in a copy of the given sequence at the given position ([1..size]).
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->insertAt(2, 'f') | Sequence{'a', 'f', 'b', 'c'} |
Creates a set with the elements from the given set that are also present in the given collection.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->intersection(OrderedSet{'a', 'f'}) | OrderedSet{'a'} |
Creates a sequence with elements from the given sequence that are present in both the current sequence and the given other {@code Collection}. Iteration order will match that of the current sequence. Duplicates from the first list will all be kept in the result if they also are in the second one, but duplicates from the second list will be dumped even if they are present in the first.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->intersection(OrderedSet{'a', 'f'}) | Sequence{'a'} |
Returns "true" when the input collection is empty.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->isEmpty() | false |
Sequence{}->isEmpty() | true |
Indicates if the evaluation of the given lambda gives a different value for all elements of the given collection.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->isUnique(str | str.size()) | false |
Sequence{'a', 'bb', 'ccc'}->isUnique(str | str.size()) | true |
Returns the last element of the given sequence.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->last() | 'c' |
Returns "true" when the input collection is not empty.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->notEmpty() | true |
Sequence{}->notEmpty() | false |
Indicates if one and only one element of the given collection validates the given lambda.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->one(str | str.equals('a')) | true |
Sequence{'a', 'a', 'c'}->one(str | str.equals('a')) | false |
Inserts the given object in a copy of the given sequence at the first position.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->prepend('f') | Sequence{'f', 'a', 'b', 'c'} |
Reject returns a filtered version of the specified sequence. Only elements for which the given "lambda" evaluates to false will be present in the returned sequence
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->reject(str | str.equals('a')) | Sequence{'b', 'c'} |
Reject returns a filtered version of the specified set. Only elements for which the given "lambda" evaluates to false will be present in the returned set
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->reject(str | str.equals('a')) | OrderedSet{'b', 'c'} |
Returns the given sequence in reversed order.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->reverse() | Sequence{'c', 'b', 'a'} |
Returns the given set in reversed order.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->reverse() | OrderedSet{'c', 'b', 'a'} |
Select returns a filtered version of the specified set. Only elements for which the given "lambda" evaluates to true will be present in the returned set.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->select(str | str.equals('a')) | OrderedSet{'a'} |
Select returns a filtered version of the specified sequence. Only elements for which the given "lambda" evaluates to true will be present in the returned sequence.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->select(str | str.equals('a')) | Sequence{'a'} |
Inserts the given separator between each elements of the given collection, the given prefix before the first element, and the given suffix after the last element.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->sep('[', '-', ']') | Sequence{'[', 'a', '-', 'b', '-', 'c', ']'} |
Inserts the given separator between each elements of the given collection.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->sep('-') | Sequence{'a', '-', 'b', '-', 'c'} |
OrderedSet{'a', 'b', 'c'}->sep('-') | Sequence{'a', '-', 'b', '-', 'c'} |
Returns the size of the specified collection
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->size() | 3 |
OrderedSet{'a', 'b', 'c', 'd'}->size() | 4 |
Returns a sequence containing the elements of the original collection ordered by the result of the given lamba
Expression | Result |
---|---|
Sequence{'aa', 'bbb', 'c'}->sortedBy(str | str.size()) | Sequence{'c', 'aa', 'bbb'} |
Returns the difference of the current set and the given collection.
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}.sub(OrderedSet{'c', 'b', 'f'}) | OrderedSet{'a'} |
The service removeAll has been replaced by "sub" in order to have access to the operator "-" between to sets
Language | Expression | Result |
---|---|---|
Acceleo 3 (MTL) | OrderedSet{'a', 'b', 'c'}.removeAll(OrderedSet{'c', 'b', 'f'}) | OrderedSet{'a'} |
Returns the difference of the current sequence and the given collection.
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}.sub(Sequence{'c', 'b', 'f'}) | Sequence{'a'} |
Sequence{'a', 'b', 'c'}.sub(OrderedSet{'c', 'b', 'f'}) | Sequence{'a'} |
The service removeAll has been replaced by "sub" in order to have access to the operator "-" between to sequences
Language | Expression | Result |
---|---|---|
Acceleo 3 (MTL) | Sequence{'a', 'b', 'c'}.removeAll(Sequence{'c', 'b', 'f'}) | Sequence{'a'} |
Acceleo 3 (MTL) | Sequence{'a', 'b', 'c'}.removeAll(OrderedSet{'c', 'b', 'f'}) | Sequence{'a'} |
Returns a subset of the given set
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->subOrderedSet(1, 2) | OrderedSet{'a', 'b'} |
Returns a subset of the given sequence
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->subSequence(1, 2) | Sequence{'a', 'b'} |
Sums elements of the given collection if possible.
Expression | Result |
---|---|
Sequence{1, 2, 3, 4}->sum() | 10 |
Returns a set containing all the elements of the first and second sets
Expression | Result |
---|---|
OrderedSet{'a', 'b', 'c'}->union(OrderedSet{'d', 'c'}) | OrderedSet{'a', 'b', 'c', 'd'} |
Returns a sequence containing all the elements of the first and second sequences
Expression | Result |
---|---|
Sequence{'a', 'b', 'c'}->union(Sequence{'d', 'c'}) | Sequence{'a', 'b', 'c', 'd'} |