|
Plexus v0.13.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.phoenixst.plexus.AbstractGraph
com.phoenixst.plexus.examples.AbstractIntegerNodeGraph
com.phoenixst.plexus.examples.CompleteTree
public class CompleteTree
A Graph
which is a complete tree.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.phoenixst.plexus.examples.AbstractIntegerNodeGraph |
---|
AbstractIntegerNodeGraph.AbstractIntegerEdgeCollection, AbstractIntegerNodeGraph.EdgeImpl |
Nested classes/interfaces inherited from interface com.phoenixst.plexus.Graph |
---|
Graph.Edge |
Constructor Summary | |
---|---|
CompleteTree(int height,
int numChildren)
Creates a new CompleteTree . |
Method Summary | |
---|---|
protected Graph.Edge |
createEdge(int tailIndex,
int headIndex)
If an edge exists between the specified indices, create and return it. |
protected Collection |
createEdgeCollection()
Creates the (single) collection of edges for this instance. |
protected Traverser |
createTraverser(int nodeIndex)
Creates a traverser with no filtering; assumes that the node index is valid. |
int |
degree(Object node)
Returns the degree of node , defined as the number
of edges incident on node . |
int |
getHeight()
Gets the height of this CompleteTree . |
int |
getNumChildren()
Gets the number of children of each internal node in this CompleteTree . |
String |
toString()
|
Methods inherited from class com.phoenixst.plexus.examples.AbstractIntegerNodeGraph |
---|
checkNode, containsEdge, containsNode, edges, getNodeIndex, getNodeSize, nodes, removeEdge, removeNode, traverser |
Methods inherited from class com.phoenixst.plexus.AbstractGraph |
---|
addEdge, addNode, adjacentNodes, degree, edges, getAdjacentNode, getEdge, getIncidentEdge, getNode, incidentEdges, nodes, traverser |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CompleteTree(int height, int numChildren)
CompleteTree
. A tree of height 0
is just a single root node (numChildren is ignored in this
case).
Method Detail |
---|
public final int getHeight()
CompleteTree
.
public final int getNumChildren()
CompleteTree
.
public int degree(Object node)
node
, defined as the number
of edges incident on node
.
degree
in interface Graph
degree
in class AbstractGraph
node
- return the degree of this node.
node
.protected Graph.Edge createEdge(int tailIndex, int headIndex)
AbstractIntegerNodeGraph
null
. The indices are
assumed to represent valid nodes for this Graph
.
createEdge
in class AbstractIntegerNodeGraph
protected Collection createEdgeCollection()
AbstractIntegerNodeGraph
createEdgeCollection
in class AbstractIntegerNodeGraph
protected Traverser createTraverser(int nodeIndex)
AbstractIntegerNodeGraph
createTraverser
in class AbstractIntegerNodeGraph
public String toString()
toString
in class Object
|
Plexus v0.13.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |