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.
|
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 EdgeKVStorage).
|
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 Graphpublic boolean isInitialized()
public int getNodes()
public int getEdges()
public NodeAccess getNodeAccess()
GraphgetNodeAccess in interface Graphpublic BBox getBounds()
Graphpublic 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 Closeableclose in interface AutoCloseablepublic long getCapacity()
public boolean loadExisting()
public EdgeIteratorState edge(int nodeA, int nodeB)
public EdgeIteratorState getEdgeIteratorState(int edgeId, int adjNode)
GraphgetEdgeIteratorState in interface GraphadjNode - 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)
GraphgetEdgeIteratorStateForKey in interface GraphEdgeIteratorState.getEdgeKey()public EdgeExplorer createEdgeExplorer(EdgeFilter filter)
GraphcreateEdgeExplorer in interface Graphpublic EdgeExplorer createEdgeExplorer()
GraphcreateEdgeExplorer in interface GraphGraph.createEdgeExplorer(EdgeFilter)public AllEdgesIterator getAllEdges()
getAllEdges in interface Graphpublic TurnCostStorage getTurnCostStorage()
getTurnCostStorage in interface GraphTurnCostStorage or null if not supportedpublic Weighting wrapWeighting(Weighting weighting)
GraphwrapWeighting in interface Graphpublic int getOtherNode(int edge,
int node)
getOtherNode in interface Graphpublic boolean isAdjacentToNode(int edge,
int node)
isAdjacentToNode in interface Graphpublic boolean isClosed()
public Directory getDirectory()
public int getSegmentSize()
Copyright © 2012–2022. All rights reserved.