Package org.eclipse.jface.viewers
Class TreeNode
java.lang.Object
org.eclipse.jface.viewers.TreeNode
A simple data structure that is useful for implemented tree models. This can
 be returned by
 
IStructuredContentProvider.getElements(Object).
 It allows simple delegation of methods from
 ITreeContentProvider such as
 ITreeContentProvider.getChildren(Object),
 ITreeContentProvider.getParent(Object) and
 ITreeContentProvider.hasChildren(Object)- Since:
- 3.2
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanTreeNode[]Returns the child nodes.Returns the parent node.getValue()Returns the value held by this node.booleanReturns whether the tree has any children.inthashCode()voidsetChildren(TreeNode[] children) Sets the children for this node.voidSets the parent for this node.
- 
Field Details- 
valueThe value contained in this node. This value may be anything.
 
- 
- 
Constructor Details- 
TreeNodeConstructs a new instance ofTreeNode.- Parameters:
- value- The value held by this node; may be anything.
 
 
- 
- 
Method Details- 
equals
- 
getChildrenReturns the child nodes. Empty arrays are converted tonullbefore being returned.- Returns:
- The child nodes; may be null, but never empty. There should be nonullchildren in the array.
 
- 
getParentReturns the parent node.- Returns:
- The parent node; may be nullif there are no parent nodes.
 
- 
getValueReturns the value held by this node.- Returns:
- The value; may be anything.
 
- 
hasChildrenpublic boolean hasChildren()Returns whether the tree has any children.- Returns:
- trueif its array of children is not- nulland is non-empty;- falseotherwise.
 
- 
hashCodepublic int hashCode()
- 
setChildrenSets the children for this node.- Parameters:
- children- The child nodes; may be- nullor empty. There should be no- nullchildren in the array.
 
- 
setParentSets the parent for this node.- Parameters:
- parent- The parent node; may be- null.
 
 
-