|
||||||||||
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 Path
public Node getEnd()
getEnd
in interface Path
public int getLength()
getLength
in interface Path
n
, then the number of edges is n-1
.public double getWeight()
getWeight
in interface Path
Edge.NO_WEIGHT
.public void getNodes(Node[] node_array)
getNodes
in interface Path
node_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 Path
edge_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 Path
source
to end
public java.lang.Iterable<Node> getNodePath()
getNodePath
in interface Path
source
to end
public boolean contains(Node n)
contains
in interface Path
true
only if this path contains the node n
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |