trait Bag[A] extends AnyRef
Ordering
- Alphabetic
- By Inheritance
Inherited
- Bag
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Abstract Value Members
- abstract def asSortedMap: SortedMap[A, Int]
-
abstract
def
contains(elem: A): Boolean
Check if a bag contains an element
-
abstract
def
delete(elem: A): Bag[A]
Deletes an element and returns the new bag It doesn't complain if the element doesn't exist
-
abstract
def
elems: Iterator[(A, Int)]
Elements of a Bag with their multiplicity
-
abstract
def
insert(elem: A): Bag[A]
Inserts an element in a bag and returns the new bag
-
abstract
def
multiplicity(elem: A): Int
Multiplicity of an element in a bag
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
add(elem: A, n: Int): Bag[A]
add an element n times to a bag This default implementation is not efficient, it should be overridden
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(other: Any): Boolean
- Definition Classes
- Bag → AnyRef → Any
- def from(t: Iterable[A]): Bag[A]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
size: Int
Size returns the total number of elements.
Size returns the total number of elements. Notice that if an element appears 4 times, it adds 4 to the counter
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toSeq: Seq[A]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
union(other: Bag[A]): Bag[A]
Union of two bags
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )