VALUE - is the generic type of the value contained in each node.public class TreeNodeSimple<VALUE> extends AbstractTreeNode<TreeNodeSimple<VALUE>> implements AttributeWriteValue<VALUE>
TreeNode. It can carry any kind
of value that can be set externally.| Constructor and Description |
|---|
TreeNodeSimple()
The constructor.
|
TreeNodeSimple(TreeNodeSimple<VALUE> parent)
The constructor.
|
TreeNodeSimple(TreeNodeSimple<VALUE> parent,
ListFactory listFactory)
The constructor.
|
TreeNodeSimple(TreeNodeSimple<VALUE> parent,
VALUE value)
The constructor.
|
TreeNodeSimple(VALUE value)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(TreeNodeSimple<VALUE> child)
|
void |
addChild(TreeNodeSimple<VALUE> child,
int index)
|
void |
addChildValue(VALUE childValue)
|
void |
addChildValue(VALUE childValue,
int index)
Creates a new
TreeNodeSimple with the given childValue and inserts it as child of this node at the given index. |
VALUE |
getValue()
This method gets the value of this object.
|
TreeNodeSimple<VALUE> |
removeChild(int index)
|
boolean |
removeChild(TreeNodeSimple<VALUE> child)
|
void |
setValue(VALUE value)
This method sets the
value. |
String |
toString() |
getChildren, getMutableChildList, getParent, isAncestor, isDescendant, setParentclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildren, getParent, isAncestor, isDescendantprivate VALUE value
public TreeNodeSimple()
public TreeNodeSimple(VALUE value)
value - is the value.public TreeNodeSimple(TreeNodeSimple<VALUE> parent, ListFactory listFactory)
public TreeNodeSimple(TreeNodeSimple<VALUE> parent)
parent - is the parent node.public TreeNodeSimple(TreeNodeSimple<VALUE> parent, VALUE value)
public VALUE getValue()
AttributeReadValuegetValue in interface AttributeReadValue<VALUE>null unless otherwise stated.public void setValue(VALUE value)
AttributeWriteValuevalue.setValue in interface AttributeWriteValue<VALUE>value - is the new value. May be null unless otherwise stated.public void addChild(TreeNodeSimple<VALUE> child)
AbstractGenericTreeNodeaddChild in class AbstractGenericTreeNode<TreeNodeSimple<VALUE>,TreeNodeSimple<VALUE>>child - is the child to add. It's parent has to be identical to
this GenericTreeNode.public void addChild(TreeNodeSimple<VALUE> child, int index)
AbstractGenericTreeNodeaddChild in class AbstractGenericTreeNode<TreeNodeSimple<VALUE>,TreeNodeSimple<VALUE>>child - is the child to add. It's parent has to be identical to
this GenericTreeNode.index - is the index where to insert the new child.public void addChildValue(VALUE childValue)
childValue - is the value of the new child node.public void addChildValue(VALUE childValue, int index)
TreeNodeSimple with the given childValue and inserts it as child of this node at the given index.public TreeNodeSimple<VALUE> removeChild(int index)
AbstractGenericTreeNoderemoveChild in class AbstractGenericTreeNode<TreeNodeSimple<VALUE>,TreeNodeSimple<VALUE>>index - is index of the child to remove.child that has actually been removed.public boolean removeChild(TreeNodeSimple<VALUE> child)
AbstractGenericTreeNoderemoveChild in class AbstractGenericTreeNode<TreeNodeSimple<VALUE>,TreeNodeSimple<VALUE>>child - is the child to remove.true if the given child was contained in this GenericTreeNodes
children and has been removed successfully, false otherwise.Copyright © 2001–2016 mmm-Team. All rights reserved.