id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
28,400 | mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.pixelXToLongitude | public static double pixelXToLongitude(double pixelX, long mapSize) {
if (pixelX < 0 || pixelX > mapSize) {
throw new IllegalArgumentException("invalid pixelX coordinate " + mapSize + ": " + pixelX);
}
return 360 * ((pixelX / mapSize) - 0.5);
} | java | public static double pixelXToLongitude(double pixelX, long mapSize) {
if (pixelX < 0 || pixelX > mapSize) {
throw new IllegalArgumentException("invalid pixelX coordinate " + mapSize + ": " + pixelX);
}
return 360 * ((pixelX / mapSize) - 0.5);
} | [
"public",
"static",
"double",
"pixelXToLongitude",
"(",
"double",
"pixelX",
",",
"long",
"mapSize",
")",
"{",
"if",
"(",
"pixelX",
"<",
"0",
"||",
"pixelX",
">",
"mapSize",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"invalid pixelX coordinate \... | Converts a pixel X coordinate at a certain map size to a longitude coordinate.
@param pixelX the pixel X coordinate that should be converted.
@param mapSize precomputed size of map.
@return the longitude value of the pixel X coordinate.
@throws IllegalArgumentException if the given pixelX coordinate is invalid. | [
"Converts",
"a",
"pixel",
"X",
"coordinate",
"at",
"a",
"certain",
"map",
"size",
"to",
"a",
"longitude",
"coordinate",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L353-L358 |
28,401 | mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.pixelYToLatitudeWithScaleFactor | public static double pixelYToLatitudeWithScaleFactor(double pixelY, double scaleFactor, int tileSize) {
long mapSize = getMapSizeWithScaleFactor(scaleFactor, tileSize);
if (pixelY < 0 || pixelY > mapSize) {
throw new IllegalArgumentException("invalid pixelY coordinate at scale " + scaleFacto... | java | public static double pixelYToLatitudeWithScaleFactor(double pixelY, double scaleFactor, int tileSize) {
long mapSize = getMapSizeWithScaleFactor(scaleFactor, tileSize);
if (pixelY < 0 || pixelY > mapSize) {
throw new IllegalArgumentException("invalid pixelY coordinate at scale " + scaleFacto... | [
"public",
"static",
"double",
"pixelYToLatitudeWithScaleFactor",
"(",
"double",
"pixelY",
",",
"double",
"scaleFactor",
",",
"int",
"tileSize",
")",
"{",
"long",
"mapSize",
"=",
"getMapSizeWithScaleFactor",
"(",
"scaleFactor",
",",
"tileSize",
")",
";",
"if",
"(",... | Converts a pixel Y coordinate at a certain scale to a latitude coordinate.
@param pixelY the pixel Y coordinate that should be converted.
@param scaleFactor the scale factor at which the coordinate should be converted.
@return the latitude value of the pixel Y coordinate.
@throws IllegalArgumentException if the g... | [
"Converts",
"a",
"pixel",
"Y",
"coordinate",
"at",
"a",
"certain",
"scale",
"to",
"a",
"latitude",
"coordinate",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L390-L397 |
28,402 | mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.pixelYToLatitude | public static double pixelYToLatitude(double pixelY, long mapSize) {
if (pixelY < 0 || pixelY > mapSize) {
throw new IllegalArgumentException("invalid pixelY coordinate " + mapSize + ": " + pixelY);
}
double y = 0.5 - (pixelY / mapSize);
return 90 - 360 * Math.atan(Math.exp(-... | java | public static double pixelYToLatitude(double pixelY, long mapSize) {
if (pixelY < 0 || pixelY > mapSize) {
throw new IllegalArgumentException("invalid pixelY coordinate " + mapSize + ": " + pixelY);
}
double y = 0.5 - (pixelY / mapSize);
return 90 - 360 * Math.atan(Math.exp(-... | [
"public",
"static",
"double",
"pixelYToLatitude",
"(",
"double",
"pixelY",
",",
"long",
"mapSize",
")",
"{",
"if",
"(",
"pixelY",
"<",
"0",
"||",
"pixelY",
">",
"mapSize",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"invalid pixelY coordinate \"... | Converts a pixel Y coordinate at a certain map size to a latitude coordinate.
@param pixelY the pixel Y coordinate that should be converted.
@param mapSize precomputed size of map.
@return the latitude value of the pixel Y coordinate.
@throws IllegalArgumentException if the given pixelY coordinate is invalid. | [
"Converts",
"a",
"pixel",
"Y",
"coordinate",
"at",
"a",
"certain",
"map",
"size",
"to",
"a",
"latitude",
"coordinate",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L407-L413 |
28,403 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/layer/hills/HillsRenderConfig.java | HillsRenderConfig.indexOnThread | public HillsRenderConfig indexOnThread() {
ShadeTileSource cache = tileSource;
if (cache != null) cache.applyConfiguration(true);
return this;
} | java | public HillsRenderConfig indexOnThread() {
ShadeTileSource cache = tileSource;
if (cache != null) cache.applyConfiguration(true);
return this;
} | [
"public",
"HillsRenderConfig",
"indexOnThread",
"(",
")",
"{",
"ShadeTileSource",
"cache",
"=",
"tileSource",
";",
"if",
"(",
"cache",
"!=",
"null",
")",
"cache",
".",
"applyConfiguration",
"(",
"true",
")",
";",
"return",
"this",
";",
"}"
] | call after initialization, after a set of changes to the settable properties or after forceReindex to initiate background indexing | [
"call",
"after",
"initialization",
"after",
"a",
"set",
"of",
"changes",
"to",
"the",
"settable",
"properties",
"or",
"after",
"forceReindex",
"to",
"initiate",
"background",
"indexing"
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/hills/HillsRenderConfig.java#L49-L53 |
28,404 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/DeltaEncoder.java | DeltaEncoder.encode | public static List<WayDataBlock> encode(List<WayDataBlock> blocks, Encoding encoding) {
if (blocks == null) {
return null;
}
if (encoding == Encoding.NONE) {
return blocks;
}
List<WayDataBlock> results = new ArrayList<>();
for (WayDataBlock wayD... | java | public static List<WayDataBlock> encode(List<WayDataBlock> blocks, Encoding encoding) {
if (blocks == null) {
return null;
}
if (encoding == Encoding.NONE) {
return blocks;
}
List<WayDataBlock> results = new ArrayList<>();
for (WayDataBlock wayD... | [
"public",
"static",
"List",
"<",
"WayDataBlock",
">",
"encode",
"(",
"List",
"<",
"WayDataBlock",
">",
"blocks",
",",
"Encoding",
"encoding",
")",
"{",
"if",
"(",
"blocks",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"encoding",
"=="... | Encodes a list of WayDataBlock objects with the given encoding scheme.
@param blocks List of WayDataBlock objects to be encoded.
@param encoding The Encoding which is used.
@return A new list of new WayDataBlock objects encoded with the given encoding. The original list is returned in
case the encoding equals NONE. | [
"Encodes",
"a",
"list",
"of",
"WayDataBlock",
"objects",
"with",
"the",
"given",
"encoding",
"scheme",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/DeltaEncoder.java#L36-L60 |
28,405 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/DeltaEncoder.java | DeltaEncoder.simulateSerialization | public static int simulateSerialization(List<WayDataBlock> blocks) {
int sum = 0;
for (WayDataBlock wayDataBlock : blocks) {
sum += mSimulateSerialization(wayDataBlock.getOuterWay());
if (wayDataBlock.getInnerWays() != null) {
for (List<Integer> list : wayDataBloc... | java | public static int simulateSerialization(List<WayDataBlock> blocks) {
int sum = 0;
for (WayDataBlock wayDataBlock : blocks) {
sum += mSimulateSerialization(wayDataBlock.getOuterWay());
if (wayDataBlock.getInnerWays() != null) {
for (List<Integer> list : wayDataBloc... | [
"public",
"static",
"int",
"simulateSerialization",
"(",
"List",
"<",
"WayDataBlock",
">",
"blocks",
")",
"{",
"int",
"sum",
"=",
"0",
";",
"for",
"(",
"WayDataBlock",
"wayDataBlock",
":",
"blocks",
")",
"{",
"sum",
"+=",
"mSimulateSerialization",
"(",
"wayD... | Computes the size in bytes for storing a list of WayDataBlock objects as unsigned var-bytes.
@param blocks the blocks which should be encoded
@return the number of bytes needed for the encoding | [
"Computes",
"the",
"size",
"in",
"bytes",
"for",
"storing",
"a",
"list",
"of",
"WayDataBlock",
"objects",
"as",
"unsigned",
"var",
"-",
"bytes",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/DeltaEncoder.java#L68-L79 |
28,406 | mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/graphics/AndroidResourceBitmap.java | AndroidResourceBitmap.clearResourceBitmaps | public static void clearResourceBitmaps() {
if (!AndroidGraphicFactory.KEEP_RESOURCE_BITMAPS) {
return;
}
synchronized (RESOURCE_BITMAPS) {
for (Pair<android.graphics.Bitmap, Integer> p : RESOURCE_BITMAPS.values()) {
p.first.recycle();
if (... | java | public static void clearResourceBitmaps() {
if (!AndroidGraphicFactory.KEEP_RESOURCE_BITMAPS) {
return;
}
synchronized (RESOURCE_BITMAPS) {
for (Pair<android.graphics.Bitmap, Integer> p : RESOURCE_BITMAPS.values()) {
p.first.recycle();
if (... | [
"public",
"static",
"void",
"clearResourceBitmaps",
"(",
")",
"{",
"if",
"(",
"!",
"AndroidGraphicFactory",
".",
"KEEP_RESOURCE_BITMAPS",
")",
"{",
"return",
";",
"}",
"synchronized",
"(",
"RESOURCE_BITMAPS",
")",
"{",
"for",
"(",
"Pair",
"<",
"android",
".",
... | clearResourceBitmaps is called | [
"clearResourceBitmaps",
"is",
"called"
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/graphics/AndroidResourceBitmap.java#L55-L71 |
28,407 | mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/graphics/AndroidResourceBitmap.java | AndroidResourceBitmap.destroyBitmap | @Override
protected void destroyBitmap() {
if (this.bitmap != null) {
if (removeBitmap(this.hash)) {
this.bitmap.recycle();
}
this.bitmap = null;
}
} | java | @Override
protected void destroyBitmap() {
if (this.bitmap != null) {
if (removeBitmap(this.hash)) {
this.bitmap.recycle();
}
this.bitmap = null;
}
} | [
"@",
"Override",
"protected",
"void",
"destroyBitmap",
"(",
")",
"{",
"if",
"(",
"this",
".",
"bitmap",
"!=",
"null",
")",
"{",
"if",
"(",
"removeBitmap",
"(",
"this",
".",
"hash",
")",
")",
"{",
"this",
".",
"bitmap",
".",
"recycle",
"(",
")",
";"... | and call down into destroyBitmap when the resource bitmap needs to be destroyed | [
"and",
"call",
"down",
"into",
"destroyBitmap",
"when",
"the",
"resource",
"bitmap",
"needs",
"to",
"be",
"destroyed"
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/graphics/AndroidResourceBitmap.java#L155-L163 |
28,408 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/OSMTag.java | OSMTag.fromOSMTag | public static OSMTag fromOSMTag(OSMTag otherTag, short newID) {
return new OSMTag(newID, otherTag.getKey(), otherTag.getValue(), otherTag.getZoomAppear(),
otherTag.isRenderable(), otherTag.isForcePolygonLine(), otherTag.isLabelPosition());
} | java | public static OSMTag fromOSMTag(OSMTag otherTag, short newID) {
return new OSMTag(newID, otherTag.getKey(), otherTag.getValue(), otherTag.getZoomAppear(),
otherTag.isRenderable(), otherTag.isForcePolygonLine(), otherTag.isLabelPosition());
} | [
"public",
"static",
"OSMTag",
"fromOSMTag",
"(",
"OSMTag",
"otherTag",
",",
"short",
"newID",
")",
"{",
"return",
"new",
"OSMTag",
"(",
"newID",
",",
"otherTag",
".",
"getKey",
"(",
")",
",",
"otherTag",
".",
"getValue",
"(",
")",
",",
"otherTag",
".",
... | Convenience method that constructs a new OSMTag with a new id from another OSMTag.
@param otherTag the OSMTag to copy
@param newID the new id
@return a newly constructed OSMTag with the attributes of otherTag | [
"Convenience",
"method",
"that",
"constructs",
"a",
"new",
"OSMTag",
"with",
"a",
"new",
"id",
"from",
"another",
"OSMTag",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/OSMTag.java#L33-L36 |
28,409 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/DirectRenderer.java | DirectRenderer.executeJob | public TileBitmap executeJob(RendererJob rendererJob) {
RenderContext renderContext = null;
try {
renderContext = new RenderContext(rendererJob, new CanvasRasterer(graphicFactory));
if (renderBitmap(renderContext)) {
TileBitmap bitmap = null;
if ... | java | public TileBitmap executeJob(RendererJob rendererJob) {
RenderContext renderContext = null;
try {
renderContext = new RenderContext(rendererJob, new CanvasRasterer(graphicFactory));
if (renderBitmap(renderContext)) {
TileBitmap bitmap = null;
if ... | [
"public",
"TileBitmap",
"executeJob",
"(",
"RendererJob",
"rendererJob",
")",
"{",
"RenderContext",
"renderContext",
"=",
"null",
";",
"try",
"{",
"renderContext",
"=",
"new",
"RenderContext",
"(",
"rendererJob",
",",
"new",
"CanvasRasterer",
"(",
"graphicFactory",
... | Called when a job needs to be executed.
@param rendererJob the job that should be executed. | [
"Called",
"when",
"a",
"job",
"needs",
"to",
"be",
"executed",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/DirectRenderer.java#L78-L130 |
28,410 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.getThreadDefaultConnectionFlags | int getThreadDefaultConnectionFlags(boolean readOnly) {
int flags = readOnly ? SQLiteConnectionPool.CONNECTION_FLAG_READ_ONLY :
SQLiteConnectionPool.CONNECTION_FLAG_PRIMARY_CONNECTION_AFFINITY;
if (isMainThread()) {
flags |= SQLiteConnectionPool.CONNECTION_FLAG_INTERACTIVE;
... | java | int getThreadDefaultConnectionFlags(boolean readOnly) {
int flags = readOnly ? SQLiteConnectionPool.CONNECTION_FLAG_READ_ONLY :
SQLiteConnectionPool.CONNECTION_FLAG_PRIMARY_CONNECTION_AFFINITY;
if (isMainThread()) {
flags |= SQLiteConnectionPool.CONNECTION_FLAG_INTERACTIVE;
... | [
"int",
"getThreadDefaultConnectionFlags",
"(",
"boolean",
"readOnly",
")",
"{",
"int",
"flags",
"=",
"readOnly",
"?",
"SQLiteConnectionPool",
".",
"CONNECTION_FLAG_READ_ONLY",
":",
"SQLiteConnectionPool",
".",
"CONNECTION_FLAG_PRIMARY_CONNECTION_AFFINITY",
";",
"if",
"(",
... | Gets default connection flags that are appropriate for this thread, taking into
account whether the thread is acting on behalf of the UI.
@param readOnly True if the connection should be read-only.
@return The connection flags. | [
"Gets",
"default",
"connection",
"flags",
"that",
"are",
"appropriate",
"for",
"this",
"thread",
"taking",
"into",
"account",
"whether",
"the",
"thread",
"is",
"acting",
"on",
"behalf",
"of",
"the",
"UI",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L382-L389 |
28,411 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.deleteDatabase | public static boolean deleteDatabase(File file) {
if (file == null) {
throw new IllegalArgumentException("file must not be null");
}
boolean deleted = false;
deleted |= file.delete();
deleted |= new File(file.getPath() + "-journal").delete();
deleted |= new F... | java | public static boolean deleteDatabase(File file) {
if (file == null) {
throw new IllegalArgumentException("file must not be null");
}
boolean deleted = false;
deleted |= file.delete();
deleted |= new File(file.getPath() + "-journal").delete();
deleted |= new F... | [
"public",
"static",
"boolean",
"deleteDatabase",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"file must not be null\"",
")",
";",
"}",
"boolean",
"deleted",
"=",
"false",
";",
"... | Deletes a database including its journal file and other auxiliary files
that may have been created by the database engine.
@param file The database file path.
@return True if the database was successfully deleted. | [
"Deletes",
"a",
"database",
"including",
"its",
"journal",
"file",
"and",
"other",
"auxiliary",
"files",
"that",
"may",
"have",
"been",
"created",
"by",
"the",
"database",
"engine",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L731-L758 |
28,412 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.reopenReadWrite | public void reopenReadWrite() {
synchronized (mLock) {
throwIfNotOpenLocked();
if (!isReadOnlyLocked()) {
return; // nothing to do
}
// Reopen the database in read-write mode.
final int oldOpenFlags = mConfigurationLocked.openFlags;
... | java | public void reopenReadWrite() {
synchronized (mLock) {
throwIfNotOpenLocked();
if (!isReadOnlyLocked()) {
return; // nothing to do
}
// Reopen the database in read-write mode.
final int oldOpenFlags = mConfigurationLocked.openFlags;
... | [
"public",
"void",
"reopenReadWrite",
"(",
")",
"{",
"synchronized",
"(",
"mLock",
")",
"{",
"throwIfNotOpenLocked",
"(",
")",
";",
"if",
"(",
"!",
"isReadOnlyLocked",
"(",
")",
")",
"{",
"return",
";",
"// nothing to do",
"}",
"// Reopen the database in read-wri... | Reopens the database in read-write mode.
If the database is already read-write, does nothing.
@throws SQLiteException if the database could not be reopened as requested, in which
case it remains open in read only mode.
@throws IllegalStateException if the database is not open.
@see #isReadOnly()
@hide | [
"Reopens",
"the",
"database",
"in",
"read",
"-",
"write",
"mode",
".",
"If",
"the",
"database",
"is",
"already",
"read",
"-",
"write",
"does",
"nothing",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L771-L790 |
28,413 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.addCustomFunction | public void addCustomFunction(String name, int numArgs, CustomFunction function) {
// Create wrapper (also validates arguments).
SQLiteCustomFunction wrapper = new SQLiteCustomFunction(name, numArgs, function);
synchronized (mLock) {
throwIfNotOpenLocked();
mConfigurati... | java | public void addCustomFunction(String name, int numArgs, CustomFunction function) {
// Create wrapper (also validates arguments).
SQLiteCustomFunction wrapper = new SQLiteCustomFunction(name, numArgs, function);
synchronized (mLock) {
throwIfNotOpenLocked();
mConfigurati... | [
"public",
"void",
"addCustomFunction",
"(",
"String",
"name",
",",
"int",
"numArgs",
",",
"CustomFunction",
"function",
")",
"{",
"// Create wrapper (also validates arguments).",
"SQLiteCustomFunction",
"wrapper",
"=",
"new",
"SQLiteCustomFunction",
"(",
"name",
",",
"n... | Registers a CustomFunction callback as a function that can be called from
SQLite database triggers.
@param name the name of the sqlite3 function
@param numArgs the number of arguments for the function
@param function callback to call when the function is executed
@hide | [
"Registers",
"a",
"CustomFunction",
"callback",
"as",
"a",
"function",
"that",
"can",
"be",
"called",
"from",
"SQLite",
"database",
"triggers",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L845-L860 |
28,414 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.setMaximumSize | public long setMaximumSize(long numBytes) {
long pageSize = getPageSize();
long numPages = numBytes / pageSize;
// If numBytes isn't a multiple of pageSize, bump up a page
if ((numBytes % pageSize) != 0) {
numPages++;
}
long newPageCount = DatabaseUtils.longFo... | java | public long setMaximumSize(long numBytes) {
long pageSize = getPageSize();
long numPages = numBytes / pageSize;
// If numBytes isn't a multiple of pageSize, bump up a page
if ((numBytes % pageSize) != 0) {
numPages++;
}
long newPageCount = DatabaseUtils.longFo... | [
"public",
"long",
"setMaximumSize",
"(",
"long",
"numBytes",
")",
"{",
"long",
"pageSize",
"=",
"getPageSize",
"(",
")",
";",
"long",
"numPages",
"=",
"numBytes",
"/",
"pageSize",
";",
"// If numBytes isn't a multiple of pageSize, bump up a page",
"if",
"(",
"(",
... | Sets the maximum size the database will grow to. The maximum size cannot
be set below the current size.
@param numBytes the maximum database size, in bytes
@return the new maximum database size | [
"Sets",
"the",
"maximum",
"size",
"the",
"database",
"will",
"grow",
"to",
".",
"The",
"maximum",
"size",
"cannot",
"be",
"set",
"below",
"the",
"current",
"size",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L897-L907 |
28,415 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.findEditTable | public static String findEditTable(String tables) {
if (!TextUtils.isEmpty(tables)) {
// find the first word terminated by either a space or a comma
int spacepos = tables.indexOf(' ');
int commapos = tables.indexOf(',');
if (spacepos > 0 && (spacepos < commapos |... | java | public static String findEditTable(String tables) {
if (!TextUtils.isEmpty(tables)) {
// find the first word terminated by either a space or a comma
int spacepos = tables.indexOf(' ');
int commapos = tables.indexOf(',');
if (spacepos > 0 && (spacepos < commapos |... | [
"public",
"static",
"String",
"findEditTable",
"(",
"String",
"tables",
")",
"{",
"if",
"(",
"!",
"TextUtils",
".",
"isEmpty",
"(",
"tables",
")",
")",
"{",
"// find the first word terminated by either a space or a comma",
"int",
"spacepos",
"=",
"tables",
".",
"i... | Finds the name of the first table, which is editable.
@param tables a list of tables
@return the first table listed | [
"Finds",
"the",
"name",
"of",
"the",
"first",
"table",
"which",
"is",
"editable",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L964-L979 |
28,416 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.replaceOrThrow | public long replaceOrThrow(String table, String nullColumnHack,
ContentValues initialValues) throws SQLException {
return insertWithOnConflict(table, nullColumnHack, initialValues,
CONFLICT_REPLACE);
} | java | public long replaceOrThrow(String table, String nullColumnHack,
ContentValues initialValues) throws SQLException {
return insertWithOnConflict(table, nullColumnHack, initialValues,
CONFLICT_REPLACE);
} | [
"public",
"long",
"replaceOrThrow",
"(",
"String",
"table",
",",
"String",
"nullColumnHack",
",",
"ContentValues",
"initialValues",
")",
"throws",
"SQLException",
"{",
"return",
"insertWithOnConflict",
"(",
"table",
",",
"nullColumnHack",
",",
"initialValues",
",",
... | Convenience method for replacing a row in the database.
Inserts a new row if a row does not already exist.
@param table the table in which to replace the row
@param nullColumnHack optional; may be <code>null</code>.
SQL doesn't allow inserting a completely empty row without
naming at least one column name. If your pr... | [
"Convenience",
"method",
"for",
"replacing",
"a",
"row",
"in",
"the",
"database",
".",
"Inserts",
"a",
"new",
"row",
"if",
"a",
"row",
"does",
"not",
"already",
"exist",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L1417-L1421 |
28,417 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.insertWithOnConflict | public long insertWithOnConflict(String table, String nullColumnHack,
ContentValues initialValues, int conflictAlgorithm) {
acquireReference();
try {
StringBuilder sql = new StringBuilder();
sql.append("INSERT");
sql.append(CONFLICT_VALUES[conflictAlgorith... | java | public long insertWithOnConflict(String table, String nullColumnHack,
ContentValues initialValues, int conflictAlgorithm) {
acquireReference();
try {
StringBuilder sql = new StringBuilder();
sql.append("INSERT");
sql.append(CONFLICT_VALUES[conflictAlgorith... | [
"public",
"long",
"insertWithOnConflict",
"(",
"String",
"table",
",",
"String",
"nullColumnHack",
",",
"ContentValues",
"initialValues",
",",
"int",
"conflictAlgorithm",
")",
"{",
"acquireReference",
"(",
")",
";",
"try",
"{",
"StringBuilder",
"sql",
"=",
"new",
... | General method for inserting a row into the database.
@param table the table to insert the row into
@param nullColumnHack optional; may be <code>null</code>.
SQL doesn't allow inserting a completely empty row without
naming at least one column name. If your provided <code>initialValues</code> is
empty, no column name... | [
"General",
"method",
"for",
"inserting",
"a",
"row",
"into",
"the",
"database",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L1442-L1483 |
28,418 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.dumpAll | static void dumpAll(Printer printer, boolean verbose) {
for (SQLiteDatabase db : getActiveDatabases()) {
db.dump(printer, verbose);
}
} | java | static void dumpAll(Printer printer, boolean verbose) {
for (SQLiteDatabase db : getActiveDatabases()) {
db.dump(printer, verbose);
}
} | [
"static",
"void",
"dumpAll",
"(",
"Printer",
"printer",
",",
"boolean",
"verbose",
")",
"{",
"for",
"(",
"SQLiteDatabase",
"db",
":",
"getActiveDatabases",
"(",
")",
")",
"{",
"db",
".",
"dump",
"(",
"printer",
",",
"verbose",
")",
";",
"}",
"}"
] | Dump detailed information about all open databases in the current process.
Used by bug report. | [
"Dump",
"detailed",
"information",
"about",
"all",
"open",
"databases",
"in",
"the",
"current",
"process",
".",
"Used",
"by",
"bug",
"report",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L2062-L2066 |
28,419 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.getAttachedDbs | public List<Pair<String, String>> getAttachedDbs() {
ArrayList<Pair<String, String>> attachedDbs = new ArrayList<Pair<String, String>>();
synchronized (mLock) {
if (mConnectionPoolLocked == null) {
return null; // not open
}
if (!mHasAttachedDbsLocked... | java | public List<Pair<String, String>> getAttachedDbs() {
ArrayList<Pair<String, String>> attachedDbs = new ArrayList<Pair<String, String>>();
synchronized (mLock) {
if (mConnectionPoolLocked == null) {
return null; // not open
}
if (!mHasAttachedDbsLocked... | [
"public",
"List",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
">",
"getAttachedDbs",
"(",
")",
"{",
"ArrayList",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
">",
"attachedDbs",
"=",
"new",
"ArrayList",
"<",
"Pair",
"<",
"String",
",",
"String",... | Returns list of full pathnames of all attached databases including the main database
by executing 'pragma database_list' on the database.
@return ArrayList of pairs of (database name, database file path) or null if the database
is not open. | [
"Returns",
"list",
"of",
"full",
"pathnames",
"of",
"all",
"attached",
"databases",
"including",
"the",
"main",
"database",
"by",
"executing",
"pragma",
"database_list",
"on",
"the",
"database",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L2084-L2130 |
28,420 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TDWay.java | TDWay.fromWay | public static TDWay fromWay(Way way, NodeResolver resolver, List<String> preferredLanguages) {
if (way == null)
return null;
SpecialTagExtractionResult ster = OSMUtils.extractSpecialFields(way, preferredLanguages);
Map<Short, Object> knownWayTags = OSMUtils.extractKnownWayTags(way);... | java | public static TDWay fromWay(Way way, NodeResolver resolver, List<String> preferredLanguages) {
if (way == null)
return null;
SpecialTagExtractionResult ster = OSMUtils.extractSpecialFields(way, preferredLanguages);
Map<Short, Object> knownWayTags = OSMUtils.extractKnownWayTags(way);... | [
"public",
"static",
"TDWay",
"fromWay",
"(",
"Way",
"way",
",",
"NodeResolver",
"resolver",
",",
"List",
"<",
"String",
">",
"preferredLanguages",
")",
"{",
"if",
"(",
"way",
"==",
"null",
")",
"return",
"null",
";",
"SpecialTagExtractionResult",
"ster",
"="... | Creates a new TDWay from an osmosis way entity using the given NodeResolver.
@param way the way
@param resolver the resolver
@param preferredLanguages the preferred language(s) or null if no preference
@return a new TDWay if it is valid, null otherwise | [
"Creates",
"a",
"new",
"TDWay",
"from",
"an",
"osmosis",
"way",
"entity",
"using",
"the",
"given",
"NodeResolver",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TDWay.java#L59-L104 |
28,421 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TDWay.java | TDWay.mergeRelationInformation | public void mergeRelationInformation(TDRelation relation) {
if (relation.hasTags()) {
addTags(relation.getTags());
}
if (getName() == null && relation.getName() != null) {
setName(relation.getName());
}
if (getRef() == null && relation.getRef() != null) {
... | java | public void mergeRelationInformation(TDRelation relation) {
if (relation.hasTags()) {
addTags(relation.getTags());
}
if (getName() == null && relation.getName() != null) {
setName(relation.getName());
}
if (getRef() == null && relation.getRef() != null) {
... | [
"public",
"void",
"mergeRelationInformation",
"(",
"TDRelation",
"relation",
")",
"{",
"if",
"(",
"relation",
".",
"hasTags",
"(",
")",
")",
"{",
"addTags",
"(",
"relation",
".",
"getTags",
"(",
")",
")",
";",
"}",
"if",
"(",
"getName",
"(",
")",
"==",... | Merges tags from a relation with the tags of this way and puts the result into the way tags of this way.
@param relation the relation | [
"Merges",
"tags",
"from",
"a",
"relation",
"with",
"the",
"tags",
"of",
"this",
"way",
"and",
"puts",
"the",
"result",
"into",
"the",
"way",
"tags",
"of",
"this",
"way",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TDWay.java#L351-L361 |
28,422 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TDNode.java | TDNode.fromNode | public static TDNode fromNode(Node node, List<String> preferredLanguages) {
SpecialTagExtractionResult ster = OSMUtils.extractSpecialFields(node, preferredLanguages);
Map<Short, Object> knownWayTags = OSMUtils.extractKnownPOITags(node);
return new TDNode(node.getId(), LatLongUtils.degreesToMicr... | java | public static TDNode fromNode(Node node, List<String> preferredLanguages) {
SpecialTagExtractionResult ster = OSMUtils.extractSpecialFields(node, preferredLanguages);
Map<Short, Object> knownWayTags = OSMUtils.extractKnownPOITags(node);
return new TDNode(node.getId(), LatLongUtils.degreesToMicr... | [
"public",
"static",
"TDNode",
"fromNode",
"(",
"Node",
"node",
",",
"List",
"<",
"String",
">",
"preferredLanguages",
")",
"{",
"SpecialTagExtractionResult",
"ster",
"=",
"OSMUtils",
".",
"extractSpecialFields",
"(",
"node",
",",
"preferredLanguages",
")",
";",
... | Constructs a new TDNode from a given osmosis node entity. Checks the validity of the entity.
@param node the osmosis entity
@param preferredLanguages the preferred language(s) or null if no preference
@return a new TDNode | [
"Constructs",
"a",
"new",
"TDNode",
"from",
"a",
"given",
"osmosis",
"node",
"entity",
".",
"Checks",
"the",
"validity",
"of",
"the",
"entity",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/TDNode.java#L42-L49 |
28,423 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/RenderContext.java | RenderContext.setScaleStrokeWidth | private void setScaleStrokeWidth(byte zoomLevel) {
int zoomLevelDiff = Math.max(zoomLevel - STROKE_MIN_ZOOM_LEVEL, 0);
this.renderTheme.scaleStrokeWidth((float) Math.pow(STROKE_INCREASE, zoomLevelDiff), this.rendererJob.tile.zoomLevel);
} | java | private void setScaleStrokeWidth(byte zoomLevel) {
int zoomLevelDiff = Math.max(zoomLevel - STROKE_MIN_ZOOM_LEVEL, 0);
this.renderTheme.scaleStrokeWidth((float) Math.pow(STROKE_INCREASE, zoomLevelDiff), this.rendererJob.tile.zoomLevel);
} | [
"private",
"void",
"setScaleStrokeWidth",
"(",
"byte",
"zoomLevel",
")",
"{",
"int",
"zoomLevelDiff",
"=",
"Math",
".",
"max",
"(",
"zoomLevel",
"-",
"STROKE_MIN_ZOOM_LEVEL",
",",
"0",
")",
";",
"this",
".",
"renderTheme",
".",
"scaleStrokeWidth",
"(",
"(",
... | Sets the scale stroke factor for the given zoom level.
@param zoomLevel the zoom level for which the scale stroke factor should be set. | [
"Sets",
"the",
"scale",
"stroke",
"factor",
"for",
"the",
"given",
"zoom",
"level",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/RenderContext.java#L108-L111 |
28,424 | mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java | MapFile.closeFileChannel | private void closeFileChannel() {
try {
if (this.databaseIndexCache != null) {
this.databaseIndexCache.destroy();
}
if (this.inputChannel != null) {
this.inputChannel.close();
}
} catch (Exception e) {
LOGGER.log... | java | private void closeFileChannel() {
try {
if (this.databaseIndexCache != null) {
this.databaseIndexCache.destroy();
}
if (this.inputChannel != null) {
this.inputChannel.close();
}
} catch (Exception e) {
LOGGER.log... | [
"private",
"void",
"closeFileChannel",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"databaseIndexCache",
"!=",
"null",
")",
"{",
"this",
".",
"databaseIndexCache",
".",
"destroy",
"(",
")",
";",
"}",
"if",
"(",
"this",
".",
"inputChannel",
"!=",
... | Closes the map file channel and destroys all internal caches.
Has no effect if no map file channel is currently opened. | [
"Closes",
"the",
"map",
"file",
"channel",
"and",
"destroys",
"all",
"internal",
"caches",
".",
"Has",
"no",
"effect",
"if",
"no",
"map",
"file",
"channel",
"is",
"currently",
"opened",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L316-L327 |
28,425 | mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java | MapFile.processBlockSignature | private boolean processBlockSignature(ReadBuffer readBuffer) {
if (this.mapFileHeader.getMapFileInfo().debugFile) {
// get and check the block signature
String signatureBlock = readBuffer.readUTF8EncodedString(SIGNATURE_LENGTH_BLOCK);
if (!signatureBlock.startsWith("###TileSt... | java | private boolean processBlockSignature(ReadBuffer readBuffer) {
if (this.mapFileHeader.getMapFileInfo().debugFile) {
// get and check the block signature
String signatureBlock = readBuffer.readUTF8EncodedString(SIGNATURE_LENGTH_BLOCK);
if (!signatureBlock.startsWith("###TileSt... | [
"private",
"boolean",
"processBlockSignature",
"(",
"ReadBuffer",
"readBuffer",
")",
"{",
"if",
"(",
"this",
".",
"mapFileHeader",
".",
"getMapFileInfo",
"(",
")",
".",
"debugFile",
")",
"{",
"// get and check the block signature",
"String",
"signatureBlock",
"=",
"... | Processes the block signature, if present.
@return true if the block signature could be processed successfully, false otherwise. | [
"Processes",
"the",
"block",
"signature",
"if",
"present",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L502-L512 |
28,426 | mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java | MapFile.readLabels | @Override
public MapReadResult readLabels(Tile tile) {
return readMapData(tile, tile, Selector.LABELS);
} | java | @Override
public MapReadResult readLabels(Tile tile) {
return readMapData(tile, tile, Selector.LABELS);
} | [
"@",
"Override",
"public",
"MapReadResult",
"readLabels",
"(",
"Tile",
"tile",
")",
"{",
"return",
"readMapData",
"(",
"tile",
",",
"tile",
",",
"Selector",
".",
"LABELS",
")",
";",
"}"
] | Reads only labels for tile.
@param tile tile for which data is requested.
@return label data for the tile. | [
"Reads",
"only",
"labels",
"for",
"tile",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L837-L840 |
28,427 | mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java | MapFile.readMapData | @Override
public MapReadResult readMapData(Tile tile) {
return readMapData(tile, tile, Selector.ALL);
} | java | @Override
public MapReadResult readMapData(Tile tile) {
return readMapData(tile, tile, Selector.ALL);
} | [
"@",
"Override",
"public",
"MapReadResult",
"readMapData",
"(",
"Tile",
"tile",
")",
"{",
"return",
"readMapData",
"(",
"tile",
",",
"tile",
",",
"Selector",
".",
"ALL",
")",
";",
"}"
] | Reads all map data for the area covered by the given tile at the tile zoom level.
@param tile defines area and zoom level of read map data.
@return the read map data. | [
"Reads",
"all",
"map",
"data",
"for",
"the",
"area",
"covered",
"by",
"the",
"given",
"tile",
"at",
"the",
"tile",
"zoom",
"level",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L862-L865 |
28,428 | mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java | MapFile.readPoiData | @Override
public MapReadResult readPoiData(Tile tile) {
return readMapData(tile, tile, Selector.POIS);
} | java | @Override
public MapReadResult readPoiData(Tile tile) {
return readMapData(tile, tile, Selector.POIS);
} | [
"@",
"Override",
"public",
"MapReadResult",
"readPoiData",
"(",
"Tile",
"tile",
")",
"{",
"return",
"readMapData",
"(",
"tile",
",",
"tile",
",",
"Selector",
".",
"POIS",
")",
";",
"}"
] | Reads only POI data for tile.
@param tile tile for which data is requested.
@return POI data for the tile. | [
"Reads",
"only",
"POI",
"data",
"for",
"tile",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L937-L940 |
28,429 | mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java | MapFile.readPoiData | @Override
public MapReadResult readPoiData(Tile upperLeft, Tile lowerRight) {
return readMapData(upperLeft, lowerRight, Selector.POIS);
} | java | @Override
public MapReadResult readPoiData(Tile upperLeft, Tile lowerRight) {
return readMapData(upperLeft, lowerRight, Selector.POIS);
} | [
"@",
"Override",
"public",
"MapReadResult",
"readPoiData",
"(",
"Tile",
"upperLeft",
",",
"Tile",
"lowerRight",
")",
"{",
"return",
"readMapData",
"(",
"upperLeft",
",",
"lowerRight",
",",
"Selector",
".",
"POIS",
")",
";",
"}"
] | Reads POI data for an area defined by the tile in the upper left and the tile in
the lower right corner.
This implementation takes the data storage of a MapFile into account for greater efficiency.
@param upperLeft tile that defines the upper left corner of the requested area.
@param lowerRight tile that defines the ... | [
"Reads",
"POI",
"data",
"for",
"an",
"area",
"defined",
"by",
"the",
"tile",
"in",
"the",
"upper",
"left",
"and",
"the",
"tile",
"in",
"the",
"lower",
"right",
"corner",
".",
"This",
"implementation",
"takes",
"the",
"data",
"storage",
"of",
"a",
"MapFil... | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L951-L954 |
28,430 | mapsforge/mapsforge | mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/cluster/Cluster.java | Cluster.addItem | public synchronized void addItem(T item) {
synchronized (items) {
items.add(item);
}
// clusterMarker.setMarkerBitmap();
if (center == null) {
center = item.getLatLong();
} else {
// computing the centroid
double lat = 0, lon = 0;
... | java | public synchronized void addItem(T item) {
synchronized (items) {
items.add(item);
}
// clusterMarker.setMarkerBitmap();
if (center == null) {
center = item.getLatLong();
} else {
// computing the centroid
double lat = 0, lon = 0;
... | [
"public",
"synchronized",
"void",
"addItem",
"(",
"T",
"item",
")",
"{",
"synchronized",
"(",
"items",
")",
"{",
"items",
".",
"add",
"(",
"item",
")",
";",
"}",
"// clusterMarker.setMarkerBitmap();",
"if",
"(",
"center",
"==",
"null",
")",
"{",
"ce... | add item to cluster object
@param item GeoItem object to be added. | [
"add",
"item",
"to",
"cluster",
"object"
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/cluster/Cluster.java#L73-L99 |
28,431 | mapsforge/mapsforge | mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/cluster/Cluster.java | Cluster.clear | public void clear() {
if (clusterMarker != null) {
Layers mapOverlays = clusterManager.getMapView().getLayerManager().getLayers();
if (mapOverlays.contains(clusterMarker)) {
mapOverlays.remove(clusterMarker);
}
clusterManager = null;
cl... | java | public void clear() {
if (clusterMarker != null) {
Layers mapOverlays = clusterManager.getMapView().getLayerManager().getLayers();
if (mapOverlays.contains(clusterMarker)) {
mapOverlays.remove(clusterMarker);
}
clusterManager = null;
cl... | [
"public",
"void",
"clear",
"(",
")",
"{",
"if",
"(",
"clusterMarker",
"!=",
"null",
")",
"{",
"Layers",
"mapOverlays",
"=",
"clusterManager",
".",
"getMapView",
"(",
")",
".",
"getLayerManager",
"(",
")",
".",
"getLayers",
"(",
")",
";",
"if",
"(",
"ma... | clears cluster object and removes the cluster from the layers collection. | [
"clears",
"cluster",
"object",
"and",
"removes",
"the",
"cluster",
"from",
"the",
"layers",
"collection",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/cluster/Cluster.java#L124-L136 |
28,432 | mapsforge/mapsforge | mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/cluster/Cluster.java | Cluster.redraw | public void redraw() {
Layers mapOverlays = clusterManager.getMapView().getLayerManager().getLayers();
if (clusterMarker != null && !clusterManager.getCurBounds().contains(center)
&& mapOverlays.contains(clusterMarker)) {
mapOverlays.remove(clusterMarker);
return;... | java | public void redraw() {
Layers mapOverlays = clusterManager.getMapView().getLayerManager().getLayers();
if (clusterMarker != null && !clusterManager.getCurBounds().contains(center)
&& mapOverlays.contains(clusterMarker)) {
mapOverlays.remove(clusterMarker);
return;... | [
"public",
"void",
"redraw",
"(",
")",
"{",
"Layers",
"mapOverlays",
"=",
"clusterManager",
".",
"getMapView",
"(",
")",
".",
"getLayerManager",
"(",
")",
".",
"getLayers",
"(",
")",
";",
"if",
"(",
"clusterMarker",
"!=",
"null",
"&&",
"!",
"clusterManager"... | add the ClusterMarker to the Layers if is within Viewport, otherwise remove. | [
"add",
"the",
"ClusterMarker",
"to",
"the",
"Layers",
"if",
"is",
"within",
"Viewport",
"otherwise",
"remove",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/cluster/Cluster.java#L141-L154 |
28,433 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/GeometryUtils.java | GeometryUtils.calculateCenterOfBoundingBox | static Point calculateCenterOfBoundingBox(Point[] coordinates) {
double pointXMin = coordinates[0].x;
double pointXMax = coordinates[0].x;
double pointYMin = coordinates[0].y;
double pointYMax = coordinates[0].y;
for (Point immutablePoint : coordinates) {
if (immutab... | java | static Point calculateCenterOfBoundingBox(Point[] coordinates) {
double pointXMin = coordinates[0].x;
double pointXMax = coordinates[0].x;
double pointYMin = coordinates[0].y;
double pointYMax = coordinates[0].y;
for (Point immutablePoint : coordinates) {
if (immutab... | [
"static",
"Point",
"calculateCenterOfBoundingBox",
"(",
"Point",
"[",
"]",
"coordinates",
")",
"{",
"double",
"pointXMin",
"=",
"coordinates",
"[",
"0",
"]",
".",
"x",
";",
"double",
"pointXMax",
"=",
"coordinates",
"[",
"0",
"]",
".",
"x",
";",
"double",
... | Calculates the center of the minimum bounding rectangle for the given coordinates.
@param coordinates the coordinates for which calculation should be done.
@return the center coordinates of the minimum bounding rectangle. | [
"Calculates",
"the",
"center",
"of",
"the",
"minimum",
"bounding",
"rectangle",
"for",
"the",
"given",
"coordinates",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/renderer/GeometryUtils.java#L26-L47 |
28,434 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/ZoomIntervalConfiguration.java | ZoomIntervalConfiguration.fromString | public static ZoomIntervalConfiguration fromString(String confString) {
String[] splitted = confString.split(",");
if (splitted.length % 3 != 0) {
throw new IllegalArgumentException(
"invalid zoom interval configuration, amount of comma-separated values must be a multiple... | java | public static ZoomIntervalConfiguration fromString(String confString) {
String[] splitted = confString.split(",");
if (splitted.length % 3 != 0) {
throw new IllegalArgumentException(
"invalid zoom interval configuration, amount of comma-separated values must be a multiple... | [
"public",
"static",
"ZoomIntervalConfiguration",
"fromString",
"(",
"String",
"confString",
")",
"{",
"String",
"[",
"]",
"splitted",
"=",
"confString",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"splitted",
".",
"length",
"%",
"3",
"!=",
"0",
")",
... | Create a new ZoomIntervalConfiguration from the given string representation. Checks for validity.
@param confString the string representation of a zoom interval configuration
@return a new zoom interval configuration | [
"Create",
"a",
"new",
"ZoomIntervalConfiguration",
"from",
"the",
"given",
"string",
"representation",
".",
"Checks",
"for",
"validity",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/ZoomIntervalConfiguration.java#L29-L43 |
28,435 | mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/WorkingSetCache.java | WorkingSetCache.setWorkingSet | public void setWorkingSet(Set<K> workingSet) {
synchronized(workingSet) {
for (K key : workingSet) {
this.get(key);
}
}
} | java | public void setWorkingSet(Set<K> workingSet) {
synchronized(workingSet) {
for (K key : workingSet) {
this.get(key);
}
}
} | [
"public",
"void",
"setWorkingSet",
"(",
"Set",
"<",
"K",
">",
"workingSet",
")",
"{",
"synchronized",
"(",
"workingSet",
")",
"{",
"for",
"(",
"K",
"key",
":",
"workingSet",
")",
"{",
"this",
".",
"get",
"(",
"key",
")",
";",
"}",
"}",
"}"
] | Sets the current working set, ensuring that elements in this working set
will not be ejected in the near future.
@param workingSet set of K that makes up the current working set. | [
"Sets",
"the",
"current",
"working",
"set",
"ensuring",
"that",
"elements",
"in",
"this",
"working",
"set",
"will",
"not",
"be",
"ejected",
"in",
"the",
"near",
"future",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/WorkingSetCache.java#L40-L46 |
28,436 | mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/graphics/GraphicUtils.java | GraphicUtils.filterColor | public static int filterColor(int color, Filter filter) {
if (filter == Filter.NONE) {
return color;
}
int a = color >>> 24;
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = color & 0xFF;
switch (filter) {
case GRAYSCALE:
... | java | public static int filterColor(int color, Filter filter) {
if (filter == Filter.NONE) {
return color;
}
int a = color >>> 24;
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = color & 0xFF;
switch (filter) {
case GRAYSCALE:
... | [
"public",
"static",
"int",
"filterColor",
"(",
"int",
"color",
",",
"Filter",
"filter",
")",
"{",
"if",
"(",
"filter",
"==",
"Filter",
".",
"NONE",
")",
"{",
"return",
"color",
";",
"}",
"int",
"a",
"=",
"color",
">>>",
"24",
";",
"int",
"r",
"=",
... | Color filtering.
@param color color value in layout 0xAARRGGBB.
@param filter filter to apply on the color.
@return the filtered color. | [
"Color",
"filtering",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/graphics/GraphicUtils.java#L30-L52 |
28,437 | mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/graphics/GraphicUtils.java | GraphicUtils.imageSize | public static float[] imageSize(float picWidth, float picHeight, float scaleFactor, int width, int height, int percent) {
float bitmapWidth = picWidth * scaleFactor;
float bitmapHeight = picHeight * scaleFactor;
float aspectRatio = picWidth / picHeight;
if (width != 0 && height != 0) {... | java | public static float[] imageSize(float picWidth, float picHeight, float scaleFactor, int width, int height, int percent) {
float bitmapWidth = picWidth * scaleFactor;
float bitmapHeight = picHeight * scaleFactor;
float aspectRatio = picWidth / picHeight;
if (width != 0 && height != 0) {... | [
"public",
"static",
"float",
"[",
"]",
"imageSize",
"(",
"float",
"picWidth",
",",
"float",
"picHeight",
",",
"float",
"scaleFactor",
",",
"int",
"width",
",",
"int",
"height",
",",
"int",
"percent",
")",
"{",
"float",
"bitmapWidth",
"=",
"picWidth",
"*",
... | Given the original image size, as well as width, height, percent parameters,
can compute the final image size.
@param picWidth original image width
@param picHeight original image height
@param scaleFactor scale factor to screen DPI
@param width requested width (0: no change)
@param height requested he... | [
"Given",
"the",
"original",
"image",
"size",
"as",
"well",
"as",
"width",
"height",
"percent",
"parameters",
"can",
"compute",
"the",
"final",
"image",
"size",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/graphics/GraphicUtils.java#L73-L99 |
28,438 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/MapWriterConfiguration.java | MapWriterConfiguration.validate | public void validate() {
if (this.mapStartPosition != null && this.bboxConfiguration != null
&& !this.bboxConfiguration.contains(this.mapStartPosition)) {
throw new IllegalArgumentException(
"map start position is not valid, must be included in bounding box of the... | java | public void validate() {
if (this.mapStartPosition != null && this.bboxConfiguration != null
&& !this.bboxConfiguration.contains(this.mapStartPosition)) {
throw new IllegalArgumentException(
"map start position is not valid, must be included in bounding box of the... | [
"public",
"void",
"validate",
"(",
")",
"{",
"if",
"(",
"this",
".",
"mapStartPosition",
"!=",
"null",
"&&",
"this",
".",
"bboxConfiguration",
"!=",
"null",
"&&",
"!",
"this",
".",
"bboxConfiguration",
".",
"contains",
"(",
"this",
".",
"mapStartPosition",
... | Validates this configuration.
@throws IllegalArgumentException thrown if configuration is invalid | [
"Validates",
"this",
"configuration",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/model/MapWriterConfiguration.java#L548-L556 |
28,439 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java | GeoUtils.clipToTile | public static Geometry clipToTile(TDWay way, Geometry geometry, TileCoordinate tileCoordinate,
int enlargementInMeters) {
Geometry tileBBJTS = null;
Geometry ret = null;
// create tile bounding box
tileBBJTS = tileToJTSGeometry(tileCoordinate.getX()... | java | public static Geometry clipToTile(TDWay way, Geometry geometry, TileCoordinate tileCoordinate,
int enlargementInMeters) {
Geometry tileBBJTS = null;
Geometry ret = null;
// create tile bounding box
tileBBJTS = tileToJTSGeometry(tileCoordinate.getX()... | [
"public",
"static",
"Geometry",
"clipToTile",
"(",
"TDWay",
"way",
",",
"Geometry",
"geometry",
",",
"TileCoordinate",
"tileCoordinate",
",",
"int",
"enlargementInMeters",
")",
"{",
"Geometry",
"tileBBJTS",
"=",
"null",
";",
"Geometry",
"ret",
"=",
"null",
";",
... | Clips a geometry to a tile.
@param way the way
@param geometry the geometry
@param tileCoordinate the tile coordinate
@param enlargementInMeters the bounding box buffer
@return the clipped geometry | [
"Clips",
"a",
"geometry",
"to",
"a",
"tile",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java#L84-L124 |
28,440 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java | GeoUtils.simplifyGeometry | public static Geometry simplifyGeometry(TDWay way, Geometry geometry, byte zoomlevel, int tileSize,
double simplificationFactor) {
Geometry ret = null;
Envelope bbox = geometry.getEnvelopeInternal();
// compute maximal absolute latitude (so that we do... | java | public static Geometry simplifyGeometry(TDWay way, Geometry geometry, byte zoomlevel, int tileSize,
double simplificationFactor) {
Geometry ret = null;
Envelope bbox = geometry.getEnvelopeInternal();
// compute maximal absolute latitude (so that we do... | [
"public",
"static",
"Geometry",
"simplifyGeometry",
"(",
"TDWay",
"way",
",",
"Geometry",
"geometry",
",",
"byte",
"zoomlevel",
",",
"int",
"tileSize",
",",
"double",
"simplificationFactor",
")",
"{",
"Geometry",
"ret",
"=",
"null",
";",
"Envelope",
"bbox",
"=... | Simplifies a geometry using the Douglas Peucker algorithm.
@param way the way
@param geometry the geometry
@param zoomlevel the zoom level
@param simplificationFactor the simplification factor
@return the simplified geometry | [
"Simplifies",
"a",
"geometry",
"using",
"the",
"Douglas",
"Peucker",
"algorithm",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java#L319-L339 |
28,441 | mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java | GeoUtils.deltaLat | private static double deltaLat(double deltaPixel, double lat, byte zoom, int tileSize) {
long mapSize = MercatorProjection.getMapSize(zoom, tileSize);
double pixelY = MercatorProjection.latitudeToPixelY(lat, mapSize);
double lat2 = MercatorProjection.pixelYToLatitude(pixelY + deltaPixel, mapSize... | java | private static double deltaLat(double deltaPixel, double lat, byte zoom, int tileSize) {
long mapSize = MercatorProjection.getMapSize(zoom, tileSize);
double pixelY = MercatorProjection.latitudeToPixelY(lat, mapSize);
double lat2 = MercatorProjection.pixelYToLatitude(pixelY + deltaPixel, mapSize... | [
"private",
"static",
"double",
"deltaLat",
"(",
"double",
"deltaPixel",
",",
"double",
"lat",
",",
"byte",
"zoom",
",",
"int",
"tileSize",
")",
"{",
"long",
"mapSize",
"=",
"MercatorProjection",
".",
"getMapSize",
"(",
"zoom",
",",
"tileSize",
")",
";",
"d... | Computes the amount of latitude degrees for a given distance in pixel at a given zoom level. | [
"Computes",
"the",
"amount",
"of",
"latitude",
"degrees",
"for",
"a",
"given",
"distance",
"in",
"pixel",
"at",
"a",
"given",
"zoom",
"level",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java#L437-L443 |
28,442 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java | MapViewPosition.moveCenterAndZoom | @Override
public void moveCenterAndZoom(double moveHorizontal, double moveVertical, byte zoomLevelDiff) {
moveCenterAndZoom(moveHorizontal, moveVertical, zoomLevelDiff, true);
} | java | @Override
public void moveCenterAndZoom(double moveHorizontal, double moveVertical, byte zoomLevelDiff) {
moveCenterAndZoom(moveHorizontal, moveVertical, zoomLevelDiff, true);
} | [
"@",
"Override",
"public",
"void",
"moveCenterAndZoom",
"(",
"double",
"moveHorizontal",
",",
"double",
"moveVertical",
",",
"byte",
"zoomLevelDiff",
")",
"{",
"moveCenterAndZoom",
"(",
"moveHorizontal",
",",
"moveVertical",
",",
"zoomLevelDiff",
",",
"true",
")",
... | Animates the center position of the map by the given amount of pixels.
@param moveHorizontal the amount of pixels to move this MapViewPosition horizontally.
@param moveVertical the amount of pixels to move this MapViewPosition vertically.
@param zoomLevelDiff the difference in desired zoom level. | [
"Animates",
"the",
"center",
"position",
"of",
"the",
"map",
"by",
"the",
"given",
"amount",
"of",
"pixels",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java#L304-L307 |
28,443 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java | MapViewPosition.moveCenterAndZoom | public void moveCenterAndZoom(double moveHorizontal, double moveVertical, byte zoomLevelDiff, boolean animated) {
synchronized (this) {
long mapSize = MercatorProjection.getMapSize(this.zoomLevel, this.displayModel.getTileSize());
double pixelX = MercatorProjection.longitudeToPixelX(this... | java | public void moveCenterAndZoom(double moveHorizontal, double moveVertical, byte zoomLevelDiff, boolean animated) {
synchronized (this) {
long mapSize = MercatorProjection.getMapSize(this.zoomLevel, this.displayModel.getTileSize());
double pixelX = MercatorProjection.longitudeToPixelX(this... | [
"public",
"void",
"moveCenterAndZoom",
"(",
"double",
"moveHorizontal",
",",
"double",
"moveVertical",
",",
"byte",
"zoomLevelDiff",
",",
"boolean",
"animated",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"long",
"mapSize",
"=",
"MercatorProjection",
".",
"... | Moves the center position of the map by the given amount of pixels.
@param moveHorizontal the amount of pixels to move this MapViewPosition horizontally.
@param moveVertical the amount of pixels to move this MapViewPosition vertically.
@param zoomLevelDiff the difference in desired zoom level.
@param animated ... | [
"Moves",
"the",
"center",
"position",
"of",
"the",
"map",
"by",
"the",
"given",
"amount",
"of",
"pixels",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java#L317-L333 |
28,444 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java | MapViewPosition.setCenter | @Override
public void setCenter(LatLong latLong) {
synchronized (this) {
setCenterInternal(latLong.latitude, latLong.longitude);
}
notifyObservers();
} | java | @Override
public void setCenter(LatLong latLong) {
synchronized (this) {
setCenterInternal(latLong.latitude, latLong.longitude);
}
notifyObservers();
} | [
"@",
"Override",
"public",
"void",
"setCenter",
"(",
"LatLong",
"latLong",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"setCenterInternal",
"(",
"latLong",
".",
"latitude",
",",
"latLong",
".",
"longitude",
")",
";",
"}",
"notifyObservers",
"(",
")",
... | Sets the new center position of the map. | [
"Sets",
"the",
"new",
"center",
"position",
"of",
"the",
"map",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java#L360-L366 |
28,445 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java | MapViewPosition.setMapPosition | @Override
public void setMapPosition(MapPosition mapPosition, boolean animated) {
synchronized (this) {
setCenterInternal(mapPosition.latLong.latitude, mapPosition.latLong.longitude);
setZoomLevelInternal(mapPosition.zoomLevel, animated);
}
notifyObservers();
} | java | @Override
public void setMapPosition(MapPosition mapPosition, boolean animated) {
synchronized (this) {
setCenterInternal(mapPosition.latLong.latitude, mapPosition.latLong.longitude);
setZoomLevelInternal(mapPosition.zoomLevel, animated);
}
notifyObservers();
} | [
"@",
"Override",
"public",
"void",
"setMapPosition",
"(",
"MapPosition",
"mapPosition",
",",
"boolean",
"animated",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"setCenterInternal",
"(",
"mapPosition",
".",
"latLong",
".",
"latitude",
",",
"mapPosition",
"."... | Sets the new center position and zoom level of the map. | [
"Sets",
"the",
"new",
"center",
"position",
"and",
"zoom",
"level",
"of",
"the",
"map",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java#L392-L399 |
28,446 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java | MapViewPosition.setZoomLevel | @Override
public void setZoomLevel(byte zoomLevel, boolean animated) {
if (zoomLevel < 0) {
throw new IllegalArgumentException("zoomLevel must not be negative: " + zoomLevel);
}
synchronized (this) {
setZoomLevelInternal(zoomLevel, animated);
}
notifyO... | java | @Override
public void setZoomLevel(byte zoomLevel, boolean animated) {
if (zoomLevel < 0) {
throw new IllegalArgumentException("zoomLevel must not be negative: " + zoomLevel);
}
synchronized (this) {
setZoomLevelInternal(zoomLevel, animated);
}
notifyO... | [
"@",
"Override",
"public",
"void",
"setZoomLevel",
"(",
"byte",
"zoomLevel",
",",
"boolean",
"animated",
")",
"{",
"if",
"(",
"zoomLevel",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"zoomLevel must not be negative: \"",
"+",
"zoomLevel"... | Sets the new zoom level of the map
@param zoomLevel desired zoom level
@param animated true if the transition should be animated, false otherwise
@throws IllegalArgumentException if the zoom level is negative. | [
"Sets",
"the",
"new",
"zoom",
"level",
"of",
"the",
"map"
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/model/MapViewPosition.java#L453-L462 |
28,447 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/scalebar/MapScaleBar.java | MapScaleBar.calculateScaleBarLengthAndValue | protected ScaleBarLengthAndValue calculateScaleBarLengthAndValue(DistanceUnitAdapter unitAdapter) {
this.prevMapPosition = this.mapViewPosition.getMapPosition();
double groundResolution = MercatorProjection.calculateGroundResolution(this.prevMapPosition.latLong.latitude,
MercatorProjecti... | java | protected ScaleBarLengthAndValue calculateScaleBarLengthAndValue(DistanceUnitAdapter unitAdapter) {
this.prevMapPosition = this.mapViewPosition.getMapPosition();
double groundResolution = MercatorProjection.calculateGroundResolution(this.prevMapPosition.latLong.latitude,
MercatorProjecti... | [
"protected",
"ScaleBarLengthAndValue",
"calculateScaleBarLengthAndValue",
"(",
"DistanceUnitAdapter",
"unitAdapter",
")",
"{",
"this",
".",
"prevMapPosition",
"=",
"this",
".",
"mapViewPosition",
".",
"getMapPosition",
"(",
")",
";",
"double",
"groundResolution",
"=",
"... | Calculates the required length and value of the scalebar
@param unitAdapter the DistanceUnitAdapter to calculate for
@return a {@link ScaleBarLengthAndValue} object containing the required scaleBarLength and scaleBarValue | [
"Calculates",
"the",
"required",
"length",
"and",
"value",
"of",
"the",
"scalebar"
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/scalebar/MapScaleBar.java#L205-L225 |
28,448 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/scalebar/MapScaleBar.java | MapScaleBar.isRedrawNecessary | protected boolean isRedrawNecessary() {
if (this.redrawNeeded || this.prevMapPosition == null) {
return true;
}
MapPosition currentMapPosition = this.mapViewPosition.getMapPosition();
if (currentMapPosition.zoomLevel != this.prevMapPosition.zoomLevel) {
return tr... | java | protected boolean isRedrawNecessary() {
if (this.redrawNeeded || this.prevMapPosition == null) {
return true;
}
MapPosition currentMapPosition = this.mapViewPosition.getMapPosition();
if (currentMapPosition.zoomLevel != this.prevMapPosition.zoomLevel) {
return tr... | [
"protected",
"boolean",
"isRedrawNecessary",
"(",
")",
"{",
"if",
"(",
"this",
".",
"redrawNeeded",
"||",
"this",
".",
"prevMapPosition",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"MapPosition",
"currentMapPosition",
"=",
"this",
".",
"mapViewPositio... | Determines if a redraw is necessary or not
@return true if redraw is necessary, false otherwise | [
"Determines",
"if",
"a",
"redraw",
"is",
"necessary",
"or",
"not"
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/scalebar/MapScaleBar.java#L280-L292 |
28,449 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/layer/queue/JobQueue.java | JobQueue.get | public synchronized T get(int maxAssigned) throws InterruptedException {
while (this.queueItems.isEmpty() || this.assignedJobs.size() >= maxAssigned) {
this.wait(200);
if (this.isInterrupted) {
this.isInterrupted = false;
return null;
}
... | java | public synchronized T get(int maxAssigned) throws InterruptedException {
while (this.queueItems.isEmpty() || this.assignedJobs.size() >= maxAssigned) {
this.wait(200);
if (this.isInterrupted) {
this.isInterrupted = false;
return null;
}
... | [
"public",
"synchronized",
"T",
"get",
"(",
"int",
"maxAssigned",
")",
"throws",
"InterruptedException",
"{",
"while",
"(",
"this",
".",
"queueItems",
".",
"isEmpty",
"(",
")",
"||",
"this",
".",
"assignedJobs",
".",
"size",
"(",
")",
">=",
"maxAssigned",
"... | Returns the most important entry from this queue. The method blocks while this queue is empty
or while there are already a certain number of jobs assigned.
@param maxAssigned the maximum number of jobs that should be assigned at any one point. If there
are already so many jobs assigned, the queue will block. This is t... | [
"Returns",
"the",
"most",
"important",
"entry",
"from",
"this",
"queue",
".",
"The",
"method",
"blocks",
"while",
"this",
"queue",
"is",
"empty",
"or",
"while",
"there",
"are",
"already",
"a",
"certain",
"number",
"of",
"jobs",
"assigned",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/queue/JobQueue.java#L67-L84 |
28,450 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteOpenHelper.java | SQLiteOpenHelper.setWriteAheadLoggingEnabled | public void setWriteAheadLoggingEnabled(boolean enabled) {
synchronized (this) {
if (mEnableWriteAheadLogging != enabled) {
if (mDatabase != null && mDatabase.isOpen() && !mDatabase.isReadOnly()) {
if (enabled) {
mDatabase.enableWriteAheadL... | java | public void setWriteAheadLoggingEnabled(boolean enabled) {
synchronized (this) {
if (mEnableWriteAheadLogging != enabled) {
if (mDatabase != null && mDatabase.isOpen() && !mDatabase.isReadOnly()) {
if (enabled) {
mDatabase.enableWriteAheadL... | [
"public",
"void",
"setWriteAheadLoggingEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"mEnableWriteAheadLogging",
"!=",
"enabled",
")",
"{",
"if",
"(",
"mDatabase",
"!=",
"null",
"&&",
"mDatabase",
".",
"isOpen... | Enables or disables the use of write-ahead logging for the database.
Write-ahead logging cannot be used with read-only databases so the value of
this flag is ignored if the database is opened read-only.
@param enabled True if write-ahead logging should be enabled, false if it
should be disabled.
@see SQLiteDatabase#... | [
"Enables",
"or",
"disables",
"the",
"use",
"of",
"write",
"-",
"ahead",
"logging",
"for",
"the",
"database",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteOpenHelper.java#L163-L176 |
28,451 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteOpenHelper.java | SQLiteOpenHelper.close | public synchronized void close() {
if (mIsInitializing) throw new IllegalStateException("Closed during initialization");
if (mDatabase != null && mDatabase.isOpen()) {
mDatabase.close();
mDatabase = null;
}
} | java | public synchronized void close() {
if (mIsInitializing) throw new IllegalStateException("Closed during initialization");
if (mDatabase != null && mDatabase.isOpen()) {
mDatabase.close();
mDatabase = null;
}
} | [
"public",
"synchronized",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"mIsInitializing",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Closed during initialization\"",
")",
";",
"if",
"(",
"mDatabase",
"!=",
"null",
"&&",
"mDatabase",
".",
"isOpen",
"(",
... | Close any open database object. | [
"Close",
"any",
"open",
"database",
"object",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteOpenHelper.java#L334-L341 |
28,452 | mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/header/MapFileHeader.java | MapFileHeader.readHeader | public void readHeader(ReadBuffer readBuffer, long fileSize) throws IOException {
RequiredFields.readMagicByte(readBuffer);
RequiredFields.readRemainingHeader(readBuffer);
MapFileInfoBuilder mapFileInfoBuilder = new MapFileInfoBuilder();
RequiredFields.readFileVersion(readBuffer, mapFi... | java | public void readHeader(ReadBuffer readBuffer, long fileSize) throws IOException {
RequiredFields.readMagicByte(readBuffer);
RequiredFields.readRemainingHeader(readBuffer);
MapFileInfoBuilder mapFileInfoBuilder = new MapFileInfoBuilder();
RequiredFields.readFileVersion(readBuffer, mapFi... | [
"public",
"void",
"readHeader",
"(",
"ReadBuffer",
"readBuffer",
",",
"long",
"fileSize",
")",
"throws",
"IOException",
"{",
"RequiredFields",
".",
"readMagicByte",
"(",
"readBuffer",
")",
";",
"RequiredFields",
".",
"readRemainingHeader",
"(",
"readBuffer",
")",
... | Reads and validates the header block from the map file.
@param readBuffer the ReadBuffer for the file data.
@param fileSize the size of the map file in bytes.
@throws IOException if an error occurs while reading the file. | [
"Reads",
"and",
"validates",
"the",
"header",
"block",
"from",
"the",
"map",
"file",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/header/MapFileHeader.java#L86-L113 |
28,453 | mapsforge/mapsforge | mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/SamplesBaseActivity.java | SamplesBaseActivity.setMapScaleBar | protected void setMapScaleBar() {
String value = this.sharedPreferences.getString(SETTING_SCALEBAR, SETTING_SCALEBAR_BOTH);
if (SETTING_SCALEBAR_NONE.equals(value)) {
AndroidUtil.setMapScaleBar(this.mapView, null, null);
} else {
if (SETTING_SCALEBAR_BOTH.equals(value)) ... | java | protected void setMapScaleBar() {
String value = this.sharedPreferences.getString(SETTING_SCALEBAR, SETTING_SCALEBAR_BOTH);
if (SETTING_SCALEBAR_NONE.equals(value)) {
AndroidUtil.setMapScaleBar(this.mapView, null, null);
} else {
if (SETTING_SCALEBAR_BOTH.equals(value)) ... | [
"protected",
"void",
"setMapScaleBar",
"(",
")",
"{",
"String",
"value",
"=",
"this",
".",
"sharedPreferences",
".",
"getString",
"(",
"SETTING_SCALEBAR",
",",
"SETTING_SCALEBAR_BOTH",
")",
";",
"if",
"(",
"SETTING_SCALEBAR_NONE",
".",
"equals",
"(",
"value",
")... | Sets the scale bar from preferences. | [
"Sets",
"the",
"scale",
"bar",
"from",
"preferences",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/SamplesBaseActivity.java#L324-L340 |
28,454 | mapsforge/mapsforge | mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/SamplesBaseActivity.java | SamplesBaseActivity.setMaxTextWidthFactor | protected void setMaxTextWidthFactor() {
mapView.getModel().displayModel.setMaxTextWidthFactor(Float.valueOf(sharedPreferences.getString(SamplesApplication.SETTING_TEXTWIDTH, "0.7")));
} | java | protected void setMaxTextWidthFactor() {
mapView.getModel().displayModel.setMaxTextWidthFactor(Float.valueOf(sharedPreferences.getString(SamplesApplication.SETTING_TEXTWIDTH, "0.7")));
} | [
"protected",
"void",
"setMaxTextWidthFactor",
"(",
")",
"{",
"mapView",
".",
"getModel",
"(",
")",
".",
"displayModel",
".",
"setMaxTextWidthFactor",
"(",
"Float",
".",
"valueOf",
"(",
"sharedPreferences",
".",
"getString",
"(",
"SamplesApplication",
".",
"SETTING... | sets the value for breaking line text in labels. | [
"sets",
"the",
"value",
"for",
"breaking",
"line",
"text",
"in",
"labels",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/SamplesBaseActivity.java#L345-L347 |
28,455 | mapsforge/mapsforge | mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/Utils.java | Utils.enableHome | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void enableHome(Activity a) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// Show the Up button in the action bar.
a.getActionBar().setDisplayHomeAsUpEnabled(true);
}
} | java | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void enableHome(Activity a) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// Show the Up button in the action bar.
a.getActionBar().setDisplayHomeAsUpEnabled(true);
}
} | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"static",
"void",
"enableHome",
"(",
"Activity",
"a",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB"... | Compatibility method.
@param a the current activity | [
"Compatibility",
"method",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/Utils.java#L46-L52 |
28,456 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/layer/labels/TileBasedLabelStore.java | TileBasedLabelStore.storeMapItems | public synchronized void storeMapItems(Tile tile, List<MapElementContainer> mapItems) {
this.put(tile, LayerUtil.collisionFreeOrdered(mapItems));
this.version += 1;
} | java | public synchronized void storeMapItems(Tile tile, List<MapElementContainer> mapItems) {
this.put(tile, LayerUtil.collisionFreeOrdered(mapItems));
this.version += 1;
} | [
"public",
"synchronized",
"void",
"storeMapItems",
"(",
"Tile",
"tile",
",",
"List",
"<",
"MapElementContainer",
">",
"mapItems",
")",
"{",
"this",
".",
"put",
"(",
"tile",
",",
"LayerUtil",
".",
"collisionFreeOrdered",
"(",
"mapItems",
")",
")",
";",
"this"... | Stores a list of MapElements against a tile.
@param tile tile on which the mapItems reside.
@param mapItems the map elements. | [
"Stores",
"a",
"list",
"of",
"MapElements",
"against",
"a",
"tile",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/layer/labels/TileBasedLabelStore.java#L53-L56 |
28,457 | mapsforge/mapsforge | mapsforge-poi/src/main/java/org/mapsforge/poi/storage/DoubleLinkedPoiCategory.java | DoubleLinkedPoiCategory.getGraphVizString | public static String getGraphVizString(DoubleLinkedPoiCategory rootNode) {
StringBuilder sb = new StringBuilder();
Stack<PoiCategory> stack = new Stack<>();
stack.push(rootNode);
DoubleLinkedPoiCategory currentNode;
sb.append("// dot test.dot -Tpng > test.png\r\n");
sb.a... | java | public static String getGraphVizString(DoubleLinkedPoiCategory rootNode) {
StringBuilder sb = new StringBuilder();
Stack<PoiCategory> stack = new Stack<>();
stack.push(rootNode);
DoubleLinkedPoiCategory currentNode;
sb.append("// dot test.dot -Tpng > test.png\r\n");
sb.a... | [
"public",
"static",
"String",
"getGraphVizString",
"(",
"DoubleLinkedPoiCategory",
"rootNode",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Stack",
"<",
"PoiCategory",
">",
"stack",
"=",
"new",
"Stack",
"<>",
"(",
")",
";",
"... | Generates a GraphViz source representation as a tree having the current node as its root.
@param rootNode The resulting graph's root node. (You can use any sub node to get a sub-graph).
@return a GraphViz source representation as a tree having the current node as its root. | [
"Generates",
"a",
"GraphViz",
"source",
"representation",
"as",
"a",
"tree",
"having",
"the",
"current",
"node",
"as",
"its",
"root",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-poi/src/main/java/org/mapsforge/poi/storage/DoubleLinkedPoiCategory.java#L137-L159 |
28,458 | mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/BoundingBox.java | BoundingBox.fromString | public static BoundingBox fromString(String boundingBoxString) {
double[] coordinates = LatLongUtils.parseCoordinateString(boundingBoxString, 4);
return new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]);
} | java | public static BoundingBox fromString(String boundingBoxString) {
double[] coordinates = LatLongUtils.parseCoordinateString(boundingBoxString, 4);
return new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]);
} | [
"public",
"static",
"BoundingBox",
"fromString",
"(",
"String",
"boundingBoxString",
")",
"{",
"double",
"[",
"]",
"coordinates",
"=",
"LatLongUtils",
".",
"parseCoordinateString",
"(",
"boundingBoxString",
",",
"4",
")",
";",
"return",
"new",
"BoundingBox",
"(",
... | Creates a new BoundingBox from a comma-separated string of coordinates in the order minLat, minLon, maxLat,
maxLon. All coordinate values must be in degrees.
@param boundingBoxString the string that describes the BoundingBox.
@return a new BoundingBox with the given coordinates.
@throws IllegalArgumentException if the... | [
"Creates",
"a",
"new",
"BoundingBox",
"from",
"a",
"comma",
"-",
"separated",
"string",
"of",
"coordinates",
"in",
"the",
"order",
"minLat",
"minLon",
"maxLat",
"maxLon",
".",
"All",
"coordinate",
"values",
"must",
"be",
"in",
"degrees",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/BoundingBox.java#L39-L42 |
28,459 | mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/BoundingBox.java | BoundingBox.getPositionRelativeToTile | public Rectangle getPositionRelativeToTile(Tile tile) {
Point upperLeft = MercatorProjection.getPixelRelativeToTile(new LatLong(this.maxLatitude, minLongitude), tile);
Point lowerRight = MercatorProjection.getPixelRelativeToTile(new LatLong(this.minLatitude, maxLongitude), tile);
return new Rect... | java | public Rectangle getPositionRelativeToTile(Tile tile) {
Point upperLeft = MercatorProjection.getPixelRelativeToTile(new LatLong(this.maxLatitude, minLongitude), tile);
Point lowerRight = MercatorProjection.getPixelRelativeToTile(new LatLong(this.minLatitude, maxLongitude), tile);
return new Rect... | [
"public",
"Rectangle",
"getPositionRelativeToTile",
"(",
"Tile",
"tile",
")",
"{",
"Point",
"upperLeft",
"=",
"MercatorProjection",
".",
"getPixelRelativeToTile",
"(",
"new",
"LatLong",
"(",
"this",
".",
"maxLatitude",
",",
"minLongitude",
")",
",",
"tile",
")",
... | Computes the coordinates of this bounding box relative to a tile.
@param tile the tile to compute the relative position for.
@return rectangle giving the relative position. | [
"Computes",
"the",
"coordinates",
"of",
"this",
"bounding",
"box",
"relative",
"to",
"a",
"tile",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/BoundingBox.java#L291-L295 |
28,460 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java | RenderTheme.destroy | public void destroy() {
this.poiMatchingCache.clear();
this.wayMatchingCache.clear();
for (Rule r : this.rulesList) {
r.destroy();
}
} | java | public void destroy() {
this.poiMatchingCache.clear();
this.wayMatchingCache.clear();
for (Rule r : this.rulesList) {
r.destroy();
}
} | [
"public",
"void",
"destroy",
"(",
")",
"{",
"this",
".",
"poiMatchingCache",
".",
"clear",
"(",
")",
";",
"this",
".",
"wayMatchingCache",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Rule",
"r",
":",
"this",
".",
"rulesList",
")",
"{",
"r",
".",
"des... | Must be called when this RenderTheme gets destroyed to clean up and free resources. | [
"Must",
"be",
"called",
"when",
"this",
"RenderTheme",
"gets",
"destroyed",
"to",
"clean",
"up",
"and",
"free",
"resources",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java#L68-L74 |
28,461 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java | RenderTheme.matchClosedWay | public void matchClosedWay(RenderCallback renderCallback, final RenderContext renderContext, PolylineContainer way) {
matchWay(renderCallback, renderContext, Closed.YES, way);
} | java | public void matchClosedWay(RenderCallback renderCallback, final RenderContext renderContext, PolylineContainer way) {
matchWay(renderCallback, renderContext, Closed.YES, way);
} | [
"public",
"void",
"matchClosedWay",
"(",
"RenderCallback",
"renderCallback",
",",
"final",
"RenderContext",
"renderContext",
",",
"PolylineContainer",
"way",
")",
"{",
"matchWay",
"(",
"renderCallback",
",",
"renderContext",
",",
"Closed",
".",
"YES",
",",
"way",
... | Matches a closed way with the given parameters against this RenderTheme.
@param renderCallback the callback implementation which will be executed on each match.
@param renderContext
@param way | [
"Matches",
"a",
"closed",
"way",
"with",
"the",
"given",
"parameters",
"against",
"this",
"RenderTheme",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java#L111-L113 |
28,462 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java | RenderTheme.matchLinearWay | public void matchLinearWay(RenderCallback renderCallback, final RenderContext renderContext, PolylineContainer way) {
matchWay(renderCallback, renderContext, Closed.NO, way);
} | java | public void matchLinearWay(RenderCallback renderCallback, final RenderContext renderContext, PolylineContainer way) {
matchWay(renderCallback, renderContext, Closed.NO, way);
} | [
"public",
"void",
"matchLinearWay",
"(",
"RenderCallback",
"renderCallback",
",",
"final",
"RenderContext",
"renderContext",
",",
"PolylineContainer",
"way",
")",
"{",
"matchWay",
"(",
"renderCallback",
",",
"renderContext",
",",
"Closed",
".",
"NO",
",",
"way",
"... | Matches a linear way with the given parameters against this RenderTheme.
@param renderCallback the callback implementation which will be executed on each match.
@param renderContext
@param way | [
"Matches",
"a",
"linear",
"way",
"with",
"the",
"given",
"parameters",
"against",
"this",
"RenderTheme",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java#L122-L124 |
28,463 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java | RenderTheme.matchNode | public synchronized void matchNode(RenderCallback renderCallback, final RenderContext renderContext, PointOfInterest poi) {
MatchingCacheKey matchingCacheKey = new MatchingCacheKey(poi.tags, renderContext.rendererJob.tile.zoomLevel, Closed.NO);
List<RenderInstruction> matchingList = this.poiMatchingCac... | java | public synchronized void matchNode(RenderCallback renderCallback, final RenderContext renderContext, PointOfInterest poi) {
MatchingCacheKey matchingCacheKey = new MatchingCacheKey(poi.tags, renderContext.rendererJob.tile.zoomLevel, Closed.NO);
List<RenderInstruction> matchingList = this.poiMatchingCac... | [
"public",
"synchronized",
"void",
"matchNode",
"(",
"RenderCallback",
"renderCallback",
",",
"final",
"RenderContext",
"renderContext",
",",
"PointOfInterest",
"poi",
")",
"{",
"MatchingCacheKey",
"matchingCacheKey",
"=",
"new",
"MatchingCacheKey",
"(",
"poi",
".",
"t... | Matches a node with the given parameters against this RenderTheme.
@param renderCallback the callback implementation which will be executed on each match.
@param renderContext
@param poi the point of interest. | [
"Matches",
"a",
"node",
"with",
"the",
"given",
"parameters",
"against",
"this",
"RenderTheme",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java#L133-L152 |
28,464 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java | RenderTheme.scaleStrokeWidth | public synchronized void scaleStrokeWidth(float scaleFactor, byte zoomLevel) {
if (!strokeScales.containsKey(zoomLevel) || scaleFactor != strokeScales.get(zoomLevel)) {
for (int i = 0, n = this.rulesList.size(); i < n; ++i) {
Rule rule = this.rulesList.get(i);
if (rul... | java | public synchronized void scaleStrokeWidth(float scaleFactor, byte zoomLevel) {
if (!strokeScales.containsKey(zoomLevel) || scaleFactor != strokeScales.get(zoomLevel)) {
for (int i = 0, n = this.rulesList.size(); i < n; ++i) {
Rule rule = this.rulesList.get(i);
if (rul... | [
"public",
"synchronized",
"void",
"scaleStrokeWidth",
"(",
"float",
"scaleFactor",
",",
"byte",
"zoomLevel",
")",
"{",
"if",
"(",
"!",
"strokeScales",
".",
"containsKey",
"(",
"zoomLevel",
")",
"||",
"scaleFactor",
"!=",
"strokeScales",
".",
"get",
"(",
"zoomL... | Scales the stroke width of this RenderTheme by the given factor for a given zoom level
@param scaleFactor the factor by which the stroke width should be scaled.
@param zoomLevel the zoom level to which this is applied. | [
"Scales",
"the",
"stroke",
"width",
"of",
"this",
"RenderTheme",
"by",
"the",
"given",
"factor",
"for",
"a",
"given",
"zoom",
"level"
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java#L160-L170 |
28,465 | mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java | RenderTheme.scaleTextSize | public synchronized void scaleTextSize(float scaleFactor, byte zoomLevel) {
if (!textScales.containsKey(zoomLevel) || scaleFactor != textScales.get(zoomLevel)) {
for (int i = 0, n = this.rulesList.size(); i < n; ++i) {
Rule rule = this.rulesList.get(i);
if (rule.zoomM... | java | public synchronized void scaleTextSize(float scaleFactor, byte zoomLevel) {
if (!textScales.containsKey(zoomLevel) || scaleFactor != textScales.get(zoomLevel)) {
for (int i = 0, n = this.rulesList.size(); i < n; ++i) {
Rule rule = this.rulesList.get(i);
if (rule.zoomM... | [
"public",
"synchronized",
"void",
"scaleTextSize",
"(",
"float",
"scaleFactor",
",",
"byte",
"zoomLevel",
")",
"{",
"if",
"(",
"!",
"textScales",
".",
"containsKey",
"(",
"zoomLevel",
")",
"||",
"scaleFactor",
"!=",
"textScales",
".",
"get",
"(",
"zoomLevel",
... | Scales the text size of this RenderTheme by the given factor for a given zoom level.
@param scaleFactor the factor by which the text size should be scaled.
@param zoomLevel the zoom level to which this is applied. | [
"Scales",
"the",
"text",
"size",
"of",
"this",
"RenderTheme",
"by",
"the",
"given",
"factor",
"for",
"a",
"given",
"zoom",
"level",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/rendertheme/rule/RenderTheme.java#L178-L188 |
28,466 | mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java | MapViewerTemplate.createMapViews | protected void createMapViews() {
mapView = getMapView();
mapView.getModel().init(this.preferencesFacade);
mapView.setClickable(true);
mapView.getMapScaleBar().setVisible(true);
mapView.setBuiltInZoomControls(hasZoomControls());
mapView.getMapZoomControls().setAutoHide(is... | java | protected void createMapViews() {
mapView = getMapView();
mapView.getModel().init(this.preferencesFacade);
mapView.setClickable(true);
mapView.getMapScaleBar().setVisible(true);
mapView.setBuiltInZoomControls(hasZoomControls());
mapView.getMapZoomControls().setAutoHide(is... | [
"protected",
"void",
"createMapViews",
"(",
")",
"{",
"mapView",
"=",
"getMapView",
"(",
")",
";",
"mapView",
".",
"getModel",
"(",
")",
".",
"init",
"(",
"this",
".",
"preferencesFacade",
")",
";",
"mapView",
".",
"setClickable",
"(",
"true",
")",
";",
... | Template method to create the map views. | [
"Template",
"method",
"to",
"create",
"the",
"map",
"views",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java#L133-L142 |
28,467 | mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java | MapViewerTemplate.getInitialPosition | protected MapPosition getInitialPosition() {
MapDataStore mapFile = getMapFile();
if (mapFile.startPosition() != null) {
Byte startZoomLevel = mapFile.startZoomLevel();
if (startZoomLevel == null) {
// it is actually possible to have no start zoom level in the fi... | java | protected MapPosition getInitialPosition() {
MapDataStore mapFile = getMapFile();
if (mapFile.startPosition() != null) {
Byte startZoomLevel = mapFile.startZoomLevel();
if (startZoomLevel == null) {
// it is actually possible to have no start zoom level in the fi... | [
"protected",
"MapPosition",
"getInitialPosition",
"(",
")",
"{",
"MapDataStore",
"mapFile",
"=",
"getMapFile",
"(",
")",
";",
"if",
"(",
"mapFile",
".",
"startPosition",
"(",
")",
"!=",
"null",
")",
"{",
"Byte",
"startZoomLevel",
"=",
"mapFile",
".",
"startZ... | Extracts the initial position from the map file, falling back onto the value supplied
by getDefaultInitialPosition if there is no initial position coded into the map file.
You will only need to override this method if you do not want the initial position extracted
from the map file.
@return the initial position encode... | [
"Extracts",
"the",
"initial",
"position",
"from",
"the",
"map",
"file",
"falling",
"back",
"onto",
"the",
"value",
"supplied",
"by",
"getDefaultInitialPosition",
"if",
"there",
"is",
"no",
"initial",
"position",
"coded",
"into",
"the",
"map",
"file",
".",
"You... | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java#L171-L184 |
28,468 | mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java | MapViewerTemplate.initializePosition | protected IMapViewPosition initializePosition(IMapViewPosition mvp) {
LatLong center = mvp.getCenter();
if (center.equals(new LatLong(0, 0))) {
mvp.setMapPosition(this.getInitialPosition());
}
mvp.setZoomLevelMax(getZoomLevelMax());
mvp.setZoomLevelMin(getZoomLevelMi... | java | protected IMapViewPosition initializePosition(IMapViewPosition mvp) {
LatLong center = mvp.getCenter();
if (center.equals(new LatLong(0, 0))) {
mvp.setMapPosition(this.getInitialPosition());
}
mvp.setZoomLevelMax(getZoomLevelMax());
mvp.setZoomLevelMin(getZoomLevelMi... | [
"protected",
"IMapViewPosition",
"initializePosition",
"(",
"IMapViewPosition",
"mvp",
")",
"{",
"LatLong",
"center",
"=",
"mvp",
".",
"getCenter",
"(",
")",
";",
"if",
"(",
"center",
".",
"equals",
"(",
"new",
"LatLong",
"(",
"0",
",",
"0",
")",
")",
")... | initializes the map view position.
@param mvp the map view position to be set
@return the mapviewposition set | [
"initializes",
"the",
"map",
"view",
"position",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java#L252-L261 |
28,469 | mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java | MapViewerTemplate.onCreate | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
createSharedPreferences();
createMapViews();
createTileCaches();
checkPermissionsAndCreateLayersAndControls();
} | java | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
createSharedPreferences();
createMapViews();
createTileCaches();
checkPermissionsAndCreateLayersAndControls();
} | [
"@",
"Override",
"protected",
"void",
"onCreate",
"(",
"Bundle",
"savedInstanceState",
")",
"{",
"super",
".",
"onCreate",
"(",
"savedInstanceState",
")",
";",
"createSharedPreferences",
"(",
")",
";",
"createMapViews",
"(",
")",
";",
"createTileCaches",
"(",
")... | Android Activity life cycle method.
@param savedInstanceState | [
"Android",
"Activity",
"life",
"cycle",
"method",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/MapViewerTemplate.java#L276-L283 |
28,470 | mapsforge/mapsforge | mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/group/GroupMarker.java | GroupMarker.onTap | @Override
public boolean onTap(LatLong tapLatLong, Point layerXY, Point tapXY) {
this.expanded = !this.expanded;
double centerX = layerXY.x + this.getHorizontalOffset();
double centerY = layerXY.y + this.getVerticalOffset();
double radiusX = this.getBitmap().getWidth() / 2;
... | java | @Override
public boolean onTap(LatLong tapLatLong, Point layerXY, Point tapXY) {
this.expanded = !this.expanded;
double centerX = layerXY.x + this.getHorizontalOffset();
double centerY = layerXY.y + this.getVerticalOffset();
double radiusX = this.getBitmap().getWidth() / 2;
... | [
"@",
"Override",
"public",
"boolean",
"onTap",
"(",
"LatLong",
"tapLatLong",
",",
"Point",
"layerXY",
",",
"Point",
"tapXY",
")",
"{",
"this",
".",
"expanded",
"=",
"!",
"this",
".",
"expanded",
";",
"double",
"centerX",
"=",
"layerXY",
".",
"x",
"+",
... | Click on group marker shows all children on a spiral. | [
"Click",
"on",
"group",
"marker",
"shows",
"all",
"children",
"on",
"a",
"spiral",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/group/GroupMarker.java#L112-L151 |
28,471 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnectionPool.java | SQLiteConnectionPool.shouldYieldConnection | public boolean shouldYieldConnection(SQLiteConnection connection, int connectionFlags) {
synchronized (mLock) {
if (!mAcquiredConnections.containsKey(connection)) {
throw new IllegalStateException("Cannot perform this operation "
+ "because the specified conne... | java | public boolean shouldYieldConnection(SQLiteConnection connection, int connectionFlags) {
synchronized (mLock) {
if (!mAcquiredConnections.containsKey(connection)) {
throw new IllegalStateException("Cannot perform this operation "
+ "because the specified conne... | [
"public",
"boolean",
"shouldYieldConnection",
"(",
"SQLiteConnection",
"connection",
",",
"int",
"connectionFlags",
")",
"{",
"synchronized",
"(",
"mLock",
")",
"{",
"if",
"(",
"!",
"mAcquiredConnections",
".",
"containsKey",
"(",
"connection",
")",
")",
"{",
"t... | Returns true if the session should yield the connection due to
contention over available database connections.
@param connection The connection owned by the session.
@param connectionFlags The connection request flags.
@return True if the session should yield its connection.
@throws IllegalStateException if the conne... | [
"Returns",
"true",
"if",
"the",
"session",
"should",
"yield",
"the",
"connection",
"due",
"to",
"contention",
"over",
"available",
"database",
"connections",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnectionPool.java#L424-L439 |
28,472 | mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnectionPool.java | SQLiteConnectionPool.dump | public void dump(Printer printer, boolean verbose) {
Printer indentedPrinter = printer;
synchronized (mLock) {
printer.println("Connection pool for " + mConfiguration.path + ":");
printer.println(" Open: " + mIsOpen);
printer.println(" Max connections: " + mMaxConne... | java | public void dump(Printer printer, boolean verbose) {
Printer indentedPrinter = printer;
synchronized (mLock) {
printer.println("Connection pool for " + mConfiguration.path + ":");
printer.println(" Open: " + mIsOpen);
printer.println(" Max connections: " + mMaxConne... | [
"public",
"void",
"dump",
"(",
"Printer",
"printer",
",",
"boolean",
"verbose",
")",
"{",
"Printer",
"indentedPrinter",
"=",
"printer",
";",
"synchronized",
"(",
"mLock",
")",
"{",
"printer",
".",
"println",
"(",
"\"Connection pool for \"",
"+",
"mConfiguration"... | Dumps debugging information about this connection pool.
@param printer The printer to receive the dump, not null.
@param verbose True to dump more verbose information. | [
"Dumps",
"debugging",
"information",
"about",
"this",
"connection",
"pool",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteConnectionPool.java#L1015-L1067 |
28,473 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/HandshakeReader.java | HandshakeReader.readStatusLine | private StatusLine readStatusLine(WebSocketInputStream input) throws WebSocketException
{
String line;
try
{
// Read the status line.
line = input.readLine();
}
catch (IOException e)
{
// Failed to read an opening handshake respons... | java | private StatusLine readStatusLine(WebSocketInputStream input) throws WebSocketException
{
String line;
try
{
// Read the status line.
line = input.readLine();
}
catch (IOException e)
{
// Failed to read an opening handshake respons... | [
"private",
"StatusLine",
"readStatusLine",
"(",
"WebSocketInputStream",
"input",
")",
"throws",
"WebSocketException",
"{",
"String",
"line",
";",
"try",
"{",
"// Read the status line.",
"line",
"=",
"input",
".",
"readLine",
"(",
")",
";",
"}",
"catch",
"(",
"IO... | Read a status line from an HTTP server. | [
"Read",
"a",
"status",
"line",
"from",
"an",
"HTTP",
"server",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/HandshakeReader.java#L79-L116 |
28,474 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/HandshakeReader.java | HandshakeReader.readBody | private byte[] readBody(Map<String, List<String>> headers, WebSocketInputStream input)
{
// Get the value of "Content-Length" header.
int length = getContentLength(headers);
if (length <= 0)
{
// Response body is not available.
return null;
}
... | java | private byte[] readBody(Map<String, List<String>> headers, WebSocketInputStream input)
{
// Get the value of "Content-Length" header.
int length = getContentLength(headers);
if (length <= 0)
{
// Response body is not available.
return null;
}
... | [
"private",
"byte",
"[",
"]",
"readBody",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
",",
"WebSocketInputStream",
"input",
")",
"{",
"// Get the value of \"Content-Length\" header.",
"int",
"length",
"=",
"getContentLength",
"(",
... | Read the response body | [
"Read",
"the",
"response",
"body"
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/HandshakeReader.java#L242-L269 |
28,475 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/HandshakeReader.java | HandshakeReader.getContentLength | private int getContentLength(Map<String, List<String>> headers)
{
try
{
return Integer.parseInt(headers.get("Content-Length").get(0));
}
catch (Exception e)
{
return -1;
}
} | java | private int getContentLength(Map<String, List<String>> headers)
{
try
{
return Integer.parseInt(headers.get("Content-Length").get(0));
}
catch (Exception e)
{
return -1;
}
} | [
"private",
"int",
"getContentLength",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"headers",
".",
"get",
"(",
"\"Content-Length\"",
")",
".",
"get",
"(",
"... | Get the value of "Content-Length" header. | [
"Get",
"the",
"value",
"of",
"Content",
"-",
"Length",
"header",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/HandshakeReader.java#L275-L285 |
28,476 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocketExtension.java | WebSocketExtension.setParameter | public WebSocketExtension setParameter(String key, String value)
{
// Check the validity of the key.
if (Token.isValid(key) == false)
{
// The key is not a valid token.
throw new IllegalArgumentException("'key' is not a valid token.");
}
// If the val... | java | public WebSocketExtension setParameter(String key, String value)
{
// Check the validity of the key.
if (Token.isValid(key) == false)
{
// The key is not a valid token.
throw new IllegalArgumentException("'key' is not a valid token.");
}
// If the val... | [
"public",
"WebSocketExtension",
"setParameter",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"// Check the validity of the key.",
"if",
"(",
"Token",
".",
"isValid",
"(",
"key",
")",
"==",
"false",
")",
"{",
"// The key is not a valid token.",
"throw",
... | Set a value to the specified parameter.
@param key
The name of the parameter.
@param value
The value of the parameter. If not {@code null}, it must be
a valid token. Note that <a href="http://tools.ietf.org/html/rfc6455"
>RFC 6455</a> says "<i>When using the quoted-string syntax
variant, the value after quoted-string... | [
"Set",
"a",
"value",
"to",
"the",
"specified",
"parameter",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocketExtension.java#L167-L190 |
28,477 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java | WebSocketFrame.setPayload | public WebSocketFrame setPayload(byte[] payload)
{
if (payload != null && payload.length == 0)
{
payload = null;
}
mPayload = payload;
return this;
} | java | public WebSocketFrame setPayload(byte[] payload)
{
if (payload != null && payload.length == 0)
{
payload = null;
}
mPayload = payload;
return this;
} | [
"public",
"WebSocketFrame",
"setPayload",
"(",
"byte",
"[",
"]",
"payload",
")",
"{",
"if",
"(",
"payload",
"!=",
"null",
"&&",
"payload",
".",
"length",
"==",
"0",
")",
"{",
"payload",
"=",
"null",
";",
"}",
"mPayload",
"=",
"payload",
";",
"return",
... | Set the unmasked payload.
<p>
Note that the payload length of a <a href="http://tools.ietf.org/html/rfc6455#section-5.5"
>control frame</a> must be 125 bytes or less.
</p>
@param payload
The unmasked payload. {@code null} is accepted.
An empty byte array is treated in the same way
as {@code null}.
@return
{@code thi... | [
"Set",
"the",
"unmasked",
"payload",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java#L488-L498 |
28,478 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java | WebSocketFrame.setPayload | public WebSocketFrame setPayload(String payload)
{
if (payload == null || payload.length() == 0)
{
return setPayload((byte[])null);
}
return setPayload(Misc.getBytesUTF8(payload));
} | java | public WebSocketFrame setPayload(String payload)
{
if (payload == null || payload.length() == 0)
{
return setPayload((byte[])null);
}
return setPayload(Misc.getBytesUTF8(payload));
} | [
"public",
"WebSocketFrame",
"setPayload",
"(",
"String",
"payload",
")",
"{",
"if",
"(",
"payload",
"==",
"null",
"||",
"payload",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"setPayload",
"(",
"(",
"byte",
"[",
"]",
")",
"null",
")",
";"... | Set the payload. The given string is converted to a byte array
in UTF-8 encoding.
<p>
Note that the payload length of a <a href="http://tools.ietf.org/html/rfc6455#section-5.5"
>control frame</a> must be 125 bytes or less.
</p>
@param payload
The unmasked payload. {@code null} is accepted.
An empty string is treated ... | [
"Set",
"the",
"payload",
".",
"The",
"given",
"string",
"is",
"converted",
"to",
"a",
"byte",
"array",
"in",
"UTF",
"-",
"8",
"encoding",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java#L518-L526 |
28,479 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java | WebSocketFrame.setCloseFramePayload | public WebSocketFrame setCloseFramePayload(int closeCode, String reason)
{
// Convert the close code to a 2-byte unsigned integer
// in network byte order.
byte[] encodedCloseCode = new byte[] {
(byte)((closeCode >> 8) & 0xFF),
(byte)((closeCode ) & 0xFF)
... | java | public WebSocketFrame setCloseFramePayload(int closeCode, String reason)
{
// Convert the close code to a 2-byte unsigned integer
// in network byte order.
byte[] encodedCloseCode = new byte[] {
(byte)((closeCode >> 8) & 0xFF),
(byte)((closeCode ) & 0xFF)
... | [
"public",
"WebSocketFrame",
"setCloseFramePayload",
"(",
"int",
"closeCode",
",",
"String",
"reason",
")",
"{",
"// Convert the close code to a 2-byte unsigned integer",
"// in network byte order.",
"byte",
"[",
"]",
"encodedCloseCode",
"=",
"new",
"byte",
"[",
"]",
"{",
... | Set the payload that conforms to the payload format of close frames.
<p>
The given parameters are encoded based on the rules described in
"<a href="http://tools.ietf.org/html/rfc6455#section-5.5.1"
>5.5.1. Close</a>" of RFC 6455.
</p>
<p>
Note that the reason should not be too long because the payload
length of a <a ... | [
"Set",
"the",
"payload",
"that",
"conforms",
"to",
"the",
"payload",
"format",
"of",
"close",
"frames",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java#L559-L585 |
28,480 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java | WebSocketFrame.getCloseCode | public int getCloseCode()
{
if (mPayload == null || mPayload.length < 2)
{
return WebSocketCloseCode.NONE;
}
// A close code is encoded in network byte order.
int closeCode = (((mPayload[0] & 0xFF) << 8) | (mPayload[1] & 0xFF));
return closeCode;
} | java | public int getCloseCode()
{
if (mPayload == null || mPayload.length < 2)
{
return WebSocketCloseCode.NONE;
}
// A close code is encoded in network byte order.
int closeCode = (((mPayload[0] & 0xFF) << 8) | (mPayload[1] & 0xFF));
return closeCode;
} | [
"public",
"int",
"getCloseCode",
"(",
")",
"{",
"if",
"(",
"mPayload",
"==",
"null",
"||",
"mPayload",
".",
"length",
"<",
"2",
")",
"{",
"return",
"WebSocketCloseCode",
".",
"NONE",
";",
"}",
"// A close code is encoded in network byte order.",
"int",
"closeCod... | Parse the first two bytes of the payload as a close code.
<p>
If any payload is not set or the length of the payload is less than 2,
this method returns 1005 ({@link WebSocketCloseCode#NONE}).
</p>
<p>
The value returned from this method is meaningless if this frame
is not a close frame.
</p>
@return
The close code.... | [
"Parse",
"the",
"first",
"two",
"bytes",
"of",
"the",
"payload",
"as",
"a",
"close",
"code",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java#L609-L620 |
28,481 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java | WebSocketFrame.getCloseReason | public String getCloseReason()
{
if (mPayload == null || mPayload.length < 3)
{
return null;
}
return Misc.toStringUTF8(mPayload, 2, mPayload.length - 2);
} | java | public String getCloseReason()
{
if (mPayload == null || mPayload.length < 3)
{
return null;
}
return Misc.toStringUTF8(mPayload, 2, mPayload.length - 2);
} | [
"public",
"String",
"getCloseReason",
"(",
")",
"{",
"if",
"(",
"mPayload",
"==",
"null",
"||",
"mPayload",
".",
"length",
"<",
"3",
")",
"{",
"return",
"null",
";",
"}",
"return",
"Misc",
".",
"toStringUTF8",
"(",
"mPayload",
",",
"2",
",",
"mPayload"... | Parse the third and subsequent bytes of the payload as a close reason.
<p>
If any payload is not set or the length of the payload is less than 3,
this method returns {@code null}.
</p>
<p>
The value returned from this method is meaningless if this frame
is not a close frame.
</p>
@return
The close reason. | [
"Parse",
"the",
"third",
"and",
"subsequent",
"bytes",
"of",
"the",
"payload",
"as",
"a",
"close",
"reason",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java#L639-L647 |
28,482 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java | WebSocketFrame.createTextFrame | public static WebSocketFrame createTextFrame(String payload)
{
return new WebSocketFrame()
.setFin(true)
.setOpcode(TEXT)
.setPayload(payload);
} | java | public static WebSocketFrame createTextFrame(String payload)
{
return new WebSocketFrame()
.setFin(true)
.setOpcode(TEXT)
.setPayload(payload);
} | [
"public",
"static",
"WebSocketFrame",
"createTextFrame",
"(",
"String",
"payload",
")",
"{",
"return",
"new",
"WebSocketFrame",
"(",
")",
".",
"setFin",
"(",
"true",
")",
".",
"setOpcode",
"(",
"TEXT",
")",
".",
"setPayload",
"(",
"payload",
")",
";",
"}"
... | Create a text frame.
@param payload
The payload for a newly created frame.
@return
A WebSocket frame whose FIN bit is true, opcode is
{@link WebSocketOpcode#TEXT TEXT} and payload is
the given one. | [
"Create",
"a",
"text",
"frame",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java#L824-L830 |
28,483 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java | WebSocketFrame.createBinaryFrame | public static WebSocketFrame createBinaryFrame(byte[] payload)
{
return new WebSocketFrame()
.setFin(true)
.setOpcode(BINARY)
.setPayload(payload);
} | java | public static WebSocketFrame createBinaryFrame(byte[] payload)
{
return new WebSocketFrame()
.setFin(true)
.setOpcode(BINARY)
.setPayload(payload);
} | [
"public",
"static",
"WebSocketFrame",
"createBinaryFrame",
"(",
"byte",
"[",
"]",
"payload",
")",
"{",
"return",
"new",
"WebSocketFrame",
"(",
")",
".",
"setFin",
"(",
"true",
")",
".",
"setOpcode",
"(",
"BINARY",
")",
".",
"setPayload",
"(",
"payload",
")... | Create a binary frame.
@param payload
The payload for a newly created frame.
@return
A WebSocket frame whose FIN bit is true, opcode is
{@link WebSocketOpcode#BINARY BINARY} and payload is
the given one. | [
"Create",
"a",
"binary",
"frame",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocketFrame.java#L844-L850 |
28,484 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ByteArray.java | ByteArray.get | public byte get(int index) throws IndexOutOfBoundsException
{
if (index < 0 || mLength <= index)
{
// Bad index.
throw new IndexOutOfBoundsException(
String.format("Bad index: index=%d, length=%d", index, mLength));
}
return mBuffer.get(in... | java | public byte get(int index) throws IndexOutOfBoundsException
{
if (index < 0 || mLength <= index)
{
// Bad index.
throw new IndexOutOfBoundsException(
String.format("Bad index: index=%d, length=%d", index, mLength));
}
return mBuffer.get(in... | [
"public",
"byte",
"get",
"(",
"int",
"index",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"mLength",
"<=",
"index",
")",
"{",
"// Bad index.",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"String",
".",
"format",
... | Get a byte at the index. | [
"Get",
"a",
"byte",
"at",
"the",
"index",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ByteArray.java#L75-L85 |
28,485 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ByteArray.java | ByteArray.expandBuffer | private void expandBuffer(int newBufferSize)
{
// Allocate a new buffer.
ByteBuffer newBuffer = ByteBuffer.allocate(newBufferSize);
// Copy the content of the current buffer to the new buffer.
int oldPosition = mBuffer.position();
mBuffer.position(0);
newBuffer.put(m... | java | private void expandBuffer(int newBufferSize)
{
// Allocate a new buffer.
ByteBuffer newBuffer = ByteBuffer.allocate(newBufferSize);
// Copy the content of the current buffer to the new buffer.
int oldPosition = mBuffer.position();
mBuffer.position(0);
newBuffer.put(m... | [
"private",
"void",
"expandBuffer",
"(",
"int",
"newBufferSize",
")",
"{",
"// Allocate a new buffer.",
"ByteBuffer",
"newBuffer",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"newBufferSize",
")",
";",
"// Copy the content of the current buffer to the new buffer.",
"int",
"oldP... | Expand the size of the internal buffer. | [
"Expand",
"the",
"size",
"of",
"the",
"internal",
"buffer",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ByteArray.java#L91-L104 |
28,486 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ByteArray.java | ByteArray.put | public void put(int data)
{
// If the buffer is small.
if (mBuffer.capacity() < (mLength + 1))
{
expandBuffer(mLength + ADDITIONAL_BUFFER_SIZE);
}
mBuffer.put((byte)data);
++mLength;
} | java | public void put(int data)
{
// If the buffer is small.
if (mBuffer.capacity() < (mLength + 1))
{
expandBuffer(mLength + ADDITIONAL_BUFFER_SIZE);
}
mBuffer.put((byte)data);
++mLength;
} | [
"public",
"void",
"put",
"(",
"int",
"data",
")",
"{",
"// If the buffer is small.",
"if",
"(",
"mBuffer",
".",
"capacity",
"(",
")",
"<",
"(",
"mLength",
"+",
"1",
")",
")",
"{",
"expandBuffer",
"(",
"mLength",
"+",
"ADDITIONAL_BUFFER_SIZE",
")",
";",
"... | Add a byte at the current position. | [
"Add",
"a",
"byte",
"at",
"the",
"current",
"position",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ByteArray.java#L110-L120 |
28,487 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ReadingThread.java | ReadingThread.verifyReservedBit1 | private void verifyReservedBit1(WebSocketFrame frame) throws WebSocketException
{
// If a per-message compression extension has been agreed.
if (mPMCE != null)
{
// Verify the RSV1 bit using the rule described in RFC 7692.
boolean verified = verifyReservedBit1ForPMCE(... | java | private void verifyReservedBit1(WebSocketFrame frame) throws WebSocketException
{
// If a per-message compression extension has been agreed.
if (mPMCE != null)
{
// Verify the RSV1 bit using the rule described in RFC 7692.
boolean verified = verifyReservedBit1ForPMCE(... | [
"private",
"void",
"verifyReservedBit1",
"(",
"WebSocketFrame",
"frame",
")",
"throws",
"WebSocketException",
"{",
"// If a per-message compression extension has been agreed.",
"if",
"(",
"mPMCE",
"!=",
"null",
")",
"{",
"// Verify the RSV1 bit using the rule described in RFC 769... | Verify the RSV1 bit of a frame. | [
"Verify",
"the",
"RSV1",
"bit",
"of",
"a",
"frame",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ReadingThread.java#L460-L483 |
28,488 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ReadingThread.java | ReadingThread.verifyReservedBit2 | private void verifyReservedBit2(WebSocketFrame frame) throws WebSocketException
{
if (frame.getRsv2() == false)
{
// No problem.
return;
}
// The RSV2 bit of a frame is set unexpectedly.
throw new WebSocketException(
WebSocketError.UNEXPEC... | java | private void verifyReservedBit2(WebSocketFrame frame) throws WebSocketException
{
if (frame.getRsv2() == false)
{
// No problem.
return;
}
// The RSV2 bit of a frame is set unexpectedly.
throw new WebSocketException(
WebSocketError.UNEXPEC... | [
"private",
"void",
"verifyReservedBit2",
"(",
"WebSocketFrame",
"frame",
")",
"throws",
"WebSocketException",
"{",
"if",
"(",
"frame",
".",
"getRsv2",
"(",
")",
"==",
"false",
")",
"{",
"// No problem.",
"return",
";",
"}",
"// The RSV2 bit of a frame is set unexpec... | Verify the RSV2 bit of a frame. | [
"Verify",
"the",
"RSV2",
"bit",
"of",
"a",
"frame",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ReadingThread.java#L509-L520 |
28,489 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ReadingThread.java | ReadingThread.verifyReservedBit3 | private void verifyReservedBit3(WebSocketFrame frame) throws WebSocketException
{
if (frame.getRsv3() == false)
{
// No problem.
return;
}
// The RSV3 bit of a frame is set unexpectedly.
throw new WebSocketException(
WebSocketError.UNEXPEC... | java | private void verifyReservedBit3(WebSocketFrame frame) throws WebSocketException
{
if (frame.getRsv3() == false)
{
// No problem.
return;
}
// The RSV3 bit of a frame is set unexpectedly.
throw new WebSocketException(
WebSocketError.UNEXPEC... | [
"private",
"void",
"verifyReservedBit3",
"(",
"WebSocketFrame",
"frame",
")",
"throws",
"WebSocketException",
"{",
"if",
"(",
"frame",
".",
"getRsv3",
"(",
")",
"==",
"false",
")",
"{",
"// No problem.",
"return",
";",
"}",
"// The RSV3 bit of a frame is set unexpec... | Verify the RSV3 bit of a frame. | [
"Verify",
"the",
"RSV3",
"bit",
"of",
"a",
"frame",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ReadingThread.java#L526-L537 |
28,490 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ReadingThread.java | ReadingThread.verifyFrameOpcode | private void verifyFrameOpcode(WebSocketFrame frame) throws WebSocketException
{
switch (frame.getOpcode())
{
case CONTINUATION:
case TEXT:
case BINARY:
case CLOSE:
case PING:
case PONG:
// Known opcode
... | java | private void verifyFrameOpcode(WebSocketFrame frame) throws WebSocketException
{
switch (frame.getOpcode())
{
case CONTINUATION:
case TEXT:
case BINARY:
case CLOSE:
case PING:
case PONG:
// Known opcode
... | [
"private",
"void",
"verifyFrameOpcode",
"(",
"WebSocketFrame",
"frame",
")",
"throws",
"WebSocketException",
"{",
"switch",
"(",
"frame",
".",
"getOpcode",
"(",
")",
")",
"{",
"case",
"CONTINUATION",
":",
"case",
"TEXT",
":",
"case",
"BINARY",
":",
"case",
"... | Ensure that the opcode of the give frame is a known one.
<blockquote>
<p>From RFC 6455, 5.2. Base Framing Protocol</p>
<p><i>
If an unknown opcode is received, the receiving endpoint MUST
Fail the WebSocket Connection.
</i></p>
</blockquote> | [
"Ensure",
"that",
"the",
"opcode",
"of",
"the",
"give",
"frame",
"is",
"a",
"known",
"one",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ReadingThread.java#L551-L579 |
28,491 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ProxySettings.java | ProxySettings.reset | public ProxySettings reset()
{
mSecure = false;
mHost = null;
mPort = -1;
mId = null;
mPassword = null;
mHeaders.clear();
mServerNames = null;
return this;
} | java | public ProxySettings reset()
{
mSecure = false;
mHost = null;
mPort = -1;
mId = null;
mPassword = null;
mHeaders.clear();
mServerNames = null;
return this;
} | [
"public",
"ProxySettings",
"reset",
"(",
")",
"{",
"mSecure",
"=",
"false",
";",
"mHost",
"=",
"null",
";",
"mPort",
"=",
"-",
"1",
";",
"mId",
"=",
"null",
";",
"mPassword",
"=",
"null",
";",
"mHeaders",
".",
"clear",
"(",
")",
";",
"mServerNames",
... | Reset the proxy settings. To be concrete, parameter values are
set as shown below.
<blockquote>
<table border="1" cellpadding="5" style="border-collapse: collapse;">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Secure</td>
<td>{@code false}</td>
<td>Use TLS to connect ... | [
"Reset",
"the",
"proxy",
"settings",
".",
"To",
"be",
"concrete",
"parameter",
"values",
"are",
"set",
"as",
"shown",
"below",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ProxySettings.java#L169-L180 |
28,492 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ProxySettings.java | ProxySettings.setServer | public ProxySettings setServer(URI uri)
{
if (uri == null)
{
return this;
}
String scheme = uri.getScheme();
String userInfo = uri.getUserInfo();
String host = uri.getHost();
int port = uri.getPort();
return setServer(scheme,... | java | public ProxySettings setServer(URI uri)
{
if (uri == null)
{
return this;
}
String scheme = uri.getScheme();
String userInfo = uri.getUserInfo();
String host = uri.getHost();
int port = uri.getPort();
return setServer(scheme,... | [
"public",
"ProxySettings",
"setServer",
"(",
"URI",
"uri",
")",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"String",
"scheme",
"=",
"uri",
".",
"getScheme",
"(",
")",
";",
"String",
"userInfo",
"=",
"uri",
".",
"getUse... | Set the proxy server by a URI. The parameters are updated as
described below.
<blockquote>
<dl>
<dt>Secure</dt>
<dd><p>
If the URI contains the scheme part and its value is
either {@code "http"} or {@code "https"} (case-insensitive),
the {@code secure} parameter is updated to {@code false}
or to {@code true} according... | [
"Set",
"the",
"proxy",
"server",
"by",
"a",
"URI",
".",
"The",
"parameters",
"are",
"updated",
"as",
"described",
"below",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ProxySettings.java#L486-L499 |
28,493 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/ProxySettings.java | ProxySettings.addHeader | public ProxySettings addHeader(String name, String value)
{
if (name == null || name.length() == 0)
{
return this;
}
List<String> list = mHeaders.get(name);
if (list == null)
{
list = new ArrayList<String>();
mHeaders.put(name, li... | java | public ProxySettings addHeader(String name, String value)
{
if (name == null || name.length() == 0)
{
return this;
}
List<String> list = mHeaders.get(name);
if (list == null)
{
list = new ArrayList<String>();
mHeaders.put(name, li... | [
"public",
"ProxySettings",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"List",
"<",
"String",
">",
"l... | Add an additional HTTP header passed to the proxy server.
@param name
The name of an HTTP header (case-insensitive).
If {@code null} or an empty string is given,
nothing is added.
@param value
The value of the HTTP header.
@return
{@code this} object. | [
"Add",
"an",
"additional",
"HTTP",
"header",
"passed",
"to",
"the",
"proxy",
"server",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/ProxySettings.java#L591-L609 |
28,494 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/SocketConnector.java | SocketConnector.handshake | private void handshake() throws WebSocketException
{
try
{
// Perform handshake with the proxy server.
mProxyHandshaker.perform();
}
catch (IOException e)
{
// Handshake with the proxy server failed.
String message = String.form... | java | private void handshake() throws WebSocketException
{
try
{
// Perform handshake with the proxy server.
mProxyHandshaker.perform();
}
catch (IOException e)
{
// Handshake with the proxy server failed.
String message = String.form... | [
"private",
"void",
"handshake",
"(",
")",
"throws",
"WebSocketException",
"{",
"try",
"{",
"// Perform handshake with the proxy server.",
"mProxyHandshaker",
".",
"perform",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"// Handshake with the proxy s... | Perform proxy handshake and optionally SSL handshake. | [
"Perform",
"proxy",
"handshake",
"and",
"optionally",
"SSL",
"handshake",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/SocketConnector.java#L178-L237 |
28,495 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.addHeader | public WebSocket addHeader(String name, String value)
{
mHandshakeBuilder.addHeader(name, value);
return this;
} | java | public WebSocket addHeader(String name, String value)
{
mHandshakeBuilder.addHeader(name, value);
return this;
} | [
"public",
"WebSocket",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"mHandshakeBuilder",
".",
"addHeader",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add a pair of extra HTTP header.
@param name
An HTTP header name. When {@code null} or an empty
string is given, no header is added.
@param value
The value of the HTTP header.
@return
{@code this} object. | [
"Add",
"a",
"pair",
"of",
"extra",
"HTTP",
"header",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L1467-L1472 |
28,496 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.setUserInfo | public WebSocket setUserInfo(String id, String password)
{
mHandshakeBuilder.setUserInfo(id, password);
return this;
} | java | public WebSocket setUserInfo(String id, String password)
{
mHandshakeBuilder.setUserInfo(id, password);
return this;
} | [
"public",
"WebSocket",
"setUserInfo",
"(",
"String",
"id",
",",
"String",
"password",
")",
"{",
"mHandshakeBuilder",
".",
"setUserInfo",
"(",
"id",
",",
"password",
")",
";",
"return",
"this",
";",
"}"
] | Set the credentials to connect to the WebSocket endpoint.
@param id
The ID.
@param password
The password.
@return
{@code this} object. | [
"Set",
"the",
"credentials",
"to",
"connect",
"to",
"the",
"WebSocket",
"endpoint",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L1540-L1545 |
28,497 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.flush | public WebSocket flush()
{
synchronized (mStateManager)
{
WebSocketState state = mStateManager.getState();
if (state != OPEN && state != CLOSING)
{
return this;
}
}
// Get the reference to the instance of WritingThread... | java | public WebSocket flush()
{
synchronized (mStateManager)
{
WebSocketState state = mStateManager.getState();
if (state != OPEN && state != CLOSING)
{
return this;
}
}
// Get the reference to the instance of WritingThread... | [
"public",
"WebSocket",
"flush",
"(",
")",
"{",
"synchronized",
"(",
"mStateManager",
")",
"{",
"WebSocketState",
"state",
"=",
"mStateManager",
".",
"getState",
"(",
")",
";",
"if",
"(",
"state",
"!=",
"OPEN",
"&&",
"state",
"!=",
"CLOSING",
")",
"{",
"r... | Flush frames to the server. Flush is performed asynchronously.
@return
{@code this} object.
@since 1.5 | [
"Flush",
"frames",
"to",
"the",
"server",
".",
"Flush",
"is",
"performed",
"asynchronously",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L1753-L1776 |
28,498 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.connect | public WebSocket connect() throws WebSocketException
{
// Change the state to CONNECTING. If the state before
// the change is not CREATED, an exception is thrown.
changeStateOnConnect();
// HTTP headers from the server.
Map<String, List<String>> headers;
try
... | java | public WebSocket connect() throws WebSocketException
{
// Change the state to CONNECTING. If the state before
// the change is not CREATED, an exception is thrown.
changeStateOnConnect();
// HTTP headers from the server.
Map<String, List<String>> headers;
try
... | [
"public",
"WebSocket",
"connect",
"(",
")",
"throws",
"WebSocketException",
"{",
"// Change the state to CONNECTING. If the state before",
"// the change is not CREATED, an exception is thrown.",
"changeStateOnConnect",
"(",
")",
";",
"// HTTP headers from the server.",
"Map",
"<",
... | Connect to the server, send an opening handshake to the server,
receive the response and then start threads to communicate with
the server.
<p>
As necessary, {@link #addProtocol(String)}, {@link #addExtension(WebSocketExtension)}
{@link #addHeader(String, String)} should be called before you call this
method. It is be... | [
"Connect",
"to",
"the",
"server",
"send",
"an",
"opening",
"handshake",
"to",
"the",
"server",
"receive",
"the",
"response",
"and",
"then",
"start",
"threads",
"to",
"communicate",
"with",
"the",
"server",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L2295-L2343 |
28,499 | TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.disconnect | public WebSocket disconnect(int closeCode, String reason, long closeDelay)
{
synchronized (mStateManager)
{
switch (mStateManager.getState())
{
case CREATED:
finishAsynchronously();
return this;
case OPE... | java | public WebSocket disconnect(int closeCode, String reason, long closeDelay)
{
synchronized (mStateManager)
{
switch (mStateManager.getState())
{
case CREATED:
finishAsynchronously();
return this;
case OPE... | [
"public",
"WebSocket",
"disconnect",
"(",
"int",
"closeCode",
",",
"String",
"reason",
",",
"long",
"closeDelay",
")",
"{",
"synchronized",
"(",
"mStateManager",
")",
"{",
"switch",
"(",
"mStateManager",
".",
"getState",
"(",
")",
")",
"{",
"case",
"CREATED"... | Disconnect the WebSocket.
@param closeCode
The close code embedded in a <a href=
"https://tools.ietf.org/html/rfc6455#section-5.5.1">close frame</a>
which this WebSocket client will send to the server.
@param reason
The reason embedded in a <a href=
"https://tools.ietf.org/html/rfc6455#section-5.5.1">close frame</a>
... | [
"Disconnect",
"the",
"WebSocket",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L2574-L2624 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.