public class LabeledTree<K,X extends LabeledNode<K>> extends Object implements Tree<K>
| Modifier and Type | Field and Description |
|---|---|
protected ReversibleMap<K,K> |
childToParent |
protected ReclaimingSupplier<K> |
idSupplier |
protected Map<K,X> |
keyToNode |
protected K |
root |
protected X |
rootNode |
| Constructor and Description |
|---|
LabeledTree() |
LabeledTree(K root,
ReversibleMap<K,K> childToParent) |
| Modifier and Type | Method and Description |
|---|---|
K |
copy(K node,
List<K> children)
Copies a given node thereby setting the provided children as its children.
|
Tree<K> |
createNew(K root) |
X |
deleteNode(K node) |
Collection<K> |
getChildren(K node) |
X |
getNode(K key) |
K |
getParent(K node) |
K |
getRoot() |
long |
nodeCount() |
String |
toString() |
protected X extends LabeledNode<K> rootNode
protected Map<K,X extends LabeledNode<K>> keyToNode
protected K root
protected ReversibleMap<K,K> childToParent
protected ReclaimingSupplier<K> idSupplier
public LabeledTree()
public LabeledTree(K root, ReversibleMap<K,K> childToParent)
Copyright © 2018. All rights reserved.