| java.util.ArrayList org.geotools.graph.path.Walk
All known Subclasses: org.geotools.graph.path.Path, org.geotools.graph.path.Cycle,
Walk | public class Walk extends ArrayList implements NodeSequence(Code) | | Represents a walk in a graph. A walk W is defined as an ordered set
of nodes that two adjacenct nodes in the set share
an edge. More precisley:
G = {N,E}
W = { n(i) in N | (n(i-1),n(i)) in E }
author: Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net |
add | public boolean add(Node node)(Code) | | Adds a node to the walk. Adding a node clears the edge list which will be
recalculated on the next call to getEdges().
Parameters: node - Node to add to the walk. |
buildEdges | protected List buildEdges()(Code) | | Internal method for building the edge set of the walk. This method
calculated the edges upon every call.
The list of edges for the walk, or null if the edge set couldnot be calculated due to an invalid walk. |
getEdges | public List getEdges()(Code) | | Calculates the edges in the walk. If the edges of the walk cannot be
calculated (due to an invalid walk), null is returned, otherwise the
list of edges is returned.
The edges of the walk, otherwise null if the edges cannot be calculated. |
hashCode | public int hashCode()(Code) | | |
isClosed | public boolean isClosed()(Code) | | Determines if the walk is closed. A closed walk is one in which the
first and last nodes are the same.
True if closed, otherwise false. |
isValid | public boolean isValid()(Code) | | A valid walk is one in which each pair of adjacent nodes in the sequence
share an edge. Note,
|
remove | public void remove(Node node)(Code) | | Removes a node from the walk. Removing a node clears the edge list which
will be recalculated on the next call to getEdges().
Parameters: node - Node to remove from the walk. |
reverse | public void reverse()(Code) | | Reverses the path.
|
riterator | public Iterator riterator()(Code) | | Returns an iterator that iterates over the path in reverse. The iterator
does not support the remove operation.
the reverse iterator. |
truncate | public void truncate(int index)(Code) | | Truncates the path at the specified index. Nodes in the path whose
index is >= the specified index are removed.
Parameters: index - The index of first node to be removed. |
|
|