public class

GenericTreeNodeImpl

extends Object
implements GenericTreeNode<T>
java.lang.Object
   ↳ com.microstrategy.utils.GenericTreeNodeImpl<T>
Known Direct Subclasses

Class Overview

This class represents a generic node in an ordered tree data structure. It is not a changeable ("mutable") tree node, however. To modify a tree node, you need a MutableTreeNodeImpl class (which implements the MutableTreeNode interface). This class and its subclasses are not synchronized.

Summary

Fields
public static final Enumeration<Object> EMPTY_ENUMERATION An enumeration that is always empty.
protected List<GenericTreeNode<T>> children
protected String name
protected GenericTreeNode<T> parent
protected T value
Public Methods
int getChildCount()
Returns the number of children for this node.
Enumeration<GenericTreeNode<T>> getChildren()
Returns the enumeration of children for this node.
String getName()
Returns the name associated with this node, if any.
GenericTreeNode<T> getParent()
Returns the parent of this node.
T getValue()
Returns the value associated with this node, if any.
Protected Methods
void ensureChildren()
Ensure that we have space to hold children.
boolean isNodeAncestor(GenericTreeNode<T> treeNode)
Returns whether the supplied node is an ancestor of this node.
boolean isNodeChild(GenericTreeNode<T> treeNode)
Returns whether the specified GenericTreeNode is a child of this node.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.microstrategy.utils.GenericTreeNode

Fields

public static final Enumeration<Object> EMPTY_ENUMERATION

An enumeration that is always empty. This is used when an enumeration of a leaf node's children is requested.

protected List<GenericTreeNode<T>> children

protected String name

protected GenericTreeNode<T> parent

protected T value

Public Methods

public int getChildCount ()

Returns the number of children for this node.

Returns
  • The number of children for this node.

public Enumeration<GenericTreeNode<T>> getChildren ()

Returns the enumeration of children for this node. It will always return a non-null Enumeration, though it may be empty.

Returns
  • The Enumeration of children.

public String getName ()

Returns the name associated with this node, if any.

Returns
  • The name associated with this node, if any.

public GenericTreeNode<T> getParent ()

Returns the parent of this node.

Returns

public T getValue ()

Returns the value associated with this node, if any.

Returns
  • The value associated with this node, if any.

Protected Methods

protected void ensureChildren ()

Ensure that we have space to hold children.

protected boolean isNodeAncestor (GenericTreeNode<T> treeNode)

Returns whether the supplied node is an ancestor of this node.

Parameters
treeNode The node to examine.
Returns
  • True, if the node is an ancestor of this node; otherwise, false.

protected boolean isNodeChild (GenericTreeNode<T> treeNode)

Returns whether the specified GenericTreeNode is a child of this node.

Parameters
treeNode The GenericTreeNode to examine.
Returns
  • True, if the specified node is a child of this node.