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

trait SortedSetLike[A, +C[X] <: SortedSet[X]] extends collection.SortedSetLike[A, C] with SetLike[A, Set] with SetMonoTransforms[A, C[A]]

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SortedSetLike
  2. SetLike
  3. SetMonoTransforms
  4. SortedSetLike
  5. SetLike
  6. Equals
  7. SetMonoTransforms
  8. IterableLike
  9. IterableMonoTransforms
  10. IterableOps
  11. FromIterable
  12. SortedPolyTransforms
  13. IterablePolyTransforms
  14. SortedLike
  15. AnyRef
  16. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def &(that: collection.Set[A]): C[A]
    Definition Classes
    SetMonoTransforms
  2. abstract def +(elem: A): C[A]
    Definition Classes
    SetMonoTransforms
  3. abstract def ++(that: collection.Set[A]): C[A]
    Definition Classes
    SetMonoTransforms
  4. abstract def -(elem: A): C[A]
    Definition Classes
    SetMonoTransforms
  5. abstract def coll: Set[A]
    Attributes
    protected
    Definition Classes
    SetLikeIterablePolyTransformsIterableMonoTransformsIterableOps
  6. abstract def contains(elem: A): Boolean
    Definition Classes
    SetLike
  7. abstract def fromIterable[B](it: collection.Iterable[B]): Set[B]
    Definition Classes
    FromIterable
  8. abstract def fromIterableWithSameElemType(coll: collection.Iterable[A]): Set[A]

    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
    IterableLikeIterableMonoTransforms
  9. abstract def map[B](f: (A) ⇒ B)(implicit ordering: Ordering[B]): C[B]
    Definition Classes
    SortedPolyTransforms
  10. abstract def ordering: Ordering[A]
    Definition Classes
    SortedLike
  11. abstract def range(from: A, until: A): C[A]
    Definition Classes
    SortedLike
  12. abstract def subsetOf(that: collection.Set[A]): Boolean
    Definition Classes
    SetLike

Concrete Value Members

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

    Concatenation

    Concatenation

    Definition Classes
    IterablePolyTransforms
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def canEqual(that: Any): Boolean
    Definition Classes
    SetLike → Equals
  7. 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
    IterableOps
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def copyToArray[B >: A](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
  10. def drop(n: Int): C[A]

    The rest of the collection without its n first elements.

    The rest of the collection without its n first elements. For linear, immutable collections this should avoid making a copy.

    Definition Classes
    IterableMonoTransforms
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(that: Any): Boolean
    Definition Classes
    SetLike → Equals → AnyRef → Any
  13. def filter(p: (A) ⇒ Boolean): C[A]

    All elements satisfying predicate p

    All elements satisfying predicate p

    Definition Classes
    IterableMonoTransforms
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def flatMap[B](f: (A) ⇒ IterableOnce[B]): Set[B]

    Flatmap

    Flatmap

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

    Fold left

    Fold left

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

    Fold right

    Fold right

    Definition Classes
    IterableOps
  18. def foreach[U](f: (A) ⇒ 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
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int
    Definition Classes
    SetLike → AnyRef → Any
  21. def head: A

    The first element of the collection.

    The first element of the collection.

    Definition Classes
    IterableOps
  22. def indexWhere(p: (A) ⇒ 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
  23. def isEmpty: Boolean

    Is the collection empty?

    Is the collection empty?

    Definition Classes
    IterableOps
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. 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
  26. def map[B](f: (A) ⇒ B): Set[B]

    Map

    Map

    Definition Classes
    IterablePolyTransforms
  27. 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
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def nonEmpty: Boolean

    Is the collection not empty?

    Is the collection not empty?

    Definition Classes
    IterableOps
  30. final def notify(): Unit
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  32. def partition(p: (A) ⇒ Boolean): (C[A], C[A])

    A pair of, first, all elements that satisfy prediacte p and, second, all elements that do not.

    A pair of, first, all elements that satisfy prediacte p and, second, all elements that do not. Interesting because it splits a collection in two.

    The default implementation provided here needs to traverse the collection twice. Strict collections have an overridden version of partition in Buildable, which requires only a single traversal.

    Definition Classes
    IterableMonoTransforms
  33. 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
  34. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  35. def tail: C[A]

    The rest of the collection without its first element.

    The rest of the collection without its first element.

    Definition Classes
    IterableMonoTransforms
  36. def take(n: Int): C[A]

    A collection containing the first n elements of this collection.

    A collection containing the first n elements of this collection.

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

    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
  38. def toArray[B >: A](implicit arg0: ClassTag[B]): Array[B]

    Convert collection to array.

    Convert collection to array.

    Definition Classes
    IterableOps
  39. def toString(): String
    Definition Classes
    IterableOps → Any
  40. def view: View[A]

    A view representing the elements of this collection.

    A view representing the elements of this collection.

    Definition Classes
    IterableOps
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. def zip[B](xs: IterableOnce[B]): Set[(A, B)]

    Zip.

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

    Definition Classes
    IterablePolyTransforms

Inherited from SetLike[A, Set]

Inherited from SetMonoTransforms[A, C[A]]

Inherited from collection.SortedSetLike[A, C]

Inherited from collection.SetLike[A, Set]

Inherited from Equals

Inherited from collection.SetMonoTransforms[A, C[A]]

Inherited from IterableLike[A, Set]

Inherited from IterableMonoTransforms[A, C[A]]

Inherited from IterableOps[A]

Inherited from FromIterable[Set]

Inherited from SortedPolyTransforms[A, C]

Inherited from IterablePolyTransforms[A, Set]

Inherited from SortedLike[A, C[A]]

Inherited from AnyRef

Inherited from Any

Ungrouped