scala.collection

# mutable

#### package mutable

Content Hierarchy Learn more about scaladoc diagrams
Visibility

1. Public
2. All

### Type Members

1. #### abstract class AbstractBuffer[A] extends AbstractSeq[A] with Buffer[A]

   Explicit instantiation of the `Buffer` trait to reduce class file size in subclasses.

2. #### abstract class AbstractIterable[A] extends collection.AbstractIterable[A] with Iterable[A]

   Explicit instantiation of the `Iterable` trait to reduce class file size in subclasses.

3. #### abstract class AbstractMap[A, B] extends collection.AbstractMap[A, B] with Map[A, B]

   Explicit instantiation of the `Map` trait to reduce class file size in subclasses.

4. #### abstract class AbstractSeq[A] extends collection.AbstractSeq[A] with Seq[A]

   Explicit instantiation of the `Seq` trait to reduce class file size in subclasses.

5. #### abstract class AbstractSet[A] extends AbstractIterable[A] with Set[A]

   Explicit instantiation of the `Set` trait to reduce class file size in subclasses.

6. #### final class AnyRefMap[K <: AnyRef, V] extends AbstractMap[K, V] with Map[K, V] with MapLike[K, V, AnyRefMap[K, V]]

   This class implements mutable maps with `AnyRef` keys based on a hash table with open addressing.

7. #### class ArrayBuffer[A] extends AbstractBuffer[A] with Buffer[A] with GenericTraversableTemplate[A, ArrayBuffer] with BufferLike[A, ArrayBuffer[A]] with IndexedSeqOptimized[A, ArrayBuffer[A]] with Builder[A, ArrayBuffer[A]] with ResizableArray[A] with CustomParallelizable[A, ParArray[A]] with Serializable

   An implementation of the `Buffer` class using an array to represent the assembled sequence internally.

8. #### abstract class ArrayBuilder[T] extends Builder[T, Array[T]] with Serializable

   A builder class for arrays.

9. #### trait ArrayLike[A, +Repr] extends IndexedSeqOptimized[A, Repr]

   A common supertrait of `ArrayOps` and `WrappedArray` that factors out the `deep` method for arrays and wrapped arrays and serves as a marker trait for array wrappers.

10. #### trait ArrayOps[T] extends ArrayLike[T, Array[T]] with CustomParallelizable[T, ParArray[T]]

    This class serves as a wrapper for `Array`s with all the operations found in indexed sequences.

11. #### class ArraySeq[A] extends AbstractSeq[A] with IndexedSeq[A] with GenericTraversableTemplate[A, ArraySeq] with IndexedSeqOptimized[A, ArraySeq[A]] with CustomParallelizable[A, ParArray[A]] with Serializable

    A class for polymorphic arrays of elements that's represented internally by an array of objects.

12. #### class ArrayStack[T] extends AbstractSeq[T] with Seq[T] with SeqLike[T, ArrayStack[T]] with GenericTraversableTemplate[T, ArrayStack] with Cloneable[ArrayStack[T]] with Builder[T, ArrayStack[T]] with Serializable

    Simple stack class backed by an array.

13. #### class BitSet extends AbstractSet[Int] with SortedSet[Int] with collection.BitSet with BitSetLike[BitSet] with SetLike[Int, BitSet] with Serializable

    A class for mutable bitsets.

14. #### trait Buffer[A] extends Seq[A] with GenericTraversableTemplate[A, Buffer] with BufferLike[A, Buffer[A]] with scala.Cloneable

    Buffers are used to create sequences of elements incrementally by appending, prepending, or inserting new elements.

15. #### trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]] extends Growable[A] with Shrinkable[A] with Scriptable[A] with Subtractable[A, This] with SeqLike[A, This] with scala.Cloneable

    A template trait for buffers of type `Buffer[A]`.

16. #### trait Builder[-Elem, +To] extends Growable[Elem]

    The base trait of all builders.

17. #### trait Cloneable[+A <: AnyRef] extends scala.Cloneable

    A trait for cloneable collections.

18. #### final class DefaultEntry[A, B] extends HashEntry[A, DefaultEntry[A, B]] with Serializable

    Class used internally for default map model.

19. #### trait FlatHashTable[A] extends HashUtils[A]

    An implementation class backing a `HashSet`.

20. #### class GrowingBuilder[Elem, To <: Growable[Elem]] extends Builder[Elem, To]

    The canonical builder for collections that are growable, i.

21. #### trait HashEntry[A, E] extends AnyRef

    Class used internally.

