Modifier and Type | Class and Description |
---|---|
class |
AbstractTree<E>
This class provides a skeletal implementation of the tree interface.
|
class |
BinaryTree<E>
This class implements a binary tree.
|
class |
OrderedTree<E>
This class implements an ordered tree.
|
class |
UnorderedTree<E>
This class implements an unordered tree.
|
Modifier and Type | Method and Description |
---|---|
Tree<E> |
Tree.find(E element)
Finds a node of the first occurrence of the given element in this tree.
|
Tree<E> |
Tree.findChild(E element)
Finds a child of the first occurrence of the given element in this node.
|
Tree<E> |
Tree.getParent()
Returns the parent of this node.
|
Tree<E> |
Tree.getRoot()
Returns the root of this tree.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Tree<E>> |
UnorderedTree.getNodes()
Returns a list of all nodes of the type
Tree<E> in this tree. |
java.util.List<Tree<E>> |
Tree.getNodes()
Returns a list of all nodes of this tree.
|
java.util.List<Tree<E>> |
OrderedTree.getNodes()
Returns a list of all nodes of the type
Tree<E> in this tree. |
Modifier and Type | Method and Description |
---|---|
int |
Tree.degree(Tree<E> node)
Returns the degree of the given node.
|
int |
AbstractTree.degree(Tree<E> node)
Returns the degree of the given node.
|
int |
Tree.depth(Tree<E> node)
Returns the depth of the given node.
|
int |
AbstractTree.depth(Tree<E> node)
Returns the depth of the given node.
|
boolean |
Tree.hasAncestor(Tree<E> ancestor)
Returns
true if this node has the given ancestor. |
boolean |
AbstractTree.hasAncestor(Tree<E> ancestor)
Returns
true if this node has the given ancestor. |
boolean |
Tree.hasDescendant(Tree<E> descendant)
Returns
true if this node has the given descendant. |
boolean |
AbstractTree.hasDescendant(Tree<E> descendant)
Returns
true if this node has the given descendant. |
boolean |
Tree.hasParent(Tree<E> parent)
Returns
true if this node has the given parent. |
boolean |
AbstractTree.hasParent(Tree<E> parent)
Returns
true if this node has the given parent. |