public class Walk extends ArrayList implements NodeSequence
modCount
Constructor and Description |
---|
Walk() |
Walk(Collection nodes) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Object element) |
boolean |
add(Node node)
Adds a node to the walk.
|
boolean |
add(Object o) |
boolean |
addAll(Collection c) |
boolean |
addAll(int index,
Collection c) |
boolean |
addEdge(Edge e) |
void |
addEdges(Collection edges) |
protected List |
buildEdges()
Internal method for building the edge set of the walk.
|
Path |
duplicate() |
boolean |
equals(Object other) |
boolean |
equals(Walk other) |
List |
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.
|
Object |
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 |
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, trimToSize
containsAll, toString
iterator, size
containsAll
parallelStream, stream
public Walk()
public Walk(Collection nodes)
public boolean isValid()
isValid
in interface NodeSequence
public List getEdges()
public boolean add(Node node)
node
- Node to add to the walk.public void add(int index, Object element)
public boolean add(Object o)
public boolean addAll(Collection c)
public boolean addAll(int index, Collection c)
public boolean addEdge(Edge e)
public void addEdges(Collection edges)
public void remove(Node node)
node
- Node to remove from the walk.public Object remove(int index)
public boolean remove(Object o)
public boolean removeAll(Collection c)
public boolean isClosed()
public Node getFirst()
NodeSequence
getFirst
in interface NodeSequence
NodeSequence.getFirst()
public Node getLast()
NodeSequence
getLast
in interface NodeSequence
NodeSequence.getLast()
protected List buildEdges()
public void reverse()
public void truncate(int index)
index
- The index of first node to be removed.public Iterator riterator()
public Path duplicate()
public boolean equals(Object other)
equals
in interface Collection
equals
in interface List
equals
in class AbstractList
public boolean equals(Walk other)
public int hashCode()
hashCode
in interface Collection
hashCode
in interface List
hashCode
in class AbstractList
Copyright © 1996–2019 Geotools. All rights reserved.