22. #### class HashMap[A, B] extends AbstractMap[A, B] with Map[A, B] with MapLike[A, B, HashMap[A, B]] with HashTable[A, DefaultEntry[A, B]] with CustomParallelizable[(A, B), ParHashMap[A, B]] with Serializable

    This class implements mutable maps using a hashtable.

23. #### class HashSet[A] extends AbstractSet[A] with Set[A] with GenericSetTemplate[A, HashSet] with SetLike[A, HashSet[A]] with FlatHashTable[A] with CustomParallelizable[A, ParHashSet[A]] with Serializable

    This class implements mutable sets using a hashtable.

24. #### trait HashTable[A, Entry >: Null <: HashEntry[A, Entry]] extends HashUtils[A]

    This class can be used to construct data structures that are based on hashtables.

25. #### class History[Evt, Pub] extends AbstractIterable[(Pub, Evt)] with Subscriber[Evt, Pub] with Iterable[(Pub, Evt)] with Serializable

    `History[A, B]` objects may subscribe to events of type `A` published by an object of type `B`.

26. #### trait IndexedSeq[A] extends Seq[A] with collection.IndexedSeq[A] with GenericTraversableTemplate[A, IndexedSeq] with IndexedSeqLike[A, IndexedSeq[A]]

    A subtrait of `collection.IndexedSeq` which represents sequences that can be mutated.

27. #### trait IndexedSeqLike[A, +Repr] extends collection.IndexedSeqLike[A, Repr]

    A subtrait of scala.

28. #### trait IndexedSeqOptimized[A, +Repr] extends IndexedSeqLike[A, Repr] with collection.IndexedSeqOptimized[A, Repr]

    A subtrait of scala.

29. #### trait IndexedSeqView[A, +Coll] extends IndexedSeq[A] with IndexedSeqOptimized[A, IndexedSeqView[A, Coll]] with SeqView[A, Coll] with SeqViewLike[A, Coll, IndexedSeqView[A, Coll]]

    A non-strict view of a mutable `IndexedSeq`.

30. #### trait Iterable[A] extends Traversable[A] with collection.Iterable[A] with GenericTraversableTemplate[A, Iterable] with IterableLike[A, Iterable[A]] with Parallelizable[A, ParIterable[A]]

    A base trait for iterable collections that can be mutated.

31. #### abstract class LazyBuilder[Elem, +To] extends Builder[Elem, To]

    A builder that constructs its result lazily.

32. #### trait LinearSeq[A] extends Seq[A] with collection.LinearSeq[A] with GenericTraversableTemplate[A, LinearSeq] with LinearSeqLike[A, LinearSeq[A]]

    A subtrait of `collection.LinearSeq` which represents sequences that can be mutated.

33. #### final class LinkedEntry[A, B] extends HashEntry[A, LinkedEntry[A, B]] with Serializable

    Class for the linked hash map entry, used internally.

34. #### class LinkedHashMap[A, B] extends AbstractMap[A, B] with Map[A, B] with MapLike[A, B, LinkedHashMap[A, B]] with HashTable[A, LinkedEntry[A, B]] with Serializable

    This class implements mutable maps using a hashtable.

35. #### class LinkedHashSet[A] extends AbstractSet[A] with Set[A] with GenericSetTemplate[A, LinkedHashSet] with SetLike[A, LinkedHashSet[A]] with HashTable[A, Entry[A]] with Serializable

    This class implements mutable sets using a hashtable.

36. #### final class ListBuffer[A] extends AbstractBuffer[A] with Buffer[A] with GenericTraversableTemplate[A, ListBuffer] with BufferLike[A, ListBuffer[A]] with Builder[A, immutable.List[A]] with SeqForwarder[A] with java.io.Serializable

    A `Buffer` implementation back up by a list.

37. #### class ListMap[A, B] extends AbstractMap[A, B] with Map[A, B] with MapLike[A, B, ListMap[A, B]] with Serializable

    A simple mutable map backed by a list.

38. #### final class LongMap[V] extends AbstractMap[Long, V] with Map[Long, V] with MapLike[Long, V, LongMap[V]] with Serializable

    This class implements mutable maps with `Long` keys based on a hash table with open addressing.

39. #### trait Map[A, B] extends Iterable[(A, B)] with collection.Map[A, B] with MapLike[A, B, Map[A, B]]

    A base trait for maps that can be mutated.

40. #### class MapBuilder[A, B, Coll <: GenMap[A, B] with GenMapLike[A, B, Coll]] extends Builder[(A, B), Coll]

    The canonical builder for immutable maps, working with the map's `+` method to add new elements.

