Concrete collection type: ArrayBuffer
A trait representing indexable collections with finite length
Decorator to add collection operations to arrays.
Base trait for strict collections that can be built using a builder.
Base trait for collection builders
Base trait for instances that can construct a collection from an iterable
View defined in terms of indexing a range
Base trait for generic collections
Base trait for companion objects of collections
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]
.
Type-preserving transforms over iterables.
Type-preserving transforms over iterables. Operations defined here return in their result iterables of the same type as the one they are invoked on.
Iterator can be used only once
Operations over iterables.
Operations over iterables. No operation defined here is generic in the type of the underlying collection.
Transforms over iterables that can return collections of different element types.
A core Iterator class
Base trait for linearly accessed sequences that have efficient head
and
tail
operations.
Base trait for linearly accessed sequences that have efficient head
and
tail
operations.
Known subclasses: List, LazyList
Base trait for linear Seq operations
Concrete collection type: List
Concrete collection type: ListBuffer
Base trait for sequence collections
Base trait for Seq operations
Type-preserving transforms over sequences.
Decorator to add collection operations to strings.
Concrete collection type: View
This object reifies operations on views as case classes
Convert array to iterable via view.
Convert array to iterable via view. Lower priority than ArrayOps
Convert string to iterable via view.
Convert string to iterable via view. Lower priority than StringOps
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:
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:
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