GeneralKVTreeBuilder

com.phasmidsoftware.lascala.tree.GeneralKVTreeBuilder
abstract class GeneralKVTreeBuilder[K, V](implicit vo: ValueOps[K, V]) extends TreeBuilder[V]

Base class implementing TreeBuilder for GeneralKVTree

Type parameters

K

key type

V

value type

Value parameters

vo

implicit ValueOps

Attributes

Graph
Supertypes
trait TreeBuilder[V]
class Object
trait Matchable
class Any
Known subtypes

Members list

Type members

Classlikes

object NodeOrdering extends Ordering[Node[V]]

Attributes

Supertypes
trait Ordering[Node[GeneralKVTreeBuilder.this.V]]
trait PartialOrdering[Node[GeneralKVTreeBuilder.this.V]]
trait Equiv[Node[GeneralKVTreeBuilder.this.V]]
trait Serializable
trait Comparator[Node[GeneralKVTreeBuilder.this.V]]
class Object
trait Matchable
class Any
Show all
Self type

Value members

Concrete methods

def buildLeaf(a: V): Node[V]

Build a new leaf for a GeneralKVTree

Build a new leaf for a GeneralKVTree

Value parameters

a

the value for the leaf

Attributes

Returns

a node which is a leaf node

def buildTree(maybeValue: Option[V], children: Seq[Node[V]]): Tree[V]

Build a new tree, given a value and child nodes

Build a new tree, given a value and child nodes

Value parameters

children

the the children of the node

maybeValue

the (optional) value which the new tree will have at its root

Attributes

Returns

a tree the (optional) value at the root and children as the immediate descendants

def getParent(tree: Tree[V], a: V): Option[Node[V]]

Get a node from an existing tree to which a new node with value a can be attached

Get a node from an existing tree to which a new node with value a can be attached

Value parameters

a

the value of the new node

tree

the tree whence we want to find the (potential) parent of a new node with value a

Attributes

Returns

the Node to which the new node will be attached (if such a node exists). Note that this might be a leaf

def nodesAlike(x: Node[V], y: Node[V]): Boolean

This method determines if the two given nodes are structurally the same

This method determines if the two given nodes are structurally the same

Value parameters

x

node x

y

node y

Attributes

Returns

true if they are the same