public class

PreorderEnumeration

extends FlattenedEnumerationBase
implements Enumeration<E>
java.lang.Object
   ↳ com.microstrategy.utils.FlattenedEnumerationBase
     ↳ com.microstrategy.utils.PreorderEnumeration

Class Overview

This class performs a preorder traversal of the tree specified by the supplied GenericTreeNode. The result is an java.util.Enumeration of FlattenedTreeNode objects. A FlattenedTreeNode is a proxy for the underlying GenericTreeNode, with one exception. If the node specified for traversal is not the root node in the larger tree, it is will appear as the root in the flattened tree node hierarchy; that is, the getParent() method will return null for the root node supplied to the traversal. Finally, a preorder enumeration can be performed on a single root node or a "forest" of root nodes.

Summary

[Expand]
Inherited Constants
From class com.microstrategy.utils.FlattenedEnumerationBase
[Expand]
Inherited Fields
From class com.microstrategy.utils.FlattenedEnumerationBase
Public Constructors
PreorderEnumeration(GenericTreeNode treeNode)
Creates a new PreorderEnumeration object.
PreorderEnumeration(Vector forest)
Creates a new PreorderEnumeration object.
Public Methods
boolean hasMoreElements()
Whether the enumeration has any more elements.
Object nextElement()
The next element in this enumeration.
[Expand]
Inherited Methods
From class com.microstrategy.utils.FlattenedEnumerationBase
From class java.lang.Object
From interface java.util.Enumeration

Public Constructors

public PreorderEnumeration (GenericTreeNode treeNode)

Creates a new PreorderEnumeration object.

Parameters
treeNode The sole, root GenericTreeNode instance that is being traversed. It and all of its children are traversed.

public PreorderEnumeration (Vector forest)

Creates a new PreorderEnumeration object.

Parameters
forest A list of GenericTreeNode instances which form the "forest" of trees.

Public Methods

public boolean hasMoreElements ()

Whether the enumeration has any more elements.

Returns
  • True, if there are more elements to return; otherwise, false.

public Object nextElement ()

The next element in this enumeration. For this traversal, the parent node is returned before any of its children.

Returns