NonUniqueCollection<T>

NonUniqueCollection<T>

The NonUniqueCollection type provides the shared functionality of the Bag and Sequence collections for which the elements are not unique. The common supertype of NonUniqueCollection is Collection.

conformsTo Collection<T>

Iterations

sortedBy(i : T | body : Lambda T() : OclAny) : Sequence<T>

Results in the Sequence containing all elements of the source collection. The element for which body has the lowest value comes first, and so on. The type of the body expression must have the < operation defined. The < operation must return a Boolean value and must be transitive (i.e., if a < b and b < c then a < c).