|
Scala 2.1.6
|
class
Tree
[ A , B ]
extends
java.lang.Object with
scala.ScalaObjectConstructor Summary | |
def
this
( ) ( view$0 : (A) => scala.Ordered[A] )
|
Type Summary | |
protected
|
type
aNode
The type of nodes that the tree is build from. |
Def Summary | |
protected
|
def
New
( sz : scala.Int , t : scala.collection.immutable.GBTree[A,B] )
: Tree.this.This
This abstract method should be defined by a concrete implementation C[T] as something like: override def New(sz:Int,t:aNode):This { new C[T](order) { override def size=sz; override protected def tree:aNode=t; }The concrete implementation should also override the def of This override type This = C[T];
|
protected
|
def
add
( key : A , entry : B )
: Tree.this.This
A new tree with the entry added is returned, assuming that key is not in the tree. |
def
balance
: Tree.this.This
Create a new balanced tree from the tree. Might be useful to call after many deletions, since deletion does not rebalance the tree. |
|
protected
|
def
deleteAny
( key : A )
: Tree.this.This
Removes the key from the tree. |
protected
|
def
entries
: scala.Iterator[B]
Gives you an iterator over all elements in the tree. The iterator structure corresponds to the call stack of an in-order traversal. Note: The iterator itself has a state, i.e., it is not functional. |
protected
|
def
findValue
( key : A )
: scala.Option[B]
Check if this map maps key to a value and return the
value if it exists.
|
protected
|
def
getThis
: Tree.this.This
|
def
size
: scala.Int
The size of the tree, returns 0 (zero) if the tree is empty. |
|
protected
|
def
tree
: scala.collection.immutable.GBTree[A,B]
The nodes in the tree. |
protected
|
def
updateOrAdd
( key : A , entry : B )
: Tree.this.This
A new tree with the entry added is returned, if key is not in the tree, otherwise the key is updated with the new entry. |
Constructor Detail |
def
this
( ) ( view$0 : (A) => scala.Ordered[A] )
Type Detail |
type
aNode
Def Detail |
def
New
( sz : scala.Int , t : scala.collection.immutable.GBTree[A,B] ) : Tree.this.This
override def New(sz:Int,t:aNode):This { new C[T](order) { override def size=sz; override protected def tree:aNode=t; }The concrete implementation should also override the def of This
override type This = C[T];
def
add
( key : A , entry : B ) : Tree.this.This
def
balance
: Tree.this.This
def
deleteAny
( key : A ) : Tree.this.This
def
entries
: scala.Iterator[B]
def
findValue
( key : A ) : scala.Option[B]
key
to a value and return the
value if it exists.def
getThis
: Tree.this.This
def
size
: scala.Int
def
tree
: scala.collection.immutable.GBTree[A,B]
def
updateOrAdd
( key : A , entry : B ) : Tree.this.This