BagSortedMap

case class BagSortedMap[A](smap: SortedMap[A, Int])(implicit evidence$1: Ordering[A]) extends Bag[A]
Companion:
object
trait Serializable
trait Product
trait Equals
trait Bag[A]
class Object
trait Matchable
class Any

Value members

Concrete methods

override def add(elem: A, n: Int): BagSortedMap[A]

A more efficient version of add

A more efficient version of add

Definition Classes
def contains(elem: A): Boolean

Check if a bag contains an element

Check if a bag contains an element

def delete(elem: A): BagSortedMap[A]

Deletes an element and returns the new bag It doesn't complain if the element doesn't exist

Deletes an element and returns the new bag It doesn't complain if the element doesn't exist

def elems: Iterator[(A, Int)]

Elements of a Bag with their multiplicity

Elements of a Bag with their multiplicity

def insert(elem: A): BagSortedMap[A]

Inserts an element in a bag and returns the new bag

Inserts an element in a bag and returns the new bag

def multiplicity(elem: A): Int

Multiplicity of an element in a bag

Multiplicity of an element in a bag

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Returns:

a string representation of the object.

Definition Classes
Any

Inherited methods

def from(t: Iterable[A]): Bag[A]
Inherited from:
Bag
Inherited from:
Product
def size: Int

Size returns the total number of elements. Notice that if an element appears 4 times, it adds 4 to the counter

Size returns the total number of elements. Notice that if an element appears 4 times, it adds 4 to the counter

Inherited from:
Bag
def toSeq: Seq[A]
Inherited from:
Bag
def union(other: Bag[A]): Bag[A]

Union of two bags

Union of two bags

Inherited from:
Bag