Class CmsTreeNode<T>

java.lang.Object
org.opencms.util.CmsTreeNode<T>
Type Parameters:
T - the type of data associated with the tree node

public class CmsTreeNode<T> extends Object
Generic tree node which can contain an object of generic type T as data, and which has a mutable list of child nodes.
  • Constructor Details

  • Method Details

    • addChild

      public void addChild(CmsTreeNode<T> cmsTreeNode)
      Adds a child node.

      Parameters:
      cmsTreeNode - the child node to add
    • addDataInPreOrder

      public void addDataInPreOrder(List<T> result)
      Adds the enclosed data of this node and its children to the given list, in preorder.
      Parameters:
      result - the list to add the data to
    • getChildren

      Gets the (mutable) list of child nodes.

      Returns:
      the list of child nodes
    • getData

      public T getData()
      Gets the data associated with this node.

      Returns:
      the data for this node
    • setData

      public void setData(T data)
      Sets the data for this node.

      Parameters:
      data - the data to set