|
Scala 2
|
class
Tree
[ A , B ]
extends
java.lang.Object with
ScalaObjectConstructor Summary | |
def
this
( ) ( view$0 : Function1 )
|
Type Summary | |
protected
|
type
aNode
The type of nodes that the tree is build from. |
Def Summary | |
protected
|
def
New
( sz : scala.Int , t : GBTree )
: 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 )
: This
A new tree with the entry added is returned, assuming that key is not in the tree. |
def
balance
: 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 )
: This
Removes the key from the tree. |
protected
|
def
entries
: Iterator
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 )
: Option
Check if this map maps key to a value and return the
value if it exists.
|
protected
|
def
getThis
: This
|
def
size
: scala.Int
The size of the tree, returns 0 (zero) if the tree is empty. |
|
protected
|
def
tree
: GBTree
The nodes in the tree. |
protected
|
def
updateOrAdd
( key : A , entry : B )
: 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 : Function1 )
Type Detail |
type
aNode
Def Detail |
def
New
( sz : scala.Int , t : GBTree ) : 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 ) : This
def
balance
: This
def
deleteAny
( key : A ) : This
def
entries
: Iterator
def
findValue
( key : A ) : Option
key
to a value and return the
value if it exists.def
getThis
: This
def
size
: scala.Int
def
tree
: GBTree
def
updateOrAdd
( key : A , entry : B ) : This