Add a single item to this bag.
Add an item and a count as a tuple to this bag.
Add multiple items to this bag.
Remove a single item from this bag.
Remove an item and a count as a tuple from this bag.
Add an item and a count to this bag.
Add an item and a count to this bag.
an item to add
the count to add
a bag with count more of key k
Efficiently convert to a immutable.
Efficiently convert to a immutable.Map
Get the count of a key from this bag
Get the count of a key from this bag
the key to lookup
Some of the count if the bag contains the key, or None
Efficiently merge another bag with this bag.
Efficiently merge another bag with this bag.
the merged bag
Remove a particular key from this bag.
(Changed in version 2.9.0) The behavior of scanRight has changed. The previous behavior can be reproduced with scanRight.reverse.
(Changed in version 2.9.0) transpose throws an IllegalArgumentException if collections are not uniformly sized.
An iterable of the unique keys in this bag.
Update the count of a particular key in this bag.
Update the count of a particular key in this bag.
a tuple of the key and the new count
a bag with key updated to the count
(Since version 2.8.0) use iterator' instead
(Since version 2.8.0) use head' instead
(Since version 2.8.0) use headOption' instead
(Since version 2.8.0) use view' instead
An immutable data structure that is similar to a set but can store multiple instances of any one value. Also known as a multiset.
Bags are created using the companion object.