Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.phoenixst.plexus.examples
Class Path  view Path download Path.java

java.lang.Object
  extended bycom.phoenixst.plexus.AbstractGraph
      extended bycom.phoenixst.plexus.examples.IntegerNodeGraph
          extended bycom.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 Class Summary
private  class Path.EdgeIterator
           
private  class Path.TraverserImpl
           
 
Nested classes inherited from class com.phoenixst.plexus.examples.IntegerNodeGraph
IntegerNodeGraph.EdgeImpl
 
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
 
Field Summary
 
Fields inherited from class com.phoenixst.plexus.examples.IntegerNodeGraph
n
 
Constructor Summary
Path(int n)
          Creates a new Path.
 
Method Summary
 int degree(java.lang.Object node)
          Returns the degree of node, defined as the number of edges incident on node.
 java.util.Iterator edgeIterator()
          Returns an Iterator over all the Edges in this Graph.
 int edgeSize()
          Returns the number of edges in this Graph.
 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.
 boolean isEmpty()
          Returns false.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 com.phoenixst.plexus.Traverser traverser(java.lang.Object node)
          Returns a com.phoenixst.plexus.Traverser from node to all adjacent nodes.
 
Methods inherited from class com.phoenixst.plexus.examples.IntegerNodeGraph
checkNode, clear, containsNode, getNodeIndex, isDirected, isSimple, nodeIterator, nodeSize, removeEdge, removeNode
 
Methods inherited from class com.phoenixst.plexus.AbstractGraph
addEdge, addNode, containsEdge, edgeIterator, inDegree, inTraverser, iteratorClear, iteratorContains, iteratorCount, iteratorRemove, outDegree, outTraverser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Path

public Path(int n)
Creates a new Path.

Method Detail

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()).