public class Walk extends ArrayList<Node> implements NodeSequence
modCount| Constructor and Description |
|---|
Walk() |
Walk(Collection<Node> nodes) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Node element) |
boolean |
add(Node node)
Adds a node to the walk.
|
boolean |
addAll(Collection<? extends Node> c) |
boolean |
addAll(int index,
Collection<? extends Node> c) |
boolean |
addEdge(Edge e) |
void |
addEdges(Collection<Edge> edges) |
protected List<Edge> |
buildEdges()
Internal method for building the edge set of the walk.
|
Path |
duplicate() |
boolean |
equals(Object other) |
boolean |
equals(Walk other) |
List<Edge> |
getEdges()
Calculates the edges in the walk.
|
Node |
getFirst()
Returns the first node in the sequence.
|
Node |
getLast()
Returns the last node in the sequence.
|
int |
hashCode() |
boolean |
isClosed()
Determines if the walk is closed.
|
boolean |
isValid()
A valid walk is one in which each pair of adjacent nodes in the sequence share an edge.
|
Node |
remove(int index) |
void |
remove(Node node)
Removes a node from the walk.
|
boolean |
remove(Object o) |
boolean |
removeAll(Collection c) |
void |
reverse()
Reverses the path.
|
Iterator<Node> |
riterator()
Returns an iterator that iterates over the path in reverse.
|
void |
truncate(int index)
Truncates the path at the specified index.
|
clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizecontainsAll, toStringiterator, sizecontainsAllparallelStream, streampublic Walk()
public Walk(Collection<Node> nodes)
public boolean isValid()
isValid in interface NodeSequencepublic List<Edge> getEdges()
public boolean add(Node node)
public void add(int index,
Node element)
public boolean addAll(Collection<? extends Node> c)
public boolean addAll(int index,
Collection<? extends Node> c)
public boolean addEdge(Edge e)
public void addEdges(Collection<Edge> edges)
public void remove(Node node)
node - Node to remove from the walk.public Node remove(int index)
public boolean remove(Object o)
public boolean removeAll(Collection c)
public boolean isClosed()
public Node getFirst()
NodeSequencegetFirst in interface NodeSequenceNodeSequence.getFirst()public Node getLast()
NodeSequencegetLast in interface NodeSequenceNodeSequence.getLast()protected List<Edge> buildEdges()
public void reverse()
public void truncate(int index)
index - The index of first node to be removed.public Iterator<Node> riterator()
public Path duplicate()
public boolean equals(Object other)
equals in interface Collection<Node>equals in interface List<Node>equals in class AbstractList<Node>public boolean equals(Walk other)
public int hashCode()
hashCode in interface Collection<Node>hashCode in interface List<Node>hashCode in class AbstractList<Node>Copyright © 1996–2021 Geotools. All rights reserved.