Bag(T)

Operations

union(s: Bag(T)): Bag(T)
The union of self and b.
union(s: Set(T)): Bag(T)
The union of self and s.
intersection(s: Bag(T)): Bag(T)
The bag of all elements contained in self and b.
intersection(s: Set(T)): Set(T)
The set of all elements contained in self and s.
including(t: T): Bag(T)
A bag containing all elements of self and t.
excluding(t: T): Set(T)
A bag containing all elements of self except from all occurences of t.
select(e: OclExpression): Bag(T)
The Bag containing the elements of self for which e evaluates to true.
reject(e: OclExpression): Bag(T)
The Bag containing the elements of self for which e evaluates to false.
collect(e: OclExpression): T2
Equivalent to self->collectNested(e1)->flatten()
flatten(): T2
If the element type is not a collection type, this operation results in the same bag. Otherwise, the result is a bag containing all the elements of all the elements of self
collectNested(e: OclExpression): T2
The Bag of elements resulting from applying e to every element in self. The element type of the resulting bag is the type of e.