Scala 2.8.0.r0-b20090810214045 API

This document is the API specification for Scala Library

Class Summary
class ArrayBuffer [A](protected val override initialSize : Int) extends Buffer[A] with TraversableClass[A, ArrayBuffer] with BufferTemplate[A, ArrayBuffer[A]] with VectorTemplate[A, ArrayBuffer[A]] with Builder[A, ArrayBuffer[A]] with ResizableArray[A]
An implementation of the Buffer class using an array to represent the assembled sequence internally. Append, update and random access take constant time (amortized time). Prepends and removes are linear in the buffer size.
class ArrayStack [T](private table : Array[AnyRef], private index : Int) extends Iterable[T]
Simple stack class backed by an array. Should be significantly faster than the standard mutable stack.
class BitSet (protected val elems : Array[Long]) extends Set[Int] with BitSet with BitSetTemplate[BitSet] with MutableSetTemplate[Int, BitSet]
A class for mutable bitsets
trait Buffer [A] extends Sequence[A] with TraversableClass[A, Buffer] with BufferTemplate[A, Buffer[A]]
Buffers are used to create sequences of elements incrementally by appending, prepending, or inserting new elements. It is also possible to access and modify elements in a random access fashion via the index of the element in the current sequence.
trait CloneableCollection extends AnyRef
The J2ME version of the library defined this trait with a clone method to substitute for the lack of Object.clone there
final class DefaultEntry [A, B](val key : A, val value : B) extends HashEntry[A, DefaultEntry[A, B]]
trait DefaultMapModel [A, B] extends Map[A, B]
This class is used internally. It implements the mutable Map class in terms of three functions: findEntry, addEntry, and entries.
trait FlatHashTable [A] extends AnyRef
trait HashEntry [A, E] extends AnyRef
class HashMap [A, B] extends Map[A, B] with MutableMapTemplate[A, B, HashMap[A, B]] with HashTable[A]
class HashSet [A] extends Set[A] with SetClass[A, HashSet] with MutableSetTemplate[A, HashSet[A]] with FlatHashTable[A]
This class implements mutable sets using a hashtable.
trait HashTable [A] extends AnyRef
This class can be used to construct data structures that are based on hashtables. Class HashTable[A] implements a hashtable that maps keys of type A to values of the fully abstract member type Entry. Classes that make use of HashTable have to provide an implementation for Entry There are mainly two parameters that affect the performance of a hashtable: the initial size and the load factor. The size refers to the number of buckets in the hashtable, and the load factor is a measure of how full the hashtable is allowed to get before its size is automatically doubled. Both parameters may be changed by overriding the corresponding values in class HashTable.
class History [A, B] extends Subscriber[A, B] with Iterable[(B, A)]
History[A, B] objects may subscribe to events of type A published by an object of type B. The history subscriber object records all published events up to maximum number of maxHistory events.
class ImmutableMapAdaptor [A, B](protected val imap : Map[A, B]) extends Map[A, B]
This class can be used as an adaptor to create mutable maps from immutable map implementations. Only method empty has to be redefined if the immutable map on which this mutable map is originally based is not empty. empty is supposed to return the representation of an empty map.
class ImmutableSetAdaptor [A](protected val set : Set[A]) extends Set[A]
This class can be used as an adaptor to create mutable sets from immutable set implementations. Only method empty has to be redefined if the immutable set on which this mutable set is originally based is not empty. empty is supposed to return the representation of an empty set.
trait Iterable [A] extends Traversable[A] with Iterable[A] with TraversableClass[A, Iterable] with IterableTemplate[A, Iterable[A]]
trait LinearSequence [A] extends Sequence[A] with LinearSequence[A] with TraversableClass[A, LinearSequence] with LinearSequenceTemplate[A, LinearSequence[A]]
A subtrait of collection.Sequence which represents sequences that cannot be mutated.
final class LinkedEntry [A, B](val key : A, val value : B) extends HashEntry[A, LinkedEntry[A, B]]
class LinkedHashMap [A, B] extends Map[A, B] with MutableMapTemplate[A, B, LinkedHashMap[A, B]] with HashTable[A]
class LinkedHashSet [A] extends Set[A] with SetClass[A, LinkedHashSet] with MutableSetTemplate[A, LinkedHashSet[A]] with FlatHashTable[A]
Todo: this has O(n) cost for element removal. Should be rewritten to be more efficient.
class LinkedList [A](_elem : A, _next : LinkedList[A]) extends LinearSequence[A] with TraversableClass[A, LinkedList] with LinkedListTemplate[A, LinkedList[A]]
This class implements single linked lists where both the head (elem) and the tail (next) are mutable.
final class ListBuffer [A] extends Buffer[A] with TraversableClass[A, ListBuffer] with BufferTemplate[A, ListBuffer[A]] with Builder[A, List[A]] with SequenceForwarder[A]
A Buffer implementation back up by a list. It provides constant time prepend and append. Most other operations are linear.
class ListMap [A, B] extends Map[A, B] with MutableMapTemplate[A, B, ListMap[A, B]]
trait Map [A, B] extends Iterable[(A, B)] with Map[A, B] with MutableMapTemplate[A, B, Map[A, B]] with Unhashable
trait MapProxy [A, B] extends Map[A, B] with MapProxyTemplate[A, B, Map[A, B]]
trait MultiMap [A, B] extends Map[A, Set[B]]
This class is typically used as a mixin. It turns maps which map A to Set[B] objects into multi maps which map A to B objects.
class MutableList [A] extends LinearSequence[A] with LinearSequenceTemplate[A, MutableList[A]] with Builder[A, MutableList[A]]
This class is used internally to represent mutable lists. It is the basis for the implementation of the classes Stack, and Queue. !!! todo: convert to LinkedListBuffer?
trait ObservableBuffer [A, This <: ObservableBuffer[A, This]] extends Buffer[A] with Publisher[Message[A] with Undoable, This]
This class is typically used as a mixin. It adds a subscription mechanism to the Buffer class into which this abstract class is mixed in. Class ObservableBuffer publishes events of the type Message.
trait ObservableMap [A, B, This <: ObservableMap[A, B, This]] extends Map[A, B] with Publisher[Message[(A, B)] with Undoable, This]
This class is typically used as a mixin. It adds a subscription mechanism to the Map class into which this abstract class is mixed in. Class ObservableMap publishes events of the type Message.
trait ObservableSet [A, This <: ObservableSet[A, This]] extends Set[A] with Publisher[Message[A] with Undoable, This]
This class is typically used as a mixin. It adds a subscription mechanism to the Set class into which this abstract class is mixed in. Class ObservableSet publishes events of the type Message.
class OpenHashMap [Key, Value](initialSize : Int) extends Map[Key, Value]
A mutable hash map based on an open hashing scheme. The precise scheme is undefined, but it should make a reasonable effort to ensure that an insert with consecutive hash codes is not unneccessarily penalised. In particular, mappings of consecutive integer keys should work without significant performance loss.
class PriorityQueue [A](implicit ord : Ordering[A]) extends ResizableArray[A] with Addable[A, PriorityQueue[A]] with Growable[A] with Cloneable[PriorityQueue[A]]
This class implements priority queues using a heap. To prioritize elements of type T there must be an implicit Ordering[T] available at creation.
trait Publisher [A, This <: Publisher[A, This]] extends AnyRef
Publisher[A,This] objects publish events of type A to all registered subscribers. When subscribing, a subscriber may specify a filter which can be used to constrain the number of events sent to the subscriber. Subscribers may suspend their subscription, or reactivate a suspended subscription. Class Publisher is typically used as a mixin. The type variable This models self types.
class Queue [A] extends MutableList[A] with Cloneable[Queue[A]]
Queue objects implement data structures that allow to insert and retrieve elements in a first-in-first-out (FIFO) manner.
trait ResizableArray [A] extends Vector[A] with TraversableClass[A, ResizableArray] with VectorTemplate[A, ResizableArray[A]]
This class is used internally to implement data structures that are based on resizable arrays.
class RevertableHistory [A <: Undoable, B] extends History[A, B] with Undoable
A revertable history is a History object which supports an undo operation. Type variable A refers to the type of the published events, B denotes the publisher type. Type B is typically a subtype of Publisher.
trait Sequence [A] extends Iterable[A] with Sequence[A] with TraversableClass[A, Sequence] with SequenceTemplate[A, Sequence[A]] with Unhashable
A subtrait of collection.Sequence which represents sequences that can be mutated. The class adds an `update` method to collection.Sequence.
trait Set [A] extends Iterable[A] with Set[A] with SetClass[A, Set] with MutableSetTemplate[A, Set[A]] with Unhashable
A generic trait for mutable sets. Concrete set implementations have to provide functionality for the abstract methods in Set: def contains(elem: A): Boolean def iterator: Iterator[A] def += (elem: A): this.type def -= (elem: A): this.type
trait SetProxy [A] extends Set[A] with SetProxyTemplate[A, Set[A]]
This is a simple wrapper class for scala.collection.mutable.Set. It is most useful for assembling customized set abstractions dynamically using object composition and forwarding.
class Stack [A](val elems : List[A]) extends Sequence[A] with Cloneable[Stack[A]]
A stack implements a data structure which allows to store and retrieve objects in a last-in-first-out (LIFO) fashion.
final class StringBuilder (initCapacity : Int, private initValue : java.lang.String) extends Builder[Char, java.lang.String] with Vector[Char]
trait Subscriber [-A, -B] extends AnyRef
Subscriber[A, B] objects may subscribe to events of type A published by an object of type B. B is typically a subtype of Publisher.
trait SynchronizedBuffer [A] extends Buffer[A]
This class should be used as a mixin. It synchronizes the Buffer methods of the class into which it is mixed in.
trait SynchronizedMap [A, B] extends Map[A, B]
This class should be used as a mixin. It synchronizes the Map functions of the class into which it is mixed in.
class SynchronizedQueue [A] extends Queue[A]
This is a synchronized version of the Queue[T] class. It implements a data structure that allows one to insert and retrieve elements in a first-in-first-out (FIFO) manner.
trait SynchronizedSet [A] extends Set[A]
This class should be used as a mixin. It synchronizes the Set functions of the class into which it is mixed in.
class SynchronizedStack [A] extends Stack[A]
This is a synchronized version of the Stack[T] class. It implements a data structure which allows to store and retrieve objects in a last-in-first-out (LIFO) fashion.
trait Traversable [A] extends Traversable[A] with TraversableClass[A, Traversable] with TraversableTemplate[A, Traversable[A]] with Mutable
A subtrait of collection.Traversable which represents traversables that can be mutated.
trait Undoable extends AnyRef
Classes that mix in the Undoable class provide an operation undo which can be used to undo the last operation.
trait Vector [A] extends Sequence[A] with Vector[A] with TraversableClass[A, Vector] with MutableVectorTemplate[A, Vector[A]]
A subtrait of collection.Vector which represents sequences that can be mutated.
class WeakHashMap [A, B] extends JMapWrapper[A, B]
Object Summary
object ArrayBuffer extends SequenceFactory[ArrayBuffer]
object BitSet extends BitSetFactory[BitSet]
A factory object for mutable bitsets
object Buffer extends SequenceFactory[Buffer]
object HashMap extends MutableMapFactory[HashMap]
This class implements mutable maps using a hashtable.
object HashSet extends SetFactory[HashSet]
Factory object for `HashSet` class
object Iterable extends TraversableFactory[Iterable]
object LinearSequence extends SequenceFactory[LinearSequence]
object LinkedHashMap extends MutableMapFactory[LinkedHashMap]
This class implements mutable maps using a hashtable.
object LinkedHashSet extends SetFactory[LinkedHashSet]
Factory object for `LinkedHashSet` class
object LinkedList extends SequenceFactory[LinkedList]
object ListBuffer extends SequenceFactory[ListBuffer]
object ListMap extends MutableMapFactory[ListMap]
This class implements mutable maps using a list.
object Map extends MutableMapFactory[Map]
object OpenHashMap extends AnyRef
object ResizableArray extends SequenceFactory[ResizableArray]
object Sequence extends SequenceFactory[Sequence]
object Set extends SetFactory[Set]
The canonical factory methods for mutable sets. Currently this returns a HashSet.
object StringBuilder extends AnyRef
object Traversable extends TraversableFactory[Traversable]
object Vector extends SequenceFactory[Vector]