41. #### trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]] extends collection.MapLike[A, B, This] with Builder[(A, B), This] with Growable[(A, B)] with Shrinkable[A] with Cloneable[This] with Parallelizable[(A, B), ParMap[A, B]]

    A template trait for mutable maps.

42. #### trait MultiMap[A, B] extends Map[A, Set[B]]

    A trait for mutable maps with multiple values assigned to a key.

43. #### class MutableList[A] extends AbstractSeq[A] with LinearSeq[A] with LinearSeqOptimized[A, MutableList[A]] with GenericTraversableTemplate[A, MutableList] with Builder[A, MutableList[A]] with Serializable

    This class is used internally to represent mutable lists.

44. #### class OpenHashMap[Key, Value] extends AbstractMap[Key, Value] with Map[Key, Value] with MapLike[Key, Value, OpenHashMap[Key, Value]]

    A mutable hash map based on an open hashing scheme.

45. #### class PriorityQueue[A] extends AbstractIterable[A] with Iterable[A] with GenericOrderedTraversableTemplate[A, PriorityQueue] with IterableLike[A, PriorityQueue[A]] with Growable[A] with Builder[A, PriorityQueue[A]] with Serializable with scala.Cloneable

    This class implements priority queues using a heap.

46. #### trait Publisher[Evt] extends AnyRef

    `Publisher[A,This]` objects publish events of type `A` to all registered subscribers.

47. #### class Queue[A] extends MutableList[A] with LinearSeqOptimized[A, Queue[A]] with GenericTraversableTemplate[A, Queue] with Cloneable[Queue[A]] with Serializable

    `Queue` objects implement data structures that allow to insert and retrieve elements in a first-in-first-out (FIFO) manner.

48. #### trait ResizableArray[A] extends IndexedSeq[A] with GenericTraversableTemplate[A, ResizableArray] with IndexedSeqOptimized[A, ResizableArray[A]]

    This class is used internally to implement data structures that are based on resizable arrays.

49. #### class RevertibleHistory[Evt <: Undoable, Pub] extends History[Evt, Pub] with Undoable with Serializable

    A revertible history is a `History` object which supports an undo operation.

50. #### trait Seq[A] extends Iterable[A] with collection.Seq[A] with GenericTraversableTemplate[A, Seq] with SeqLike[A, Seq[A]]

    A subtrait of `collection.Seq` which represents sequences that can be mutated.

51. #### trait SeqLike[A, +This <: SeqLike[A, This] with Seq[A]] extends collection.SeqLike[A, This] with Cloneable[This] with Parallelizable[A, ParSeq[A]]

    A template trait for mutable sequences of type `mutable.Seq[A]`.

52. #### trait Set[A] extends Iterable[A] with collection.Set[A] with GenericSetTemplate[A, Set] with SetLike[A, Set[A]]

    A generic trait for mutable sets.

53. #### class SetBuilder[A, Coll <: collection.Set[A] with collection.SetLike[A, Coll]] extends Builder[A, Coll]

    The canonical builder for mutable Sets.

54. #### trait SetLike[A, +This <: SetLike[A, This] with Set[A]] extends collection.SetLike[A, This] with Scriptable[A] with Builder[A, This] with Growable[A] with Shrinkable[A] with Cloneable[Set[A]] with Parallelizable[A, ParSet[A]]

    A template trait for mutable sets of type `mutable.Set[A]`.

55. #### trait SortedSet[A] extends collection.SortedSet[A] with SortedSetLike[A, SortedSet[A]] with Set[A] with SetLike[A, SortedSet[A]]

    Base trait for mutable sorted set.

56. #### class Stack[A] extends AbstractSeq[A] with Seq[A] with SeqLike[A, Stack[A]] with GenericTraversableTemplate[A, Stack] with Cloneable[Stack[A]] with Serializable

    A stack implements a data structure which allows to store and retrieve objects in a last-in-first-out (LIFO) fashion.

57. #### final class StringBuilder extends AbstractSeq[Char] with CharSequence with IndexedSeq[Char] with StringLike[StringBuilder] with Builder[Char, String] with Serializable

    A builder for mutable sequence of characters.

58. #### trait Subscriber[-Evt, -Pub] extends AnyRef

    `Subscriber[A, B]` objects may subscribe to events of type `A` published by an object of type `B`.

59. #### trait Traversable[A] extends collection.Traversable[A] with GenericTraversableTemplate[A, Traversable] with TraversableLike[A, Traversable[A]] with Mutable

    A trait for traversable collections that can be mutated.

60. #### class TreeSet[A] extends SortedSet[A] with SetLike[A, TreeSet[A]] with SortedSetLike[A, TreeSet[A]] with Set[A] with Serializable

    A mutable SortedSet using an immutable RedBlack Tree as underlying data structure.

