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 mutable
    Definition Classes
    collection
  • ArrayBuffer
  • ArrayBufferView
  • BitSet
  • Buildable
  • Builder
  • Growable
  • GrowableSeq
  • HashMap
  • HashSet
  • IndexedOptimizedGrowableSeq
  • IndexedOptimizedSeq
  • Iterable
  • ListBuffer
  • Map
  • MapLike
  • RefArrayUtils
  • Seq
  • Set
  • SetLike
  • SetMonoTransforms
  • SortedSet
  • SortedSetLike
  • StringBuilder
t

strawman.collection.mutable

IndexedOptimizedGrowableSeq

trait IndexedOptimizedGrowableSeq[A] extends IndexedOptimizedSeq[A] with GrowableSeq[A]

Linear Supertypes
GrowableSeq[A], Growable[A], IndexedOptimizedSeq[A], Seq[A], Iterable[A], collection.Seq[A], ArrayLike[A], SeqLike[A, Seq], Equals, SeqMonoTransforms[A, Seq[A @scala.annotation.unchecked.uncheckedVariance]], collection.Iterable[A], IterableLike[A, Seq], IterablePolyTransforms[A, Seq], IterableMonoTransforms[A, Seq[A @scala.annotation.unchecked.uncheckedVariance]], IterableOps[A], FromIterable[Seq], IterableOnce[A], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IndexedOptimizedGrowableSeq
  2. GrowableSeq
  3. Growable
  4. IndexedOptimizedSeq
  5. Seq
  6. Iterable
  7. Seq
  8. ArrayLike
  9. SeqLike
  10. Equals
  11. SeqMonoTransforms
  12. Iterable
  13. IterableLike
  14. IterablePolyTransforms
  15. IterableMonoTransforms
  16. IterableOps
  17. FromIterable
  18. IterableOnce
  19. AnyRef
  20. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def +=(elem: A): IndexedOptimizedGrowableSeq.this.type

    ${Add}s a single element to this $coll.

    ${Add}s a single element to this $coll.

    elem

    the element to $add.

    returns

    the $coll itself

    Definition Classes
    Growable
  2. abstract def apply(i: Int): A
    Definition Classes
    ArrayLike
  3. abstract def clear(): Unit

    Clears the $coll's contents.

    Clears the $coll's contents. After this operation, the $coll is empty.

    Definition Classes
    Growable
  4. abstract def fromIterable[B](coll: collection.Iterable[B]): Seq[B]
    Definition Classes
    IterablePolyTransforms
  5. abstract def insert(idx: Int, elem: A): Unit
    Definition Classes
    GrowableSeq
  6. abstract def insertAll(idx: Int, elems: IterableOnce[A]): Unit
    Definition Classes
    GrowableSeq
  7. abstract def iterator(): Iterator[A]

    Iterator can be used only once

    Iterator can be used only once

    Definition Classes
    IterableOnce
  8. abstract def length: Int
    Definition Classes
    ArrayLike
  9. abstract def remove(from: Int, n: Int): Unit
    Definition Classes
    GrowableSeq
  10. abstract def remove(idx: Int): A
    Definition Classes
    GrowableSeq
  11. abstract def update(idx: Int, elem: A): Unit
    Definition Classes
    Seq

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]): Seq[B]

    Concatenation

    Concatenation

    Definition Classes
    IterablePolyTransforms
  4. def ++=(xs: IterableOnce[A]): IndexedOptimizedGrowableSeq.this.type

    ${Add}s all elements produced by a TraversableOnce to this $coll.

    ${Add}s all elements produced by a TraversableOnce to this $coll.

    xs

    the TraversableOnce producing the elements to $add.

    returns

    the $coll itself.

    Definition Classes
    Growable
  5. def +=(elem1: A, elem2: A, elems: A*): IndexedOptimizedGrowableSeq.this.type

    ${Add}s two or more elements to this $coll.

    ${Add}s two or more elements to this $coll.

    elem1

    the first element to $add.

    elem2

    the second element to $add.

    elems

    the remaining elements to $add.

    returns

    the $coll itself

    Definition Classes
    Growable
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. 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
  9. 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
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def coll: IndexedOptimizedGrowableSeq.this.type

    The collection itself

    The collection itself

    Attributes
    protected
    Definition Classes
    IterableIterablePolyTransformsIterableMonoTransformsIterableOps
  12. 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
  13. def drop(n: Int): Seq[A @scala.annotation.unchecked.uncheckedVariance]

    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
  14. def dropInPlace(n: Int): IndexedOptimizedGrowableSeq.this.type
    Definition Classes
    GrowableSeq
  15. def dropRightInPlace(n: Int): IndexedOptimizedGrowableSeq.this.type
    Definition Classes
    GrowableSeq
  16. def dropWhileInPlace(p: (A) ⇒ Boolean): IndexedOptimizedGrowableSeq.this.type
    Definition Classes
    GrowableSeq
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(o: Any): Boolean
    Definition Classes
    SeqLike → Equals → AnyRef → Any
  19. def filter(p: (A) ⇒ Boolean): Seq[A @scala.annotation.unchecked.uncheckedVariance]

    All elements satisfying predicate p

    All elements satisfying predicate p

    Definition Classes
    IterableMonoTransforms
  20. def filterInPlace(p: (A) ⇒ Boolean): IndexedOptimizedGrowableSeq.this.type
  21. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def flatMap[B](f: (A) ⇒ IterableOnce[B]): Seq[B]

    Flatmap

    Flatmap

    Definition Classes
    IterablePolyTransforms
  23. def flatMapInPlace(f: (A) ⇒ IterableOnce[A]): IndexedOptimizedGrowableSeq.this.type
  24. def foldLeft[B](z: B)(op: (B, A) ⇒ B): B

    Fold left

    Fold left

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

    Fold right

    Fold right

    Definition Classes
    IterableOps
  26. 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
  27. def fromIterableWithSameElemType(coll: collection.Iterable[A]): Seq[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
    SeqLikeIterableLikeIterableMonoTransforms
  28. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  29. def hashCode(): Int
    Definition Classes
    SeqLike → AnyRef → Any
  30. def head: A

    The first element of the collection.

    The first element of the collection.

    Definition Classes
    IterableOps
  31. 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
  32. def isEmpty: Boolean

    Is the collection empty?

    Is the collection empty?

    Definition Classes
    IterableOps
  33. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  34. 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
  35. def map[B](f: (A) ⇒ B): Seq[B]

    Map

    Map

    Definition Classes
    IterablePolyTransforms
  36. def mapInPlace(f: (A) ⇒ A): IndexedOptimizedGrowableSeq.this.type
    Definition Classes
    IndexedOptimizedSeqSeq
  37. 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
  38. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  39. def nonEmpty: Boolean

    Is the collection not empty?

    Is the collection not empty?

    Definition Classes
    IterableOps
  40. final def notify(): Unit
    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  42. def padToInPlace(len: Int, elem: A): IndexedOptimizedGrowableSeq.this.type
    Definition Classes
    GrowableSeq
  43. def partition(p: (A) ⇒ Boolean): (Seq[A @scala.annotation.unchecked.uncheckedVariance], Seq[A @scala.annotation.unchecked.uncheckedVariance])

    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
  44. def patchInPlace(from: Int, patch: collection.Seq[A], replaced: Int): IndexedOptimizedGrowableSeq.this.type
  45. def reverse: Seq[A @scala.annotation.unchecked.uncheckedVariance]
    Definition Classes
    SeqMonoTransforms
  46. def sameElements[B >: A](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
  47. 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
  48. def sliceInPlace(start: Int, end: Int): IndexedOptimizedGrowableSeq.this.type
    Definition Classes
    GrowableSeq
  49. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  50. def tail: Seq[A @scala.annotation.unchecked.uncheckedVariance]

    The rest of the collection without its first element.

    The rest of the collection without its first element.

    Definition Classes
    IterableMonoTransforms
  51. def take(n: Int): Seq[A @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
  52. def takeInPlace(n: Int): IndexedOptimizedGrowableSeq.this.type
    Definition Classes
    GrowableSeq
  53. def takeRightInPlace(n: Int): IndexedOptimizedGrowableSeq.this.type
    Definition Classes
    GrowableSeq
  54. def takeWhileInPlace(p: (A) ⇒ Boolean): IndexedOptimizedGrowableSeq.this.type
    Definition Classes
    GrowableSeq
  55. 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
  56. def toArray[B >: A](implicit arg0: ClassTag[B]): Array[B]

    Convert collection to array.

    Convert collection to array.

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

    A view representing the elements of this collection.

    A view representing the elements of this collection.

    Definition Classes
    IterableOps
  59. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. def zip[B](xs: IterableOnce[B]): Seq[(A, B)]

    Zip.

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

    Definition Classes
    IterablePolyTransforms

Inherited from GrowableSeq[A]

Inherited from Growable[A]

Inherited from IndexedOptimizedSeq[A]

Inherited from Seq[A]

Inherited from Iterable[A]

Inherited from collection.Seq[A]

Inherited from ArrayLike[A]

Inherited from SeqLike[A, Seq]

Inherited from Equals

Inherited from SeqMonoTransforms[A, Seq[A @scala.annotation.unchecked.uncheckedVariance]]

Inherited from collection.Iterable[A]

Inherited from IterableLike[A, Seq]

Inherited from IterablePolyTransforms[A, Seq]

Inherited from IterableMonoTransforms[A, Seq[A @scala.annotation.unchecked.uncheckedVariance]]

Inherited from IterableOps[A]

Inherited from FromIterable[Seq]

Inherited from IterableOnce[A]

Inherited from AnyRef

Inherited from Any

Ungrouped