public class BaseGraph extends Object implements Graph, Closeable
Note: A RAM DataAccess Object is thread-safe in itself but if used in this Graph implementation it is not write thread safe.
Life cycle: (1) object creation, (2) configuration via setters & getters, (3) create or loadExisting, (4) usage, (5) flush, (6) close
Modifier and Type | Class and Description |
---|---|
protected static class |
BaseGraph.AllEdgeIterator
Include all edges of this storage in the iterator.
|
static class |
BaseGraph.Builder |
protected static class |
BaseGraph.EdgeIteratorImpl |
Constructor and Description |
---|
BaseGraph(Directory dir,
int intsForFlags,
boolean withElevation,
boolean withTurnCosts,
int segmentSize) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
BaseGraph |
create(long initSize) |
EdgeExplorer |
createEdgeExplorer()
Creates an EdgeExplorer that accepts all edges
|
EdgeExplorer |
createEdgeExplorer(EdgeFilter filter)
Returns an EdgeExplorer which makes it possible to traverse all filtered edges of a specific
node.
|
EdgeIntAccess |
createEdgeIntAccess() |
void |
debugPrint() |
EdgeIteratorState |
edge(int nodeA,
int nodeB)
Create edge between nodes a and b
|
void |
flush() |
void |
flushAndCloseGeometryAndNameStorage()
Flush and free resources that are not needed for post-processing (way geometries and KVStorage for edges).
|
void |
freeze() |
AllEdgesIterator |
getAllEdges() |
BaseGraph |
getBaseGraph() |
BBox |
getBounds()
Returns the implicit bounds of this graph calculated from the lat,lon input of setNode
|
long |
getCapacity() |
Directory |
getDirectory() |
EdgeIteratorState |
getEdgeIteratorState(int edgeId,
int adjNode)
Returns a wrapper over the specified edgeId.
|
EdgeIteratorState |
getEdgeIteratorStateForKey(int edgeKey)
Returns the edge state for the given edge key
|
int |
getEdges() |
int |
getIntsForFlags() |
NodeAccess |
getNodeAccess()
Creates an object to access node properties.
|
int |
getNodes() |
int |
getOtherNode(int edge,
int node) |
int |
getSegmentSize() |
TurnCostStorage |
getTurnCostStorage() |
boolean |
isAdjacentToNode(int edge,
int node) |
boolean |
isClosed() |
boolean |
isFrozen() |
boolean |
isInitialized() |
boolean |
loadExisting() |
String |
toDetailsString() |
Weighting |
wrapWeighting(Weighting weighting)
Wraps the given weighting into a weighting that can be used by this graph
|
public BaseGraph(Directory dir, int intsForFlags, boolean withElevation, boolean withTurnCosts, int segmentSize)
public void debugPrint()
public BaseGraph getBaseGraph()
getBaseGraph
in interface Graph
public boolean isInitialized()
public int getNodes()
public int getEdges()
public NodeAccess getNodeAccess()
Graph
getNodeAccess
in interface Graph
public BBox getBounds()
Graph
public void freeze()
public boolean isFrozen()
public BaseGraph create(long initSize)
public int getIntsForFlags()
public String toDetailsString()
public void flushAndCloseGeometryAndNameStorage()
public void flush()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public long getCapacity()
public boolean loadExisting()
public EdgeIteratorState edge(int nodeA, int nodeB)
public EdgeIteratorState getEdgeIteratorState(int edgeId, int adjNode)
Graph
getEdgeIteratorState
in interface Graph
adjNode
- is the node that will be returned via getAdjNode(). If adjNode is
Integer.MIN_VALUE then the edge will be returned in the direction of how it is storedpublic EdgeIteratorState getEdgeIteratorStateForKey(int edgeKey)
Graph
getEdgeIteratorStateForKey
in interface Graph
EdgeIteratorState.getEdgeKey()
public EdgeExplorer createEdgeExplorer(EdgeFilter filter)
Graph
createEdgeExplorer
in interface Graph
public EdgeExplorer createEdgeExplorer()
Graph
createEdgeExplorer
in interface Graph
Graph.createEdgeExplorer(EdgeFilter)
public AllEdgesIterator getAllEdges()
getAllEdges
in interface Graph
public TurnCostStorage getTurnCostStorage()
getTurnCostStorage
in interface Graph
TurnCostStorage
or null if not supportedpublic Weighting wrapWeighting(Weighting weighting)
Graph
wrapWeighting
in interface Graph
public int getOtherNode(int edge, int node)
getOtherNode
in interface Graph
public boolean isAdjacentToNode(int edge, int node)
isAdjacentToNode
in interface Graph
public EdgeIntAccess createEdgeIntAccess()
public boolean isClosed()
public Directory getDirectory()
public int getSegmentSize()
Copyright © 2012–2023. All rights reserved.