61. #### trait Undoable extends AnyRef

    Classes that mix in the `Undoable` class provide an operation `undo` which can be used to undo the last operation.

62. #### class UnrolledBuffer[T] extends AbstractBuffer[T] with Buffer[T] with BufferLike[T, UnrolledBuffer[T]] with GenericClassTagTraversableTemplate[T, UnrolledBuffer] with Builder[T, UnrolledBuffer[T]] with Serializable

    A buffer that stores elements in an unrolled linked list.

63. #### class WeakHashMap[A, B] extends convert.Wrappers.JMapWrapper[A, B] with convert.Wrappers.JMapWrapperLike[A, B, WeakHashMap[A, B]]

    A hash map with references to entries which are weakly reachable.

64. #### abstract class WrappedArray[T] extends AbstractSeq[T] with IndexedSeq[T] with ArrayLike[T, WrappedArray[T]] with CustomParallelizable[T, ParArray[T]]

    A class representing `Array[T]`.

65. #### class WrappedArrayBuilder[A] extends Builder[A, WrappedArray[A]]

    A builder class for arrays.

66. #### trait BufferProxy[A] extends Buffer[A] with Proxy

    This is a simple proxy class for `scala.collection.mutable.Buffer`.

67. #### trait DefaultMapModel[A, B] extends Map[A, B]

    This class is used internally.

68. #### class DoubleLinkedList[A] extends AbstractSeq[A] with LinearSeq[A] with GenericTraversableTemplate[A, DoubleLinkedList] with DoubleLinkedListLike[A, DoubleLinkedList[A]] with Serializable

    This class implements double linked lists where both the head (`elem`), the tail (`next`) and a reference to the previous node (`prev`) are mutable.

69. #### trait DoubleLinkedListLike[A, This <: Seq[A] with DoubleLinkedListLike[A, This]] extends SeqLike[A, This] with LinkedListLike[A, This]

    This extensible class may be used as a basis for implementing double linked lists.

70. #### class ImmutableMapAdaptor[A, B] extends AbstractMap[A, B] with Map[A, B] with Serializable

    This class can be used as an adaptor to create mutable maps from immutable map implementations.

71. #### class ImmutableSetAdaptor[A] extends AbstractSet[A] with Set[A] with Serializable

    This class can be used as an adaptor to create mutable sets from immutable set implementations.

72. #### class LinkedList[A] extends AbstractSeq[A] with LinearSeq[A] with GenericTraversableTemplate[A, LinkedList] with LinkedListLike[A, LinkedList[A]] with Serializable

    A more traditional/primitive style of linked list where the "list" is also the "head" link.

73. #### trait LinkedListLike[A, This <: Seq[A] with LinkedListLike[A, This]] extends SeqLike[A, This]

    This extensible class may be used as a basis for implementing linked list.

74. #### trait MapProxy[A, B] extends Map[A, B] with MapProxyLike[A, B, Map[A, B]]

    This trait implements a proxy for scala.collection.mutable.Map.

75. #### trait ObservableBuffer[A] extends Buffer[A] with Publisher[Message[A] with Undoable]

    This class is typically used as a mixin.

76. #### trait ObservableMap[A, B] extends Map[A, B] with Publisher[Message[(A, B)] with Undoable]

    This class is typically used as a mixin.

77. #### trait ObservableSet[A] extends Set[A] with Publisher[Message[A] with Undoable]

    This class is typically used as a mixin.

78. #### abstract class PriorityQueueProxy[A] extends PriorityQueue[A] with Proxy

    This class servers as a proxy for priority queues.

79. #### trait QueueProxy[A] extends Queue[A] with Proxy

    `Queue` objects implement data structures that allow to insert and retrieve elements in a first-in-first-out (FIFO) manner.

80. #### trait SetProxy[A] extends Set[A] with SetProxyLike[A, Set[A]]

    This is a simple wrapper class for scala.collection.mutable.Set.

81. #### trait StackProxy[A] extends Stack[A] with Proxy

    A stack implements a data structure which allows to store and retrieve objects in a last-in-first-out (LIFO) fashion.

82. #### trait SynchronizedBuffer[A] extends Buffer[A]

    This class should be used as a mixin.

83. #### trait SynchronizedMap[A, B] extends Map[A, B]

    This class should be used as a mixin.

84. #### class SynchronizedPriorityQueue[A] extends PriorityQueue[A]

    This class implements synchronized priority queues using a binary heap.

85. #### class SynchronizedQueue[A] extends Queue[A]

    This is a synchronized version of the `Queue[T]` class.

