name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
graphhopper_VectorTile_getLayersBuilder_rdh | /**
* <code>repeated .vector_tile.Tile.Layer layers = 3;</code>
*/
public VectorTile.Tile.Layer.Builder getLayersBuilder(int index) {
return getLayersFieldBuilder().getBuilder(index);
} | 3.26 |
graphhopper_VectorTile_addKeys_rdh | /**
* <pre>
* Dictionary encoding for keys
* </pre>
*
* <code>repeated string keys = 3;</code>
*/
public Builder addKeys(String value) {
if (value == null) {
throw new NullPointerException();
}
ensureKeysIsMutable();
keys_.add(value);
onChanged();
return this;
} | 3.26 |
graphhopper_VectorTile_m12_rdh | /**
* <pre>
* The type of geometry stored in this feature.
* </pre>
*
* <code>optional .vector_tile.Tile.GeomType type = 3 [default = UNKNOWN];</code>
*/
public boolean m12() {
return (bitField0_ & 0x2) ==
0x2;
} | 3.26 |
graphhopper_VectorTile_m23_rdh | /**
* <code>repeated .vector_tile.Tile.Layer layers = 3;</code>
*/
public VectorTile.Tile.LayerOrBuilder m23(int index) {
return layers_.get(index);
} | 3.26 |
graphhopper_VectorTile_setType_rdh | /**
* <pre>
* The type of geometry stored in this feature.
* </pre>
*
* <code>optional .vector_tile.Tile.GeomType type = 3 [default = UNKNOWN];</code>
*/
public Builder setType(VectorTile.Tile.GeomType value) {
if (value == null) {
throw new NullPointerException();
}bitField0_ |= 0x4;
type_ = value.getNumber()... | 3.26 |
graphhopper_VectorTile_getTagsCount_rdh | /**
* <pre>
* Tags of this feature are encoded as repeated pairs of
* integers.
* A detailed description of tags is located in sections
* 4.2 and 4.4 of the specification
* </pre>
*
* <code>repeated uint32 tags = 2 [packed = true];</code>
*/
public int getTagsCount() {
return tags_.size();
} | 3.26 |
graphhopper_VectorTile_hasIntValue_rdh | /**
* <code>optional int64 int_value = 4;</code>
*/
public boolean hasIntValue() {
return (bitField0_ & 0x8) == 0x8;
} | 3.26 |
graphhopper_VectorTile_setKeys_rdh | /**
* <pre>
* Dictionary encoding for keys
* </pre>
*
* <code>repeated string keys = 3;</code>
*/
public Builder setKeys(int index, String value)
{
if (value == null) {
throw new
NullPointerException();
}
ensureKeysIsMutable();keys_.set(index, value);
onChanged();
... | 3.26 |
graphhopper_VectorTile_getValuesOrBuilder_rdh | /**
* <pre>
* Dictionary encoding for values
* </pre>
*
* <code>repeated .vector_tile.Tile.Value values = 4;</code>
*/
public VectorTile.Tile.ValueOrBuilder getValuesOrBuilder(int index) {
if (valuesBuilder_ == null) {
return values_.get(index);
} else {
return valuesBuilder_.getMessageO... | 3.26 |
graphhopper_VectorTile_getIntValue_rdh | /**
* <code>optional int64 int_value = 4;</code>
*/
public long getIntValue() {
return intValue_;
} | 3.26 |
graphhopper_VectorTile_hasType_rdh | /**
* <pre>
* The type of geometry stored in this feature.
* </pre>
*
* <code>optional .vector_tile.Tile.GeomType type = 3 [default = UNKNOWN];</code>
*/
public boolean hasType() {
return (bitField0_ & 0x4) == 0x4;
} | 3.26 |
graphhopper_VectorTile_addFeaturesBuilder_rdh | /**
* <pre>
* The actual features in this tile.
* </pre>
*
* <code>repeated .vector_tile.Tile.Feature features = 2;</code>
*/
public VectorTile.Tile.Feature.Builder addFeaturesBuilder(int index) {
return getFeaturesFieldBuilder().addBuilder(index, VectorTile.Tile.Feature.getDefaultInstance());
} | 3.26 |
graphhopper_VectorTile_getFeaturesCount_rdh | /**
* <pre>
* The actual features in this tile.
* </pre>
*
* <code>repeated .vector_tile.Tile.Feature features = 2;</code>
*/
public int getFeaturesCount() {
return features_.size();
} | 3.26 |
graphhopper_VectorTile_m18_rdh | /**
* <pre>
* Dictionary encoding for keys
* </pre>
*
* <code>repeated string keys = 3;</code>
*/public int m18() {
return keys_.size();
} | 3.26 |
graphhopper_VectorTile_getLayersBuilderList_rdh | /**
* <code>repeated .vector_tile.Tile.Layer layers = 3;</code>
*/
public List<VectorTile.Tile.Layer.Builder> getLayersBuilderList()
{
return getLayersFieldBuilder().getBuilderList();
} | 3.26 |
graphhopper_VectorTile_clearBoolValue_rdh | /**
* <code>optional bool bool_value = 7;</code>
*/
public Builder clearBoolValue() {
bitField0_ = bitField0_ & (~0x40);
boolValue_ = false;onChanged();
return this;
} | 3.26 |
graphhopper_VectorTile_setBoolValue_rdh | /**
* <code>optional bool bool_value = 7;</code>
*/
public Builder setBoolValue(boolean value) {
bitField0_ |= 0x40;
boolValue_ = value;
onChanged();
return this;
} | 3.26 |
graphhopper_VectorTile_clearStringValue_rdh | /**
* <pre>
* Exactly one of these values must be present in a valid message
* </pre>
*
* <code>optional string string_value = 1;</code>
*/
public Builder clearStringValue() {
bitField0_ = bitField0_ & (~0x1);
stringValue_ = getDefaultInstance().getStringValue();
onChanged();
return this;
} | 3.26 |
graphhopper_VectorTile_getVersion_rdh | /**
* <pre>
* Any compliant implementation must first read the version
* number encoded in this message and choose the correct
* implementation for this version number before proceeding to
* decode other parts of this message.
* </pre>
*
* <code>required uint32 version = 15 [default = 1];</code>
*/
public int ... | 3.26 |
graphhopper_VectorTile_getLayersList_rdh | /**
* <code>repeated .vector_tile.Tile.Layer layers = 3;</code>
*/
public List<VectorTile.Tile.Layer> getLayersList() {
if (layersBuilder_ == null) {
return Collections.unmodifiableList(layers_);
} else {
return layersBuilder_.getMessageList();
}
} | 3.26 |
graphhopper_VectorTile_setGeometry_rdh | /**
* <pre>
* Contains a stream of commands and parameters (vertices).
* A detailed description on geometry encoding is located in
* section 4.3 of the specification.
* </pre>
*
* <code>repeated uint32 geometry = 4 [packed = true];</code>
*/
public Builder setGeometry(int index, int value) {
ensureGeometryIsM... | 3.26 |
graphhopper_VectorTile_addAllValues_rdh | /**
* <pre>
* Dictionary encoding for values
* </pre>
*
* <code>repeated .vector_tile.Tile.Value values = 4;</code>
*/
public Builder addAllValues(Iterable<? extends VectorTile.Tile.Value>
values) {
if (valuesBuilder_ == null) {
ensureValuesIsMutable();
AbstractMessageLite.Builder.addAll(value... | 3.26 |
graphhopper_VectorTile_getGeometryCount_rdh | /**
* <pre>
* Contains a stream of commands and parameters (vertices).
* A detailed description on geometry encoding is located in
* section 4.3 of the specification.
* </pre>
*
* <code>repeated uint32 geometry = 4 [packed = true];</code>
*/
public int getGeometryCount() {
return geometry_.size();
} | 3.26 |
graphhopper_VectorTile_clearFloatValue_rdh | /**
* <code>optional float float_value = 2;</code>
*/
public Builder clearFloatValue() {
bitField0_ = bitField0_ & (~0x2);floatValue_ = 0.0F;
onChanged();
return this;
} | 3.26 |
graphhopper_VectorTile_m9_rdh | /**
* <code>optional int64 int_value = 4;</code>
*/
public Builder m9() {
bitField0_ = bitField0_ & (~0x8);
intValue_ = 0L;onChanged();
return this;
} | 3.26 |
graphhopper_VectorTile_clearFeatures_rdh | /**
* <pre>
* The actual features in this tile.
* </pre>
*
* <code>repeated .vector_tile.Tile.Feature features = 2;</code>
*/
public Builder clearFeatures() {
if (featuresBuilder_ == null) {
features_ = Collections.emptyList();
bitField0_ = bitField0_ & (~0x4);
onChanged();
} else ... | 3.26 |
graphhopper_VectorTile_setValues_rdh | /**
* <pre>
* Dictionary encoding for values
* </pre>
*
* <code>repeated .vector_tile.Tile.Value values = 4;</code>
*/
public Builder setValues(int index, VectorTile.Tile.Value.Builder builderForValue) {
if (valuesBuilder_ == null)
{
ensureValuesIsMutable();
values_.set(index, builderForV... | 3.26 |
graphhopper_VectorTile_removeValues_rdh | /**
* <pre>
* Dictionary encoding for values
* </pre>
*
* <code>repeated .vector_tile.Tile.Value values = 4;</code>
*/
public Builder removeValues(int index) {
if (valuesBuilder_ == null) {
ensureValuesIsMutable();
values_.remove(index);
onChanged();
}
else {
valuesBuil... | 3.26 |
graphhopper_VectorTile_valueOf_rdh | /**
*
* @deprecated Use {@link #forNumber(int)} instead.
*/
@Deprecated
public static GeomType valueOf(int value) {
return forNumber(value);
} | 3.26 |
graphhopper_VectorTile_m14_rdh | /**
* <pre>
* Tags of this feature are encoded as repeated pairs of
* integers.
* A detailed description of tags is located in sections
* 4.2 and 4.4 of the specification
* </pre>
*
* <code>repeated uint32 tags = 2 [packed = true];</code>
*/
public Builder m14(int index, int value) {
ensureTagsIsMutable();tags... | 3.26 |
graphhopper_VectorTile_getGeometryList_rdh | /**
* <pre>
* Contains a stream of commands and parameters (vertices).
* A detailed description on geometry encoding is located in
* section 4.3 of the specification.
* </pre>
*
* <code>repeated uint32 geometry = 4 [packed = true];</code>
*/public List<Integer> getGeometryList() {
return Collections.unmodifiabl... | 3.26 |
graphhopper_VectorTile_setDoubleValue_rdh | /**
* <code>optional double double_value = 3;</code>
*/
public Builder setDoubleValue(double value) {
bitField0_ |= 0x4;
doubleValue_ = value;
onChanged();
return this;} | 3.26 |
graphhopper_VectorTile_addFeatures_rdh | /**
* <pre>
* The actual features in this tile.
* </pre>
*
* <code>repeated .vector_tile.Tile.Feature features = 2;</code>
*/
public Builder addFeatures(int index, VectorTile.Tile.Feature.Builder builderForValue) {
if (featuresBuilder_ == null) {
ensureFeaturesIsMutable();
features_.add(inde... | 3.26 |
graphhopper_VectorTile_hasBoolValue_rdh | /**
* <code>optional bool bool_value = 7;</code>
*/
public boolean hasBoolValue() {
return (bitField0_ & 0x40) == 0x40;
} | 3.26 |
graphhopper_VectorTile_getFeaturesOrBuilderList_rdh | /**
* <pre>
* The actual features in this tile.
* </pre>
*
* <code>repeated .vector_tile.Tile.Feature features = 2;</code>
*/
public List<? extends VectorTile.Tile.FeatureOrBuilder>
getFeaturesOrBuilderList() {
if (featuresBuilder_ != null) {return featuresBuilder_.getMessageOrBuilderList();} else {
... | 3.26 |
graphhopper_VectorTile_getFeaturesBuilderList_rdh | /**
* <pre>
* The actual features in this tile.
* </pre>
*
* <code>repeated .vector_tile.Tile.Feature features = 2;</code>
*/
public List<VectorTile.Tile.Feature.Builder> getFeaturesBuilderList() {return getFeaturesFieldBuilder().getBuilderList();
} | 3.26 |
graphhopper_VectorTile_hasFloatValue_rdh | /**
* <code>optional float float_value = 2;</code>
*/
public boolean hasFloatValue() {
return (bitField0_ & 0x2) == 0x2;
} | 3.26 |
graphhopper_VectorTile_m21_rdh | /**
* <pre>
* Dictionary encoding for values
* </pre>
*
* <code>repeated .vector_tile.Tile.Value values = 4;</code>
*/
public List<VectorTile.Tile.Value.Builder> m21() {
return getValuesFieldBuilder().getBuilderList();
} | 3.26 |
graphhopper_VectorTile_getKeysCount_rdh | /**
* <pre>
* Dictionary encoding for keys
* </pre>
*
* <code>repeated string keys = 3;</code>
*/
public int getKeysCount() {
return keys_.size();} | 3.26 |
graphhopper_VectorTile_addGeometry_rdh | /**
* <pre>
* Contains a stream of commands and parameters (vertices).
* A detailed description on geometry encoding is located in
* section 4.3 of the specification.
* </pre>
*
* <code>repeated uint32 geometry = 4 [packed = true];</code>
*/
public Builder addGeometry(int value) {
ensureGeometryIsMutable();
geo... | 3.26 |
graphhopper_VectorTile_hasName_rdh | /**
* <code>required string name = 1;</code>
*/
public boolean hasName() {
return (bitField0_ & 0x2) == 0x2;
} | 3.26 |
graphhopper_VectorTile_getTags_rdh | /**
* <pre>
* Tags of this feature are encoded as repeated pairs of
* integers.
* A detailed description of tags is located in sections
* 4.2 and 4.4 of the specification
* </pre>
*
* <code>repeated uint32 tags = 2 [packed = true];</code>
*/
public int getTags(int index) {return tags_.get(index);
} | 3.26 |
graphhopper_VectorTile_setVersion_rdh | /**
* <pre>
* Any compliant implementation must first read the version
* number encoded in this message and choose the correct
* implementation for this version number before proceeding to
* decode other parts of this message.
* </pre>
*
* <code>required uint32 version = 15 [default = 1];</code>
*/
public Buil... | 3.26 |
graphhopper_VectorTile_addAllKeys_rdh | /**
* <pre>
* Dictionary encoding for keys
* </pre>
*
* <code>repeated string keys = 3;</code>
*/
public Builder addAllKeys(Iterable<String> values) {
... | 3.26 |
graphhopper_VectorTile_setLayers_rdh | /**
* <code>repeated .vector_tile.Tile.Layer layers = 3;</code>
*/
public Builder setLayers(int index, VectorTile.Tile.Layer.Builder builderForValue) {
if (layersBuilder_ == null) {
ensureLayersIsMutable();
layers_.set(index, builderForValue.build());
onChanged();
} else {
laye... | 3.26 |
graphhopper_VectorTile_removeLayers_rdh | /**
* <code>repeated .vector_tile.Tile.Layer layers = 3;</code>
*/
public Builder removeLayers(int index) {
if (layersBuilder_ == null) {ensureLayersIsMutable();
layers_.remove(index);
onChanged();
} else {
layersBuilder_.remove(index);
}
return this;
} | 3.26 |
graphhopper_VectorTile_clearGeometry_rdh | /**
* <pre>
* Contains a stream of commands and parameters (vertices).
* A detailed description on geometry encoding is located in
* section 4.3 of the specification.
* </pre>
*
* <code>repeated uint32 geometry = 4 [packed = true];</code>
*/
public Builder clearGeometry() {
geometry_ = Collections.emptyList();
... | 3.26 |
graphhopper_VectorTile_getFloatValue_rdh | /**
* <code>optional float float_value = 2;</code>
*/public float getFloatValue() {
return floatValue_;
} | 3.26 |
graphhopper_VectorTile_setStringValue_rdh | /**
* <pre>
* Exactly one of these values must be present in a valid message
* </pre>
*
* <code>optional string string_value = 1;</code>
*/
public Builder setStringValue(String value) {
if (value == null) {
throw
new NullPointerException();
}
bitField0_ |= 0x1;
stringValue_ = valu... | 3.26 |
graphhopper_VectorTile_getFeaturesList_rdh | /**
* <pre>
* The actual features in this tile.
* </pre>
*
* <code>repeated .vector_tile.Tile.Feature features = 2;</code>
*/
public List<VectorTile.Tile.Feature> getFeaturesList() {
if (featuresBuilder_ == null) {
return Collections.unmodifiableList(features_);
} else {
return featuresBu... | 3.26 |
graphhopper_VectorTile_getKeysBytes_rdh | /**
* <pre>
* Dictionary encoding for keys
* </pre>
*
* <code>repeated string keys = 3;</code>
*/
public ByteString getKeysBytes(int index) {return keys_.getByteString(index);
} | 3.26 |
graphhopper_VectorTile_getSintValue_rdh | /**
* <code>optional sint64 sint_value = 6;</code>
*/
public long getSintValue() {
return sintValue_;
} | 3.26 |
graphhopper_VectorTile_m20_rdh | /**
* <pre>
* Dictionary encoding for values
* </pre>
*
* <code>repeated .vector_tile.Tile.Value values = 4;</code>
*/
public VectorTile.Tile.Value.Builder m20() {
return getValuesFieldBuilder().addBuilder(VectorTile.Tile.Value.getDefaultInstance());
} | 3.26 |
graphhopper_VectorTile_getId_rdh | /**
* <code>optional uint64 id = 1 [default = 0];</code>
*/
public long
getId() {
return id_;
} | 3.26 |
graphhopper_VectorTile_getKeysList_rdh | /**
* <pre>
* Dictionary encoding for keys
* </pre>
*
* <code>repeated string keys = 3;</code>
*/
public ProtocolStringList getKeysList() {
return keys_.getUnmodifiableView();
} | 3.26 |
graphhopper_VectorTile_addAllTags_rdh | /**
* <pre>
* Tags of this feature are encoded as repeated pairs of
* integers.
* A detailed description of tags is located in sections
* 4.2 and 4.4 of the specification
* </pre>
*
* <code>repeated uint32 tags = 2 [packed = true];</code>
*/
public Builder addAllTags(Iterable<? extends Integer> values) {
ens... | 3.26 |
graphhopper_VectorTile_addAllLayers_rdh | /**
* <code>repeated .vector_tile.Tile.Layer layers = 3;</code>
*/
public Builder addAllLayers(Iterable<? extends VectorTile.Tile.Layer> values) {
if (layersBuilder_ ==
null) {
ensureLayersIsMutable();
AbstractMessageLite.Builder.addAll(values, layers_);onChanged();
} else {
layers... | 3.26 |
graphhopper_VectorTile_setFeatures_rdh | /**
* <pre>
* The actual features in this tile.
* </pre>
*
* <code>repeated .vector_tile.Tile.Feature features = 2;</code>
*/
public Builder setFeatures(int index, VectorTile.Tile.Feature.Builder builderForValue) {
if (featuresBuilder_ == null) {
ensureFeaturesIsMutable();
features_.set(ind... | 3.26 |
graphhopper_VectorTile_m19_rdh | /**
* <pre>
* Dictionary encoding for values
* </pre>
*
* <code>repeated .vector_tile.Tile.Value values = 4;</code>
*/
public List<VectorTile.Tile.Value> m19() {
if (... | 3.26 |
graphhopper_VectorTile_getKeys_rdh | /**
* <pre>
* Dictionary encoding for keys
* </pre>
*
* <code>repeated string keys = 3;</code>
*/
public String getKeys(int index) {
return keys_.get(index);
} | 3.26 |
graphhopper_VectorTile_getUintValue_rdh | /**
* <code>optional uint64 uint_value = 5;</code>
*/
public long getUintValue() {
return uintValue_;
} | 3.26 |
graphhopper_VectorTile_removeFeatures_rdh | /**
* <pre>
* The actual features in this tile.
* </pre>
*
* <code>repeated .vector_tile.Tile.Feature features = 2;</code>
*/
public Builder removeFeatures(int index) {
if (featuresBuilder_ == null) {
ensureFeaturesIsMutable();
features_.remove(index);
onChanged();
... | 3.26 |
graphhopper_VectorTile_m4_rdh | /**
* <code>optional sint64 sint_value = 6;</code>
*/
public long m4() {
return sintValue_;
} | 3.26 |
graphhopper_VectorTile_setExtent_rdh | /**
* <pre>
* Although this is an "optional" field it is required by the specification.
* See https://github.com/mapbox/vector-tile-spec/issues/47
* </pre>
*
* <code>optional uint32 extent = 5 [default = 4096];</code>
*/
public Builder setExtent(int value) {
bitField0_ |= 0x20;
extent_ = value;
onC... | 3.26 |
graphhopper_NavigateResponseConverter_getModifier_rdh | /**
* No modifier values for arrive and depart
* <p>
* Find modifier values here: https://www.mapbox.com/api-documentation/#stepmaneuver-object
*/
private static String getModifier(Instruction instruction) {
switch (instruction.getSign()) {
case Instruction.CONTINUE_ON_STREET :
return "strai... | 3.26 |
graphhopper_NavigateResponseConverter_convertFromGHResponse_rdh | /**
* Converts a GHResponse into a json that follows the Mapbox API specification
*/
public static ObjectNode convertFromGHResponse(GHResponse ghResponse, TranslationMap translationMap, Locale locale, DistanceConfig distanceConfig) {
ObjectNode json = JsonNodeFactory.instance.objectNode();
if (ghResponse.has... | 3.26 |
graphhopper_NavigateResponseConverter_putLocation_rdh | /**
* Puts a location array in GeoJson format into the node
*/
private static ObjectNode putLocation(double lat, double lon, ObjectNode node) {
ArrayNode location = node.putArray("location");
// GeoJson lon,lat
location.add(Helper.round6(lon));
location.add(Helper.round6(lat));
return node;
} | 3.26 |
graphhopper_NavigateResponseConverter_putBannerInstructions_rdh | /**
* Banner instructions are the turn instructions that are shown to the user in the top bar.
* <p>
* Between two instructions we can show multiple banner instructions, you can control when they pop up using distanceAlongGeometry.
*/
private static void putBannerInstructions(InstructionList instructions, double di... | 3.26 |
graphhopper_NavigateResponseConverter_getTurnType_rdh | /**
* Relevant maneuver types are:
* depart (firs instruction)
* turn (regular turns)
* roundabout (enter roundabout, maneuver contains also the exit number)
* arrive (last instruction and waypoints)
* <p>
* You can find all maneuver types at: https://www.mapbox.com/api-documentation/#maneuver-types
*/
private ... | 3.26 |
graphhopper_NavigateResponseConverter_getThenVoiceInstructionpart_rdh | /**
* For close turns, it is important to announce the next turn in the earlier instruction.
* e.g.: instruction i+1= turn right, instruction i+2=turn left, with instruction i+1 distance < VOICE_INSTRUCTION_MERGE_TRESHHOLD
* The voice instruction should be like "turn right, then turn left"
* <p>
* For instruction ... | 3.26 |
graphhopper_DepthFirstSearch_start_rdh | /**
* beginning with startNode add all following nodes to LIFO queue. If node has been already
* explored before, skip reexploration.
*/
@Override
public void start(EdgeExplorer explorer, int startNode) {
IntArrayDeque stack = new IntArrayDeque();
GHBitSet explored = createBitSet();
stack.addLast(start... | 3.26 |
graphhopper_AbstractTiffElevationProvider_downloadToFile_rdh | /**
* Download a file at the provided url and save it as the given downloadFile if the downloadFile does not exist.
*/
private void downloadToFile(File downloadFile, String url) throws IOException {
if (!downloadFile.exists()) {
int max = 3;
for (int trial = 0; trial < max; trial++) {
... | 3.26 |
graphhopper_CustomModelParser_injectStatements_rdh | /**
* Injects the already parsed expressions (converted to BlockStatement) via Janino's DeepCopier to the provided
* CompilationUnit cu (a class file).
*/
private static CompilationUnit injectStatements(List<Java.BlockStatement> priorityStatements, List<Java.BlockStatement> speedStatements, Java.CompilationUnit cu) ... | 3.26 |
graphhopper_CustomModelParser_createClassTemplate_rdh | /**
* Create the class source file from the detected variables (priorityVariables and speedVariables). We assume that
* these variables are safe although they are user input because we collected them from parsing via Janino. This
* means that the source file is free from user input and could be directly compiled. Be... | 3.26 |
graphhopper_CustomModelParser_createGetSpeedStatements_rdh | /**
* Parse the expressions from CustomModel relevant for the method getSpeed - see createClassTemplate.
*
* @return the created statements (parsed expressions)
*/
private static List<Java.BlockStatement> createGetSpeedStatements(Set<String> speedVariables, CustomModel customModel, EncodedValueLookup lookup) throw... | 3.26 |
graphhopper_CustomModelParser_verifyExpressions_rdh | /**
* This method does:
* 1. check user expressions via Parser.parseConditionalExpression and only allow whitelisted variables and methods.
* 2. while this check it also guesses the variable names and stores it in createObjects
* 3. creates if-then-elseif expressions from the checks and returns them as BlockStateme... | 3.26 |
graphhopper_CustomModelParser_getVariableDeclaration_rdh | /**
* For the methods getSpeed and getPriority we declare variables that contain the encoded value of the current edge
* or if an area contains the current edge.
*/private static String getVariableDeclaration(EncodedValueLookup lookup, final String arg) {
if (lookup.hasEncodedValue(arg)) {
EncodedValue enc = lookup.... | 3.26 |
graphhopper_CustomModelParser_createWeightingParameters_rdh | /**
* This method compiles a new subclass of CustomWeightingHelper composed from the provided CustomModel caches this
* and returns an instance.
*
* @param priorityEnc
* can be null
*/
public static Parameters createWeightingParameters(CustomModel customModel, EncodedValueLookup lookup, DecimalEncodedValue av... | 3.26 |
graphhopper_CustomModelParser_createGetPriorityStatements_rdh | /**
* Parse the expressions from CustomModel relevant for the method getPriority - see createClassTemplate.
*
* @return the created statements (parsed expressions)
*/
private static List<Java.BlockStatement>
createGetPriorityStatements(Set<String>
priorityVariables, CustomModel customModel, EncodedValueLookup look... | 3.26 |
graphhopper_ReaderElement_m0_rdh | /**
* Returns the first existing tag of the specified list where the order is important.
*
* @return an empty string if nothing found
*/
public String m0(List<String> restrictions) {
for (String str : restrictions) {
Object value = properties.get(str);
if (value != null)
return ((Str... | 3.26 |
graphhopper_ReaderElement_hasTag_rdh | /**
* Check a number of tags in the given order if their value is equal to the specified value.
*/
public boolean hasTag(List<String> keyList, Object value) {
for (String key : keyList) {
if (value.equals(getTag(key, null)))
return true;
}
return false;
} | 3.26 |
graphhopper_HeadingExample_createGraphHopperInstance_rdh | /**
* See {@link RoutingExample#createGraphHopperInstance} for more comments on creating the GraphHopper instance.
*/
static GraphHopper createGraphHopperInstance(String ghLoc)
{
GraphHopper hopper = new GraphHopper();
hopper.setOSMFile(ghLoc);
hopper.setGraphHopperLocation("target/heading-graph-cache");
... | 3.26 |
graphhopper_SubnetworkStorage_getSubnetwork_rdh | /**
* Returns the subnetwork ID for the specified nodeId or 0 if non is associated e.g. because the
* subnetwork is too small.
*/
public int getSubnetwork(int nodeId) {
return da.getByte(nodeId);
} | 3.26 |
graphhopper_SubnetworkStorage_setSubnetwork_rdh | /**
* This method sets the subnetwork if of the specified nodeId. Default is 0 and means subnetwork
* was too small to be useful to be stored.
*/
public void setSubnetwork(int nodeId, int subnetwork)
{
if (subnetwork > 127)
throw new IllegalArgumentException("Number of subnetworks is currently limited t... | 3.26 |
graphhopper_ResponsePathDeserializer_toMap_rdh | // Credits to: http://stackoverflow.com/a/24012023/194609
private static Map<String, Object> toMap(ObjectMapper objectMapper, JsonNode object) {return objectMapper.convertValue(object, new TypeReference<Map<String, Object>>() {});
} | 3.26 |
graphhopper_MaxSpeedCalculator_fillMaxSpeed_rdh | /**
* This method sets max_speed values where the value is UNSET_SPEED to a value determined by
* the default speed library which is country-dependent.
*/
public void fillMaxSpeed(Graph graph, EncodingManager em) {
// In DefaultMaxSpeedParser and in OSMMaxSpeedParser we don't have the rural/urban info,
// b... | 3.26 |
graphhopper_MaxSpeedCalculator_createMaxSpeedStorage_rdh | /**
* Creates temporary uni dir max_speed storage that is removed after import.
*/
private EdgeIntAccess createMaxSpeedStorage(DataAccess dataAccess) {return new EdgeIntAccess() {
public int getInt(int edgeId, int index) {
dataAccess.ensureCapacity((edgeId * 2L) + 2L);
return dataAcces... | 3.26 |
graphhopper_ResponsePath_addPathDetails_rdh | /**
* Adds the given PathDetails to the existing ones. If there are already PathDetails set, the number
* details has to be equal to <code>details</code>.
*
* @param details
* The PathDetails to add
*/
public void addPathDetails(Map<String, List<PathDetail>> details) {
if (((!this.pathDetails.isEmpty()) && (!de... | 3.26 |
graphhopper_ResponsePath_calcBBox2D_rdh | /**
* Calculates the 2D bounding box of this route
*/public Envelope calcBBox2D() {
check("calcBBox2D");
Envelope bounds = new Envelope();
for (int i = 0; i < pointList.size();
i++) {
bounds.expandToInclude(pointList.getLon(i), pointList.getLat(i));
}
return bounds;
} | 3.26 |
graphhopper_ResponsePath_getTime_rdh | /**
*
* @return time in millis
*/
public long getTime() {
check("getTimes");
return time;
} | 3.26 |
graphhopper_ResponsePath_getWaypoints_rdh | /**
* This method returns the input points snapped to the road network.
*/
public PointList getWaypoints() {
check("getWaypoints");
return waypointList;
} | 3.26 |
graphhopper_ResponsePath_getDescend_rdh | /**
* This method returns the total elevation change (going downwards) in meter.
* <p>
*
* @return decline in meter
*/
public double getDescend() {
return descend;
} | 3.26 |
graphhopper_ResponsePath_getRouteWeight_rdh | /**
* This method returns a double value which is better than the time for comparison of routes but
* only if you know what you are doing, e.g. only to compare routes gained with the same query
* parameters like vehicle.
*/
public double getRouteWeight() {
check("getRouteWeight");
return f0;
} | 3.26 |
graphhopper_ResponsePath_getAscend_rdh | /**
* This method returns the total elevation change (going upwards) in meter.
* <p>
*
* @return ascend in meter
*/ public double getAscend() {
return ascend;
} | 3.26 |
graphhopper_ResponsePath_getPoints_rdh | /**
* This method returns all points on the path. Keep in mind that calculating the distance from
* these points might yield different results compared to getDistance as points could have been
* simplified on import or after querying.
*/
public PointList getPoints() {
check("getPoints");
return pointList;
... | 3.26 |
graphhopper_EncodedValue_next_rdh | /**
* This method determines a space of the specified bits and sets shift and dataIndex accordingly
*/
void next(int usedBits) {
shift = nextShift;if ((((shift - 1) + usedBits) / 32) > ((shift - 1) / 32)) {
dataIndex++;
shift = 0;
}
// we need 1L as otherwise it'll fail for usedBits==32
... | 3.26 |
graphhopper_TraversalMode_createTraversalId_rdh | /**
* Returns the identifier to access the map of the shortest path tree according to the traversal
* mode. E.g. returning the adjacent node id in node-based behavior whilst returning the edge id
* in edge-based behavior
* <p>
*
* @param edgeState
* the current {@link EdgeIteratorState}
* @param reverse
* ... | 3.26 |
graphhopper_RestrictionConverter_convert_rdh | /**
* OSM restriction relations specify turn restrictions between OSM ways (of course). This method converts such a
* relation into a 'graph' representation, where the turn restrictions are specified in terms of edge/node IDs instead
* of OSM IDs.
*
* @throws OSMRestrictionException
* if the given relation is e... | 3.26 |
graphhopper_GHRequest_setAlgorithm_rdh | /**
* For possible values see AlgorithmOptions.*
*/
public GHRequest setAlgorithm(String algo) {
if (algo != null)
this.algo
= Helper.camelCaseToUnderScore(algo);
return this;
} | 3.26 |
graphhopper_GHRequest_putHint_rdh | /**
* This method sets a key value pair in the hints and is unrelated to the setPointHints method.
* It is mainly used for deserialization with Jackson.
*
* @see #setPointHints(List)
*/
// a good trick to serialize unknown properties into the HintsMap
@JsonAnySetter
public GHRequest putHint(String
fieldName, Objec... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.