kermeta::standard
Class Bag[G] inherited from Collection[G]



Bag is a concrete non-ordered Collection allowing duplicates

@CompilerIgnore "true"
@ScalaCompilerName "k2.standard.Bag"

Method Summary
Boolean
equals(Object)


Overrides Object.equals(elt : Object)
Returns a Boolean stating whether the provided element is equal to
current Bag.
The provided element is equal to the current Bag if:


  • it is not an OrderedCollection

  • it is a Collection (not necessarily a Bag)

  • it contains exactly the same elements than the current Bag,
    with the same multiplicity


           
Bag[G]
excluding()


Returns a new Bag which content includes the content of the
current Bag from which all instances of object have been
removed


           
Bag[Object]
flatten()


Returns a new Bag which content includes all non-Collection elements
of the current Set, and, for each Collection element of the current
Bag, as many elements as the Collection contains


           
Bag[G]
including()


Returns a new Bag which content includes the content of the
current Bag and the element object


           
Bag[G]
intersection(Collection)


Returns a new Bag corresponding to the intersection of elements
and the Bag


           
Set[G]
intersectionWithSet(Set)


Returns a new Set corresponding to the intersection of a Set of
elements and the Bag


           
Void
removeFromOid()


Removes the element identified by the provided Oid from the Bag


           
Void
removeOne()


Removes one instance of element from the Bag


           
Sequence[G]
sortedBy()


Returns a sequence of the bag elements sorted using the given comparator.
The comparator must return an integer n such that


  • n > 0 if the second [G] element is greater than the first

  • n == 0 if the second [G] element equals the first

  • n < 0 if the second [G] element is lower than the first


           
Bag[G]
union(Collection)


Returns a new Bag corresponding to the union of elements and
current Bag


           


Details of operations

equals

Boolean equals[(Object)


Overrides Object.equals(elt : Object)
Returns a Boolean stating whether the provided element is equal to
current Bag.
The provided element is equal to the current Bag if:

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;14176;14231"

excluding

Bag[G] excluding[()


Returns a new Bag which content includes the content of the
current Bag from which all instances of object have been
removed

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;15304;15354"

flatten

Bag[Object] flatten[()


Returns a new Bag which content includes all non-Collection elements
of the current Set, and, for each Collection element of the current
Bag, as many elements as the Collection contains

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;15567;15611"

including

Bag[G] including[()


Returns a new Bag which content includes the content of the
current Bag and the element object

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;15101;15151"

intersection

Bag[G] intersection[(Collection)


Returns a new Bag corresponding to the intersection of elements
and the Bag

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;14486;14554"

intersectionWithSet

Set[G] intersectionWithSet[(Set)


Returns a new Set corresponding to the intersection of a Set of
elements and the Bag

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;14662;14730"

removeFromOid

Void removeFromOid[()


Removes the element identified by the provided Oid from the Bag

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;14813;14869"

removeOne

Void removeOne[()


Removes one instance of element from the Bag

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;14933;14983"

sortedBy

Sequence[G] sortedBy[()


Returns a sequence of the bag elements sorted using the given comparator.
The comparator must return an integer n such that

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;15989;16067"

union

Bag[G] union[(Collection)


Returns a new Bag corresponding to the union of elements and
current Bag

@traceability_text_reference "file:/mnt/extradisk/builds/workspace/org.kermeta.language.library_master/org/kermeta/language/org.kermeta.language.library.standard/src/main/kmt/kermeta/standard/collections.kmt;14326;14387"