An interface to represent a (geo) graph - suited for efficient storage as it can be requested via indices called node IDs. To get the lat,lon point you need to set up a LocationIndex instance. @author Peter Karich
| 31 | * @author Peter Karich |
| 32 | */ |
| 33 | public interface Graph { |
| 34 | /** |
| 35 | * @return a graph which behaves like an unprepared graph and e.g. the normal unidirectional |
| 36 | * Dijkstra or any graph traversal algorithm can be executed. |
| 37 | */ |
| 38 | BaseGraph getBaseGraph(); |
| 39 | |
| 40 | /** |
| 41 | * @return the number of created locations - via setNode() or edge() |
| 42 | */ |
| 43 | int getNodes(); |
| 44 | |
| 45 | /** |
| 46 | * @return the number of edges in this graph. Equivalent to getAllEdges().length(). |
| 47 | */ |
| 48 | int getEdges(); |
| 49 | |
| 50 | /** |
| 51 | * Creates an object to access node properties. |
| 52 | */ |
| 53 | NodeAccess getNodeAccess(); |
| 54 | |
| 55 | /** |
| 56 | * Returns the implicit bounds of this graph calculated from the lat,lon input of setNode |
| 57 | */ |
| 58 | BBox getBounds(); |
| 59 | |
| 60 | /** |
| 61 | * Creates an edge between the nodes a and b. To set distance or access use the returned edge |
| 62 | * and e.g. edgeState.setDistance |
| 63 | * |
| 64 | * @param a the index of the starting (tower) node of the edge |
| 65 | * @param b the index of the ending (tower) node of the edge |
| 66 | * @return the newly created edge |
| 67 | */ |
| 68 | EdgeIteratorState edge(int a, int b); |
| 69 | |
| 70 | /** |
| 71 | * Returns a wrapper over the specified edgeId. |
| 72 | * |
| 73 | * @param adjNode is the node that will be returned via getAdjNode(). If adjNode is |
| 74 | * Integer.MIN_VALUE then the edge will be returned in the direction of how it is stored |
| 75 | * @return a new EdgeIteratorState object or potentially null if adjNode does not match |
| 76 | * @throws IllegalStateException if edgeId is not valid |
| 77 | */ |
| 78 | EdgeIteratorState getEdgeIteratorState(int edgeId, int adjNode); |
| 79 | |
| 80 | /** |
| 81 | * Returns the edge state for the given edge key |
| 82 | * |
| 83 | * @see EdgeIteratorState#getEdgeKey() |
| 84 | */ |
| 85 | EdgeIteratorState getEdgeIteratorStateForKey(int edgeKey); |
| 86 | |
| 87 | /** |
| 88 | * @return the 'opposite' node of a given edge, so if there is an edge 3-2 and node =2 this returns 3 |
| 89 | */ |
| 90 | int getOtherNode(int edge, int node); |
no outgoing calls
no test coverage detected