Packages

  • package root
    Definition Classes
    root
  • package strawman
    Definition Classes
    root
  • package collection

    A strawman architecture for new collections.

    A strawman architecture for new collections. It contains some example collection classes and methods with the intent to expose some key issues. It would be good to compare this to odether implementations of the same functionality, to get an idea of the strengths and weaknesses of different collection architectures.

    For a test file, see tests/run/CollectionTests.scala.

    Strawman6 is like strawman5, and adds lazy lists (i.e. lazie streams), arrays and some utilitity methods (take, tail, mkString, toArray). Also, systematically uses builders for all strict collections.

    Types covered in this strawman:

    1. Collection base types:

    IterableOnce, Iterable, Seq, LinearSeq, View, IndexedView

    2. Collection creator base types:

    FromIterable, IterableFactory, Buildable, Builder

    3. Types that bundle operations:

    IterableOps, IterableMonoTransforms, IterablePolyTransforms, IterableLike SeqMonoTransforms, SeqLike

    4. Concrete collection types:

    List, LazyList, ListBuffer, ArrayBuffer, ArrayBufferView, StringView, ArrayView

    5. Decorators for existing types

    StringOps, ArrayOps

    6. Related non collection types:

    Iterator, StringBuilder

    Operations covered in this strawman:

    1. Abstract operations, or expected to be overridden:

    For iterables:

    iterator, fromIterable, fromIterableWithSameElemType, knownLength, className

    For sequences:

    apply, length

    For buildables:

    newBuilder

    For builders:

    +=, result

    2. Utility methods, might be overridden for performance:

    Operations returning not necessarily a collection:

    foreach, foldLeft, foldRight, indexWhere, isEmpty, head, size, mkString

    Operations returning a collection of a fixed type constructor:

    view, to, toArray, copyToArray

    Type-preserving generic transforms:

    filter, partition, take, drop, tail, reverse

    Generic transforms returning collections of different element types:

    map, flatMap, ++, zip

    Definition Classes
    strawman
  • package immutable
    Definition Classes
    collection
  • ::
  • BitSet
  • HashSet
  • Iterable
  • LazyList
  • List
  • Map
  • MapLike
  • MapMonoTransforms
  • Nil
  • Seq
  • Set
  • SetLike
  • SetMonoTransforms
  • SortedMap
  • SortedMapFactories
  • SortedMapLike
  • SortedMapPolyTransforms
  • SortedSet
  • SortedSetLike
  • TreeMap
  • TreeSet

