com.businessobjects.rebean.wi
Interface TreeNode

All Known Subinterfaces:
AdvancedCondition, Cell, ConditionContainer, ConditionObject, DataSourceObject, DPExpression, FilterConditionContainer, FilterConditionNode, FilterConditionObject, FilterContainer, FilterObject, FormulaExpression, FreeCell, Link, PageHeaderFooter, Query, QueryContainer, QueryNode, RankCondition, ReportBlock, ReportBody, ReportCell, ReportContainer, ReportElement, ReportElementContainer, ReportExpression, ReportMapNode, ReportStructure, SectionContainer, SQLContainer, SQLNode, SQLSelectStatement, VariableExpression

public interface TreeNode

A node in a tree. A node may have a parent and one or more children.

See Also:
QueryNode, SQLNode

Method Summary
 TreeNode getChildAt(int index)
          Returns the child node at the specified position in the tree.
 int getChildCount()
          Returns the number of children of this TreeNode.
 int getIndex(TreeNode node)
          Return the index of the child node passed as a parameter.
 TreeNode getParent()
          Return the parent node.
 boolean isLeaf()
          Returns true if this node is a "leaf".
 

Method Detail

isLeaf

boolean isLeaf()
Returns true if this node is a "leaf". A leaf is a final node, that is to say, a node that has no child nodes.

Returns:
true when this node is a leaf

getChildAt

TreeNode getChildAt(int index)
Returns the child node at the specified position in the tree.

Parameters:
index - the index of the child to return (0 based)
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index is out of range (index < 0 || index >= getChildCount())

getChildCount

int getChildCount()
Returns the number of children of this TreeNode.

Returns:
the amount of children

getParent

TreeNode getParent()
Return the parent node.

For any valid index, it is guaranteed that for a TreeNode t, t.getChildAt(index).getParent() == t.

Returns:
the parent TreeNode, or null when there is no parent

getIndex

int getIndex(TreeNode node)
Return the index of the child node passed as a parameter.

Parameters:
node - the child node to look for
Returns:
the index found, or -1 when node is not a child of this node