strawman.collections

CollectionStrawMan5

Related Doc: package collections

object CollectionStrawMan5

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 other 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.

Strawman5 is like strawman4, but using inheritance through ...Like traits instead of decorators.

Advantage: Much easier to specialize. See partition for strict (buildable) collections or drop for Lists.

Disadvantage: More "weird" types in base traits; some awkwardness with

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CollectionStrawMan5
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class ArrayBuffer[A] extends Seq[A] with SeqLike[A, ArrayBuffer] with Builder[A, ArrayBuffer[A]]

    Concrete collection type: ArrayBuffer

  2. class ArrayBufferView[A] extends RandomAccessView[A]

  3. trait Buildable[+A, +To <: Iterable[A]] extends Iterable[A]

    Base trait for strict collections

  4. trait Builder[-A, +To] extends AnyRef

    Base trait for collection builders

  5. case class Cons[+A](x: A, next: List[A]) extends List[A] with Product with Serializable

  6. trait FromIterable[+C[X] <: Iterable[X]] extends AnyRef

    Base trait for instances that can construct a collection from an iterable

  7. trait Iterable[+A] extends IterableOnce[A] with IterableLike[A, Iterable]

    Base trait for generic collections

  8. trait IterableFactory[+C[X] <: Iterable[X]] extends FromIterable[C]

    Base trait for companion objects of collections

  9. trait IterableLike[+A, +C[X] <: Iterable[X]] extends FromIterable[C] with IterableOps[A] with IterableMonoTransforms[A, C[A]] with IterablePolyTransforms[A, C]

    Base trait for Iterable operations

    Base trait for Iterable operations

    VarianceNote

    We require that for all child classes of Iterable the variance of the child class and the variance of the C parameter passed to IterableLike are the same. We cannot express this since we lack variance polymorphism. That's why we have to resort at some places to write C[A @uncheckedVariance].

  10. trait IterableMonoTransforms[+A, +Repr] extends Any

  11. trait IterableOnce[+A] extends AnyRef

    Iterator can be used only once

  12. trait IterableOps[+A] extends Any

  13. trait IterablePolyTransforms[+A, +C[A]] extends Any

  14. trait Iterator[+A] extends IterableOnce[A]

    A core Iterator class

  15. sealed trait List[+A] extends Seq[A] with SeqLike[A, List] with Buildable[A, List[A]]

    Concrete collection type: List

  16. class ListBuffer[A] extends Seq[A] with SeqLike[A, ListBuffer] with Builder[A, List[A]]

    Concrete collection type: ListBuffer

  17. trait RandomAccessView[+A] extends View[A]

    View defined in terms of indexing a range

  18. trait Seq[+A] extends Iterable[A] with SeqLike[A, Seq]

    Base trait for sequence collections

  19. trait SeqLike[+A, +C[X] <: Seq[X]] extends IterableLike[A, C] with SeqMonoTransforms[A, C[A]]

    Base trait for Seq operations

  20. trait SeqMonoTransforms[+A, +Repr] extends IterableMonoTransforms[A, Repr]

  21. implicit final class StringOps extends AnyVal with IterableOps[Char] with SeqMonoTransforms[Char, String] with IterablePolyTransforms[Char, List]

    Concrete collection type: String

  22. case class StringView(s: String) extends RandomAccessView[Char] with Product with Serializable

  23. trait View[+A] extends Iterable[A] with IterableLike[A, View]

    Concrete collection type: View

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. object ArrayBuffer extends IterableFactory[ArrayBuffer]

  5. object Iterator

  6. object List extends IterableFactory[List]

  7. object ListBuffer extends IterableFactory[ListBuffer]

  8. object Nil extends List[Nothing] with Product with Serializable

  9. object View

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. def toString(): String

    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped