Module gen.tree

Class TreeNode<T>

  • Type Parameters:
    T - the generic type of the value
    All Implemented Interfaces:
    io.github.astrapi69.design.pattern.visitor.Acceptable<io.github.astrapi69.design.pattern.visitor.Visitor<TreeNode<T>>>, ITreeNode<T,​TreeNode<T>>, java.io.Serializable

    public class TreeNode<T>
    extends java.lang.Object
    implements ITreeNode<T,​TreeNode<T>>
    The generic class TreeNode.
    See Also:
    Serialized Form
    • Constructor Detail

      • TreeNode

        public TreeNode​(T value)
        Instantiates a new tree node.
        Parameters:
        value - the value
    • Method Detail

      • contains

        public boolean contains​(TreeNode<T> treeNode)
        Checks if the given ITreeNode object is a descendant of this tree node
        Specified by:
        contains in interface ITreeNode<T,​TreeNode<T>>
        Parameters:
        treeNode - the tree node to check
        Returns:
        true if the given ITreeNode object is a descendant of this tree node otherwise false