Class GenericTreeNodeImpl<T>

  • All Implemented Interfaces:
    GenericTreeNode<T>
    Direct Known Subclasses:
    MutableTreeNodeImpl

    public class GenericTreeNodeImpl<T>
    extends java.lang.Object
    implements GenericTreeNode<T>
    This class represents a generic node in an ordered tree data structure. It is not a changeable ("mutable") tree node, however. To modify a tree node, you need a MutableTreeNodeImpl class (which implements the MutableTreeNode interface). This class and its subclasses are not synchronized.
    Since:
    MicroStrategy Web 9.0.0
    • Field Detail

      • EMPTY_ENUMERATION

        public static final java.util.Enumeration<java.lang.Object> EMPTY_ENUMERATION
        An enumeration that is always empty. This is used when an enumeration of a leaf node's children is requested.
      • name

        protected java.lang.String name
      • value

        protected T value
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: GenericTreeNode
        Returns the name associated with this node, if any.
        Specified by:
        getName in interface GenericTreeNode<T>
        Returns:
        The name associated with this node, if any.
      • getValue

        public T getValue()
        Description copied from interface: GenericTreeNode
        Returns the value associated with this node, if any.
        Specified by:
        getValue in interface GenericTreeNode<T>
        Returns:
        The value associated with this node, if any.
      • getChildren

        public java.util.Enumeration<GenericTreeNode<T>> getChildren()
        Description copied from interface: GenericTreeNode
        Returns the enumeration of children for this node. It will always return a non-null Enumeration, though it may be empty.
        Specified by:
        getChildren in interface GenericTreeNode<T>
        Returns:
        The Enumeration of children.
      • getChildCount

        public int getChildCount()
        Description copied from interface: GenericTreeNode
        Returns the number of children for this node.
        Specified by:
        getChildCount in interface GenericTreeNode<T>
        Returns:
        The number of children for this node.
      • isNodeChild

        protected boolean isNodeChild​(GenericTreeNode<T> treeNode)
        Returns whether the specified GenericTreeNode is a child of this node.
        Parameters:
        treeNode - The GenericTreeNode to examine.
        Returns:
        True, if the specified node is a child of this node.
      • isNodeAncestor

        protected boolean isNodeAncestor​(GenericTreeNode<T> treeNode)
        Returns whether the supplied node is an ancestor of this node.
        Parameters:
        treeNode - The node to examine.
        Returns:
        True, if the node is an ancestor of this node; otherwise, false.
      • ensureChildren

        protected void ensureChildren()
        Ensure that we have space to hold children.