| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Tree<T> childTree) |
void |
addChild(Tree<T> childTree,
int insertIndex) |
Tree<T> |
connect(T childValue) |
boolean |
contains(Tree<T> node) |
<A extends T,B extends A> |
findParent(Tree<B> node) |
T |
get() |
Tree<T> |
getChild(int index) |
Array<Tree<T>> |
getChilds() |
int |
getNumChilds() |
Array<Tree<T>> |
getPathTo(Tree<? super T> root) |
T |
getValue() |
boolean |
isEmpty() |
<R> Tree<R> |
map(IConverter<R,T> mapper)
Convert a Tree
|
boolean |
reconnect(T parent,
T child)
Reconnect two existing
Tree nodes from their respective values. |
Tree<T> |
remove(int index) |
void |
removeChilds()
Remove all nodes from this
Tree |
<PT extends T> |
removeNode(Tree<PT> node) |
java.lang.String |
toString() |
public Tree(T value)
public final java.lang.String toString()
toString in class java.lang.Objectpublic final int getNumChilds()
getNumChilds in interface ITree<Tree<T>>Treepublic final boolean isEmpty()
Tree is a leaf node (does not contains any child)public final Tree<T> getChild(int index)
getChild in interface ITree<Tree<T>>index - in the range [0; getNumChilds()[public final void removeChilds()
Treepublic final Tree<T> connect(T childValue)
childValue - value to addTree containing the specified valuepublic final boolean reconnect(T parent, T child)
Tree nodes from their respective values.parent - parent valuechild - child valuepublic final Tree<T> remove(int index)
index - of the child to removepublic final <PT extends T> Tree<PT> removeNode(Tree<PT> node)
node - a Tree node to removepublic final <R> Tree<R> map(IConverter<R,T> mapper)
mapper - a IConverter to map R to a T objectBonzai Engine 1.3.4 11/12/2015 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2015 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com