org.apache.commons.graph.algorithm.path
Class AllPairsShortestPath.WPath

java.lang.Object
  extended byorg.apache.commons.graph.algorithm.path.AllPairsShortestPath.WPath
All Implemented Interfaces:
Path, WeightedPath
Enclosing class:
AllPairsShortestPath

public class AllPairsShortestPath.WPath
extends java.lang.Object
implements WeightedPath

Description of the Class


Field Summary
private  double cost
           
private  Vertex finish
           
private  DirectedGraph graph
           
private  Vertex start
           
private  java.util.List vertexList
           
 
Constructor Summary
AllPairsShortestPath.WPath(DirectedGraph graph, Vertex[] vArray, int[][] pred, int start, int finish, double cost)
          Constructor for the WPath object
 
Method Summary
 java.util.List getEdges()
          Gets the edges attribute of the WPath object
 Vertex getEnd()
          Gets the end attribute of the WPath object
 Vertex getStart()
          Gets the start attribute of the WPath object
 java.util.List getVertices()
          Gets the vertices attribute of the WPath object
 double getWeight()
          Gets the weight attribute of the WPath object
private  java.util.List segment(Vertex[] vArray, int[][] pred, int start, int finish)
          Returns a List of Vectors in order.
 int size()
          size() - This returns the size of the path in terms of number of verticies it visits.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

start

private Vertex start

finish

private Vertex finish

vertexList

private java.util.List vertexList

graph

private DirectedGraph graph

cost

private double cost
Constructor Detail

AllPairsShortestPath.WPath

public AllPairsShortestPath.WPath(DirectedGraph graph,
                                  Vertex[] vArray,
                                  int[][] pred,
                                  int start,
                                  int finish,
                                  double cost)
                           throws GraphException
Constructor for the WPath object

Parameters:
graph -
vArray -
pred -
start -
finish -
cost -
Throws:
GraphException
Method Detail

segment

private java.util.List segment(Vertex[] vArray,
                               int[][] pred,
                               int start,
                               int finish)
                        throws GraphException
Returns a List of Vectors in order. Includes the start, but not the finish.

Throws:
GraphException

getWeight

public double getWeight()
Gets the weight attribute of the WPath object

Specified by:
getWeight in interface WeightedPath

getVertices

public java.util.List getVertices()
Gets the vertices attribute of the WPath object

Specified by:
getVertices in interface Path

getEdges

public java.util.List getEdges()
Gets the edges attribute of the WPath object

Specified by:
getEdges in interface Path

getStart

public Vertex getStart()
Gets the start attribute of the WPath object

Specified by:
getStart in interface Path

getEnd

public Vertex getEnd()
Gets the end attribute of the WPath object

Specified by:
getEnd in interface Path

size

public int size()
Description copied from interface: Path
size() - This returns the size of the path in terms of number of verticies it visits.

Specified by:
size in interface Path