Package com.microstrategy.utils
Class FlattenedTreeNodeImpl
- java.lang.Object
-
- com.microstrategy.utils.FlattenedTreeNodeImpl
-
- All Implemented Interfaces:
FlattenedTreeNode,GenericTreeNode
public class FlattenedTreeNodeImpl extends java.lang.Object implements FlattenedTreeNode
This is the implementation class for theFlattenedTreeNodeinterface. In general, this class delegates to a heldGenericTreeNodewith the exception of the "parent" link. When a root node is being traversed, it may not be the root node in its containing graph. Instead of requiring the node to be a root in the larger tree, we simply manage the parent link in this object.- Since:
- MicroStrategy Web 9.0.0
-
-
Constructor Summary
Constructors Constructor Description FlattenedTreeNodeImpl(GenericTreeNode treeNode, java.lang.String location, GenericTreeNode parent)Creates a new FlattenedTreeNodeImpl object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetChildCount()Returns the number of children for this node.java.util.EnumerationgetChildren()Returns the enumeration of children for this node.java.lang.StringgetLocation()Returns the location of this node in the larger tree using a modified Dewey Decimal notation.java.lang.StringgetName()Returns the name associated with this node, if any.GenericTreeNodegetParent()Returns the parent of this node.java.lang.ObjectgetValue()Returns the value associated with this node, if any.
-
-
-
Constructor Detail
-
FlattenedTreeNodeImpl
public FlattenedTreeNodeImpl(GenericTreeNode treeNode, java.lang.String location, GenericTreeNode parent)
Creates a new FlattenedTreeNodeImpl object.- Parameters:
treeNode- The node in the supplied tree that this object represents.location- The location string for this tree node.parent- The parent of this flattened tree node.
-
-
Method Detail
-
getLocation
public java.lang.String getLocation()
Description copied from interface:FlattenedTreeNodeReturns the location of this node in the larger tree using a modified Dewey Decimal notation. The location of the root node in the first tree is "0". The location of the second root node (assuming it is a forest of tree node that we are flattening) is "1". The first child of the first root node is "0/0".- Specified by:
getLocationin interfaceFlattenedTreeNode- Returns:
- The location of this node in the tree it is contained in.
-
getParent
public GenericTreeNode getParent()
Description copied from interface:GenericTreeNodeReturns the parent of this node.- Specified by:
getParentin interfaceGenericTreeNode- Returns:
- The
GenericTreeNodewhich is the parent of this node, if any.
-
getName
public java.lang.String getName()
Description copied from interface:GenericTreeNodeReturns the name associated with this node, if any.- Specified by:
getNamein interfaceGenericTreeNode- Returns:
- The name associated with this node, if any.
-
getValue
public java.lang.Object getValue()
Description copied from interface:GenericTreeNodeReturns the value associated with this node, if any.- Specified by:
getValuein interfaceGenericTreeNode- Returns:
- The value associated with this node, if any.
-
getChildren
public java.util.Enumeration getChildren()
Description copied from interface:GenericTreeNodeReturns the enumeration of children for this node. It will always return a non-null Enumeration, though it may be empty.- Specified by:
getChildrenin interfaceGenericTreeNode- Returns:
- The
Enumerationof children.
-
getChildCount
public int getChildCount()
Description copied from interface:GenericTreeNodeReturns the number of children for this node.- Specified by:
getChildCountin interfaceGenericTreeNode- Returns:
- The number of children for this node.
-
-