Package com.microstrategy.utils
Class FlattenedEnumerationBase
- java.lang.Object
-
- com.microstrategy.utils.FlattenedEnumerationBase
-
- Direct Known Subclasses:
PreorderEnumeration
public class FlattenedEnumerationBase extends java.lang.Object
This is the base class for a set of classes that produce an enumeration (or "flattening") of a Tree.- Since:
- MicroStrategy Web 9.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
LOCATION_BASE_INDEX
This is the starting (or base) index of a node in a tree.static java.lang.String
LOCATION_SEPARATOR
This is the separator between indices of children in the larger "location string".protected java.util.Stack
locationStack
protected java.util.Stack
nodeStack
-
Constructor Summary
Constructors Constructor Description FlattenedEnumerationBase(GenericTreeNode treeNode)
Creates a new FlattenedEnumerationBase object.FlattenedEnumerationBase(java.util.Vector forest)
Creates a new FlattenedEnumerationBase object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Enumeration
getLocationEnum(java.lang.String startLocation, int numLocs)
Gets an enumeration of location strings (starting a specific location).protected boolean
isRootNode(GenericTreeNode node)
Returns whether the specified node is a "root node" for this specific traversal.
-
-
-
Field Detail
-
LOCATION_BASE_INDEX
public static final int LOCATION_BASE_INDEX
This is the starting (or base) index of a node in a tree. This number is used in "location strings" returned byFlattenedTreeNode.getLocation()
.- See Also:
- Constant Field Values
-
LOCATION_SEPARATOR
public static final java.lang.String LOCATION_SEPARATOR
This is the separator between indices of children in the larger "location string".- See Also:
- Constant Field Values
-
nodeStack
protected java.util.Stack nodeStack
-
locationStack
protected java.util.Stack locationStack
-
-
Constructor Detail
-
FlattenedEnumerationBase
public FlattenedEnumerationBase(GenericTreeNode treeNode)
Creates a new FlattenedEnumerationBase object.- Parameters:
treeNode
- A single tree to traverse.
-
FlattenedEnumerationBase
public FlattenedEnumerationBase(java.util.Vector forest)
Creates a new FlattenedEnumerationBase object.- Parameters:
forest
- AVector
of root nodes to traverse.
-
-
Method Detail
-
getLocationEnum
protected java.util.Enumeration getLocationEnum(java.lang.String startLocation, int numLocs)
Gets an enumeration of location strings (starting a specific location).- Parameters:
startLocation
- The starting location of a parent node.numLocs
- The number of location strings to create.- Returns:
- An
Enumeration
of Strings.
-
isRootNode
protected boolean isRootNode(GenericTreeNode node)
Returns whether the specified node is a "root node" for this specific traversal.- Parameters:
node
- TheGenericTreeNode
to consider.- Returns:
- True if the specified node is a "root node" for this specific traversal; otherwise, false.
-
-