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 theFlattenedTreeNode
interface. In general, this class delegates to a heldGenericTreeNode
with 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 int
getChildCount()
Returns the number of children for this node.java.util.Enumeration
getChildren()
Returns the enumeration of children for this node.java.lang.String
getLocation()
Returns the location of this node in the larger tree using a modified Dewey Decimal notation.java.lang.String
getName()
Returns the name associated with this node, if any.GenericTreeNode
getParent()
Returns the parent of this node.java.lang.Object
getValue()
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:FlattenedTreeNode
Returns 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:
getLocation
in interfaceFlattenedTreeNode
- Returns:
- The location of this node in the tree it is contained in.
-
getParent
public GenericTreeNode getParent()
Description copied from interface:GenericTreeNode
Returns the parent of this node.- Specified by:
getParent
in interfaceGenericTreeNode
- Returns:
- The
GenericTreeNode
which is the parent of this node, if any.
-
getName
public java.lang.String getName()
Description copied from interface:GenericTreeNode
Returns the name associated with this node, if any.- Specified by:
getName
in interfaceGenericTreeNode
- Returns:
- The name associated with this node, if any.
-
getValue
public java.lang.Object getValue()
Description copied from interface:GenericTreeNode
Returns the value associated with this node, if any.- Specified by:
getValue
in interfaceGenericTreeNode
- Returns:
- The value associated with this node, if any.
-
getChildren
public java.util.Enumeration getChildren()
Description copied from interface:GenericTreeNode
Returns the enumeration of children for this node. It will always return a non-null Enumeration, though it may be empty.- Specified by:
getChildren
in interfaceGenericTreeNode
- Returns:
- The
Enumeration
of children.
-
getChildCount
public int getChildCount()
Description copied from interface:GenericTreeNode
Returns the number of children for this node.- Specified by:
getChildCount
in interfaceGenericTreeNode
- Returns:
- The number of children for this node.
-
-