Class AbstractGenericTreeNode<T>

  • All Implemented Interfaces:
    ITreeNode<T>, javax.swing.tree.TreeModel

    public abstract class AbstractGenericTreeNode<T>
    extends java.lang.Object
    implements ITreeNode<T>
    • Constructor Detail

      • AbstractGenericTreeNode

        public AbstractGenericTreeNode()
        Instantiates a new tree node.
      • AbstractGenericTreeNode

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

      • addChild

        public void addChild​(ITreeNode<T> child)
        Adds the child.
        Specified by:
        addChild in interface ITreeNode<T>
        Parameters:
        child - the child
      • addChildAt

        public void addChildAt​(int index,
                               ITreeNode<T> child)
                        throws java.lang.IndexOutOfBoundsException
        Adds the child.
        Specified by:
        addChildAt in interface ITreeNode<T>
        Parameters:
        index - the index
        child - the child
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • equals

        public boolean equals​(ITreeNode<T> treeNode)
        Equals.
        Specified by:
        equals in interface ITreeNode<T>
        Parameters:
        treeNode - the tree node
        Returns:
        true, if successful
      • getChildCount

        public int getChildCount()
        Gets the child count.
        Specified by:
        getChildCount in interface ITreeNode<T>
        Returns:
        the child count
      • getChildren

        public java.util.List<ITreeNode<T>> getChildren()
        Gets the children.
        Specified by:
        getChildren in interface ITreeNode<T>
        Returns:
        the children
      • getValue

        public T getValue()
        Gets the value.
        Specified by:
        getValue in interface ITreeNode<T>
        Returns:
        the value
      • hashCode

        public int hashCode()
        (non-Javadoc).
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the int
        See Also:
        Object.hashCode()
      • removeChild

        public void removeChild​(ITreeNode<T> child)
        Removes the child.
        Specified by:
        removeChild in interface ITreeNode<T>
        Parameters:
        child - the child
      • removeChildAt

        public void removeChildAt​(int index)
                           throws java.lang.IndexOutOfBoundsException
        Removes the child.
        Specified by:
        removeChildAt in interface ITreeNode<T>
        Parameters:
        index - the index
        Throws:
        java.lang.IndexOutOfBoundsException - the index out of bounds exception
      • setChildren

        public void setChildren​(java.util.List<ITreeNode<T>> children)
        Sets the children.
        Specified by:
        setChildren in interface ITreeNode<T>
        Parameters:
        children - the new children
      • setValue

        public void setValue​(T value)
        Sets the value.
        Specified by:
        setValue in interface ITreeNode<T>
        Parameters:
        value - the new value
      • toList

        public java.util.List<ITreeNode<T>> toList()
        To list.
        Specified by:
        toList in interface ITreeNode<T>
        Returns:
        the list
      • traverse

        public void traverse​(ITreeNode<T> node,
                             java.util.List<ITreeNode<T>> list)
        Traverse.
        Specified by:
        traverse in interface ITreeNode<T>
        Parameters:
        node - the node
        list - the list