public class Path
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
add(Link link,
Node node)
Append the node and the link to the path.
|
void |
add(Node node)
Append the node to the path.
|
boolean |
contains(Link link)
Checks whether the specified link is a participant in the path.
|
boolean |
contains(Node node)
Checks whether the specified node is a participant in the path.
|
java.util.ArrayList<java.lang.Object> |
getItems()
Gets a list with all items (nodes and links) composing the path.
|
int |
getLength()
Gets the length of the path.
|
LinkList |
getLinks()
Gets a list of all links composing the path.
|
NodeList |
getNodes()
Gets the list of all nodes connected by the path.
|
float |
getWeight(boolean incNodes,
boolean incLinks)
Gets the length of the path expressed
as a sum of the weights of all nodes and
links, composing the path.
|
boolean |
sameCycle(Path path)
Determines whether the current path traverses the same
nodes as the specified path in the same order, disregard
which one is the starting node.
|
public Path()
public Path(Path p)
public boolean contains(Node node)
public boolean contains(Link link)
public boolean sameCycle(Path path)
public NodeList getNodes()
public LinkList getLinks()
public java.util.ArrayList<java.lang.Object> getItems()
public int getLength()
public float getWeight(boolean incNodes, boolean incLinks)
public void add(Node node)