java.lang.Object
com.phoenixst.plexus.AbstractGraph
com.phoenixst.plexus.examples.IntegerNodeGraph
com.phoenixst.plexus.examples.Path
- All Implemented Interfaces:
- com.phoenixst.plexus.Graph, java.io.Serializable
- public class Path
- extends IntegerNodeGraph
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.7 $
| Nested classes inherited from class com.phoenixst.plexus.AbstractGraph |
com.phoenixst.plexus.AbstractGraph.ChainTraverser |
| Nested classes inherited from class com.phoenixst.plexus.Graph |
com.phoenixst.plexus.Graph.Edge |
|
Constructor Summary |
Path(int n)
Creates a new Path. |
| Methods inherited from class com.phoenixst.plexus.AbstractGraph |
addEdge, addNode, containsEdge, edgeIterator, inDegree, inTraverser, iteratorClear, iteratorContains, iteratorCount, iteratorRemove, outDegree, outTraverser |
Path
public Path(int n)
- Creates a new
Path.
isEmpty
public boolean isEmpty()
- Returns
false.
edgeSize
public int edgeSize()
- Returns the number of edges in this
Graph.
degree
public int degree(java.lang.Object node)
- Returns the degree of
node, defined as the number
of edges incident on node.
getEdge
public com.phoenixst.plexus.Graph.Edge getEdge(java.lang.Object tail,
java.lang.Object head)
- Returns the
Edge from tail to
head, or null if it does not exist.
edgeIterator
public java.util.Iterator edgeIterator()
- Description copied from interface:
com.phoenixst.plexus.Graph
- Returns an
Iterator over all the
Edges in this Graph. There are no
guarantees concerning the order in which the edges are
returned (unless this Graph is an instance of
some class that provides a guarantee).
traverser
public com.phoenixst.plexus.Traverser traverser(java.lang.Object node)
- Returns a com.phoenixst.plexus.Traverser from
node to all
adjacent nodes.
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).