Package com.microstrategy.utils
Interface MutableTreeNode<T>
-
- All Superinterfaces:
GenericTreeNode<T>
- All Known Implementing Classes:
MutableTreeNodeImpl
public interface MutableTreeNode<T> extends GenericTreeNode<T>
This interface extends the concept of a "generic" tree nodeGenericTreeNodeby providing a set of methods that change its contents. This includes changing the name and value, adding and removing children.- Since:
- MicroStrategy Web 9.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(MutableTreeNode<T> treeNode)Adds a node to the end of a list of children of this node.voidadd(MutableTreeNode<T> treeNode, int index)Adds a node as a child of this node at a specified position.MutableTreeNode<T>remove(int index)Removes a child at a specific index.voidremove(MutableTreeNode<T> treeNode)Removes a specific GenericTreeNode from the list of children.voidsetName(java.lang.String name)Sets the name associated with this node.voidsetValue(T value)Sets the value associated with this node.-
Methods inherited from interface com.microstrategy.utils.GenericTreeNode
getChildCount, getChildren, getName, getParent, getValue
-
-
-
-
Method Detail
-
setName
void setName(java.lang.String name)
Sets the name associated with this node.- Parameters:
name- The name to associate with this node.
-
setValue
void setValue(T value)
Sets the value associated with this node.- Parameters:
value- The value to associate with this node.
-
add
void add(MutableTreeNode<T> treeNode)
Adds a node to the end of a list of children of this node. This is merely a shortcut to using the full version of this method#add(GenericTreeNode, int)See it for more details.- Parameters:
treeNode- TheMutableTreeNodeto add.- See Also:
add(MutableTreeNode, int)
-
add
void add(MutableTreeNode<T> treeNode, int index) throws java.lang.IllegalArgumentException, java.lang.ArrayIndexOutOfBoundsException
Adds a node as a child of this node at a specified position.- Parameters:
treeNode- TheMutableTreeNodeto add.index- The position in the children list to add into.- Throws:
java.lang.IllegalArgumentException- If the 'treeNode' parameter is null or is an ancestor of this node.java.lang.ArrayIndexOutOfBoundsException- If the 'index' parameter is less than 0 or greater than the number of children currently in the list.
-
remove
void remove(MutableTreeNode<T> treeNode) throws java.lang.IllegalArgumentException
Removes a specific GenericTreeNode from the list of children.- Parameters:
treeNode- TheMutableTreeNodeto remove.- Throws:
java.lang.IllegalArgumentException- If 'treeNode' is either null or NOT a child of this node.
-
remove
MutableTreeNode<T> remove(int index) throws java.lang.ArrayIndexOutOfBoundsException
Removes a child at a specific index.- Parameters:
index- The index of the child to remove.- Returns:
- The
MutableTreeNoderemoved by this operation. - Throws:
java.lang.ArrayIndexOutOfBoundsException- If the index is less than 0 or greater than or equal to the number of children currently in the list.
-
-