com.marsching.flexiparse.objecttree
Interface MutableObjectTreeElement

All Superinterfaces:
ObjectTreeElement
All Known Implementing Classes:
DefaultMutableObjectTreeElement

public interface MutableObjectTreeElement
extends ObjectTreeElement

ObjectTreeElement that can be modified. Child nodes may be added to or deleted from this node.

Author:
Sebastian Marsching

Method Summary
 void addChild(MutableObjectTreeElement child)
          Registers another node as a child node of this node.
 Collection<? extends MutableObjectTreeElement> getChildren()
          Returns all children of this node.
 MutableObjectTreeElement getParent()
          Returns the parent of this node.
 ObjectTreeElement getRoot()
          Returns the root node of the tree this node belongs to.
 boolean removeChild(MutableObjectTreeElement child)
          Removes the specified child from this node.
 
Methods inherited from interface com.marsching.flexiparse.objecttree.ObjectTreeElement
addObject, getObjects, getObjectsOfType, getObjectsOfTypeFromSubTree, getObjectsOfTypeFromTopTree, removeObject
 

Method Detail

addChild

void addChild(MutableObjectTreeElement child)
Registers another node as a child node of this node. For each child node, this method should only be called once. This node should be registered as the parent node of the node being supplied by the calling code.

Parameters:
child - node to be attached as a child.

removeChild

boolean removeChild(MutableObjectTreeElement child)
Removes the specified child from this node.

Parameters:
child - node to remove
Returns:
true if child was attached to this node, false otherwise

getParent

MutableObjectTreeElement getParent()
Returns the parent of this node.

Specified by:
getParent in interface ObjectTreeElement
Returns:
parent of this node or null if this is the root node

getRoot

ObjectTreeElement getRoot()
Returns the root node of the tree this node belongs to.

Specified by:
getRoot in interface ObjectTreeElement
Returns:
root node of the tree

getChildren

Collection<? extends MutableObjectTreeElement> getChildren()
Returns all children of this node.

Specified by:
getChildren in interface ObjectTreeElement
Returns:
a list containing all child nodes of this node


Copyright © 2008-2009. All Rights Reserved.