org.olat.core.util.nodes
Class GenericNode

java.lang.Object
  extended by org.olat.core.util.nodes.GenericNode
All Implemented Interfaces:
java.io.Serializable, INode
Direct Known Subclasses:
GenericCourseNode, GenericQTIElement, GenericTreeNode, MessageNode, NodeEvaluation

public abstract class GenericNode
extends java.lang.Object
implements INode, java.io.Serializable

Description:

Author:
Felix Jost
See Also:
Serialized Form

Method Summary
 void addChild(INode newChild)
          Adds a child to the current node.
 INode findRoot()
           
 INode getChildAt(int childIndex)
           
 int getChildCount()
           
 java.lang.String getIdent()
           
 INode getParent()
           
 int getPosition()
           
 void insert(INode newChild, int index)
           
 void remove(INode node)
           
 void removeAllChildren()
           
 void removeFromParent()
           
 void setIdent(java.lang.String ident)
           
 void setParent(INode newParent)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIdent

public java.lang.String getIdent()
Specified by:
getIdent in interface INode
Returns:
node identifier
See Also:
INode.getIdent()

setIdent

public void setIdent(java.lang.String ident)
Parameters:
ident -

getParent

public INode getParent()
Specified by:
getParent in interface INode
Returns:
parent of this node
See Also:
INode.getParent()

setParent

public void setParent(INode newParent)
Specified by:
setParent in interface INode
See Also:
INode.setParent(org.olat.core.util.nodes.INode)

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface INode
Returns:
number of children attached to this node
See Also:
INode.getChildCount()

getChildAt

public INode getChildAt(int childIndex)
Specified by:
getChildAt in interface INode
Returns:
node at index childIndex
See Also:
INode.getChildAt(int)

getPosition

public int getPosition()
Specified by:
getPosition in interface INode
Returns:
position of this node
See Also:
INode.getPosition()

removeFromParent

public void removeFromParent()
Specified by:
removeFromParent in interface INode
See Also:
INode.removeFromParent()

insert

public void insert(INode newChild,
                   int index)
Specified by:
insert in interface INode
See Also:
INode.insert(org.olat.core.util.nodes.INode, int)

removeAllChildren

public void removeAllChildren()
Specified by:
removeAllChildren in interface INode
See Also:
INode.removeAllChildren()

remove

public void remove(INode node)
Specified by:
remove in interface INode
See Also:
INode.remove(org.olat.core.util.nodes.INode)

addChild

public void addChild(INode newChild)
Description copied from interface: INode
Adds a child to the current node. IMPORTANT: Sets the parent of the child to this node. I.e. detach from old parent.

Specified by:
addChild in interface INode
See Also:
INode.addChild(org.olat.core.util.nodes.INode)

findRoot

public INode findRoot()
Returns:
top-level root of node tree