package immutable

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. case class :: [+A](x: A, next: List[A]) extends List[A] with Product with Serializable
  2. sealed abstract class BitSet extends SortedSet[Int] with collection.BitSet with SortedSetOps[Int, SortedSet, BitSet] with BitSetOps[BitSet] with StrictOptimizedIterableOps[Int, Set, BitSet] with Serializable

    A class for immutable bitsets.

    A class for immutable bitsets. $bitsetinfo

    Annotations
    @SerialVersionUID()
    See also

    "Scala's Collection Library overview" section on Immutable BitSets for more information.

  3. sealed trait HashMap [K, +V] extends Map[K, V] with MapOps[K, V, HashMap, HashMap[K, V]] with StrictOptimizedIterableOps[(K, V), Iterable, HashMap[K, V]] with Serializable

    This class implements immutable maps using a hash trie.

    This class implements immutable maps using a hash trie.

    Note: The builder of this hash map may return specialized representations for small maps.

    K

    the type of the keys contained in this hash map.

    V

    the type of the values associated with the keys.

    Annotations
    @SerialVersionUID()
    Version

    2.8

    Since

    2.3

    See also

    "Scala's Collection Library overview" section on Hash Tries for more information.

  4. sealed trait HashSet [A] extends Set[A] with SetOps[A, HashSet, HashSet[A]] with StrictOptimizedIterableOps[A, HashSet, HashSet[A]] with Serializable

    This class implements immutable sets using a hash trie.

    This class implements immutable sets using a hash trie.

    Note: The builder of this hash set may return specialized representations for small sets.

    A

    the type of the elements contained in this hash set.

    Annotations
    @SerialVersionUID()
    Version

    2.8

    Since

    2.3

  5. class ImmutableArray [+A] extends IndexedSeq[A] with IndexedSeqOps[A, ImmutableArray, ImmutableArray[A]] with StrictOptimizedSeqOps[A, ImmutableArray, ImmutableArray[A]]

    An immutable array.

    An immutable array.

    Supports efficient indexed access and has a small memory footprint.

  6. trait IndexedSeq [+A] extends Seq[A] with collection.IndexedSeq[A] with IndexedSeqOps[A, IndexedSeq, IndexedSeq[A]]

    Base trait for immutable indexed sequences that have efficient apply and length

  7. trait IndexedSeqOps [+A, +CC[X] <: IndexedSeq[X], +C] extends SeqOps[A, CC, C] with collection.IndexedSeqOps[A, CC, C]

    Base trait for immutable indexed Seq operations

  8. trait Iterable [+A] extends collection.Iterable[A] with IterableOps[A, Iterable, Iterable[A]]
  9. class LazyList [+A] extends LinearSeq[A] with LinearSeqOps[A, LazyList, LazyList[A]]
  10. trait LinearSeq [+A] extends Seq[A] with collection.LinearSeq[A] with LinearSeqOps[A, LinearSeq, LinearSeq[A]]

    Base trait for immutable linear sequences that have efficient head and tail

  11. trait LinearSeqOps [+A, +CC[X] <: LinearSeq[X], +C <: LinearSeq[A]] extends SeqOps[A, CC, C] with collection.LinearSeqOps[A, CC, C]
  12. sealed trait List [+A] extends LinearSeq[A] with LinearSeqOps[A, List, List[A]] with StrictOptimizedSeqOps[A, List, List[A]] with Serializable

    A class for immutable linked lists representing ordered collections of elements of type A.

    A class for immutable linked lists representing ordered collections of elements of type A.

    This class comes with two implementing case classes scala.Nil and scala.:: that implement the abstract members isEmpty, head and tail.

    This class is optimal for last-in-first-out (LIFO), stack-like access patterns. If you need another access pattern, for example, random access or FIFO, consider using a collection more suited to this than List.

    $usesMutableState

    Performance

    Time: List has O(1) prepend and head/tail access. Most other operations are O(n) on the number of elements in the list. This includes the index-based lookup of elements, length, append and reverse.

    Space: List implements structural sharing of the tail list. This means that many operations are either zero- or constant-memory cost.

    val mainList = List(3, 2, 1)
    val with4 =    4 :: mainList  // re-uses mainList, costs one :: instance
    val with42 =   42 :: mainList // also re-uses mainList, cost one :: instance
    val shorter =  mainList.tail  // costs nothing as it uses the same 2::1::Nil instances as mainList
    Annotations
    @SerialVersionUID()
    Example:
    1. // Make a list via the companion object factory
      val days = List("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
      
      // Make a list element-by-element
      val when = "AM" :: "PM" :: Nil
      
      // Pattern match
      days match {
        case firstDay :: otherDays =>
          println("The first day of the week is: " + firstDay)
        case Nil =>
          println("There don't seem to be any week days.")
      }
    Version

    2.8

    Since

    1.0

    Note

    The functional list is characterized by persistence and structural sharing, thus offering considerable performance and space consumption benefits in some scenarios if used correctly. However, note that objects having multiple references into the same functional list (that is, objects that rely on structural sharing), will be serialized and deserialized with multiple lists, one for each reference to it. I.e. structural sharing is lost after serialization/deserialization.

    See also

    "Scala's Collection Library overview" section on Lists for more information.

  13. sealed class ListMap [K, +V] extends Map[K, V] with MapOps[K, V, ListMap, ListMap[K, V]] with StrictOptimizedIterableOps[(K, V), Iterable, ListMap[K, V]] with Serializable

    This class implements immutable maps using a list-based data structure.

    This class implements immutable maps using a list-based data structure. List map iterators and traversal methods visit key-value pairs in the order whey were first inserted.

    Entries are stored internally in reversed insertion order, which means the newest key is at the head of the list. As such, methods such as head and tail are O(n), while last and init are O(1). Other operations, such as inserting or removing entries, are also O(n), which makes this collection suitable only for a small number of elements.

    Instances of ListMap represent empty maps; they can be either created by calling the constructor directly, or by applying the function ListMap.empty.

    K

    the type of the keys contained in this list map

    V

    the type of the values associated with the keys

    Annotations
    @SerialVersionUID()
    Version

    2.0, 01/01/2007

    Since

    1

  14. sealed class ListSet [A] extends Set[A] with SetOps[A, ListSet, ListSet[A]] with StrictOptimizedIterableOps[A, ListSet, ListSet[A]] with Serializable

    This class implements immutable sets using a list-based data structure.

    This class implements immutable sets using a list-based data structure. List set iterators and traversal methods visit elements in the order whey were first inserted.

    Elements are stored internally in reversed insertion order, which means the newest element is at the head of the list. As such, methods such as head and tail are O(n), while last and init are O(1). Other operations, such as inserting or removing entries, are also O(n), which makes this collection suitable only for a small number of elements.

    Instances of ListSet represent empty sets; they can be either created by calling the constructor directly, or by applying the function ListSet.empty.

    A

    the type of the elements contained in this list set

    Annotations
    @SerialVersionUID()
    Version

    1.0, 09/07/2003

    Since

    1

  15. trait Map [K, +V] extends Iterable[(K, V)] with collection.Map[K, V] with MapOps[K, V, Map, Map[K, V]]

    Base type of immutable Maps

  16. trait MapOps [K, +V, +CC[X, +Y] <: Map[X, Y] with MapOps[X, Y, CC, _], +C <: Map[K, V]] extends IterableOps[(K, V), Iterable, C] with collection.MapOps[K, V, CC, C]

    Base trait of immutable Maps implementations

  17. final class NumericRange [T] extends IndexedSeq[T] with IndexedSeqOps[T, IndexedSeq, IndexedSeq[T]] with StrictOptimizedSeqOps[T, IndexedSeq, IndexedSeq[T]] with Serializable

    NumericRange is a more generic version of the Range class which works with arbitrary types.

    NumericRange is a more generic version of the Range class which works with arbitrary types. It must be supplied with an Integral implementation of the range type.

    Factories for likely types include Range.BigInt, Range.Long, and Range.BigDecimal. Range.Int exists for completeness, but the Int-based scala.Range should be more performant.

    val r1 = new Range(0, 100, 1)
    val veryBig = Int.MaxValue.toLong + 1
    val r2 = Range.Long(veryBig, veryBig + 100, 1)
    assert(r1 sameElements r2.map(_ - veryBig))
  18. final class Range extends IndexedSeq[Int] with IndexedSeqOps[Int, IndexedSeq, IndexedSeq[Int]] with StrictOptimizedSeqOps[Int, IndexedSeq, IndexedSeq[Int]] with Serializable

    The Range class represents integer values in range [start;end) with non-zero step value step.

    The Range class represents integer values in range [start;end) with non-zero step value step. It's a special case of an indexed sequence. For example:

    val r1 = 0 until 10
    val r2 = r1.start until r1.end by r1.step + 1
    println(r2.length) // = 5

    Ranges that contain more than Int.MaxValue elements can be created, but these overfull ranges have only limited capabilities. Any method that could require a collection of over Int.MaxValue length to be created, or could be asked to index beyond Int.MaxValue elements will throw an exception. Overfull ranges can safely be reduced in size by changing the step size (e.g. by 3) or taking/dropping elements. contains, equals, and access to the ends of the range (head, last, tail, init) are also permitted on overfull ranges.

    Annotations
    @SerialVersionUID()
  19. trait Seq [+A] extends Iterable[A] with collection.Seq[A] with SeqOps[A, Seq, Seq[A]]
  20. trait SeqOps [+A, +CC[_], +C] extends collection.SeqOps[A, CC, C]
  21. trait Set [A] extends Iterable[A] with collection.Set[A] with SetOps[A, Set, Set[A]]

    Base trait for immutable set collections

  22. trait SetOps [A, +CC[X], +C <: Set[A] with SetOps[A, Set, C]] extends collection.SetOps[A, CC, C]

    Base trait for immutable set operations

  23. trait SortedMap [K, +V] extends Map[K, V] with collection.SortedMap[K, V] with SortedMapOps[K, V, SortedMap, SortedMap[K, V]]
  24. trait SortedMapOps [K, +V, +CC[X, +Y] <: SortedMap[X, Y] with SortedMapOps[X, Y, CC, _], +C <: SortedMap[K, V]] extends MapOps[K, V, Map, C] with collection.SortedMapOps[K, V, CC, C]
  25. trait SortedSet [A] extends Set[A] with collection.SortedSet[A] with SortedSetOps[A, SortedSet, SortedSet[A]]

    Base trait for sorted sets

  26. trait SortedSetOps [A, +CC[X] <: SortedSet[X] with SortedSetOps[X, CC, _], +C <: SortedSet[A] with SortedSetOps[A, SortedSet, C]] extends SetOps[A, Set, C] with collection.SortedSetOps[A, CC, C]
  27. trait StrictOptimizedSeqOps [+A, +CC[_], +C] extends SeqOps[A, CC, C] with StrictOptimizedIterableOps[A, CC, C]

    Trait that overrides operations to take advantage of strict builders.

  28. final class TreeMap [K, +V] extends SortedMap[K, V] with SortedMapOps[K, V, TreeMap, TreeMap[K, V]] with StrictOptimizedIterableOps[(K, V), Iterable, TreeMap[K, V]] with Serializable

    This class implements immutable maps using a tree.

    This class implements immutable maps using a tree.

    K

    the type of the keys contained in this tree map.

    V

    the type of the values associated with the keys.

    Annotations
    @SerialVersionUID()
    Version

    1.1, 03/05/2004

    Since

    1

    See also

    "Scala's Collection Library overview" section on Red-Black Trees for more information.

  29. final class TreeSet [A] extends SortedSet[A] with SortedSetOps[A, TreeSet, TreeSet[A]] with StrictOptimizedIterableOps[A, Set, TreeSet[A]]

    This class implements immutable sorted sets using a tree.

    This class implements immutable sorted sets using a tree.

    A

    the type of the elements contained in this tree set

    Version

    2.0, 02/01/2007

    Since

    1

    See also

    "Scala's Collection Library overview" section on Red-Black Trees for more information.

  30. final class Vector [+A] extends IndexedSeq[A] with IndexedSeqOps[A, Vector, Vector[A]] with StrictOptimizedSeqOps[A, Vector, Vector[A]] with VectorPointer[A] with Serializable

    Vector is a general-purpose, immutable data structure.

    Vector is a general-purpose, immutable data structure. It provides random access and updates in effectively constant time, as well as very fast append and prepend. Because vectors strike a good balance between fast random selections and fast random functional updates, they are currently the default implementation of immutable indexed sequences. It is backed by a little endian bit-mapped vector trie with a branching factor of 32. Locality is very good, but not contiguous, which is good for very large sequences.

    $usesMutableState

    A

    the element type

    Annotations
    @SerialVersionUID()
    See also

    "Scala's Collection Library overview" section on Vectors for more information.

  31. final class VectorBuilder [A] extends ReusableBuilder[A, Vector[A]] with VectorPointer[A]

    A class to build instances of Vector.

    A class to build instances of Vector. This builder is reusable.

  32. class VectorIterator [+A] extends Iterator[A] with VectorPointer[A]

Value Members

  1. object BitSet extends SpecificIterableFactory[Int, BitSet] with Serializable
  2. object HashMap extends MapFactory[HashMap] with Serializable
  3. object HashSet extends IterableFactory[HashSet] with Serializable
  4. object ImmutableArray extends IterableFactory[ImmutableArray]
  5. object IndexedSeq extends Delegate[IndexedSeq]
  6. object LazyList extends IterableFactory[LazyList]
  7. object List extends IterableFactory[List] with Serializable
  8. object ListMap extends MapFactory[ListMap] with Serializable

    $factoryInfo

    $factoryInfo

    Note that each element insertion takes O(n) time, which means that creating a list map with n elements will take O(n2) time. This makes the builder suitable only for a small number of elements.

    Since

    1

    See also

    "Scala's Collection Library overview" section on List Maps for more information.

  9. object ListSet extends IterableFactory[ListSet] with Serializable

    $factoryInfo

    $factoryInfo

    Note that each element insertion takes O(n) time, which means that creating a list set with n elements will take O(n2) time. This makes the builder suitable only for a small number of elements.

    Since

    1

  10. object Map extends Delegate[Map]
  11. object Nil extends List[Nothing] with Product with Serializable
  12. object NumericRange extends Serializable

    A companion object for numeric ranges.

  13. object Range extends Serializable
  14. object Seq extends Delegate[Seq]
  15. object Set extends Delegate[Set]
  16. object SortedSet extends Delegate[SortedSet]
  17. object TreeMap extends SortedMapFactory[TreeMap] with Serializable

    $factoryInfo

  18. object TreeSet extends SortedIterableFactory[TreeSet]
  19. object Vector extends IterableFactory[Vector] with Serializable

    Companion object to the Vector class

Ungrouped