Package com.github.mike10004.xvfbmanager
Class ListTreeNode<T>
- java.lang.Object
-
- com.github.mike10004.xvfbmanager.ListTreeNode<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.mike10004.xvfbmanager.TreeNode
TreeNode.NodeTraversal<T>, TreeNode.Utils
-
-
Constructor Summary
Constructors Constructor Description ListTreeNode(T label)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListTreeNode<T>addChild(TreeNode<T> child)Adds a child to this node's children.TreeNode.NodeTraversal<T>breadthFirstTraversal()Gets an iterable that provides a breadth-first iteration of nodes in the tree rooted at this node.Iterable<TreeNode<T>>children()Gets an iterable of this node's childrenintgetChildCount()Gets the count of this node's children.TgetLabel()Gets this node's label.intgetLevel()Gets the level, which is the distance to the root.TreeNode<T>getParent()Gets this node's parent.booleanisLeaf()Checks whether this node is a leaf node.booleanisRoot()Checks whether this node is the root node of a tree.TreeNode<T>setParent(TreeNode<T> parent)Sets the parent of a given node.StringtoString()
-
-
-
Constructor Detail
-
ListTreeNode
public ListTreeNode(T label)
-
-
Method Detail
-
children
public Iterable<TreeNode<T>> children()
Description copied from interface:TreeNodeGets an iterable of this node's children
-
getLevel
public int getLevel()
Description copied from interface:TreeNodeGets the level, which is the distance to the root. The level of the root node is zero.
-
getChildCount
public int getChildCount()
Description copied from interface:TreeNodeGets the count of this node's children.- Specified by:
getChildCountin interfaceTreeNode<T>- Returns:
- the child count
-
getParent
public TreeNode<T> getParent()
Description copied from interface:TreeNodeGets this node's parent.
-
setParent
public TreeNode<T> setParent(TreeNode<T> parent)
Description copied from interface:TreeNodeSets the parent of a given node.
-
addChild
public ListTreeNode<T> addChild(TreeNode<T> child)
Description copied from interface:TreeNodeAdds a child to this node's children. Returns this instance (to facilitate chaining).
-
isRoot
public boolean isRoot()
Description copied from interface:TreeNodeChecks whether this node is the root node of a tree.
-
breadthFirstTraversal
public TreeNode.NodeTraversal<T> breadthFirstTraversal()
Description copied from interface:TreeNodeGets an iterable that provides a breadth-first iteration of nodes in the tree rooted at this node. The iteration includes this node.- Specified by:
breadthFirstTraversalin interfaceTreeNode<T>- Returns:
- an iterable
-
isLeaf
public boolean isLeaf()
Description copied from interface:TreeNodeChecks whether this node is a leaf node. Leaf nodes have no children.
-
-