com.graphhopper.routing.ch.NodeOrderingProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphhopper-core Show documentation
Show all versions of graphhopper-core Show documentation
GraphHopper is a fast and memory efficient Java road routing engine
working seamlessly with OpenStreetMap data.
package com.graphhopper.routing.ch;
public interface NodeOrderingProvider {
static NodeOrderingProvider identity(int nodes) {
return new NodeOrderingProvider() {
@Override
public int getNodeIdForLevel(int level) {
return level;
}
@Override
public int getNumNodes() {
return nodes;
}
};
}
static NodeOrderingProvider fromArray(int... nodes) {
return new NodeOrderingProvider() {
@Override
public int getNodeIdForLevel(int level) {
return nodes[level];
}
@Override
public int getNumNodes() {
return nodes.length;
}
};
}
int getNodeIdForLevel(int level);
int getNumNodes();
}