public class TurnCostExtension extends Object implements GraphExtension
GraphExtension.NoOpExtension| Constructor and Description |
|---|
TurnCostExtension() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTurnInfo(int fromEdge,
int viaNode,
int toEdge,
long turnFlags)
Add an entry which is a turn restriction or cost information via the turnFlags.
|
void |
close()
This method makes sure that the underlying used resources are released.
|
GraphExtension |
copyTo(GraphExtension clonedStorage)
creates a copy of this extended storage
|
TurnCostExtension |
create(long initBytes)
Creates the underlying storage.
|
void |
flush()
This method makes sure that the underlying data is written to the storage.
|
long |
getCapacity() |
int |
getDefaultEdgeFieldValue() |
int |
getDefaultNodeFieldValue() |
long |
getTurnCostFlags(int edgeFrom,
int nodeVia,
int edgeTo) |
void |
init(Graph graph,
Directory dir)
initializes the extended storage by giving the base graph
|
boolean |
isClosed() |
boolean |
isRequireEdgeField() |
boolean |
isRequireNodeField() |
boolean |
loadExisting() |
void |
mergeOrOverwriteTurnInfo(int fromEdge,
int viaNode,
int toEdge,
long turnFlags,
boolean merge)
Add a new turn cost entry or clear an existing.
|
void |
setSegmentSize(int bytes)
sets the segment size in all additional data storages
|
String |
toString() |
public void init(Graph graph, Directory dir)
GraphExtensioninit in interface GraphExtensionpublic void setSegmentSize(int bytes)
GraphExtensionsetSegmentSize in interface GraphExtensionpublic TurnCostExtension create(long initBytes)
Storablecreate in interface Storable<GraphExtension>public void flush()
Storableflush in interface Storable<GraphExtension>public void close()
Storableclose in interface Storable<GraphExtension>close in interface Closeableclose in interface AutoCloseablepublic long getCapacity()
getCapacity in interface Storable<GraphExtension>public boolean loadExisting()
loadExisting in interface Storable<GraphExtension>public void addTurnInfo(int fromEdge,
int viaNode,
int toEdge,
long turnFlags)
public void mergeOrOverwriteTurnInfo(int fromEdge,
int viaNode,
int toEdge,
long turnFlags,
boolean merge)
fromEdge - edge IDviaNode - node IDtoEdge - edge IDturnFlags - flags to be writtenmerge - If true don't overwrite existing entries with the new flag but do a bitwise OR of the old and
new flags and write this merged flag.public long getTurnCostFlags(int edgeFrom,
int nodeVia,
int edgeTo)
public boolean isRequireNodeField()
isRequireNodeField in interface GraphExtensionpublic boolean isRequireEdgeField()
isRequireEdgeField in interface GraphExtensionpublic int getDefaultNodeFieldValue()
getDefaultNodeFieldValue in interface GraphExtensionpublic int getDefaultEdgeFieldValue()
getDefaultEdgeFieldValue in interface GraphExtensionpublic GraphExtension copyTo(GraphExtension clonedStorage)
GraphExtensioncopyTo in interface GraphExtensionpublic boolean isClosed()
isClosed in interface Storable<GraphExtension>Copyright © 2012–2018. All rights reserved.