com.phoenixst.plexus.examples

Class CompleteTree

public class CompleteTree extends AbstractIntegerNodeGraph

A Graph which is a complete tree.

Since: 1.0

Version: $Revision: 1.32 $

Author: Ray A. Conner

Constructor Summary
CompleteTree(int height, int numChildren)
Creates a new CompleteTree.
Method Summary
protected Graph.EdgecreateEdge(int tailIndex, int headIndex)
protected CollectioncreateEdgeCollection()
protected TraversercreateTraverser(int nodeIndex)
intdegree(Object node)
Returns the degree of node, defined as the number of edges incident on node.
intgetHeight()
Gets the height of this CompleteTree.
intgetNumChildren()
Gets the number of children of each internal node in this CompleteTree.
StringtoString()

Constructor Detail

CompleteTree

public CompleteTree(int height, int numChildren)
Creates a new CompleteTree. A tree of height 0 is just a single root node (numChildren is ignored in this case).

Method Detail

createEdge

protected Graph.Edge createEdge(int tailIndex, int headIndex)

createEdgeCollection

protected Collection createEdgeCollection()

createTraverser

protected Traverser createTraverser(int nodeIndex)

degree

public int degree(Object node)
Returns the degree of node, defined as the number of edges incident on node.

getHeight

public final int getHeight()
Gets the height of this CompleteTree.

getNumChildren

public final int getNumChildren()
Gets the number of children of each internal node in this CompleteTree.

toString

public String toString()
See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.