object Nil extends List[Nothing] with Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, List[Nothing], Buildable[Nothing, List[Nothing]], LinearSeq[Nothing], LinearSeqLike[Nothing, LinearSeq], Seq[Nothing], Iterable[Nothing], collection.Seq[Nothing], ArrayLike[Nothing], SeqLike[Nothing, List], Equals, SeqMonoTransforms[Nothing, List[Nothing @scala.annotation.unchecked.uncheckedVariance]], collection.Iterable[Nothing], IterableLike[Nothing, List], IterablePolyTransforms[Nothing, List], IterableMonoTransforms[Nothing, List[Nothing @scala.annotation.unchecked.uncheckedVariance]], IterableOps[Nothing], FromIterable[List], IterableOnce[Nothing], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Nil
  2. Serializable
  3. Serializable
  4. Product
  5. List
  6. Buildable
  7. LinearSeq
  8. LinearSeqLike
  9. Seq
  10. Iterable
  11. Seq
  12. ArrayLike
  13. SeqLike
  14. Equals
  15. SeqMonoTransforms
  16. Iterable
  17. IterableLike
  18. IterablePolyTransforms
  19. IterableMonoTransforms
  20. IterableOps
  21. FromIterable
  22. IterableOnce
  23. AnyRef
  24. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++[B >: Nothing](xs: IterableOnce[B]): List[B]

    When concatenating with another list xs, avoid copying xs

    When concatenating with another list xs, avoid copying xs

    Definition Classes
    ListIterablePolyTransforms
  4. def ++:[B >: Nothing](prefix: List[B]): List[B]

    Prepend operation that avoids copying this list

    Prepend operation that avoids copying this list

    Definition Classes
    List
  5. def ::[B >: Nothing](elem: B): List[B]

    Prepend element

    Prepend element

    Definition Classes
    List
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def apply(n: Int): Nothing

    apply is defined in terms of drop, which is in turn defined in terms of tail.

    apply is defined in terms of drop, which is in turn defined in terms of tail.

    Definition Classes
    LinearSeqArrayLike
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def canEqual(that: Any): Boolean

    Method called from equality methods, so that user-defined subclasses can refuse to be equal to other collections of the same kind.

    Method called from equality methods, so that user-defined subclasses can refuse to be equal to other collections of the same kind.

    that

    The object with which this $coll should be compared

    returns

    true, if this $coll can possibly equal that, false otherwise. The test takes into consideration only the run-time types of objects but ignores their elements.

    Definition Classes
    SeqLike → Equals
  10. def className: String

    The class name of this collection.

    The class name of this collection. To be used for converting to string. Collections generally print like this:

    <className>(elem_1, ..., elem_n)

    Definition Classes
    ListIterableOps
  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def coll: Nil.this.type

    The collection itself

    The collection itself

    Attributes
    protected
    Definition Classes
    IterableIterablePolyTransformsIterableMonoTransformsIterableOps
  13. def copyToArray[B >: Nothing](xs: Array[B], start: Int = 0): xs.type

    Copy all elements of this collection to array xs, starting at start.

    Copy all elements of this collection to array xs, starting at start.

    Definition Classes
    IterableOps
  14. def drop(n: Int): LinearSeq[Nothing]

    Optimized version of drop that avoids copying Note: drop is defined here, rather than in a trait like LinearSeqMonoTransforms, because the ...MonoTransforms traits make no assumption about the type of Repr whereas we need to assume here that Repr is the same as the underlying collection type.

    Optimized version of drop that avoids copying Note: drop is defined here, rather than in a trait like LinearSeqMonoTransforms, because the ...MonoTransforms traits make no assumption about the type of Repr whereas we need to assume here that Repr is the same as the underlying collection type.

    Definition Classes
    LinearSeqLikeIterableMonoTransforms
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(o: Any): Boolean
    Definition Classes
    SeqLike → Equals → AnyRef → Any
  17. def filter(p: (Nothing) ⇒ Boolean): List[Nothing @scala.annotation.unchecked.uncheckedVariance]

    All elements satisfying predicate p

    All elements satisfying predicate p

    Definition Classes
    IterableMonoTransforms
  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def flatMap[B](f: (Nothing) ⇒ IterableOnce[B]): List[B]

    Flatmap

    Flatmap

    Definition Classes
    IterablePolyTransforms
  20. def foldLeft[B](z: B)(op: (B, Nothing) ⇒ B): B

    Fold left

    Fold left

    Definition Classes
    IterableOps
  21. def foldRight[B](z: B)(op: (Nothing, B) ⇒ B): B

    Fold right

    Fold right

    Definition Classes
    IterableOps
  22. def foreach[U](f: (Nothing) ⇒ U): Unit

    Apply f to each element for its side effects Note: [U] parameter needed to help scalac's type inference.

    Apply f to each element for its side effects Note: [U] parameter needed to help scalac's type inference.

    Definition Classes
    IterableOps
  23. def fromIterable[B](c: collection.Iterable[B]): List[B]
    Definition Classes
    ListIterablePolyTransformsFromIterable
  24. def fromIterableWithSameElemType(coll: collection.Iterable[Nothing]): List[Nothing]

    Create a collection of type C[A] from the elements of coll, which has the same element type as this collection.

    Create a collection of type C[A] from the elements of coll, which has the same element type as this collection. Overridden in StringOps and ArrayOps.

    Attributes
    protected[this]
    Definition Classes
    SeqLikeIterableLikeIterableMonoTransforms
  25. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  26. def hashCode(): Int
    Definition Classes
    SeqLike → AnyRef → Any
  27. def head: Nothing

    The first element of the collection.

    The first element of the collection.

    Definition Classes
    NilLinearSeqIterableOps
  28. def indexWhere(p: (Nothing) ⇒ Boolean): Int

    The index of the first element in this collection for which p holds.

    The index of the first element in this collection for which p holds.

    Definition Classes
    IterableOps
  29. def isEmpty: Boolean

    To be overridden in implementations:

    To be overridden in implementations:

    Definition Classes
    NilLinearSeqIterableOps
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. def iterator(): Iterator[Nothing]

    iterator is overridden in terms of head and tail

    iterator is overridden in terms of head and tail

    Definition Classes
    LinearSeqIterableOnce
  32. def knownSize: Int

    The number of elements in this collection, if it can be cheaply computed, -1 otherwise.

    The number of elements in this collection, if it can be cheaply computed, -1 otherwise. Cheaply usually means: Not requiring a collection traversal.

    Definition Classes
    IterableOps
  33. def length: Int

    length is defined in terms of iterator

    length is defined in terms of iterator

    Definition Classes
    LinearSeqArrayLike
  34. def map[B](f: (Nothing) ⇒ B): List[B]

    Map

    Map

    Definition Classes
    IterablePolyTransforms
  35. def mkString(sep: String): String

    A string showing all elements of this collection, separated by string sep.

    A string showing all elements of this collection, separated by string sep.

    Definition Classes
    IterableOps
  36. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  37. def newBuilder: Builder[Nothing, List[Nothing]]

    Creates a new builder.

    Creates a new builder.

    Attributes
    protected[this]
    Definition Classes
    ListBuildable
  38. def nonEmpty: Boolean

    Is the collection not empty?

    Is the collection not empty?

    Definition Classes
    NilIterableOps
  39. final def notify(): Unit
    Definition Classes
    AnyRef
  40. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  41. def partition(p: (Nothing) ⇒ Boolean): (List[Nothing], List[Nothing])

    Optimized, push-based version of partition.

    Optimized, push-based version of partition.

    Definition Classes
    BuildableIterableMonoTransforms
  42. def reverse: List[Nothing @scala.annotation.unchecked.uncheckedVariance]
    Definition Classes
    SeqMonoTransforms
  43. def sameElements[B >: Nothing](that: IterableOnce[B]): Boolean

    Do the elements of this collection are the same (and in the same order) as those of that?

    Do the elements of this collection are the same (and in the same order) as those of that?

    Definition Classes
    SeqLike
  44. def size: Int

    The number of elements in this collection.

    The number of elements in this collection. Does not terminate for infinite collections.

    Definition Classes
    IterableOps
  45. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  46. def tail: Nothing

    The rest of the collection without its first element.

    The rest of the collection without its first element.

    Definition Classes
    NilLinearSeqIterableMonoTransforms
  47. def take(n: Int): List[Nothing @scala.annotation.unchecked.uncheckedVariance]

    A collection containing the first n elements of this collection.

    A collection containing the first n elements of this collection.

    Definition Classes
    IterableMonoTransforms
  48. def to[C[X] <: collection.Iterable[X]](fi: FromIterable[C]): C[Nothing]

    Given a collection factory fi for collections of type constructor C, convert this collection to one of type C[A].

    Given a collection factory fi for collections of type constructor C, convert this collection to one of type C[A]. Example uses:

    xs.to(List) xs.to(ArrayBuffer)

    Definition Classes
    IterableOps
  49. def toArray[B >: Nothing](implicit arg0: ClassTag[B]): Array[B]

    Convert collection to array.

    Convert collection to array.

    Definition Classes
    IterableOps
  50. def toString(): String
    Definition Classes
    IterableOps → Any
  51. def view: View[Nothing]

    A view representing the elements of this collection.

    A view representing the elements of this collection.

    Definition Classes
    IterableOps
  52. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. def zip[B](xs: IterableOnce[B]): List[(Nothing, B)]

    Zip.

    Zip. Interesting because it requires to align to source collections.

    Definition Classes
    IterablePolyTransforms

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from List[Nothing]

Inherited from Buildable[Nothing, List[Nothing]]

Inherited from LinearSeq[Nothing]

Inherited from LinearSeqLike[Nothing, LinearSeq]

Inherited from Seq[Nothing]

Inherited from Iterable[Nothing]

Inherited from collection.Seq[Nothing]

Inherited from ArrayLike[Nothing]

Inherited from SeqLike[Nothing, List]

Inherited from Equals

Inherited from SeqMonoTransforms[Nothing, List[Nothing @scala.annotation.unchecked.uncheckedVariance]]

Inherited from collection.Iterable[Nothing]

Inherited from IterableLike[Nothing, List]

Inherited from IterablePolyTransforms[Nothing, List]

Inherited from IterableMonoTransforms[Nothing, List[Nothing @scala.annotation.unchecked.uncheckedVariance]]

Inherited from IterableOps[Nothing]

Inherited from FromIterable[List]

Inherited from IterableOnce[Nothing]

Inherited from AnyRef

Inherited from Any

Ungrouped