public class TreeNode
extends java.lang.Object
IStructuredContentProvider.getElements(Object).
It allows simple delegation of methods from
ITreeContentProvider such as
ITreeContentProvider.getChildren(Object),
ITreeContentProvider.getParent(Object) and
ITreeContentProvider.hasChildren(Object)| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Object |
value
The value contained in this node.
|
| Constructor and Description |
|---|
TreeNode(java.lang.Object value)
Constructs a new instance of
TreeNode. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object) |
TreeNode[] |
getChildren()
Returns the child nodes.
|
TreeNode |
getParent()
Returns the parent node.
|
java.lang.Object |
getValue()
Returns the value held by this node.
|
boolean |
hasChildren()
Returns whether the tree has any children.
|
int |
hashCode() |
void |
setChildren(TreeNode[] children)
Sets the children for this node.
|
void |
setParent(TreeNode parent)
Sets the parent for this node.
|
protected java.lang.Object value
public TreeNode(java.lang.Object value)
TreeNode.value - The value held by this node; may be anything.public boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic TreeNode[] getChildren()
null
before being returned.null, but never empty.
There should be no null children in the array.public TreeNode getParent()
null if there are no
parent nodes.public java.lang.Object getValue()
public boolean hasChildren()
true if its array of children is not
null and is non-empty; false
otherwise.public int hashCode()
hashCode in class java.lang.Objectpublic void setChildren(TreeNode[] children)
children - The child nodes; may be null or empty. There
should be no null children in the array.public void setParent(TreeNode parent)
parent - The parent node; may be null.
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.