Class TreeNode<T>
- java.lang.Object
-
- de.captaingoldfish.scim.sdk.common.tree.TreeNode<T>
-
public class TreeNode<T> extends Object
a simple representation of a tree node- Since:
- 25.03.2022
- Author:
- Pascal Knueppel
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTreeNode(GenericTree<T> tree, T value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(TreeNode<T> child)add a child to this nodevoidaddChildren(TreeNode<T>... children)adds several children at oncevoidaddParent(TreeNode<T> parent)add a parent to this nodevoidaddParents(TreeNode<T>... parents)add several parents at oncevoidclearParents()removes this node from its parents and forgets its own parentsSet<TreeNode<T>>getAllBranchNodes()Set<TreeNode<T>>getChildren()Set<TreeNode<T>>getParents()TgetValue()this node itselfbooleanisLeaf()if this node is a leaf or notbooleanisRoot()if this node is a root-node or notvoidremoveChild(TreeNode<T> child)remove a child from this node.voidremoveChildren(TreeNode<T>... children)removes several children at oncevoidremoveParent(TreeNode<T> parent)remove a parent from this nodevoidremoveParents(TreeNode<T>... parents)removes several parents at onceStringtoString()
-
-
-
Constructor Detail
-
TreeNode
protected TreeNode(GenericTree<T> tree, T value)
-
-
Method Detail
-
isRoot
public boolean isRoot()
if this node is a root-node or not
-
isLeaf
public boolean isLeaf()
if this node is a leaf or not
-
removeChildren
public void removeChildren(TreeNode<T>... children)
removes several children at once
-
removeChild
public void removeChild(TreeNode<T> child)
remove a child from this node. If this child has many parents it will not be removed from the tree though
-
getAllBranchNodes
public Set<TreeNode<T>> getAllBranchNodes()
- Returns:
- the nodes from the whole branch of this node
-
clearParents
public void clearParents()
removes this node from its parents and forgets its own parents
-
getValue
public T getValue()
this node itself
-
-