T
- tree node typepublic abstract class BasicTree<T extends BasicTree<T>> extends java.lang.Object implements ITree<T>, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
class |
BasicTree.BreadthFirstTreeNodes
Obtains tree nodes in breadth-first order
|
class |
BasicTree.DepthFirstPostOrderTreeNodes
Obtains tree nodes in depth-first post-order
|
class |
BasicTree.DepthFirstPreOrderTreeNodes
Obtains tree nodes in depth-first pre-order
|
static class |
BasicTree.TreeIterator<T extends BasicTree<T>>
Tree iterator on nodes
|
class |
BasicTree.TreeNodesByLevel
Obtains tree nodes by decreasing levels
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<T> |
children
List of children nodes
|
protected BasicTree<T> |
parent
Parent node
|
private static long |
serialVersionUID |
Constructor and Description |
---|
BasicTree()
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
depth()
Finds the depth of the tree.
|
java.util.List<T> |
getChildren()
Get children
|
abstract java.lang.String |
getId()
Get node id (each type instance will manage its own id)
|
T |
getNode()
Get node cast to type
|
BasicTree<T> |
getParent()
Get parent
|
private java.lang.String |
toCompactString()
Get compact string
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String indent)
Get string
|
private static final long serialVersionUID
public abstract java.lang.String getId()
public java.util.List<T> getChildren()
ITree
getChildren
in interface ITree<T extends BasicTree<T>>
public T getNode()
public int depth()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String indent)
indent
- indentationprivate java.lang.String toCompactString()