Package com.exasol.util
Class AbstractTree
- java.lang.Object
-
- com.exasol.util.AbstractTree
-
- All Implemented Interfaces:
TreeNode
- Direct Known Subclasses:
AbstractBottomUpTreeNode,AbstractTreeNode
public abstract class AbstractTree extends Object implements TreeNode
An abstract base forTreeNodeimplementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractTree()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TreeNodegetChild(int index)Get child node by position in the list of siblings.List<TreeNode>getChildren()Get all child nodes of this nodeTreeNodegetParent()Get the parent of this nodebooleanisChild()Check whether this node is a child nodebooleanisFirstSibling()Check whether a child is the first in the list of siblingsbooleanisRoot()Check whether this node is the root of the tree.booleanisSibling(TreeNode node)Check whether this node is a sibling of the second node.
-
-
-
Method Detail
-
getParent
public TreeNode getParent()
Description copied from interface:TreeNodeGet the parent of this node
-
getChildren
public List<TreeNode> getChildren()
Description copied from interface:TreeNodeGet all child nodes of this node- Specified by:
getChildrenin interfaceTreeNode- Returns:
- child nodes
-
getChild
public TreeNode getChild(int index)
Description copied from interface:TreeNodeGet child node by position in the list of siblings. The position depends on the order in which the children were added.
-
isRoot
public boolean isRoot()
Description copied from interface:TreeNodeCheck whether this node is the root of the tree.
-
isChild
public boolean isChild()
Description copied from interface:TreeNodeCheck whether this node is a child node
-
isFirstSibling
public boolean isFirstSibling()
Description copied from interface:TreeNodeCheck whether a child is the first in the list of siblings- Specified by:
isFirstSiblingin interfaceTreeNode- Returns:
trueif the child is the first in the list of siblings
-
-