public class GHUtility extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GHUtility.DisabledEdgeIterator
This edge iterator can be used in tests to mock specific iterator behaviour via overloading
certain methods.
|
Constructor and Description |
---|
GHUtility() |
Modifier and Type | Method and Description |
---|---|
static Set<Integer> |
asSet(int... values) |
static Graph |
copyTo(Graph fromGraph,
Graph toGraph) |
static int |
count(EdgeIterator iter)
Counts reachable edges.
|
static int |
createEdgeKey(int nodeA,
int nodeB,
int edgeId,
boolean reverse)
Creates unique positive number for specified edgeId taking into account the direction defined
by nodeA, nodeB and reverse.
|
static EdgeIteratorState |
createMockedEdgeIteratorState(double distance,
long flags) |
static int |
getAdjNode(Graph g,
int edge,
int adjNode) |
static EdgeIteratorState |
getEdge(Graph graph,
int base,
int adj) |
static int |
getEdgeFromEdgeKey(int edgeKey) |
static List<Integer> |
getEdgeIds(EdgeIterator iter) |
static Set<Integer> |
getNeighbors(EdgeIterator iter) |
static String |
getNodeInfo(CHGraph g,
int nodeId,
EdgeFilter filter) |
static String |
getNodeInfo(Graph g,
int nodeId,
EdgeFilter filter) |
static List<String> |
getProblems(Graph g)
This method could throw exception if uncatched problems like index out of bounds etc
|
static boolean |
isSameEdgeKeys(int edgeKey1,
int edgeKey2)
Returns if the specified edgeKeys (created by createEdgeKey) are identical regardless of the
direction.
|
static GraphHopperStorage |
newStorage(GraphHopperStorage store)
Create a new storage from the specified one without copying the data.
|
static void |
printEdgeInfo(Graph g,
FlagEncoder encoder) |
static void |
printInfo(Graph g,
int startNode,
int counts,
EdgeFilter filter) |
static int |
reverseEdgeKey(int edgeKey)
Returns the edgeKey of the opposite direction
|
static Graph |
shuffle(Graph g,
Graph sortedGraph) |
static Graph |
sortDFS(Graph g,
Graph sortedGraph)
Sorts the graph according to depth-first search traversal.
|
public static List<String> getProblems(Graph g)
public static int count(EdgeIterator iter)
public static Set<Integer> getNeighbors(EdgeIterator iter)
public static List<Integer> getEdgeIds(EdgeIterator iter)
public static void printEdgeInfo(Graph g, FlagEncoder encoder)
public static void printInfo(Graph g, int startNode, int counts, EdgeFilter filter)
public static String getNodeInfo(CHGraph g, int nodeId, EdgeFilter filter)
public static String getNodeInfo(Graph g, int nodeId, EdgeFilter filter)
public static Graph sortDFS(Graph g, Graph sortedGraph)
public static Graph copyTo(Graph fromGraph, Graph toGraph)
public static GraphHopperStorage newStorage(GraphHopperStorage store)
public static int getAdjNode(Graph g, int edge, int adjNode)
public static EdgeIteratorState createMockedEdgeIteratorState(double distance, long flags)
public static EdgeIteratorState getEdge(Graph graph, int base, int adj)
public static int createEdgeKey(int nodeA, int nodeB, int edgeId, boolean reverse)
public static boolean isSameEdgeKeys(int edgeKey1, int edgeKey2)
public static int reverseEdgeKey(int edgeKey)
public static int getEdgeFromEdgeKey(int edgeKey)
Copyright © 2012–2018. All rights reserved.