86. #### trait SynchronizedSet[A] extends Set[A]

    This class should be used as a mixin.

87. #### class SynchronizedStack[A] extends Stack[A]

    This is a synchronized version of the `Stack[T]` class.

### Value Members

1. #### object AnyRefMap

2. #### object ArrayBuffer extends SeqFactory[ArrayBuffer] with Serializable

   Factory object for the `ArrayBuffer` class.

3. #### object ArrayBuilder extends Serializable

   A companion object for array builders.

4. #### object ArrayOps

   A companion object for `ArrayOps`.

5. #### object ArraySeq extends SeqFactory[ArraySeq] with Serializable

   This object provides a set of operations to create ``ArraySeq`` values.

6. #### object ArrayStack extends SeqFactory[ArrayStack] with Serializable

   Factory object for the `ArrayStack` class.

7. #### object BitSet extends BitSetFactory[BitSet] with Serializable

   This object provides a set of operations to create ``BitSet`` values.

8. #### object Buffer extends SeqFactory[Buffer]

   This object provides a set of operations to create ``Buffer`` values.

9. #### object HashMap extends MutableMapFactory[HashMap] with Serializable

   This object provides a set of operations needed to create ``mutable.HashMap`` values.

10. #### object HashSet extends MutableSetFactory[HashSet] with Serializable

    This object provides a set of operations needed to create ``mutable.HashSet`` values.

11. #### object IndexedSeq extends SeqFactory[IndexedSeq]

    This object provides a set of operations to create ``mutable.IndexedSeq`` values.

12. #### object IndexedSeqView

    An object containing the necessary implicit definitions to make `SeqView`s work.

13. #### object Iterable extends GenTraversableFactory[Iterable] with TraversableFactory[Iterable]

    This object provides a set of operations to create ``mutable.Iterable`` values.

14. #### object LinearSeq extends SeqFactory[LinearSeq]

    This object provides a set of operations to create ``mutable.LinearSeq`` values.

15. #### object LinkedHashMap extends MutableMapFactory[LinkedHashMap] with Serializable

    This object provides a set of operations needed to create ``LinkedHashMap`` values.

16. #### object LinkedHashSet extends MutableSetFactory[LinkedHashSet] with Serializable

    This object provides a set of operations needed to create ``LinkedHashSet`` values.

17. #### object ListBuffer extends SeqFactory[ListBuffer] with Serializable

    This object provides a set of operations to create ``ListBuffer`` values.

18. #### object ListMap extends MutableMapFactory[ListMap] with Serializable

    This object provides a set of operations needed to create ``mutable.ListMap`` values.

19. #### object LongMap extends Serializable

20. #### object Map extends MutableMapFactory[Map]

    This object provides a set of operations needed to create ``mutable.Map`` values.

21. #### object MutableList extends SeqFactory[MutableList] with Serializable

22. #### object OpenHashMap

23. #### object PriorityQueue extends OrderedTraversableFactory[PriorityQueue] with Serializable

24. #### object Queue extends SeqFactory[Queue] with Serializable

25. #### object ResizableArray extends SeqFactory[ResizableArray]

26. #### object Seq extends SeqFactory[Seq]

    This object provides a set of operations to create ``mutable.Seq`` values.

27. #### object Set extends MutableSetFactory[Set]

    This object provides a set of operations needed to create ``mutable.Set`` values.

28. #### object SortedSet extends MutableSortedSetFactory[SortedSet]

    A template for mutable sorted set companion objects.

29. #### object Stack extends SeqFactory[Stack] with Serializable

    Factory object for the `mutable.Stack` class.

30. #### object StringBuilder extends Serializable

31. #### object Traversable extends GenTraversableFactory[Traversable] with TraversableFactory[Traversable]

    This object provides a set of operations to create ``mutable.Traversable`` values.

32. #### object TreeSet extends MutableSortedSetFactory[TreeSet] with Serializable

33. #### object UnrolledBuffer extends ClassTagTraversableFactory[UnrolledBuffer] with Serializable

34. #### object WeakHashMap extends MutableMapFactory[WeakHashMap] with Serializable

    This object provides a set of operations needed to create ``WeakHashMap`` values.

35. #### object WrappedArray

    A companion object used to create instances of `WrappedArray`.

### Deprecated Value Members

1. #### object DoubleLinkedList extends SeqFactory[DoubleLinkedList] with Serializable

   This object provides a set of operations to create ``DoubleLinkedList`` values.

2. #### object LinkedList extends SeqFactory[LinkedList] with Serializable

   This object provides a set of operations to create ``LinkedList`` values.

### Ungrouped