| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectphylonet.graph.model.PathImpl
public class PathImpl
This class provides a basic implementation of the Path interface.  It is designed to be easily used and
 to be easily extended for more specific path implementations.
| Constructor Summary | |
|---|---|
PathImpl(Edge[] edges)
Build the path from an array of edges.  | 
|
| Method Summary | |
|---|---|
 boolean | 
contains(Node n)
 | 
 java.lang.Iterable<Edge> | 
getEdgePath()
 | 
 void | 
getEdges(Edge[] edge_array)
Retrieve the actual edges in the path, in order from source to end.  | 
 Node | 
getEnd()
 | 
 int | 
getLength()
 | 
 java.lang.Iterable<Node> | 
getNodePath()
 | 
 void | 
getNodes(Node[] node_array)
Retrieve the actual nodes in the path, in order from source to end.  | 
 Node | 
getSource()
 | 
 double | 
getWeight()
 | 
| Methods inherited from class java.lang.Object | 
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public PathImpl(Edge[] edges)
| Method Detail | 
|---|
public Node getSource()
getSource in interface Pathpublic Node getEnd()
getEnd in interface Pathpublic int getLength()
getLength in interface Pathn, then the number of edges is n-1.public double getWeight()
getWeight in interface PathEdge.NO_WEIGHT.public void getNodes(Node[] node_array)
getNodes in interface Pathnode_array - must be an array with length greater than or equal to the length of this path.public void getEdges(Edge[] edge_array)
getEdges in interface Pathedge_array - must be an array with length greater than or equal to the this path's length - 1.public java.lang.Iterable<Edge> getEdgePath()
getEdgePath in interface Pathsource to endpublic java.lang.Iterable<Node> getNodePath()
getNodePath in interface Pathsource to endpublic boolean contains(Node n)
contains in interface Pathtrue only if this path contains the node n.
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||