in scala.collection.immutable
class TreeMap

`class` TreeMap [ A , B ]
  `extends` scala.collection.immutable.Tree[A,scala.Tuple2[A,B]]
  `with` scala.collection.immutable.Map[A,B]
  `with` scala.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 : (A) => scala.Ordered[A] )

Type Summary
`override` `protected` | `type` This

Def Summary
| `def` - ( key : A ) : scala.collection.immutable.TreeMap[A,B] Removes the key from the TreeMap.
`protected` | `def` New ( sz : scala.Int , t : scala.collection.immutable.GBTree[A,scala.Tuple2[A,B]] ) : scala.collection.immutable.TreeMap[A,B] 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 : scala.Iterator[scala.Tuple2[A,B]] Creates a new iterator over all elements contained in this object.
| `def` empty [ C ] : scala.collection.immutable.TreeMap[A,C] 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 ) : scala.Option[B] Check if this map maps `key` to a value and return the value if it exists.
`override` `protected` | `def` getThis : scala.collection.immutable.TreeMap[A,B]
| `def` insert ( key : A , value : B ) : scala.collection.immutable.TreeMap[A,B] A new TreeMap with the entry added is returned, assuming that key is not in the TreeMap.
`override` | `def` toList : scala.List[scala.Tuple2[A,B]] Creates a list of all (key, value) mappings.
| `def` update ( key : A , value : B ) : scala.collection.immutable.TreeMap[A,B] 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 : (A) => scala.Ordered[A] )

Type Detail

override protected `type` This

Def Detail

`def` - ( key : A ) : scala.collection.immutable.TreeMap[A,B]

  Removes the key from the TreeMap.

protected `def` New ( sz : scala.Int , t : scala.collection.immutable.GBTree[A,scala.Tuple2[A,B]] ) : scala.collection.immutable.TreeMap[A,B]

  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 : scala.Iterator[scala.Tuple2[A,B]]

  Creates a new iterator over all elements contained in this object.

return:
  the new iterator

`def` empty [ C ] : scala.collection.immutable.TreeMap[A,C]

  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 ) : scala.Option[B]

  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 : scala.collection.immutable.TreeMap[A,B]

`def` insert ( key : A , value : B ) : scala.collection.immutable.TreeMap[A,B]

  A new TreeMap with the entry added is returned, assuming that key is not in the TreeMap.

override `def` toList : scala.List[scala.Tuple2[A,B]]

  Creates a list of all (key, value) mappings.

return:
  the list of all mappings

`def` update ( key : A , value : B ) : scala.collection.immutable.TreeMap[A,B]

  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.