package mutable
- Alphabetic
- Public
- All
Type Members
-
abstract
class
AbstractBuffer[A] extends AbstractSeq[A] with Buffer[A]
Explicit instantiation of the
Buffer
trait to reduce class file size in subclasses. -
abstract
class
AbstractIterable[A] extends collection.AbstractIterable[A] with Iterable[A]
Explicit instantiation of the
Iterable
trait to reduce class file size in subclasses. -
abstract
class
AbstractMap[K, V] extends collection.AbstractMap[K, V] with Map[K, V]
Explicit instantiation of the
Map
trait to reduce class file size in subclasses. -
abstract
class
AbstractSeq[A] extends collection.AbstractSeq[A] with Seq[A]
Explicit instantiation of the
Seq
trait to reduce class file size in subclasses. -
abstract
class
AbstractSet[A] extends AbstractIterable[A] with Set[A]
Explicit instantiation of the
Set
trait to reduce class file size in subclasses. -
abstract
class
AbstractSortedMap[A, B] extends AbstractMap[A, B] with SortedMap[A, B]
Explicit instantiation of the
SortedMap
trait to reduce class file size in subclasses. -
abstract
class
AbstractSortedSet[A] extends AbstractSet[A] with SortedSet[A]
Explicit instantiation of the
SortedSet
trait to reduce class file size in subclasses. -
final
class
AnyRefMap[K <: AnyRef, V] extends AbstractMap[K, V] with Map[K, V] with MapLike[K, V, AnyRefMap[K, V]] with Serializable
This class implements mutable maps with
AnyRef
keys based on a hash table with open addressing.This class implements mutable maps with
AnyRef
keys based on a hash table with open addressing.Basic map operations on single entries, including
contains
andget
, are typically significantly faster withAnyRefMap
than HashMap. Note that numbers and characters are not handled specially in AnyRefMap; only plainequals
andhashCode
are used in comparisons.Methods that traverse or regenerate the map, including
foreach
andmap
, are not in general faster than withHashMap
. The methodsforeachKey
,foreachValue
,mapValuesNow
, andtransformValues
are, however, faster than alternative ways to achieve the same functionality.Maps with open addressing may become less efficient at lookup after repeated addition/removal of elements. Although
AnyRefMap
makes a decent attempt to remain efficient regardless, callingrepack
on a map that will no longer have elements removed but will be used heavily may save both time and storage space.This map is not intended to contain more than 229 entries (approximately 500 million). The maximum capacity is 230, but performance will degrade rapidly as 230 is approached.
- Annotations
- @SerialVersionUID()
-
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.An implementation of the
Buffer
class using an array to represent the assembled sequence internally. Append, update and random access take constant time (amortized time). Prepends and removes are linear in the buffer size.- A
the type of this arraybuffer's elements.
- Annotations
- @SerialVersionUID()
- Version
2.8
- Since
1
- See also
"Scala's Collection Library overview" section on
Array Buffers
for more information.
-
abstract
class
ArrayBuilder[T] extends ReusableBuilder[T, Array[T]] with Serializable
A builder class for arrays.
A builder class for arrays.
- T
the type of the elements for the builder.
- Since
2.8
-
trait
ArrayLike[A, +Repr] extends IndexedSeqOptimized[A, Repr]
A common supertrait of
ArrayOps
andWrappedArray
that factors out thedeep
method for arrays and wrapped arrays and serves as a marker trait for array wrappers.A common supertrait of
ArrayOps
andWrappedArray
that factors out thedeep
method for arrays and wrapped arrays and serves as a marker trait for array wrappers.- A
type of the elements contained in the array like object.
- Repr
the type of the actual collection containing the elements.
-
sealed
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.This class serves as a wrapper for
Array
s with all the operations found in indexed sequences. Where needed, instances of arrays are implicitly converted into this class.The difference between this class and
WrappedArray
is that calling transformer methods such asfilter
andmap
will yield an array, whereas aWrappedArray
will remain aWrappedArray
.- T
type of the elements contained in this array.
- Since
2.8
-
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.
A class for polymorphic arrays of elements that's represented internally by an array of objects. This means that elements of primitive types are boxed.
- A
type of the elements contained in this array sequence.
- Annotations
- @SerialVersionUID()
- Version
2.8
- Since
2.8
- See also
"Scala's Collection Library overview" section on
Array Sequences
for more information.
-
class
ArrayStack[T] extends AbstractSeq[T] with IndexedSeq[T] with IndexedSeqLike[T, ArrayStack[T]] with GenericTraversableTemplate[T, ArrayStack] with IndexedSeqOptimized[T, ArrayStack[T]] with Cloneable[ArrayStack[T]] with Builder[T, ArrayStack[T]] with Serializable
Simple stack class backed by an array.
Simple stack class backed by an array. Should be significantly faster than the standard mutable stack.
- T
type of the elements contained in this array stack.
- Annotations
- @SerialVersionUID()
- Since
2.7
- See also
"Scala's Collection Library overview" section on
Array Stacks
for more information.
-
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.
A class for mutable bitsets.
Bitsets are sets of non-negative integers which are represented as variable-size arrays of bits packed into 64-bit words. The memory footprint of a bitset is determined by the largest number stored in it.
- Annotations
- @SerialVersionUID()
- See also
"Scala's Collection Library overview" section on
Mutable Bitsets
for more information.
-
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.
Buffers are used to create sequences of elements incrementally by appending, prepending, or inserting new elements. It is also possible to access and modify elements in a random access fashion via the index of the element in the current sequence.
- A
type of the elements contained in this buffer.
- Version
2.8
- Since
1
-
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]
.A template trait for buffers of type
Buffer[A]
.Buffers are used to create sequences of elements incrementally by appending, prepending, or inserting new elements. It is also possible to access and modify elements in a random access fashion via the index of the element in the current sequence.
- A
the type of the elements of the buffer
- This
the type of the buffer itself.
- Version
2.8
- Since
2.8
- Note
This trait provides most of the operations of a
Buffer
independently of its representation. It is typically inherited by concrete implementations of buffers. To implement a concrete buffer, you need to provide implementations of the following methods:def apply(idx: Int): A def update(idx: Int, elem: A) def length: Int def clear() def +=(elem: A): this.type def +=:(elem: A): this.type def insertAll(n: Int, iter: Traversable[A]) def remove(n: Int): A
-
trait
Builder[-Elem, +To] extends Growable[Elem]
The base trait of all builders.
The base trait of all builders. A builder lets one construct a collection incrementally, by adding elements to the builder with
+=
and then converting to the required collection type withresult
.One cannot assume that a single
Builder
can build more than one instance of the desired collection. Particular subclasses may allow such behavior. Otherwise,result
should be treated as a terminal operation: after it is called, no further methods should be called on the builder. Extend the collection.mutable.ReusableBuilder trait instead ofBuilder
for builders that may be reused to build multiple instances.- Elem
the type of elements that get added to the builder.
- To
the type of collection that it produced.
- Since
2.8
-
trait
Cloneable[+A <: AnyRef] extends scala.Cloneable
A trait for cloneable collections.
A trait for cloneable collections.
- A
Type of the elements contained in the collection, covariant and with reference types as upperbound.
- Since
2.8
-
final
class
DefaultEntry[A, B] extends HashEntry[A, DefaultEntry[A, B]] with Serializable
Class used internally for default map model.
Class used internally for default map model.
- Since
2.3
-
trait
FlatHashTable[A] extends HashUtils[A]
An implementation class backing a
HashSet
.An implementation class backing a
HashSet
.This trait is used internally. It can be mixed in with various collections relying on hash table as an implementation.
-
class
GrowingBuilder[Elem, To <: Growable[Elem]] extends Builder[Elem, To]
The canonical builder for collections that are growable, i.e.
The canonical builder for collections that are growable, i.e. that support an efficient
+=
method which adds an element to the collection.GrowableBuilders can produce only a single instance of the collection they are growing.
- Version
2.8
- Since
2.8
-
trait
HashEntry[A, E] extends AnyRef
Class used internally.
Class used internally.
- Since
2.8
-
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.
This class implements mutable maps using a hashtable.
- A
the type of the keys contained in this hash map.
- B
the type of the values assigned to keys in this hash map.
- Annotations
- @SerialVersionUID()
- Since
1
- See also
"Scala's Collection Library overview" section on
Hash Tables
for more information.
-
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.
This class implements mutable sets using a hashtable.
- Annotations
- @SerialVersionUID()
- Version
2.0, 31/12/2006
- Since
1
- See also
"Scala's Collection Library overview" section on
Hash Tables
for more information.
-
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.
This class can be used to construct data structures that are based on hashtables. Class
HashTable[A]
implements a hashtable that maps keys of typeA
to values of the fully abstract member typeEntry
. Classes that make use ofHashTable
have to provide an implementation forEntry
.There are mainly two parameters that affect the performance of a hashtable: the initial size and the load factor. The size refers to the number of buckets in the hashtable, and the load factor is a measure of how full the hashtable is allowed to get before its size is automatically doubled. Both parameters may be changed by overriding the corresponding values in class
HashTable
.- A
type of the elements contained in this hash table.
- Version
2.0, 31/12/2006
- Since
1
-
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 typeA
published by an object of typeB
.History[A, B]
objects may subscribe to events of typeA
published by an object of typeB
. The history subscriber object records all published events up to maximum number ofmaxHistory
events.- Evt
Type of events.
- Pub
Type of publishers.
- Annotations
- @SerialVersionUID()
- Version
1.0, 08/07/2003
- Since
1
-
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. -
trait
IndexedSeqLike[A, +Repr] extends collection.IndexedSeqLike[A, Repr]
A subtrait of scala.collection.IndexedSeq which represents sequences that can be mutated.
A subtrait of scala.collection.IndexedSeq which represents sequences that can be mutated.
It declares a method
update
which allows updating an element at a specific index in the sequence.This trait just implements
iterator
in terms ofapply
andlength
. However, seeIndexedSeqOptimized
for an implementation trait that overrides operations to make them run faster under the assumption of fast random access withapply
.- A
the element type of the mutable indexed sequence
- Repr
the type of the actual mutable indexed sequence containing the elements.
-
trait
IndexedSeqOptimized[A, +Repr] extends IndexedSeqLike[A, Repr] with collection.IndexedSeqOptimized[A, Repr]
A subtrait of scala.collection.IndexedSeq which represents sequences that can be mutated.
A subtrait of scala.collection.IndexedSeq which represents sequences that can be mutated.
- Since
2.8
-
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
.A non-strict view of a mutable
IndexedSeq
.A view is a lazy version of some collection. Collection transformers such as
map
orfilter
or++
do not traverse any elements when applied on a view. Instead they create a new view which simply records that fact that the operation needs to be applied. The collection elements are accessed, and the view operations are applied, when a non-view result is needed, or when theforce
method is called on a view. Some of the operations of this class will yield again a mutable indexed sequence, others will just yield a plain indexed sequence of typecollection.IndexedSeq
. Because this is a leaf class there is no associatedLike
class.- A
the element type of the view
- Coll
the type of the underlying collection containing the elements.
- Version
2.8
- Since
2.8
-
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.
A base trait for iterable collections that can be mutated.
This is a base trait for all mutable Scala collections that define an
iterator
method to step through one-by-one the collection's elements. Implementations of this trait need to provide a concrete method with signature:def iterator: Iterator[A]
They also need to provide a method
newBuilder
which creates a builder for collections of the same kind.This trait implements
Iterable
'sforeach
method by stepping through all elements usingiterator
. Subclasses should re-implementforeach
with something more efficient, if possible.This trait adds methods
iterator
,sameElements
,takeRight
,dropRight
to the methods inherited from trait `Traversable`.Note: This trait replaces every method that uses
break
inTraversableLike
by an iterator version. -
abstract
class
LazyBuilder[Elem, +To] extends ReusableBuilder[Elem, To]
A builder that constructs its result lazily.
A builder that constructs its result lazily. Iterators or iterables to be added to this builder with
++=
are not evaluated untilresult
is called.This builder can be reused.
- Elem
type of the elements for this builder.
- To
type of the collection this builder builds.
- Since
2.8
-
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.A subtrait of
collection.LinearSeq
which represents sequences that can be mutated.Linear sequences have reasonably efficient
head
,tail
, andisEmpty
methods. If these methods provide the fastest way to traverse the collection, a collectionColl
that extends this trait should also extendLinearSeqOptimized[A, Coll[A]]
. -
final
class
LinkedEntry[A, B] extends HashEntry[A, LinkedEntry[A, B]] with Serializable
Class for the linked hash map entry, used internally.
Class for the linked hash map entry, used internally.
- Since
2.8
-
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.
This class implements mutable maps using a hashtable. The iterator and all traversal methods of this class visit elements in the order they were inserted.
- A
the type of the keys contained in this hash map.
- B
the type of the values assigned to keys in this hash map.
- Annotations
- @SerialVersionUID()
-
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.
This class implements mutable sets using a hashtable. The iterator and all traversal methods of this class visit elements in the order they were inserted.
- A
the type of the elements contained in this set.
- Annotations
- @SerialVersionUID()
- Version
2.0, 31/12/2006
- Since
1
-
final
class
ListBuffer[A] extends AbstractBuffer[A] with Buffer[A] with GenericTraversableTemplate[A, ListBuffer] with BufferLike[A, ListBuffer[A]] with ReusableBuilder[A, immutable.List[A]] with SeqForwarder[A] with Serializable
A
Buffer
implementation backed by a list.A
Buffer
implementation backed by a list. It provides constant time prepend and append. Most other operations are linear.- A
the type of this list buffer's elements.
- Annotations
- @SerialVersionUID()
- Version
2.8
- Since
1
- See also
"Scala's Collection Library overview" section on
List Buffers
for more information.
-
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, so it preserves insertion order.
A simple mutable map backed by a list, so it preserves insertion order.
- A
the type of the keys contained in this list map.
- B
the type of the values assigned to keys in this list map.
-
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.This class implements mutable maps with
Long
keys based on a hash table with open addressing.Basic map operations on single entries, including
contains
andget
, are typically substantially faster withLongMap
than HashMap. Methods that act on the whole map, includingforeach
andmap
are not in general expected to be faster than with a generic map, save for those that take particular advantage of the internal structure of the map:foreachKey
,foreachValue
,mapValuesNow
, andtransformValues
.Maps with open addressing may become less efficient at lookup after repeated addition/removal of elements. Although
LongMap
makes a decent attempt to remain efficient regardless, callingrepack
on a map that will no longer have elements removed but will be used heavily may save both time and storage space.This map is not intended to contain more than 229 entries (approximately 500 million). The maximum capacity is 230, but performance will degrade rapidly as 2^30 is approached.
-
trait
Map[K, V] extends Iterable[(K, V)] with collection.Map[K, V] with MapLike[K, V, Map[K, V]]
A base trait for maps that can be mutated.
A base trait for maps that can be mutated.
Implementation note: This trait provides most of the operations of a mutable
Map
independently of its representation. It is typically inherited by concrete implementations of maps.To implement a concrete mutable map, you need to provide implementations of the following methods:
def get(key: K): Option[V] def iterator: Iterator[(K, V)] def += (kv: (K, V)): This def -= (key: K): This
If you wish that methods like
take
,drop
,filter
also return the same kind of map you should also override:def empty: This
It is also good idea to override methods
foreach
andsize
for efficiency.- Since
1.0
-
class
MapBuilder[A, B, Coll <: GenMap[A, B] with GenMapLike[A, B, Coll]] extends ReusableBuilder[(A, B), Coll]
The canonical builder for immutable maps, working with the map's
+
method to add new elements.The canonical builder for immutable maps, working with the map's
+
method to add new elements. Collections are built from theirempty
element using this + method.- A
Type of the keys for the map this builder creates.
- B
Type of the values for the map this builder creates.
- Coll
The type of the actual collection this builder builds.
- Since
2.8
-
trait
MapLike[K, V, +This <: MapLike[K, V, This] with Map[K, V]] extends collection.MapLike[K, V, This] with Builder[(K, V), This] with Growable[(K, V)] with Shrinkable[K] with Cloneable[This] with Parallelizable[(K, V), ParMap[K, V]]
A template trait for mutable maps.
A template trait for mutable maps.
Implementation note: This trait provides most of the operations of a mutable
Map
independently of its representation. It is typically inherited by concrete implementations of maps.To implement a concrete mutable map, you need to provide implementations of the following methods:
def get(key: K): Option[V] def iterator: Iterator[(K, V)] def += (kv: (K, V)): This def -= (key: K): This
If you wish that methods like
take
,drop
,filter
also return the same kind of map you should also override:def empty: This
It is also good idea to override methods
foreach
andsize
for efficiency. -
trait
MultiMap[A, B] extends Map[A, Set[B]]
A trait for mutable maps with multiple values assigned to a key.
A trait for mutable maps with multiple values assigned to a key.
This class is typically used as a mixin. It turns maps which map
A
toSet[B]
objects into multimaps that mapA
toB
objects.// first import all necessary types from package `collection.mutable` import collection.mutable.{ HashMap, MultiMap, Set } // to create a `MultiMap` the easiest way is to mixin it into a normal // `Map` instance val mm = new HashMap[Int, Set[String]] with MultiMap[Int, String] // to add key-value pairs to a multimap it is important to use // the method `addBinding` because standard methods like `+` will // overwrite the complete key-value pair instead of adding the // value to the existing key mm.addBinding(1, "a") mm.addBinding(2, "b") mm.addBinding(1, "c") // mm now contains `Map(2 -> Set(b), 1 -> Set(c, a))` // to check if the multimap contains a value there is method // `entryExists`, which allows to traverse the including set mm.entryExists(1, _ == "a") == true mm.entryExists(1, _ == "b") == false mm.entryExists(2, _ == "b") == true // to remove a previous added value there is the method `removeBinding` mm.removeBinding(1, "a") mm.entryExists(1, _ == "a") == false
Example: -
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.
This class is used internally to represent mutable lists. It is the basis for the implementation of the class
Queue
.- Annotations
- @SerialVersionUID()
- Version
2.8
- Since
1
-
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.
A mutable hash map based on an open hashing scheme. The precise scheme is undefined, but it should make a reasonable effort to ensure that an insert with consecutive hash codes is not unnecessarily penalised. In particular, mappings of consecutive integer keys should work without significant performance loss.
- Key
type of the keys in this map.
- Value
type of the values in this map.
- Since
2.7
-
sealed
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.
This class implements priority queues using a heap. To prioritize elements of type A there must be an implicit Ordering[A] available at creation.
Only the
dequeue
anddequeueAll
methods will return elements in priority order (while removing elements from the heap). Standard collection methods includingdrop
,iterator
, andtoString
will remove or traverse the heap in whichever order seems most convenient.Therefore, printing a
PriorityQueue
will not reveal the priority order of the elements, though the highest-priority element will be printed first. To print the elements in order, one must duplicate thePriorityQueue
(by usingclone
, for instance) and then dequeue them:- A
type of the elements in this priority queue.
val pq = collection.mutable.PriorityQueue(1, 2, 5, 3, 7) println(pq) // elements probably not in order println(pq.clone.dequeueAll) // prints Vector(7, 5, 3, 2, 1)
- Version
1.0, 03/05/2004
- Since
1
Example: -
trait
Publisher[Evt] extends AnyRef
Publisher[A,This]
objects publish events of typeA
to all registered subscribers.Publisher[A,This]
objects publish events of typeA
to all registered subscribers. When subscribing, a subscriber may specify a filter which can be used to constrain the number of events sent to the subscriber. Subscribers may suspend their subscription, or reactivate a suspended subscription. ClassPublisher
is typically used as a mixin. The abstract typePub
models the type of the publisher itself.- Evt
type of the published event.
- Version
2.8
- Since
1
-
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.Queue
objects implement data structures that allow to insert and retrieve elements in a first-in-first-out (FIFO) manner.- Version
2.8
- Since
1
- See also
"Scala's Collection Library overview" section on
Queues
for more information.
-
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.
This class is used internally to implement data structures that are based on resizable arrays.
- A
type of the elements contained in this resizable array.
- Version
2.8
- Since
1
-
trait
ReusableBuilder[-Elem, +To] extends Builder[Elem, To]
ReusableBuilder
is a marker trait that indicates that aBuilder
can be reused to build more than one instance of a collection.ReusableBuilder
is a marker trait that indicates that aBuilder
can be reused to build more than one instance of a collection. In particular, callingresult
followed byclear
will produce a collection and reset the builder to begin building a new collection of the same type.It is up to subclasses to implement this behavior, and to document any other behavior that varies from standard
ReusableBuilder
usage (e.g. operations being well-defined after a call toresult
, or allowing multiple calls to result to obtain different snapshots of a collection under construction).- Elem
the type of elements that get added to the builder.
- To
the type of collection that it produced.
- Since
2.12
-
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.A revertible history is a
History
object which supports an undo operation. Type variableEvt
refers to the type of the published events,Pub
denotes the publisher type. TypePub
is typically a subtype ofPublisher
.- Evt
type of the events
- Pub
type of the publisher
- Version
1.0, 08/07/2003
- Since
2.8
-
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.A subtrait of
collection.Seq
which represents sequences that can be mutated.Sequences are special cases of iterable collections of class
Iterable
. Unlike iterables, sequences always have a defined order of elements. Sequences provide a methodapply
for indexing. Indices range from0
up to thelength
of a sequence. Sequences support a number of methods to find occurrences of elements or subsequences, includingsegmentLength
,prefixLength
,indexWhere
,indexOf
,lastIndexWhere
,lastIndexOf
,startsWith
,endsWith
,indexOfSlice
.Another way to see a sequence is as a
PartialFunction
fromInt
values to the element type of the sequence. TheisDefinedAt
method of a sequence returnstrue
for the interval from0
untillength
.Sequences can be accessed in reverse order of their elements, using methods
reverse
andreverseIterator
.Sequences have two principal subtraits,
IndexedSeq
andLinearSeq
, which give different guarantees for performance. AnIndexedSeq
provides fast random-access of elements and a fastlength
operation. ALinearSeq
provides fast access only to the first element viahead
, but also has a fasttail
operation.The class adds an
update
method tocollection.Seq
. -
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]
.A template trait for mutable sequences of type
mutable.Seq[A]
.- A
the type of the elements of the set
- This
the type of the set itself.
-
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.
A generic trait for mutable sets.
To implement a concrete mutable set, you need to provide implementations of the following methods:
def contains(elem: A): Boolean def iterator: Iterator[A] def += (elem: A): this.type def -= (elem: A): this.type
If you wish that methods like
take
,drop
,filter
return the same kind of set, you should also override:def empty: This
It is also good idea to override methods
foreach
andsize
for efficiency.- Since
1.0
-
class
SetBuilder[A, Coll <: collection.Set[A] with collection.SetLike[A, Coll]] extends ReusableBuilder[A, Coll]
The canonical builder for mutable Sets.
The canonical builder for mutable Sets.
- A
The type of the elements that will be contained in this set.
- Coll
The type of the actual collection this set builds.
- Since
2.8
-
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]
.A template trait for mutable sets of type
mutable.Set[A]
.This trait provides most of the operations of a
mutable.Set
independently of its representation. It is typically inherited by concrete implementations of sets.To implement a concrete mutable set, you need to provide implementations of the following methods:
def contains(elem: A): Boolean def iterator: Iterator[A] def += (elem: A): this.type def -= (elem: A): this.type
If you wish that methods like
take
,drop
,filter
return the same kind of set, you should also override:def empty: This
It is also good idea to override methods
foreach
andsize
for efficiency.- A
the type of the elements of the set
- This
the type of the set itself.
- Version
2.8
- Since
2.8
-
trait
SortedMap[A, B] extends Map[A, B] with collection.SortedMap[A, B] with MapLike[A, B, SortedMap[A, B]] with SortedMapLike[A, B, SortedMap[A, B]]
A mutable map whose keys are sorted.
A mutable map whose keys are sorted.
- A
the type of the keys contained in this sorted map.
- B
the type of the values associated with the keys.
- Version
2.12
- Since
2.12
-
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.
-
final
class
StringBuilder extends AbstractSeq[Char] with CharSequence with IndexedSeq[Char] with StringLike[StringBuilder] with ReusableBuilder[Char, String] with Serializable
A builder for mutable sequence of characters.
A builder for mutable sequence of characters. This class provides an API mostly compatible with
java.lang.StringBuilder
, except where there are conflicts with the Scala collections API (such as thereverse
method.)- Annotations
- @SerialVersionUID()
- Version
2.8
- Since
2.7
-
trait
Subscriber[-Evt, -Pub] extends AnyRef
Subscriber[A, B]
objects may subscribe to events of typeA
published by an object of typeB
.Subscriber[A, B]
objects may subscribe to events of typeA
published by an object of typeB
.B
is typically a subtype of scala.collection.mutable.Publisher.- Version
2.8
- Since
1
-
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.
A trait for traversable collections that can be mutated.
This is a base trait of all kinds of mutable Scala collections. It implements the behavior common to all collections, in terms of a method
foreach
with signature:def foreach[U](f: Elem => U): Unit
Collection classes mixing in this trait provide a concrete
foreach
method which traverses all the elements contained in the collection, applying a given function to each. They also need to provide a methodnewBuilder
which creates a builder for collections of the same kind.A traversable class might or might not have two properties: strictness and orderedness. Neither is represented as a type.
The instances of a strict collection class have all their elements computed before they can be used as values. By contrast, instances of a non-strict collection class may defer computation of some of their elements until after the instance is available as a value. A typical example of a non-strict collection class is a scala.collection.immutable.Stream. A more general class of examples are
TraversableViews
.If a collection is an instance of an ordered collection class, traversing its elements with
foreach
will always visit elements in the same order, even for different runs of the program. If the class is not ordered,foreach
can visit elements in different orders for different runs (but it will keep the same order in the same run).'A typical example of a collection class which is not ordered is a
HashMap
of objects. The traversal order for hash maps will depend on the hash codes of its elements, and these hash codes might differ from one run to the next. By contrast, aLinkedHashMap
is ordered because itsforeach
method visits elements in the order they were inserted into theHashMap
. -
sealed
class
TreeMap[A, B] extends AbstractSortedMap[A, B] with SortedMap[A, B] with MapLike[A, B, TreeMap[A, B]] with SortedMapLike[A, B, TreeMap[A, B]] with Serializable
A mutable sorted map implemented using a mutable red-black tree as underlying data structure.
A mutable sorted map implemented using a mutable red-black tree as underlying data structure.
- A
the type of the keys contained in this tree map.
- B
the type of the values associated with the keys.
- Annotations
- @SerialVersionUID()
- Version
2.12
- Since
2.12
-
sealed
class
TreeSet[A] extends AbstractSortedSet[A] with SortedSet[A] with SetLike[A, TreeSet[A]] with SortedSetLike[A, TreeSet[A]] with Serializable
A mutable sorted set implemented using a mutable red-black tree as underlying data structure.
A mutable sorted set implemented using a mutable red-black tree as underlying data structure.
- A
the type of the keys contained in this tree set.
- Annotations
- @SerialVersionUID()
- Version
2.12
- Since
2.10
-
trait
Undoable extends AnyRef
Classes that mix in the
Undoable
class provide an operationundo
which can be used to undo the last operation.Classes that mix in the
Undoable
class provide an operationundo
which can be used to undo the last operation.- Version
1.0, 08/07/2003
- Since
1
-
sealed
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.
A buffer that stores elements in an unrolled linked list.
Unrolled linked lists store elements in linked fixed size arrays.
Unrolled buffers retain locality and low memory overhead properties of array buffers, but offer much more efficient element addition, since they never reallocate and copy the internal array.
However, they provide
O(n/m)
complexity random access, wheren
is the number of elements, andm
the size of internal array chunks.Ideal to use when:
- elements are added to the buffer and then all of the elements are traversed sequentially
- two unrolled buffers need to be concatenated (see
concat
)
Better than singly linked lists for random access, but should still be avoided for such a purpose.
- Annotations
- @SerialVersionUID()
-
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.
A hash map with references to entries which are weakly reachable. Entries are removed from this map when the key is no longer (strongly) referenced. This class wraps
java.util.WeakHashMap
.- A
type of keys contained in this map
- B
type of values associated with the keys
- Since
2.8
- See also
"Scala's Collection Library overview" section on
Weak Hash Maps
for more information.
-
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]
.A class representing
Array[T]
.- T
type of the elements in this wrapped array.
- Version
1.0
- Since
2.8
-
class
WrappedArrayBuilder[A] extends ReusableBuilder[A, WrappedArray[A]]
A builder class for arrays.
A builder class for arrays.
This builder can be reused.
- A
type of elements that can be added to this builder.
- Since
2.8
-
trait
BufferProxy[A] extends Buffer[A] with Proxy
This is a simple proxy class for `scala.collection.mutable.Buffer`.
This is a simple proxy class for `scala.collection.mutable.Buffer`. It is most useful for assembling customized set abstractions dynamically using object composition and forwarding.
- A
type of the elements the buffer proxy contains.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) proxying is deprecated due to lack of use and compiler-level support
- Version
1.0, 16/04/2004
- Since
1
-
trait
DefaultMapModel[A, B] extends Map[A, B]
This class is used internally.
This class is used internally. It implements the mutable
Map
class in terms of three functions:findEntry
,addEntry
, andentries
.- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) this trait will be removed
- Version
1.0, 08/07/2003
- Since
1
-
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.This class implements double linked lists where both the head (
elem
), the tail (next
) and a reference to the previous node (prev
) are mutable.- A
the type of the elements contained in this double linked list.
- Annotations
- @deprecated @SerialVersionUID()
- Deprecated
(Since version 2.11.0) low-level linked lists are deprecated due to idiosyncrasies in interface and incomplete features
- Version
2.8
- Since
1
- See also
"Scala's Collection Library overview" section on
Double Linked Lists
for more information.
-
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.
This extensible class may be used as a basis for implementing double linked lists. Type variable
A
refers to the element type of the list, type variableThis
is used to model self types of linked lists.The invariant of this data structure is that
prev
is always a reference to the previous node in the list. Ifthis
is the first node of the list,prev
will benull
. Fieldnext
is set tothis
iff the list is empty.Examples (right arrow represents
next
, left arrow representsprev
,_
represents no value):Empty: null <-- [ _ ] --, [ ] <-` Single element: null <-- [ x ] --> [ _ ] --, [ ] <-- [ ] <-` More elements: null <-- [ x ] --> [ y ] --> [ z ] --> [ _ ] --, [ ] <-- [ ] <-- [ ] <-- [ ] <-`
- A
type of the elements contained in the double linked list
- This
the type of the actual linked list holding the elements
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) low-level linked lists are deprecated due to idiosyncrasies in interface and incomplete features
- Version
1.0, 08/07/2003
- Since
2.8
-
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.
This class can be used as an adaptor to create mutable maps from immutable map implementations. Only method
empty
has to be redefined if the immutable map on which this mutable map is originally based is not empty.empty
is supposed to return the representation of an empty map.- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) adaptors are inherently unreliable and prone to performance problems
- Version
2.0, 01/01/2007
- Since
1
-
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.
This class can be used as an adaptor to create mutable sets from immutable set implementations. Only method
empty
has to be redefined if the immutable set on which this mutable set is originally based is not empty.empty
is supposed to return the representation of an empty set.- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) adaptors are inherently unreliable and prone to performance problems
- Version
1.0, 21/07/2003
- Since
1
-
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.
A more traditional/primitive style of linked list where the "list" is also the "head" link. Links can be manually created and manipulated, though the use of the API, when possible, is recommended.
The danger of directly manipulating next:
scala> val b = LinkedList(1) b: scala.collection.mutable.LinkedList[Int] = LinkedList(1) scala> b.next = null scala> println(b) java.lang.NullPointerException
If the list is empty
next
must be set tothis
. The last node in every mutable linked list is empty.Examples (
_
represents no value):Empty: [ _ ] --, [ ] <-` Single element: [ x ] --> [ _ ] --, [ ] <-` More elements: [ x ] --> [ y ] --> [ z ] --> [ _ ] --, [ ] <-`
- A
the type of the elements contained in this linked list.
- Annotations
- @SerialVersionUID() @deprecated
- Deprecated
(Since version 2.11.0) low-level linked lists are deprecated due to idiosyncrasies in interface and incomplete features
- Version
2.8
- Since
1
- See also
"Scala's Collection Library overview" section on
Linked Lists
for more information.
-
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.
This extensible class may be used as a basis for implementing linked list. Type variable
A
refers to the element type of the list, type variableThis
is used to model self types of linked lists.If the list is empty
next
must be set tothis
. The last node in every mutable linked list is empty.Examples (
_
represents no value):Empty: [ _ ] --, [ ] <-` Single element: [ x ] --> [ _ ] --, [ ] <-` More elements: [ x ] --> [ y ] --> [ z ] --> [ _ ] --, [ ] <-`
- A
type of the elements contained in the linked list
- This
the type of the actual linked list holding the elements
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) low-level linked lists are deprecated due to idiosyncrasies in interface and incomplete features
- Version
1.0, 08/07/2003
- Since
2.8
-
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.
This trait implements a proxy for scala.collection.mutable.Map.
It is most useful for assembling customized map abstractions dynamically using object composition and forwarding.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) proxying is deprecated due to lack of use and compiler-level support
- Version
2.0, 31/12/2006
- Since
1
-
trait
ObservableBuffer[A] extends Buffer[A] with Publisher[Message[A] with Undoable]
This class is typically used as a mixin.
This class is typically used as a mixin. It adds a subscription mechanism to the
Buffer
class into which this abstract class is mixed in. ClassObservableBuffer
publishes events of the typeMessage
.- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) observables are deprecated because scripting is deprecated
- Version
1.0, 08/07/2003
- Since
1
-
trait
ObservableMap[A, B] extends Map[A, B] with Publisher[Message[(A, B)] with Undoable]
This class is typically used as a mixin.
This class is typically used as a mixin. It adds a subscription mechanism to the
Map
class into which this abstract class is mixed in. ClassObservableMap
publishes events of the typeMessage
.- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) observables are deprecated because scripting is deprecated
- Version
2.0, 31/12/2006
- Since
1
-
trait
ObservableSet[A] extends Set[A] with Publisher[Message[A] with Undoable]
This class is typically used as a mixin.
This class is typically used as a mixin. It adds a subscription mechanism to the
Set
class into which this abstract class is mixed in. ClassObservableSet
publishes events of the typeMessage
.- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) observables are deprecated because scripting is deprecated
- Version
1.0, 08/07/2003
- Since
1
-
sealed abstract
class
PriorityQueueProxy[A] extends PriorityQueue[A] with Proxy
This class servers as a proxy for priority queues.
This class servers as a proxy for priority queues. The elements of the queue have to be ordered in terms of the
Ordered[T]
class.- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) proxying is deprecated due to lack of use and compiler-level support
- Version
1.0, 03/05/2004
- Since
1
-
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.Queue
objects implement data structures that allow to insert and retrieve elements in a first-in-first-out (FIFO) manner.- A
type of the elements in this queue proxy.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) proxying is deprecated due to lack of use and compiler-level support
- Version
1.1, 03/05/2004
- Since
1
-
trait
SetProxy[A] extends Set[A] with SetProxyLike[A, Set[A]]
This is a simple wrapper class for scala.collection.mutable.Set.
This is a simple wrapper class for scala.collection.mutable.Set. It is most useful for assembling customized set abstractions dynamically using object composition and forwarding.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) proxying is deprecated due to lack of use and compiler-level support
- Version
1.1, 09/05/2004
- Since
1
-
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.
A stack implements a data structure which allows to store and retrieve objects in a last-in-first-out (LIFO) fashion.
- A
type of the elements contained in this stack.
- Annotations
- @deprecated
- Deprecated
(Since version 2.12.0) Stack is an inelegant and potentially poorly-performing wrapper around List. Use a List assigned to a var instead.
- Version
2.8
- Since
1
- See also
"Scala's Collection Library overview" section on
Stacks
for more information.
-
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.
A stack implements a data structure which allows to store and retrieve objects in a last-in-first-out (LIFO) fashion.
- A
type of the elements in this stack proxy.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) proxying is deprecated due to lack of use and compiler-level support
- Version
1.0, 10/05/2004
- Since
1
-
trait
SynchronizedBuffer[A] extends Buffer[A]
This class should be used as a mixin.
This class should be used as a mixin. It synchronizes the
Buffer
methods of the class into which it is mixed in.- A
type of the elements contained in this buffer.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) Synchronization via traits is deprecated as it is inherently unreliable. Consider java.util.concurrent.ConcurrentLinkedQueue as an alternative.
- Version
1.0, 08/07/2003
- Since
1
-
trait
SynchronizedMap[A, B] extends Map[A, B]
This class should be used as a mixin.
This class should be used as a mixin. It synchronizes the
Map
functions of the class into which it is mixed in.- A
type of the keys contained in this map.
- B
type of the values associated with keys.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) Synchronization via traits is deprecated as it is inherently unreliable. Consider java.util.concurrent.ConcurrentHashMap as an alternative.
- Version
2.0, 31/12/2006
- Since
1
-
sealed
class
SynchronizedPriorityQueue[A] extends PriorityQueue[A]
This class implements synchronized priority queues using a binary heap.
This class implements synchronized priority queues using a binary heap. The elements of the queue have to be ordered in terms of the
Ordered[T]
class.- A
type of the elements contained in this synchronized priority queue
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) Comprehensive synchronization via selective overriding of methods is inherently unreliable. Consider java.util.concurrent.ConcurrentSkipListSet as an alternative.
- Version
1.0, 03/05/2004
- Since
1
-
class
SynchronizedQueue[A] extends Queue[A]
This is a synchronized version of the
Queue[T]
class.This is a synchronized version of the
Queue[T]
class. It implements a data structure that allows one to insert and retrieve elements in a first-in-first-out (FIFO) manner.- A
type of elements contained in this synchronized queue.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) Synchronization via selective overriding of methods is inherently unreliable. Consider java.util.concurrent.ConcurrentLinkedQueue as an alternative.
- Version
1.0, 03/05/2004
- Since
1
-
trait
SynchronizedSet[A] extends Set[A]
This class should be used as a mixin.
This class should be used as a mixin. It synchronizes the
Set
functions of the class into which it is mixed in.- A
type of the elements contained in this synchronized set.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) Synchronization via traits is deprecated as it is inherently unreliable. Consider java.util.concurrent.ConcurrentHashMap[A,Unit] as an alternative.
- Version
1.0, 08/07/2003
- Since
1
-
class
SynchronizedStack[A] extends Stack[A]
This is a synchronized version of the
Stack[T]
class.This is a synchronized version of the
Stack[T]
class. It implements a data structure which allows to store and retrieve objects in a last-in-first-out (LIFO) fashion.- A
type of the elements contained in this stack.
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) Synchronization via selective overriding of methods is inherently unreliable. Consider java.util.concurrent.LinkedBlockingDequeue instead.
- Version
1.0, 03/05/2004
- Since
1
Value Members
- object AnyRefMap extends Serializable
-
object
ArrayBuffer extends SeqFactory[ArrayBuffer] with Serializable
Factory object for the
ArrayBuffer
class.Factory object for the
ArrayBuffer
class.This object provides a set of operations to create
values.ArrayBuffer
-
object
ArrayBuilder extends Serializable
A companion object for array builders.
A companion object for array builders.
- Since
2.8
-
object
ArrayOps
A companion object for
ArrayOps
.A companion object for
ArrayOps
.- Since
2.8
-
object
ArraySeq extends SeqFactory[ArraySeq] with Serializable
This object provides a set of operations to create
values.ArraySeq
-
object
ArrayStack extends SeqFactory[ArrayStack] with Serializable
Factory object for the
ArrayStack
class.Factory object for the
ArrayStack
class.This object provides a set of operations to create
values.ArrayStack
-
object
BitSet extends BitSetFactory[BitSet] with Serializable
This object provides a set of operations to create
values.BitSet
-
object
Buffer extends SeqFactory[Buffer]
This object provides a set of operations to create
values.Buffer
-
object
HashMap extends MutableMapFactory[HashMap] with Serializable
This object provides a set of operations needed to create
values.mutable.HashMap
-
object
HashSet extends MutableSetFactory[HashSet] with Serializable
This object provides a set of operations needed to create
values.mutable.HashSet
-
object
IndexedSeq extends SeqFactory[IndexedSeq]
This object provides a set of operations to create
values.mutable.IndexedSeq
This object provides a set of operations to create
values. The current default implementation of amutable.IndexedSeq
mutable.IndexedSeq
is anArrayBuffer
. -
object
IndexedSeqView
An object containing the necessary implicit definitions to make
SeqView
s work.An object containing the necessary implicit definitions to make
SeqView
s work. Its definitions are generally not accessed directly by clients.Note that the
canBuildFrom
factories yieldSeqView
s, notIndexedSeqView
s. This is intentional, because not all operations yield again amutable.IndexedSeqView
. For instance,map
just gives aSeqView
, which reflects the fact thatmap
cannot do its work and maintain a pointer into the original indexed sequence. -
object
Iterable extends GenTraversableFactory[Iterable] with TraversableFactory[Iterable]
This object provides a set of operations to create
values.mutable.Iterable
This object provides a set of operations to create
values. The current default implementation of amutable.Iterable
mutable.Iterable
is anArrayBuffer
. -
object
LinearSeq extends SeqFactory[LinearSeq]
This object provides a set of operations to create
values.mutable.LinearSeq
This object provides a set of operations to create
values. The current default implementation of amutable.LinearSeq
mutable.LinearSeq
is aMutableList
. -
object
LinkedHashMap extends MutableMapFactory[LinkedHashMap] with Serializable
This object provides a set of operations needed to create
values.LinkedHashMap
-
object
LinkedHashSet extends MutableSetFactory[LinkedHashSet] with Serializable
This object provides a set of operations needed to create
values.LinkedHashSet
-
object
ListBuffer extends SeqFactory[ListBuffer] with Serializable
This object provides a set of operations to create
values.ListBuffer
-
object
ListMap extends MutableMapFactory[ListMap] with Serializable
This object provides a set of operations needed to create
values.mutable.ListMap
- object LongMap extends Serializable
-
object
Map extends MutableMapFactory[Map]
This object provides a set of operations needed to create
values.mutable.Map
This object provides a set of operations needed to create
values. The current default implementation of amutable.Map
mutable.Map
is aHashMap
. - object MutableList extends SeqFactory[MutableList] with Serializable
- object OpenHashMap
- object PriorityQueue extends OrderedTraversableFactory[PriorityQueue] with Serializable
- object Queue extends SeqFactory[Queue] with Serializable
- object ResizableArray extends SeqFactory[ResizableArray]
-
object
Seq extends SeqFactory[Seq]
This object provides a set of operations to create
values.mutable.Seq
This object provides a set of operations to create
values. The current default implementation of amutable.Seq
mutable.Seq
is anArrayBuffer
. -
object
Set extends MutableSetFactory[Set]
This object provides a set of operations needed to create
values.mutable.Set
This object provides a set of operations needed to create
values. The current default implementation of amutable.Set
mutable.Set
is aHashSet
. -
object
SortedMap extends MutableSortedMapFactory[SortedMap]
This object provides a set of operations needed to create sorted maps of type
mutable.SortedMap
. -
object
SortedSet extends MutableSortedSetFactory[SortedSet]
A template for mutable sorted set companion objects.
-
object
Stack extends SeqFactory[Stack] with Serializable
Factory object for the
mutable.Stack
class.Factory object for the
mutable.Stack
class.This object provides a set of operations to create
values.mutable.Stack
- object StringBuilder extends Serializable
-
object
Traversable extends GenTraversableFactory[Traversable] with TraversableFactory[Traversable]
This object provides a set of operations to create
values.mutable.Traversable
This object provides a set of operations to create
values. The current default implementation of amutable.Traversable
mutable.Traversable
is anArrayBuffer
. -
object
TreeMap extends MutableSortedMapFactory[TreeMap] with Serializable
This object provides a set of operations needed to create sorted maps of type
mutable.TreeMap
. - object TreeSet extends MutableSortedSetFactory[TreeSet] with Serializable
- object UnrolledBuffer extends ClassTagTraversableFactory[UnrolledBuffer] with Serializable
-
object
WeakHashMap extends MutableMapFactory[WeakHashMap] with Serializable
This object provides a set of operations needed to create
values.WeakHashMap
-
object
WrappedArray
A companion object used to create instances of
WrappedArray
.
Deprecated Value Members
-
object
DoubleLinkedList extends SeqFactory[DoubleLinkedList] with Serializable
This object provides a set of operations to create
values.DoubleLinkedList
This object provides a set of operations to create
values.DoubleLinkedList
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) low-level linked lists are deprecated
-
object
LinkedList extends SeqFactory[LinkedList] with Serializable
This object provides a set of operations to create
values.LinkedList
This object provides a set of operations to create
values.LinkedList
- Annotations
- @deprecated
- Deprecated
(Since version 2.11.0) low-level linked lists are deprecated
This is the documentation for the Scala standard library.
Package structure
The scala package contains core types like
Int
,Float
,Array
orOption
which are accessible in all Scala compilation units without explicit qualification or imports.Notable packages include:
scala.collection
and its sub-packages contain Scala's collections frameworkscala.collection.immutable
- Immutable, sequential data-structures such asVector
,List
,Range
,HashMap
orHashSet
scala.collection.mutable
- Mutable, sequential data-structures such asArrayBuffer
,StringBuilder
,HashMap
orHashSet
scala.collection.concurrent
- Mutable, concurrent data-structures such asTrieMap
scala.collection.parallel.immutable
- Immutable, parallel data-structures such asParVector
,ParRange
,ParHashMap
orParHashSet
scala.collection.parallel.mutable
- Mutable, parallel data-structures such asParArray
,ParHashMap
,ParTrieMap
orParHashSet
scala.concurrent
- Primitives for concurrent programming such asFutures
andPromises
scala.io
- Input and output operationsscala.math
- Basic math functions and additional numeric types likeBigInt
andBigDecimal
scala.sys
- Interaction with other processes and the operating systemscala.util.matching
- Regular expressionsOther packages exist. See the complete list on the right.
Additional parts of the standard library are shipped as separate libraries. These include:
scala.reflect
- Scala's reflection API (scala-reflect.jar)scala.xml
- XML parsing, manipulation, and serialization (scala-xml.jar)scala.swing
- A convenient wrapper around Java's GUI framework called Swing (scala-swing.jar)scala.util.parsing
- Parser combinators (scala-parser-combinators.jar)Automatic imports
Identifiers in the scala package and the
scala.Predef
object are always in scope by default.Some of these identifiers are type aliases provided as shortcuts to commonly used classes. For example,
List
is an alias forscala.collection.immutable.List
.Other aliases refer to classes provided by the underlying platform. For example, on the JVM,
String
is an alias forjava.lang.String
.