| |||||
Previous Next |
A Bag is a collection that allows duplicates. That is, one object can be an element of a bag many times. There is no ordering defined on the elements in a bag.
Operation Summary | |
Boolean | =(Bag rhs) True if this bag and rhs contain the same elements, the same number of times. |
Boolean | <>(Bag rhs) True if this bag and rhs do not contain the same elements, the same number of times. |
Sequence | asSequence A sequence that contains all the elements from this bag. |
Set | asSet A set that contains all the elements from this bag, with duplicates removed. |
Bag | collect(OclAny_Expression expr) The Bag of elements which results from applying the expression expr to every member of this bag. |
Integer | count(OclAny object) The number of occurences of object in this bag. |
Bag | excluding(OclAny object) The bag containing all elements of this bag apart from all occurence of object. |
Bag | including(OclAny object) The bag containing all elements of this bag plus object. |
Bag | intersection(Bag rhs) A bag that contains every elements that are both in this bag and in rhs. |
Set | intersection(Set rhs) A bag that contains every elements that are both in this bag and in rhs. |
Bag | reject(Boolean_Expression expr) The sub-bag of all elements for which applying the expr expression evaluates to false. |
Bag | select(Boolean_Expression expr) The sub-bag of all elements for which applying the expr expression evaluates to true. |
Bag | union(Bag rhs) A Bag that contains every elements of this bag and every elements in rhs. |
Bag | union(Set rhs) A Bag that contains every elements of this bag and every elements in rhs. |
Operations inherited from type Collection |
excludes, excludesAll, exists, forAll, getOne, includes, includesAll, isEmpty, isUnique, notEmpty, size, sortedBy, sortedBy, sum |
Operations Detail |
public Boolean =(Bag rhs)
public Boolean <>(Bag rhs)
public Bag union(Bag rhs)
public Bag union(Set rhs)
public Bag intersection(Bag rhs)
public Set intersection(Set rhs)
public Bag including(OclAny object)
public Bag excluding(OclAny object)
public Bag select(Boolean_Expression expr)
public Bag reject(Boolean_Expression expr)
public Bag collect(OclAny_Expression expr)
public Integer count(OclAny object)
count
in type Collection
public Sequence asSequence
public Set asSet
| |||||
Previous Next |