Package com.graphhopper.util
Interface EdgeIterator
- All Superinterfaces:
EdgeIteratorState
- All Known Subinterfaces:
AllEdgesIterator
- All Known Implementing Classes:
BaseGraph.AllEdgeIterator
,BaseGraph.EdgeIteratorImpl
Iterates through all edges of one node. Avoids object creation in-between via direct access
methods. If you want to access some properties of an 'edge' (i.e. the current state) for later
usage store it via edgeIterator.detach() or edgeIterator.getEdge() instead of the iterator
itself. Usage:
EdgeExplorer explorer = graph.createEdgeExplorer(); EdgeIterator iter = explorer.setBaseNode(nodeId); // calls to iter.getAdjNode(), getDistance() without calling next() will cause undefined behaviour! while(iter.next()) { int baseNodeId = iter.getBaseNode(); // equal to nodeId int adjacentNodeId = iter.getAdjNode(); // this is the node where this edge state is "pointing to" ... }
- Author:
- Peter Karich
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Integer value used in places where normally an edge would be expected, but no specific edge shall be specified.static final int
Integer value used in places where normally an edge would be expected, but none is given.Fields inherited from interface com.graphhopper.util.EdgeIteratorState
REVERSE_STATE, UNFAVORED_EDGE
-
Method Summary
Methods inherited from interface com.graphhopper.util.EdgeIteratorState
copyPropertiesFrom, detach, fetchWayGeometry, get, get, get, get, get, getAdjNode, getBaseNode, getDistance, getEdge, getEdgeKey, getFlags, getKeyValues, getName, getReverse, getReverse, getReverse, getReverse, getReverse, getReverseEdgeKey, getValue, set, set, set, set, set, set, set, set, set, set, setDistance, setFlags, setKeyValues, setReverse, setReverse, setReverse, setReverse, setReverse, setWayGeometry
-
Field Details
-
NO_EDGE
static final int NO_EDGEInteger value used in places where normally an edge would be expected, but none is given. For example in the shortest path tree of route calculations every child element should have an incoming edge, but for the root item there is no parent so we would use this value instead.- See Also:
-
ANY_EDGE
static final int ANY_EDGEInteger value used in places where normally an edge would be expected, but no specific edge shall be specified.- See Also:
-
-
Method Details
-
next
boolean next()To be called to go to the next edge state.- Returns:
- true if an edge state is available
-