Scala 2.7.2.r16513-b20081107075805 API

This document is the API specification for Scala Library

Class Summary
class ArrayBuffer [A] extends Mutable[A] with Buffer[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 Collection[T]
Simple stack class backed by an array. Should be significantly faster than the standard mutable stack.
class BitSet (initSize : Int) extends BitSet with Set[Int]
The class BitSet implements mutable, resizable Bit sets
trait Buffer [A] extends Seq[A] with Scriptable[Message[(Location, A)]] with CloneableCollection
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 BufferProxy [A] extends Buffer[A] with Proxy
This is a simple proxy class for scala.collection.mutable.Buffer. It is most useful for assembling customized set abstractions dynamically using object composition and forwarding.
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.
abstract class DoubleLinkedList [A, This <: DoubleLinkedList[A, This] >: Null] extends SingleLinkedList[A, This]
This extensible class may be used as a basis for implementing double linked lists. Type variable A refers to the element type of the list, type variable This is used to model self types of linked lists.
trait FlatHashTable [A] extends AnyRef
trait HashEntry [A, E] extends AnyRef
class HashMap [A, B] extends HashTable[A] with DefaultMapModel[A, B]
class HashSet [A] extends Set[A] with FlatHashTable[A]
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 Collection[(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.
case class Include [+I](val elem : I) extends Message[I] with Product
This observable update refers to inclusion operations that add new elements to collection classes.
case class Index (val n : Int) extends Location with Product
class JavaMapAdaptor [A, B](jmap : java.util.Map[A, B]) extends Map[A, B]
This class can be used as an adaptor to create mutable maps from Java classes that implementat the java.util.Map interface.
class JavaSetAdaptor [A](jset : java.util.Set[A]) extends Set[A]
This class can be used as an adaptor to create mutable sets from Java classes that implement interface java.util.Set.
class LinkedHashMap [A, B] extends HashTable[A] with DefaultMapModel[A, B]
class LinkedHashSet [A] extends Set[A] with FlatHashTable[A]
class LinkedList [A](val elem : A, val next : LinkedList[A]) extends SingleLinkedList[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]
A Buffer implementation back up by a list. It provides constant time prepend and append. Most other operations are linear.
abstract class Location extends AnyRef
Class Location describes locations in messages implemented by class Message.
trait Map [A, B] extends Map[A, B] with Scriptable[Message[(A, B)]] with CloneableCollection
This trait represents mutable maps. Concrete map implementations just have to provide functionality for the abstract methods in scala.collection.Map as well as for update, and -=.
trait MapProxy [A, B] extends Map[A, B] with MapProxy[A, B]
trait Message [+A] extends AnyRef
Class Message represents messages that are issued by observable collection classes whenever a data structure is changed. Class Message has several subclasses for the various kinds of events: Update Remove, Include, Reset, and Script.
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.
trait MutableList [A] extends Seq[A]
This class is used internally to represent mutable lists. It is the basis for the implementation of the classes Buffer, Stack, and Queue.
trait ObservableBuffer [A, This <: ObservableBuffer[A, This]] extends Buffer[A] with Publisher[Message[(Location, 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 view$1 : (A) => Ordered[A]) extends ResizableArray[A] with CloneableCollection
This class implements priority queues using a heap. The elements of the queue have to be ordered in terms of the Ordered[T] class.
abstract class PriorityQueueProxy [A](implicit view$1 : (A) => Ordered[A]) extends PriorityQueue[A] with RandomAccessSeqProxy[A]
This class implements priority queues using a heap. The elements of the queue have to be ordered in terms of the Ordered[T] class.
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 CloneableCollection
Queue objects implement data structures that allow to insert and retrieve elements in a first-in-first-out (FIFO) manner.
trait QueueProxy [A] extends Queue[A] with SeqProxy[A]
Queue objects implement data structures that allow to insert and retrieve elements in a first-in-first-out (FIFO) manner.
case class Remove [+A](val elem : A) extends Message[A] with Product
This observable update refers to removal operations of elements from collection classes.
case class Reset [+A] extends Message[A] with Product
This command refers to reset operations.
trait ResizableArray [A] extends RandomAccessSeq[A]
This class is used internally to implement data structures that are based on resizable arrays. //todo enrich with more efficient operations
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.
class Script [A] extends ArrayBuffer[Message[A]] with Message[A]
Objects of this class represent compound messages consisting of a sequence of other messages.
trait Scriptable [A] extends AnyRef
Classes that mix in the Scriptable class allow messages to be sent to objects of that class.
trait Set [A] extends Set[A] with Scriptable[Message[A]] with CloneableCollection
This class represents mutable sets. Concrete set implementations just have to provide functionality for the abstract methods in scala.collection.Set as well as for +=, -= and clear.
trait SetProxy [A] extends Set[A] with SetProxy[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.
abstract class SingleLinkedList [A, This <: SingleLinkedList[A, This] >: Null] extends Seq[A]
This extensible class may be used as a basis for implementing linked list. Type variable A refers to the element type of the list, type variable This is used to model self types of linked lists.
class Stack [A] extends Seq[A] with CloneableCollection
A stack implements a data structure which allows to store and retrieve objects in a last-in-first-out (LIFO) fashion.
trait StackProxy [A] extends Stack[A] with SeqProxy[A]
A stack implements a data structure which allows to store and retrieve objects in a last-in-first-out (LIFO) fashion.
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 SynchronizedPriorityQueue [A](implicit view$1 : (A) => Ordered[A]) extends PriorityQueue[A]
This class implements synchronized priority queues using a heap. The elements of the queue have to be ordered in terms of the Ordered[T] class.
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 Undoable extends AnyRef
Classes that mix in the Undoable class provide an operation undo which can be used to undo the last operation.
case class Update [+A](val elem : A) extends Message[A] with Product
This observable update refers to destructive modification operations of elements from collection classes.
Object Summary
case object End extends Location with Product
object HashMap extends AnyRef
This class implements mutable maps using a hashtable.
object HashSet extends AnyRef
This class implements mutable sets using a hashtable.
object Include extends AnyRef
object Index extends (Int) => Index
object LinkedHashMap extends AnyRef
This class implements mutable maps using a hashtable.
object LinkedHashSet extends AnyRef
object Map extends AnyRef
The canonical factory methods for mutable maps. These currently return HashMap's.
case object NA extends Location with Product
object OpenHashMap extends AnyRef
object Remove extends AnyRef
object Reset extends AnyRef
object Set extends AnyRef
The canonical factory methods for mutable sets. Currently these return HashSet's.
case object Start extends Location with Product
object Update extends AnyRef