in scala.collection.immutable
class TreeMap

class TreeMap [ A , B ]
extends Tree
with Map
with ScalaObject
This class implements immutable maps using a tree.
author:
Erik Stenman
author:
Matthias Zenger
version:
1.1, 03/05/2004

Constructor Summary
def this ( ) ( view$1 : Function1 )



Type Summary
override protected type This



Def Summary
def - ( key : A ) : TreeMap
Removes the key from the TreeMap.
protected def New ( sz : scala.Int , t : GBTree ) : TreeMap
Creates a new TreeMap from a GBTree and its size.
override def apply ( key : A ) : B
Retrieve the value which is associated with the given key. This method throws an exception if there is no mapping from the given key to a value.
def elements : Iterator
Creates a new iterator over all elements contained in this object.
def empty [ C ] : TreeMap
A factory to create empty maps of the same type of keys.
override def equals ( obj : scala.Any ) : scala.Boolean
Compares two maps structurally; i.e. checks if all mappings contained in this map are also contained in the other map, and vice versa.
override def get ( key : A ) : Option
Check if this map maps key to a value and return the value if it exists.
override protected def getThis : TreeMap

def insert ( key : A , value : B ) : TreeMap
A new TreeMap with the entry added is returned, assuming that key is not in the TreeMap.
override def toList : List
Creates a list of all (key, value) mappings.
def update ( key : A , value : B ) : TreeMap
A new TreeMap with the entry added is returned, if key is not in the TreeMap, otherwise the key is updated with the new entry.


Constructor Detail
def this ( ) ( view$1 : Function1 )

Type Detail
override protected type This

Def Detail
def - ( key : A ) : TreeMap
Removes the key from the TreeMap.

protected def New ( sz : scala.Int , t : GBTree ) : TreeMap
Creates a new TreeMap from a GBTree and its size.

override def apply ( key : A ) : B
Retrieve the value which is associated with the given key. This method throws an exception if there is no mapping from the given key to a value.
param:
key the key
return:
the value associated with the given key.
throws:
Error("key not found").

def elements : Iterator
Creates a new iterator over all elements contained in this object.
return:
the new iterator

def empty [ C ] : TreeMap
A factory to create empty maps of the same type of keys.

override def equals ( obj : scala.Any ) : scala.Boolean
Compares two maps structurally; i.e. checks if all mappings contained in this map are also contained in the other map, and vice versa.
return:
true, iff both maps contain exactly the same mappings.

override def get ( key : A ) : Option
Check if this map maps key to a value and return the value if it exists.
param:
key the key of the mapping of interest
return:
the value of the mapping, if it exists

override protected def getThis : TreeMap

def insert ( key : A , value : B ) : TreeMap
A new TreeMap with the entry added is returned, assuming that key is not in the TreeMap.

override def toList : List
Creates a list of all (key, value) mappings.
return:
the list of all mappings

def update ( key : A , value : B ) : TreeMap
A new TreeMap with the entry added is returned, if key is not in the TreeMap, otherwise the key is updated with the new entry.