public interface Path
extends java.lang.Cloneable, java.io.Serializable, java.lang.Comparable
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList |
add(java.util.ArrayList pathList)
Adds a list of paths to the path.
|
java.util.ArrayList |
add(Path path)
Adds a given path to the path.
|
java.lang.Object |
clone()
Clones the path.
|
void |
computeGeometry(double tolerance)
Computes the path geometry from its link geometries.
|
boolean |
contains(Link l)
Checks if the path contains the specified link.
|
boolean |
contains(Node n)
Checks if the path contains the specified node.
|
boolean |
contains(Path path)
Checks if the path contains the specified path.
|
void |
extendPath(Link newStartLink, Link newEndLink)
Extends the path by adding a new start link and a new end link The given links must be topologically connected to the path or an exception will be thrown No extension in the specific direction (start or end) if a null link is given
|
java.util.ArrayList |
getCommonLinks(Path path)
Returns the common links between two paths Note only links with consistent path direction will be returned
|
java.util.ArrayList |
getCommonNodes(Path path)
Returns the common nodes between two paths
|
java.util.ArrayList |
getCommonSubPaths(Path path)
Returns the common sub-paths between two paths
|
double |
getCost()
Returns the path cost.
|
double |
getDuration()
Gets path duration information
|
Node |
getEndNode()
Returns the end node of the path.
|
JGeometry |
getGeometry()
Returns the path geometry (JGeometry).
|
int |
getID()
Returns the path ID.
|
Link[] |
getLinkArray()
Returns the path links as an array.
|
Link |
getLinkAt(int index) |
java.util.Iterator |
getLinks()
Returns the path links as an Iterator.
|
java.lang.String |
getName()
Returns the path name.
|
Network |
getNetwork()
Returns the network that contains the path.
|
Node[] |
getNodeArray()
Returns the path nodes as an array.
|
Node |
getNodeAt(int index)
Returns the specified node of the path.
|
java.util.Iterator |
getNodes()
Returns the path nodes as an Iterator.
|
int |
getNoOfLinks()
Returns the number of links in the path.
|
Node |
getStartNode()
Returns the start node of the path.
|
boolean |
getState()
Gets the path state.
|
Path |
getSubPath(int startNodeIndex, int endNodeIndex)
Returns the sub-path between startNodeIndex and ednNodeIndex
|
double[][] |
getTspNodeDuration()
Returns the TSP path node duration in an array of double The order of the duration is the same as the one in getTSPNodeNodeOrder() the duration is returned as an array of two doubles duration[i][0] represents the arrival duration for the i-th TSP node and This information is only used for TSP related analys
|
Node[] |
getTspNodeOrder()
Returns the TSP path node visit order in an array of Node This information is only used for TSP related analysis
|
java.lang.String |
getType()
Returns the path type.
|
java.lang.Object |
getUserData()
Gets user defined data.
|
java.lang.Object |
getUserData(java.lang.String name)
Gets user data
|
int |
indexOf(Link link)
Returns the link index of the given link in the path
|
int |
indexOf(Link link, int fromIndex)
Returns the link index of the given link in the path starting from fromIndex
|
int |
indexOf(Node node)
Returns the node index of the given node in the path
|
int |
indexOf(Node node, int fromIndex)
Returns the node index of the given node in the path starting from fromIndex
|
boolean |
isActive()
Checks if the path is active.
|
boolean |
isClosed()
Checks if the path is closed.
|
boolean |
isConnected(Path path)
Checks if the path is connected.
|
boolean |
isLinkGeometryReversed(int linkIndex, double tolerance)
Checks if the given i-th link geometry in the path is reversed in the path direction
|
boolean |
isLinkReversed(int linkIndex)
Checks if the given i-th link in the path is reversed in the path direction
|
boolean |
isLogical()
Chceks if the path is logical.
|
boolean |
isReversePath(Path path)
Checks if the given path is the reverse path of the path
|
boolean |
isSameDirection(Path path)
Checks if two paths the have same direction (indicated by the path node orde).
|
boolean |
isSamePath(Path path)
Checks if the given path has the same path links
|
boolean |
isSimple()
Checks if the path is simple (no self-crossing).
|
boolean |
isTemporary()
Checks if the path is temporary.
|
boolean |
isTspPath()
Checks if the path is a Tsp Path
|
Path |
reverse()
Reverses the path and returns it.
|
void |
setGeometry(JGeometry geom)
Sets the path geometry (JGeometry).
|
void |
setID(int id)
Sets the path ID.
|
void |
setName(java.lang.String name)
Sets the path name.
|
void |
setType(java.lang.String type)
Sets the path type.
|
void |
setUserData(java.lang.Object userData)
Sets user defined data.
|
void |
setUserData(java.lang.String name, java.lang.Object data)
Sets user data
|
int |
size()
Returns the number of links in the path
|
java.util.ArrayList |
subtract(java.util.ArrayList pathList)
Subtracts a list of paths from the path.
|
java.util.ArrayList |
subtract(Path path)
Subtracts a given from the path.
|
void |
validate()
Validates the path.
|
int getID()
void setID(int id) throws NetworkDataException
id
- the path ID to be setNetworkDataException
java.lang.String getName()
void setName(java.lang.String name)
name
- the path name to be setjava.lang.String getType()
void setType(java.lang.String type)
type
- the path type to be setLink getLinkAt(int index)
Node getNodeAt(int index)
index
- the specified node positionboolean isClosed()
Node getStartNode()
Node getEndNode()
Network getNetwork()
Link[] getLinkArray()
java.util.Iterator getLinks()
Node[] getNodeArray()
java.util.Iterator getNodes()
int getNoOfLinks()
int size()
double getCost()
boolean isConnected(Path path)
boolean isSimple()
boolean isTemporary()
boolean contains(Node n)
n
- the specified nodeboolean contains(Link l)
l
- the specified linkboolean contains(Path path)
path
- the specified pathjava.lang.Object clone()
JGeometry getGeometry()
void setGeometry(JGeometry geom)
boolean isLogical()
boolean isActive()
java.lang.Object getUserData()
void setUserData(java.lang.Object userData)
userData
- the user data.boolean getState()
void computeGeometry(double tolerance)
tolerance
- the tolerance for testing if two points are the same.double getDuration()
void setUserData(java.lang.String name, java.lang.Object data)
name
- name for the user datadata
- user datajava.lang.Object getUserData(java.lang.String name)
name
- name for the user databoolean isTspPath()
Node[] getTspNodeOrder()
double[][] getTspNodeDuration()
void extendPath(Link newStartLink, Link newEndLink) throws NetworkDataException
newStartLink
- new start link which will be insert at the start of the path null if none addednewEndLink
- new end link that will be insert at the end of the path null if none addedNetworkDataException
boolean isLinkReversed(int linkIndex)
linkIndex
- the given link index in the pathboolean isLinkGeometryReversed(int linkIndex, double tolerance)
linkIndex
- the given link index in the pathtolerance
- tolerance for end point comparasionint indexOf(Link link)
link
- given link in the pathint indexOf(Link link, int fromIndex)
link
- link given link in the pathfromIndex
- starting indexint indexOf(Node node)
node
- given node in the pathint indexOf(Node node, int fromIndex)
node
- given node in the pathfromIndex
- starting indexPath getSubPath(int startNodeIndex, int endNodeIndex)
startNodeIndex
- start node indexendNodeIndex
- end node indexjava.util.ArrayList getCommonLinks(Path path)
path
- given pathjava.util.ArrayList getCommonNodes(Path path)
path
- given pathjava.util.ArrayList getCommonSubPaths(Path path) throws NetworkDataException
path
- the given pathNetworkDataException
void validate() throws NetworkDataException
NetworkDataException
java.util.ArrayList add(Path path) throws NetworkDataException
path
- given pathNetworkDataException
java.util.ArrayList add(java.util.ArrayList pathList) throws NetworkDataException
pathList
- the given path listNetworkDataException
java.util.ArrayList subtract(Path path) throws NetworkDataException
path
- given pathNetworkDataException
java.util.ArrayList subtract(java.util.ArrayList pathList) throws NetworkDataException
pathList
- given path listNetworkDataException
boolean isSameDirection(Path path)
path
- given pathPath reverse() throws NetworkDataException
NetworkDataException
- if the path cannot be reversedboolean isReversePath(Path path)
path
- given pathboolean isSamePath(Path path)
path
- given path