The OCL Standard Library

The OCL Standard Library

Bag<T>
Boolean
Classifier<T>
Collection<T>
Enumeration
Integer
NonOrderedCollection<T>
NonUniqueCollection<T>
OclAny
OclInvalid
OclMessage
OclState
OclTuple
OclVoid
OrderedCollection<T>
OrderedSet<T>
Real
Sequence<T>
Set<T>
String
Tuple
UniqueCollection<T>
UnlimitedNatural

This documentation on the OCL Standard Library is auto-generated from the org.eclipse.ocl.examples.library/model/OCL-2.4.oclstdlib that defines the behavior of the Pivot evaluator and the Xtext editors. It is similar to the OCL 2.3 functionality. It is a prototype of functionality for OCL 2.4 where the use of models may eliminate ambiguities.

Precedences: NAVIGATION > UNARY > MULTIPLICATIVE > ADDITIVE > RELATIONAL > EQUALITY > AND > OR > XOR > IMPLIES

Bag<T>

conformsTo NonUniqueCollection<T> , NonOrderedCollection<T>

Operations

=(object2 : OclAny) : Boolean precedence: EQUALITY

True if self and bag contain the same elements, the same number of times.

<>(object2 : OclAny) : Boolean precedence: EQUALITY

excluding(object : OclAny) : Bag<T>

The bag containing all elements of self apart from all occurrences of object.

flatten<T2>() : Bag<T2>

Redefines the Collection operation. If the element type is not a collection type, this results in the same bag as self. If the element type is a collection type, the result is the bag containing all the elements of all the recursively flattened elements of self.

including(object : T) : Bag<T>

The bag containing all elements of self plus object.

Iterations

reject(i : T | body : Lambda T() : Boolean) : Bag<T>

The sub-bag of the source bag for which body is false.

select(i : T | body : Lambda T() : Boolean) : Bag<T>

The sub-bag of the source bag for which body is true.