com.phoenixst.plexus.examples
Class Path
java.lang.Object
com.phoenixst.plexus.AbstractGraph
com.phoenixst.plexus.examples.AbstractIntegerNodeGraph
com.phoenixst.plexus.examples.Path
- All Implemented Interfaces:
- Graph, Serializable
public class Path
- extends AbstractIntegerNodeGraph
A Graph
containing a set of Integer
nodes connected by a path of edges from the first node to the last
one.
- Since:
- 1.0
- Version:
- $Revision: 1.29 $
- Author:
- Ray A. Conner
- See Also:
- Serialized Form
Nested classes/interfaces inherited from interface com.phoenixst.plexus.Graph |
Graph.Edge |
Constructor Summary |
Path(int n)
Creates a new Path . |
Methods inherited from class com.phoenixst.plexus.AbstractGraph |
addEdge, addNode, adjacentNodes, degree, edges, getAdjacentNode, getEdge, getIncidentEdge, getNode, incidentEdges, nodes, traverser |
Path
public Path(int n)
- Creates a new
Path
.
degree
public int degree(Object node)
- Returns the degree of
node
, defined as the number
of edges incident on node
.
- Specified by:
degree
in interface Graph
- Overrides:
degree
in class AbstractGraph
- Parameters:
node
- return the degree of this node.
- Returns:
- the degree of
node
.
createEdge
protected Graph.Edge createEdge(int tailIndex,
int headIndex)
- Description copied from class:
AbstractIntegerNodeGraph
- If an edge exists between the specified indices, create and
return it. If not, return
null
. The indices are
assumed to represent valid nodes for this Graph
.
- Specified by:
createEdge
in class AbstractIntegerNodeGraph
createEdgeCollection
protected Collection createEdgeCollection()
- Description copied from class:
AbstractIntegerNodeGraph
- Creates the (single) collection of edges for this instance.
- Specified by:
createEdgeCollection
in class AbstractIntegerNodeGraph
createTraverser
protected Traverser createTraverser(int nodeIndex)
- Description copied from class:
AbstractIntegerNodeGraph
- Creates a traverser with no filtering; assumes that the node
index is valid.
- Specified by:
createTraverser
in class AbstractIntegerNodeGraph
toString
public String toString()
- Overrides:
toString
in class Object
See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.