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
partition
stringclasses
1 value
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/style/Styles.java
Styles.getStyle
public StyleRow getStyle(GeometryType geometryType) { StyleRow styleRow = null; if (geometryType != null && !styles.isEmpty()) { List<GeometryType> geometryTypes = GeometryUtils .parentHierarchy(geometryType); geometryTypes.add(0, geometryType); for (GeometryType type : geometryTypes) { styleRow...
java
public StyleRow getStyle(GeometryType geometryType) { StyleRow styleRow = null; if (geometryType != null && !styles.isEmpty()) { List<GeometryType> geometryTypes = GeometryUtils .parentHierarchy(geometryType); geometryTypes.add(0, geometryType); for (GeometryType type : geometryTypes) { styleRow...
[ "public", "StyleRow", "getStyle", "(", "GeometryType", "geometryType", ")", "{", "StyleRow", "styleRow", "=", "null", ";", "if", "(", "geometryType", "!=", "null", "&&", "!", "styles", ".", "isEmpty", "(", ")", ")", "{", "List", "<", "GeometryType", ">", ...
Get the style for the geometry type @param geometryType geometry type @return style
[ "Get", "the", "style", "for", "the", "geometry", "type" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/style/Styles.java#L93-L118
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/user/custom/UserCustomDao.java
UserCustomDao.count
protected int count(UserCustomResultSet resultSet) { int count = 0; try { count = resultSet.getCount(); } finally { resultSet.close(); } return count; }
java
protected int count(UserCustomResultSet resultSet) { int count = 0; try { count = resultSet.getCount(); } finally { resultSet.close(); } return count; }
[ "protected", "int", "count", "(", "UserCustomResultSet", "resultSet", ")", "{", "int", "count", "=", "0", ";", "try", "{", "count", "=", "resultSet", ".", "getCount", "(", ")", ";", "}", "finally", "{", "resultSet", ".", "close", "(", ")", ";", "}", ...
Get the count of the result set and close it @param resultSet result set @return count
[ "Get", "the", "count", "of", "the", "result", "set", "and", "close", "it" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/user/custom/UserCustomDao.java#L107-L115
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/user/custom/UserCustomDao.java
UserCustomDao.readTable
public static UserCustomDao readTable(String database, GeoPackageConnection connection, String tableName) { UserCustomConnection userDb = new UserCustomConnection(connection); UserCustomTable userCustomTable = UserCustomTableReader.readTable( userDb, tableName); UserCustomDao dao = new UserCustomDao(datab...
java
public static UserCustomDao readTable(String database, GeoPackageConnection connection, String tableName) { UserCustomConnection userDb = new UserCustomConnection(connection); UserCustomTable userCustomTable = UserCustomTableReader.readTable( userDb, tableName); UserCustomDao dao = new UserCustomDao(datab...
[ "public", "static", "UserCustomDao", "readTable", "(", "String", "database", ",", "GeoPackageConnection", "connection", ",", "String", "tableName", ")", "{", "UserCustomConnection", "userDb", "=", "new", "UserCustomConnection", "(", "connection", ")", ";", "UserCustom...
Read the database table and create a DAO @param database database name @param connection db connection @param tableName table name @return user custom DAO
[ "Read", "the", "database", "table", "and", "create", "a", "DAO" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/user/custom/UserCustomDao.java#L128-L138
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/manager/GeoPackageImpl.java
GeoPackageImpl.integrityCheck
private ResultSet integrityCheck(ResultSet resultSet) { try { if (resultSet.next()) { String value = resultSet.getString(1); if (value.equals("ok")) { resultSet.close(); resultSet = null; } } } catch (SQLException e) { throw new GeoPackageException( "Integrity check failed on dat...
java
private ResultSet integrityCheck(ResultSet resultSet) { try { if (resultSet.next()) { String value = resultSet.getString(1); if (value.equals("ok")) { resultSet.close(); resultSet = null; } } } catch (SQLException e) { throw new GeoPackageException( "Integrity check failed on dat...
[ "private", "ResultSet", "integrityCheck", "(", "ResultSet", "resultSet", ")", "{", "try", "{", "if", "(", "resultSet", ".", "next", "(", ")", ")", "{", "String", "value", "=", "resultSet", ".", "getString", "(", "1", ")", ";", "if", "(", "value", ".", ...
Check the result set returned from the integrity check to see if things are "ok" @param resultSet @return null if ok, else the open cursor
[ "Check", "the", "result", "set", "returned", "from", "the", "integrity", "check", "to", "see", "if", "things", "are", "ok" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/manager/GeoPackageImpl.java#L415-L429
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java
UrlTileGenerator.setTileFormat
public void setTileFormat(TileFormatType tileFormat) { if (tileFormat == null) { tileFormat = TileFormatType.STANDARD; } else { switch (tileFormat) { case STANDARD: case TMS: this.tileFormat = tileFormat; break; default: throw new GeoPackageException( "Unsupported Tile Format Type f...
java
public void setTileFormat(TileFormatType tileFormat) { if (tileFormat == null) { tileFormat = TileFormatType.STANDARD; } else { switch (tileFormat) { case STANDARD: case TMS: this.tileFormat = tileFormat; break; default: throw new GeoPackageException( "Unsupported Tile Format Type f...
[ "public", "void", "setTileFormat", "(", "TileFormatType", "tileFormat", ")", "{", "if", "(", "tileFormat", "==", "null", ")", "{", "tileFormat", "=", "TileFormatType", ".", "STANDARD", ";", "}", "else", "{", "switch", "(", "tileFormat", ")", "{", "case", "...
Set the tile format @param tileFormat tile format
[ "Set", "the", "tile", "format" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java#L169-L184
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java
UrlTileGenerator.replaceXYZ
private String replaceXYZ(String url, int z, long x, long y) { url = url.replaceAll(Z_VARIABLE, String.valueOf(z)); url = url.replaceAll(X_VARIABLE, String.valueOf(x)); url = url.replaceAll(Y_VARIABLE, String.valueOf(y)); return url; }
java
private String replaceXYZ(String url, int z, long x, long y) { url = url.replaceAll(Z_VARIABLE, String.valueOf(z)); url = url.replaceAll(X_VARIABLE, String.valueOf(x)); url = url.replaceAll(Y_VARIABLE, String.valueOf(y)); return url; }
[ "private", "String", "replaceXYZ", "(", "String", "url", ",", "int", "z", ",", "long", "x", ",", "long", "y", ")", "{", "url", "=", "url", ".", "replaceAll", "(", "Z_VARIABLE", ",", "String", ".", "valueOf", "(", "z", ")", ")", ";", "url", "=", "...
Replace x, y, and z in the url @param url @param z @param x @param y @return
[ "Replace", "x", "y", "and", "z", "in", "the", "url" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java#L228-L234
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java
UrlTileGenerator.replaceBoundingBox
private String replaceBoundingBox(String url, BoundingBox boundingBox) { url = url.replaceAll(MIN_LAT_VARIABLE, String.valueOf(boundingBox.getMinLatitude())); url = url.replaceAll(MAX_LAT_VARIABLE, String.valueOf(boundingBox.getMaxLatitude())); url = url.replaceAll(MIN_LON_VARIABLE, String.valueOf(bo...
java
private String replaceBoundingBox(String url, BoundingBox boundingBox) { url = url.replaceAll(MIN_LAT_VARIABLE, String.valueOf(boundingBox.getMinLatitude())); url = url.replaceAll(MAX_LAT_VARIABLE, String.valueOf(boundingBox.getMaxLatitude())); url = url.replaceAll(MIN_LON_VARIABLE, String.valueOf(bo...
[ "private", "String", "replaceBoundingBox", "(", "String", "url", ",", "BoundingBox", "boundingBox", ")", "{", "url", "=", "url", ".", "replaceAll", "(", "MIN_LAT_VARIABLE", ",", "String", ".", "valueOf", "(", "boundingBox", ".", "getMinLatitude", "(", ")", ")"...
Replace the url parts with the bounding box @param url @param boundingBox @return
[ "Replace", "the", "url", "parts", "with", "the", "bounding", "box" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java#L276-L288
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java
UrlTileGenerator.downloadTile
private byte[] downloadTile(String zoomUrl, URL url, int z, long x, long y) { byte[] bytes = null; HttpURLConnection connection = null; try { connection = (HttpURLConnection) url.openConnection(); connection.connect(); int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConn...
java
private byte[] downloadTile(String zoomUrl, URL url, int z, long x, long y) { byte[] bytes = null; HttpURLConnection connection = null; try { connection = (HttpURLConnection) url.openConnection(); connection.connect(); int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConn...
[ "private", "byte", "[", "]", "downloadTile", "(", "String", "zoomUrl", ",", "URL", "url", ",", "int", "z", ",", "long", "x", ",", "long", "y", ")", "{", "byte", "[", "]", "bytes", "=", "null", ";", "HttpURLConnection", "connection", "=", "null", ";",...
Download the tile from the URL @param zoomUrl @param url @param z @param x @param y @return tile bytes
[ "Download", "the", "tile", "from", "the", "URL" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java#L369-L410
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java
DefaultFeatureTiles.drawFeature
private boolean drawFeature(int zoom, BoundingBox boundingBox, BoundingBox expandedBoundingBox, ProjectionTransform transform, FeatureTileGraphics graphics, FeatureRow row) { boolean drawn = false; try { GeoPackageGeometryData geomData = row.getGeometry(); if (geomData != null) { Geometry geometry...
java
private boolean drawFeature(int zoom, BoundingBox boundingBox, BoundingBox expandedBoundingBox, ProjectionTransform transform, FeatureTileGraphics graphics, FeatureRow row) { boolean drawn = false; try { GeoPackageGeometryData geomData = row.getGeometry(); if (geomData != null) { Geometry geometry...
[ "private", "boolean", "drawFeature", "(", "int", "zoom", ",", "BoundingBox", "boundingBox", ",", "BoundingBox", "expandedBoundingBox", ",", "ProjectionTransform", "transform", ",", "FeatureTileGraphics", "graphics", ",", "FeatureRow", "row", ")", "{", "boolean", "draw...
Draw the feature @param zoom zoom level @param boundingBox bounding box @param expandedBoundingBox expanded bounding box @param transform projection transform @param graphics graphics to draw on @param row feature row @return true if at least one feature was drawn
[ "Draw", "the", "feature" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java#L290-L324
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java
DefaultFeatureTiles.drawLineString
private boolean drawLineString(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, FeatureTileGraphics graphics, LineString lineString, FeatureStyle featureStyle) { Path2D path = getPath(simplifyTolerance, boundingBox, transform, lineString); return drawLine(graphics, path...
java
private boolean drawLineString(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, FeatureTileGraphics graphics, LineString lineString, FeatureStyle featureStyle) { Path2D path = getPath(simplifyTolerance, boundingBox, transform, lineString); return drawLine(graphics, path...
[ "private", "boolean", "drawLineString", "(", "double", "simplifyTolerance", ",", "BoundingBox", "boundingBox", ",", "ProjectionTransform", "transform", ",", "FeatureTileGraphics", "graphics", ",", "LineString", "lineString", ",", "FeatureStyle", "featureStyle", ")", "{", ...
Draw a LineString @param simplifyTolerance simplify tolerance in meters @param boundingBox bounding box @param transform projection transform @param graphics feature tile graphics @param lineString line string @param featureStyle feature style @return true if drawn
[ "Draw", "a", "LineString" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java#L455-L462
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java
DefaultFeatureTiles.drawPolygon
private boolean drawPolygon(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, FeatureTileGraphics graphics, Polygon polygon, FeatureStyle featureStyle) { Area polygonArea = getArea(simplifyTolerance, boundingBox, transform, polygon); return drawPolygon(graphics, polygonA...
java
private boolean drawPolygon(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, FeatureTileGraphics graphics, Polygon polygon, FeatureStyle featureStyle) { Area polygonArea = getArea(simplifyTolerance, boundingBox, transform, polygon); return drawPolygon(graphics, polygonA...
[ "private", "boolean", "drawPolygon", "(", "double", "simplifyTolerance", ",", "BoundingBox", "boundingBox", ",", "ProjectionTransform", "transform", ",", "FeatureTileGraphics", "graphics", ",", "Polygon", "polygon", ",", "FeatureStyle", "featureStyle", ")", "{", "Area",...
Draw a Polygon @param simplifyTolerance simplify tolerance in meters @param boundingBox bounding box @param transform projection transform @param graphics feature tile graphics @param polygon polygon @param featureStyle feature style @return true if drawn
[ "Draw", "a", "Polygon" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java#L481-L488
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java
DefaultFeatureTiles.getPath
private Path2D getPath(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, LineString lineString) { Path2D path = null; // Try to simplify the number of points in the LineString List<Point> lineStringPoints = simplifyPoints(simplifyTolerance, lineString.getPoints()); for ...
java
private Path2D getPath(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, LineString lineString) { Path2D path = null; // Try to simplify the number of points in the LineString List<Point> lineStringPoints = simplifyPoints(simplifyTolerance, lineString.getPoints()); for ...
[ "private", "Path2D", "getPath", "(", "double", "simplifyTolerance", ",", "BoundingBox", "boundingBox", ",", "ProjectionTransform", "transform", ",", "LineString", "lineString", ")", "{", "Path2D", "path", "=", "null", ";", "// Try to simplify the number of points in the L...
Get the path of the line string @param simplifyTolerance simplify tolerance in meters @param boundingBox @param transform @param lineString
[ "Get", "the", "path", "of", "the", "line", "string" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java#L499-L527
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java
DefaultFeatureTiles.drawLine
private boolean drawLine(FeatureTileGraphics graphics, Path2D line, FeatureStyle featureStyle) { Graphics2D lineGraphics = graphics.getLineGraphics(); Paint paint = getLinePaint(featureStyle); lineGraphics.setColor(paint.getColor()); lineGraphics.setStroke(paint.getStroke()); boolean drawn = lineGraphic...
java
private boolean drawLine(FeatureTileGraphics graphics, Path2D line, FeatureStyle featureStyle) { Graphics2D lineGraphics = graphics.getLineGraphics(); Paint paint = getLinePaint(featureStyle); lineGraphics.setColor(paint.getColor()); lineGraphics.setStroke(paint.getStroke()); boolean drawn = lineGraphic...
[ "private", "boolean", "drawLine", "(", "FeatureTileGraphics", "graphics", ",", "Path2D", "line", ",", "FeatureStyle", "featureStyle", ")", "{", "Graphics2D", "lineGraphics", "=", "graphics", ".", "getLineGraphics", "(", ")", ";", "Paint", "paint", "=", "getLinePai...
Draw the line @param graphics feature tile graphics @param line line path @param featureStyle feature style @return true if drawn
[ "Draw", "the", "line" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java#L540-L556
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java
DefaultFeatureTiles.getArea
private Area getArea(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, Polygon polygon) { Area area = null; for (LineString ring : polygon.getRings()) { Path2D path = getPath(simplifyTolerance, boundingBox, transform, ring); Area ringArea = new Area(path); if (ar...
java
private Area getArea(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, Polygon polygon) { Area area = null; for (LineString ring : polygon.getRings()) { Path2D path = getPath(simplifyTolerance, boundingBox, transform, ring); Area ringArea = new Area(path); if (ar...
[ "private", "Area", "getArea", "(", "double", "simplifyTolerance", ",", "BoundingBox", "boundingBox", ",", "ProjectionTransform", "transform", ",", "Polygon", "polygon", ")", "{", "Area", "area", "=", "null", ";", "for", "(", "LineString", "ring", ":", "polygon",...
Get the area of the polygon @param simplifyTolerance simplify tolerance in meters @param boundingBox @param transform @param lineString
[ "Get", "the", "area", "of", "the", "polygon" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java#L567-L587
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java
DefaultFeatureTiles.drawPolygon
private boolean drawPolygon(FeatureTileGraphics graphics, Area polygon, FeatureStyle featureStyle) { Graphics2D polygonGraphics = graphics.getPolygonGraphics(); Paint fillPaint = getPolygonFillPaint(featureStyle); if (fillPaint != null) { polygonGraphics.setColor(fillPaint.getColor()); polygonGraphics...
java
private boolean drawPolygon(FeatureTileGraphics graphics, Area polygon, FeatureStyle featureStyle) { Graphics2D polygonGraphics = graphics.getPolygonGraphics(); Paint fillPaint = getPolygonFillPaint(featureStyle); if (fillPaint != null) { polygonGraphics.setColor(fillPaint.getColor()); polygonGraphics...
[ "private", "boolean", "drawPolygon", "(", "FeatureTileGraphics", "graphics", ",", "Area", "polygon", ",", "FeatureStyle", "featureStyle", ")", "{", "Graphics2D", "polygonGraphics", "=", "graphics", ".", "getPolygonGraphics", "(", ")", ";", "Paint", "fillPaint", "=",...
Draw the polygon @param graphics feature tile graphics @param polygon polygon area @param featureStyle feature style @return true if drawn
[ "Draw", "the", "polygon" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java#L600-L624
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java
RTreeIndexTableDao.getFeatureRow
public FeatureRow getFeatureRow(UserCustomResultSet resultSet) { RTreeIndexTableRow row = getRow(resultSet); return getFeatureRow(row); }
java
public FeatureRow getFeatureRow(UserCustomResultSet resultSet) { RTreeIndexTableRow row = getRow(resultSet); return getFeatureRow(row); }
[ "public", "FeatureRow", "getFeatureRow", "(", "UserCustomResultSet", "resultSet", ")", "{", "RTreeIndexTableRow", "row", "=", "getRow", "(", "resultSet", ")", ";", "return", "getFeatureRow", "(", "row", ")", ";", "}" ]
Get the feature row from the RTree Index Table row @param resultSet result set @return feature row
[ "Get", "the", "feature", "row", "from", "the", "RTree", "Index", "Table", "row" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java#L183-L186
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java
RTreeIndexTableDao.query
public UserCustomResultSet query(BoundingBox boundingBox, Projection projection) { BoundingBox featureBoundingBox = projectBoundingBox(boundingBox, projection); return query(featureBoundingBox); }
java
public UserCustomResultSet query(BoundingBox boundingBox, Projection projection) { BoundingBox featureBoundingBox = projectBoundingBox(boundingBox, projection); return query(featureBoundingBox); }
[ "public", "UserCustomResultSet", "query", "(", "BoundingBox", "boundingBox", ",", "Projection", "projection", ")", "{", "BoundingBox", "featureBoundingBox", "=", "projectBoundingBox", "(", "boundingBox", ",", "projection", ")", ";", "return", "query", "(", "featureBou...
Query for rows within the bounding box in the provided projection @param boundingBox bounding box @param projection projection @return results
[ "Query", "for", "rows", "within", "the", "bounding", "box", "in", "the", "provided", "projection" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java#L267-L272
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java
RTreeIndexTableDao.query
public UserCustomResultSet query(GeometryEnvelope envelope) { return query(envelope.getMinX(), envelope.getMinY(), envelope.getMaxX(), envelope.getMaxY()); }
java
public UserCustomResultSet query(GeometryEnvelope envelope) { return query(envelope.getMinX(), envelope.getMinY(), envelope.getMaxX(), envelope.getMaxY()); }
[ "public", "UserCustomResultSet", "query", "(", "GeometryEnvelope", "envelope", ")", "{", "return", "query", "(", "envelope", ".", "getMinX", "(", ")", ",", "envelope", ".", "getMinY", "(", ")", ",", "envelope", ".", "getMaxX", "(", ")", ",", "envelope", "....
Query for rows within the geometry envelope @param envelope geometry envelope @return results
[ "Query", "for", "rows", "within", "the", "geometry", "envelope" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java#L307-L310
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java
RTreeIndexTableDao.query
public UserCustomResultSet query(double minX, double minY, double maxX, double maxY) { validateRTree(); String where = buildWhere(minX, minY, maxX, maxY); String[] whereArgs = buildWhereArgs(minX, minY, maxX, maxY); return query(where, whereArgs); }
java
public UserCustomResultSet query(double minX, double minY, double maxX, double maxY) { validateRTree(); String where = buildWhere(minX, minY, maxX, maxY); String[] whereArgs = buildWhereArgs(minX, minY, maxX, maxY); return query(where, whereArgs); }
[ "public", "UserCustomResultSet", "query", "(", "double", "minX", ",", "double", "minY", ",", "double", "maxX", ",", "double", "maxY", ")", "{", "validateRTree", "(", ")", ";", "String", "where", "=", "buildWhere", "(", "minX", ",", "minY", ",", "maxX", "...
Query for rows within the bounds @param minX min x @param minY min y @param maxX max x @param maxY max y @return results
[ "Query", "for", "rows", "within", "the", "bounds" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java#L337-L343
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java
RTreeIndexTableDao.count
public long count(double minX, double minY, double maxX, double maxY) { validateRTree(); String where = buildWhere(minX, minY, maxX, maxY); String[] whereArgs = buildWhereArgs(minX, minY, maxX, maxY); return count(where, whereArgs); }
java
public long count(double minX, double minY, double maxX, double maxY) { validateRTree(); String where = buildWhere(minX, minY, maxX, maxY); String[] whereArgs = buildWhereArgs(minX, minY, maxX, maxY); return count(where, whereArgs); }
[ "public", "long", "count", "(", "double", "minX", ",", "double", "minY", ",", "double", "maxX", ",", "double", "maxY", ")", "{", "validateRTree", "(", ")", ";", "String", "where", "=", "buildWhere", "(", "minX", ",", "minY", ",", "maxX", ",", "maxY", ...
Count the rows within the bounds @param minX min x @param minY min y @param maxX max x @param maxY max y @return count
[ "Count", "the", "rows", "within", "the", "bounds" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java#L358-L363
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/related/media/MediaRow.java
MediaRow.setData
public void setData(BufferedImage image, String imageFormat) throws IOException { setData(image, imageFormat, null); }
java
public void setData(BufferedImage image, String imageFormat) throws IOException { setData(image, imageFormat, null); }
[ "public", "void", "setData", "(", "BufferedImage", "image", ",", "String", "imageFormat", ")", "throws", "IOException", "{", "setData", "(", "image", ",", "imageFormat", ",", "null", ")", ";", "}" ]
Set the data from an image @param image image @param imageFormat image format @throws IOException upon failure @since 3.2.0
[ "Set", "the", "data", "from", "an", "image" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/media/MediaRow.java#L144-L147
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/related/media/MediaRow.java
MediaRow.setData
public void setData(BufferedImage image, String imageFormat, Float quality) throws IOException { setData(ImageUtils.writeImageToBytes(image, imageFormat, quality)); }
java
public void setData(BufferedImage image, String imageFormat, Float quality) throws IOException { setData(ImageUtils.writeImageToBytes(image, imageFormat, quality)); }
[ "public", "void", "setData", "(", "BufferedImage", "image", ",", "String", "imageFormat", ",", "Float", "quality", ")", "throws", "IOException", "{", "setData", "(", "ImageUtils", ".", "writeImageToBytes", "(", "image", ",", "imageFormat", ",", "quality", ")", ...
Set the data from an image with optional quality @param image image @param imageFormat image format @param quality null or quality between 0.0 and 1.0 @throws IOException upon failure @since 3.2.0
[ "Set", "the", "data", "from", "an", "image", "with", "optional", "quality" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/media/MediaRow.java#L162-L165
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/user/TileDao.java
TileDao.queryForTilesInColumn
public TileResultSet queryForTilesInColumn(long column, long zoomLevel) { Map<String, Object> fieldValues = new HashMap<String, Object>(); fieldValues.put(TileTable.COLUMN_TILE_COLUMN, column); fieldValues.put(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel); return queryForFieldValues(fieldValues); }
java
public TileResultSet queryForTilesInColumn(long column, long zoomLevel) { Map<String, Object> fieldValues = new HashMap<String, Object>(); fieldValues.put(TileTable.COLUMN_TILE_COLUMN, column); fieldValues.put(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel); return queryForFieldValues(fieldValues); }
[ "public", "TileResultSet", "queryForTilesInColumn", "(", "long", "column", ",", "long", "zoomLevel", ")", "{", "Map", "<", "String", ",", "Object", ">", "fieldValues", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "fieldValues", ...
Query for Tiles at a zoom level and column @param column column @param zoomLevel zoom level @return tile result set
[ "Query", "for", "Tiles", "at", "a", "zoom", "level", "and", "column" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/user/TileDao.java#L324-L331
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/user/TileDao.java
TileDao.queryForTilesInRow
public TileResultSet queryForTilesInRow(long row, long zoomLevel) { Map<String, Object> fieldValues = new HashMap<String, Object>(); fieldValues.put(TileTable.COLUMN_TILE_ROW, row); fieldValues.put(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel); return queryForFieldValues(fieldValues); }
java
public TileResultSet queryForTilesInRow(long row, long zoomLevel) { Map<String, Object> fieldValues = new HashMap<String, Object>(); fieldValues.put(TileTable.COLUMN_TILE_ROW, row); fieldValues.put(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel); return queryForFieldValues(fieldValues); }
[ "public", "TileResultSet", "queryForTilesInRow", "(", "long", "row", ",", "long", "zoomLevel", ")", "{", "Map", "<", "String", ",", "Object", ">", "fieldValues", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "fieldValues", ".", ...
Query for Tiles at a zoom level and row @param row row @param zoomLevel zoom level @return tile result set
[ "Query", "for", "Tiles", "at", "a", "zoom", "level", "and", "row" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/user/TileDao.java#L342-L349
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/user/TileDao.java
TileDao.queryByTileGrid
public TileResultSet queryByTileGrid(TileGrid tileGrid, long zoomLevel, String orderBy) { TileResultSet tileCursor = null; if (tileGrid != null) { StringBuilder where = new StringBuilder(); where.append(buildWhere(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel)); where.append(" AND "); where.append(buil...
java
public TileResultSet queryByTileGrid(TileGrid tileGrid, long zoomLevel, String orderBy) { TileResultSet tileCursor = null; if (tileGrid != null) { StringBuilder where = new StringBuilder(); where.append(buildWhere(TileTable.COLUMN_ZOOM_LEVEL, zoomLevel)); where.append(" AND "); where.append(buil...
[ "public", "TileResultSet", "queryByTileGrid", "(", "TileGrid", "tileGrid", ",", "long", "zoomLevel", ",", "String", "orderBy", ")", "{", "TileResultSet", "tileCursor", "=", "null", ";", "if", "(", "tileGrid", "!=", "null", ")", "{", "StringBuilder", "where", "...
Query by tile grid and zoom level @param tileGrid tile grid @param zoomLevel zoom level @param orderBy order by @return cursor from query or null if the zoom level tile ranges do not overlap the bounding box @since 1.2.1
[ "Query", "by", "tile", "grid", "and", "zoom", "level" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/user/TileDao.java#L501-L536
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/style/IconCache.java
IconCache.put
public BufferedImage put(IconRow iconRow, BufferedImage image) { return put(iconRow.getId(), image); }
java
public BufferedImage put(IconRow iconRow, BufferedImage image) { return put(iconRow.getId(), image); }
[ "public", "BufferedImage", "put", "(", "IconRow", "iconRow", ",", "BufferedImage", "image", ")", "{", "return", "put", "(", "iconRow", ".", "getId", "(", ")", ",", "image", ")", ";", "}" ]
Cache the icon image for the icon row @param iconRow icon row @param image icon image @return previous cached icon image or null
[ "Cache", "the", "icon", "image", "for", "the", "icon", "row" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/style/IconCache.java#L94-L96
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/style/IconCache.java
IconCache.createIcon
public static BufferedImage createIcon(IconRow icon, float scale, IconCache iconCache) { BufferedImage iconImage = null; if (icon != null) { if (iconCache != null) { iconImage = iconCache.get(icon.getId()); } if (iconImage == null) { try { iconImage = icon.getDataImage(); } catch (...
java
public static BufferedImage createIcon(IconRow icon, float scale, IconCache iconCache) { BufferedImage iconImage = null; if (icon != null) { if (iconCache != null) { iconImage = iconCache.get(icon.getId()); } if (iconImage == null) { try { iconImage = icon.getDataImage(); } catch (...
[ "public", "static", "BufferedImage", "createIcon", "(", "IconRow", "icon", ",", "float", "scale", ",", "IconCache", "iconCache", ")", "{", "BufferedImage", "iconImage", "=", "null", ";", "if", "(", "icon", "!=", "null", ")", "{", "if", "(", "iconCache", "!...
Create or retrieve from cache an icon image for the icon row @param icon icon row @param scale scale factor @param iconCache icon cache @return icon image
[ "Create", "or", "retrieve", "from", "cache", "an", "icon", "image", "for", "the", "icon", "row" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/style/IconCache.java#L233-L305
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/index/FeatureTableIndex.java
FeatureTableIndex.indexRows
private int indexRows(TableIndex tableIndex, FeatureResultSet resultSet) { int count = -1; try { while ((progress == null || progress.isActive()) && resultSet.moveToNext()) { if (count < 0) { count++; } try { FeatureRow row = resultSet.getRow(); boolean indexed = index(tableInde...
java
private int indexRows(TableIndex tableIndex, FeatureResultSet resultSet) { int count = -1; try { while ((progress == null || progress.isActive()) && resultSet.moveToNext()) { if (count < 0) { count++; } try { FeatureRow row = resultSet.getRow(); boolean indexed = index(tableInde...
[ "private", "int", "indexRows", "(", "TableIndex", "tableIndex", ",", "FeatureResultSet", "resultSet", ")", "{", "int", "count", "=", "-", "1", ";", "try", "{", "while", "(", "(", "progress", "==", "null", "||", "progress", ".", "isActive", "(", ")", ")",...
Index the feature rows in the cursor @param tableIndex table index @param resultSet feature result @return count, -1 if no results or canceled
[ "Index", "the", "feature", "rows", "in", "the", "cursor" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/index/FeatureTableIndex.java#L160-L191
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java
RelatedTablesExtension.getUserDao
public UserCustomDao getUserDao(String tableName) { return UserCustomDao.readTable(getGeoPackage().getName(), connection, tableName); }
java
public UserCustomDao getUserDao(String tableName) { return UserCustomDao.readTable(getGeoPackage().getName(), connection, tableName); }
[ "public", "UserCustomDao", "getUserDao", "(", "String", "tableName", ")", "{", "return", "UserCustomDao", ".", "readTable", "(", "getGeoPackage", "(", ")", ".", "getName", "(", ")", ",", "connection", ",", "tableName", ")", ";", "}" ]
Get a User Custom DAO from a table name @param tableName table name @return user custom dao
[ "Get", "a", "User", "Custom", "DAO", "from", "a", "table", "name" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java#L66-L69
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java
RelatedTablesExtension.getMediaDao
public MediaDao getMediaDao(String tableName) { MediaDao mediaDao = new MediaDao(getUserDao(tableName)); setContents(mediaDao.getTable()); return mediaDao; }
java
public MediaDao getMediaDao(String tableName) { MediaDao mediaDao = new MediaDao(getUserDao(tableName)); setContents(mediaDao.getTable()); return mediaDao; }
[ "public", "MediaDao", "getMediaDao", "(", "String", "tableName", ")", "{", "MediaDao", "mediaDao", "=", "new", "MediaDao", "(", "getUserDao", "(", "tableName", ")", ")", ";", "setContents", "(", "mediaDao", ".", "getTable", "(", ")", ")", ";", "return", "m...
Get a related media table DAO @param tableName media table name @return media DAO
[ "Get", "a", "related", "media", "table", "DAO" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java#L122-L126
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java
RelatedTablesExtension.getMappingsForBase
public List<Long> getMappingsForBase(String tableName, long baseId) { List<Long> relatedIds = new ArrayList<>(); UserMappingDao userMappingDao = getMappingDao(tableName); UserCustomResultSet resultSet = userMappingDao.queryByBaseId(baseId); try { while (resultSet.moveToNext()) { UserMappingRow row = us...
java
public List<Long> getMappingsForBase(String tableName, long baseId) { List<Long> relatedIds = new ArrayList<>(); UserMappingDao userMappingDao = getMappingDao(tableName); UserCustomResultSet resultSet = userMappingDao.queryByBaseId(baseId); try { while (resultSet.moveToNext()) { UserMappingRow row = us...
[ "public", "List", "<", "Long", ">", "getMappingsForBase", "(", "String", "tableName", ",", "long", "baseId", ")", "{", "List", "<", "Long", ">", "relatedIds", "=", "new", "ArrayList", "<>", "(", ")", ";", "UserMappingDao", "userMappingDao", "=", "getMappingD...
Get the related id mappings for the base id @param tableName mapping table name @param baseId base id @return IDs representing the matching related IDs
[ "Get", "the", "related", "id", "mappings", "for", "the", "base", "id" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java#L190-L206
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java
RelatedTablesExtension.getMappingsForRelated
public List<Long> getMappingsForRelated(String tableName, long relatedId) { List<Long> baseIds = new ArrayList<>(); UserMappingDao userMappingDao = getMappingDao(tableName); UserCustomResultSet resultSet = userMappingDao .queryByRelatedId(relatedId); try { while (resultSet.moveToNext()) { UserMappi...
java
public List<Long> getMappingsForRelated(String tableName, long relatedId) { List<Long> baseIds = new ArrayList<>(); UserMappingDao userMappingDao = getMappingDao(tableName); UserCustomResultSet resultSet = userMappingDao .queryByRelatedId(relatedId); try { while (resultSet.moveToNext()) { UserMappi...
[ "public", "List", "<", "Long", ">", "getMappingsForRelated", "(", "String", "tableName", ",", "long", "relatedId", ")", "{", "List", "<", "Long", ">", "baseIds", "=", "new", "ArrayList", "<>", "(", ")", ";", "UserMappingDao", "userMappingDao", "=", "getMappi...
Get the base id mappings for the related id @param tableName mapping table name @param relatedId related id @return IDs representing the matching base IDs
[ "Get", "the", "base", "id", "mappings", "for", "the", "related", "id" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java#L232-L249
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java
RelatedTablesExtension.hasMapping
public boolean hasMapping(String tableName, long baseId, long relatedId) { UserMappingDao userMappingDao = getMappingDao(tableName); return userMappingDao.countByIds(baseId, relatedId) > 0; }
java
public boolean hasMapping(String tableName, long baseId, long relatedId) { UserMappingDao userMappingDao = getMappingDao(tableName); return userMappingDao.countByIds(baseId, relatedId) > 0; }
[ "public", "boolean", "hasMapping", "(", "String", "tableName", ",", "long", "baseId", ",", "long", "relatedId", ")", "{", "UserMappingDao", "userMappingDao", "=", "getMappingDao", "(", "tableName", ")", ";", "return", "userMappingDao", ".", "countByIds", "(", "b...
Determine if the base id and related id mapping exists @param tableName mapping table name @param baseId base id @param relatedId related id @return true if mapping exists @since 3.2.0
[ "Determine", "if", "the", "base", "id", "and", "related", "id", "mapping", "exists" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesExtension.java#L263-L266
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.execSQL
public static void execSQL(Connection connection, String sql) { Statement statement = null; try { statement = connection.createStatement(); statement.execute(sql); } catch (SQLException e) { throw new GeoPackageException("Failed to execute SQL statement: " + sql, e); } finally { closeStatement(...
java
public static void execSQL(Connection connection, String sql) { Statement statement = null; try { statement = connection.createStatement(); statement.execute(sql); } catch (SQLException e) { throw new GeoPackageException("Failed to execute SQL statement: " + sql, e); } finally { closeStatement(...
[ "public", "static", "void", "execSQL", "(", "Connection", "connection", ",", "String", "sql", ")", "{", "Statement", "statement", "=", "null", ";", "try", "{", "statement", "=", "connection", ".", "createStatement", "(", ")", ";", "statement", ".", "execute"...
Execute the SQL @param connection connection @param sql sql statement
[ "Execute", "the", "SQL" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L36-L48
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.query
public static ResultSet query(Connection connection, String sql, String[] selectionArgs) { PreparedStatement statement = null; ResultSet resultSet = null; try { statement = connection.prepareStatement(sql); setArguments(statement, selectionArgs); resultSet = statement.executeQuery(); } catch (SQLE...
java
public static ResultSet query(Connection connection, String sql, String[] selectionArgs) { PreparedStatement statement = null; ResultSet resultSet = null; try { statement = connection.prepareStatement(sql); setArguments(statement, selectionArgs); resultSet = statement.executeQuery(); } catch (SQLE...
[ "public", "static", "ResultSet", "query", "(", "Connection", "connection", ",", "String", "sql", ",", "String", "[", "]", "selectionArgs", ")", "{", "PreparedStatement", "statement", "=", "null", ";", "ResultSet", "resultSet", "=", "null", ";", "try", "{", "...
Query for results @param connection connection @param sql sql statement @param selectionArgs selection arguments @return result set
[ "Query", "for", "results" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L61-L81
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.count
public static int count(Connection connection, String sql, String[] selectionArgs) { if (!sql.toLowerCase().contains(" count(*) ")) { int index = sql.toLowerCase().indexOf(" from "); if (index == -1) { return -1; } sql = "select count(*)" + sql.substring(index); } int count = querySingleInteg...
java
public static int count(Connection connection, String sql, String[] selectionArgs) { if (!sql.toLowerCase().contains(" count(*) ")) { int index = sql.toLowerCase().indexOf(" from "); if (index == -1) { return -1; } sql = "select count(*)" + sql.substring(index); } int count = querySingleInteg...
[ "public", "static", "int", "count", "(", "Connection", "connection", ",", "String", "sql", ",", "String", "[", "]", "selectionArgs", ")", "{", "if", "(", "!", "sql", ".", "toLowerCase", "(", ")", ".", "contains", "(", "\" count(*) \"", ")", ")", "{", "...
Attempt to count the results of the query @param connection connection @param sql sql statement @param selectionArgs selection arguments @return count if known, -1 if not able to determine
[ "Attempt", "to", "count", "the", "results", "of", "the", "query" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L94-L108
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.max
public static Integer max(Connection connection, String table, String column, String where, String[] args) { Integer max = null; if (count(connection, table, where, args) > 0) { StringBuilder maxQuery = new StringBuilder(); maxQuery.append("select max(") .append(CoreSQLUtils.quoteWrap(column)).append...
java
public static Integer max(Connection connection, String table, String column, String where, String[] args) { Integer max = null; if (count(connection, table, where, args) > 0) { StringBuilder maxQuery = new StringBuilder(); maxQuery.append("select max(") .append(CoreSQLUtils.quoteWrap(column)).append...
[ "public", "static", "Integer", "max", "(", "Connection", "connection", ",", "String", "table", ",", "String", "column", ",", "String", "where", ",", "String", "[", "]", "args", ")", "{", "Integer", "max", "=", "null", ";", "if", "(", "count", "(", "con...
Get the max query result @param connection connection @param table table name @param column column name @param where where clause @param args where arguments @return max or null @since 1.1.1
[ "Get", "the", "max", "query", "result" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L190-L208
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.querySingleInteger
private static int querySingleInteger(Connection connection, String sql, String[] args, boolean allowEmptyResults) { int result = 0; Object value = querySingleResult(connection, sql, args, 0, GeoPackageDataType.MEDIUMINT); if (value != null) { result = ((Number) value).intValue(); } else if (!allowE...
java
private static int querySingleInteger(Connection connection, String sql, String[] args, boolean allowEmptyResults) { int result = 0; Object value = querySingleResult(connection, sql, args, 0, GeoPackageDataType.MEDIUMINT); if (value != null) { result = ((Number) value).intValue(); } else if (!allowE...
[ "private", "static", "int", "querySingleInteger", "(", "Connection", "connection", ",", "String", "sql", ",", "String", "[", "]", "args", ",", "boolean", "allowEmptyResults", ")", "{", "int", "result", "=", "0", ";", "Object", "value", "=", "querySingleResult"...
Query the SQL for a single integer result @param connection connection @param sql sql @param args query arguments @param allowEmptyResults true to accept empty results as a 0 return @return Integer result, null if no result
[ "Query", "the", "SQL", "for", "a", "single", "integer", "result" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L223-L238
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.querySingleColumnResults
public static List<Object> querySingleColumnResults(Connection connection, String sql, String[] args, int column, GeoPackageDataType dataType, Integer limit) { ResultSetResult result = wrapQuery(connection, sql, args); List<Object> results = ResultUtils.buildSingleColumnResults(result, column, dataType, l...
java
public static List<Object> querySingleColumnResults(Connection connection, String sql, String[] args, int column, GeoPackageDataType dataType, Integer limit) { ResultSetResult result = wrapQuery(connection, sql, args); List<Object> results = ResultUtils.buildSingleColumnResults(result, column, dataType, l...
[ "public", "static", "List", "<", "Object", ">", "querySingleColumnResults", "(", "Connection", "connection", ",", "String", "sql", ",", "String", "[", "]", "args", ",", "int", "column", ",", "GeoPackageDataType", "dataType", ",", "Integer", "limit", ")", "{", ...
Query for values from a single column up to the limit @param connection connection @param sql sql statement @param args arguments @param column column index @param dataType GeoPackage data type @param limit result row limit @return single column results @since 3.1.0
[ "Query", "for", "values", "from", "a", "single", "column", "up", "to", "the", "limit" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L281-L288
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.queryResults
public static List<List<Object>> queryResults(Connection connection, String sql, String[] args, GeoPackageDataType[] dataTypes, Integer limit) { ResultSetResult result = wrapQuery(connection, sql, args); List<List<Object>> results = ResultUtils.buildResults(result, dataTypes, limit); return results; }
java
public static List<List<Object>> queryResults(Connection connection, String sql, String[] args, GeoPackageDataType[] dataTypes, Integer limit) { ResultSetResult result = wrapQuery(connection, sql, args); List<List<Object>> results = ResultUtils.buildResults(result, dataTypes, limit); return results; }
[ "public", "static", "List", "<", "List", "<", "Object", ">", ">", "queryResults", "(", "Connection", "connection", ",", "String", "sql", ",", "String", "[", "]", "args", ",", "GeoPackageDataType", "[", "]", "dataTypes", ",", "Integer", "limit", ")", "{", ...
Query for values up to the limit @param connection connection @param sql sql statement @param args arguments @param dataTypes column data types @param limit result row limit @return results @since 3.1.0
[ "Query", "for", "values", "up", "to", "the", "limit" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L306-L313
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.delete
public static int delete(Connection connection, String table, String where, String[] args) { StringBuilder delete = new StringBuilder(); delete.append("delete from ").append(CoreSQLUtils.quoteWrap(table)); if (where != null) { delete.append(" where ").append(where); } String sql = delete.toString(); ...
java
public static int delete(Connection connection, String table, String where, String[] args) { StringBuilder delete = new StringBuilder(); delete.append("delete from ").append(CoreSQLUtils.quoteWrap(table)); if (where != null) { delete.append(" where ").append(where); } String sql = delete.toString(); ...
[ "public", "static", "int", "delete", "(", "Connection", "connection", ",", "String", "table", ",", "String", "where", ",", "String", "[", "]", "args", ")", "{", "StringBuilder", "delete", "=", "new", "StringBuilder", "(", ")", ";", "delete", ".", "append",...
Execute a deletion @param connection connection @param table table name @param where where clause @param args where arguments @return deleted count
[ "Execute", "a", "deletion" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L328-L352
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.update
public static int update(Connection connection, String table, ContentValues values, String whereClause, String[] whereArgs) { StringBuilder update = new StringBuilder(); update.append("update ").append(CoreSQLUtils.quoteWrap(table)) .append(" set "); int setValuesSize = values.size(); int argsSize = (w...
java
public static int update(Connection connection, String table, ContentValues values, String whereClause, String[] whereArgs) { StringBuilder update = new StringBuilder(); update.append("update ").append(CoreSQLUtils.quoteWrap(table)) .append(" set "); int setValuesSize = values.size(); int argsSize = (w...
[ "public", "static", "int", "update", "(", "Connection", "connection", ",", "String", "table", ",", "ContentValues", "values", ",", "String", "whereClause", ",", "String", "[", "]", "whereArgs", ")", "{", "StringBuilder", "update", "=", "new", "StringBuilder", ...
Update table rows @param connection connection @param table table name @param values content values @param whereClause where clause @param whereArgs where arguments @return updated count
[ "Update", "table", "rows" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L369-L413
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.setArguments
public static void setArguments(PreparedStatement statement, Object[] selectionArgs) throws SQLException { if (selectionArgs != null) { for (int i = 0; i < selectionArgs.length; i++) { statement.setObject(i + 1, selectionArgs[i]); } } }
java
public static void setArguments(PreparedStatement statement, Object[] selectionArgs) throws SQLException { if (selectionArgs != null) { for (int i = 0; i < selectionArgs.length; i++) { statement.setObject(i + 1, selectionArgs[i]); } } }
[ "public", "static", "void", "setArguments", "(", "PreparedStatement", "statement", ",", "Object", "[", "]", "selectionArgs", ")", "throws", "SQLException", "{", "if", "(", "selectionArgs", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i",...
Set the prepared statement arguments @param statement prepared statement @param selectionArgs selection arguments @throws SQLException upon failure
[ "Set", "the", "prepared", "statement", "arguments" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L517-L524
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.closeStatement
public static void closeStatement(Statement statement, String sql) { if (statement != null) { try { statement.close(); } catch (SQLException e) { log.log(Level.WARNING, "Failed to close SQL Statement: " + sql, e); } } }
java
public static void closeStatement(Statement statement, String sql) { if (statement != null) { try { statement.close(); } catch (SQLException e) { log.log(Level.WARNING, "Failed to close SQL Statement: " + sql, e); } } }
[ "public", "static", "void", "closeStatement", "(", "Statement", "statement", ",", "String", "sql", ")", "{", "if", "(", "statement", "!=", "null", ")", "{", "try", "{", "statement", ".", "close", "(", ")", ";", "}", "catch", "(", "SQLException", "e", "...
Close the statement @param statement statement @param sql sql statement
[ "Close", "the", "statement" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L534-L543
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.closeResultSet
public static void closeResultSet(ResultSet resultSet, String sql) { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { log.log(Level.WARNING, "Failed to close SQL ResultSet: " + sql, e); } } }
java
public static void closeResultSet(ResultSet resultSet, String sql) { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { log.log(Level.WARNING, "Failed to close SQL ResultSet: " + sql, e); } } }
[ "public", "static", "void", "closeResultSet", "(", "ResultSet", "resultSet", ",", "String", "sql", ")", "{", "if", "(", "resultSet", "!=", "null", ")", "{", "try", "{", "resultSet", ".", "close", "(", ")", ";", "}", "catch", "(", "SQLException", "e", "...
Close the ResultSet @param resultSet result set @param sql sql statement
[ "Close", "the", "ResultSet" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L553-L562
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.closeResultSetStatement
public static void closeResultSetStatement(ResultSet resultSet, String sql) { if (resultSet != null) { try { resultSet.getStatement().close(); } catch (SQLException e) { log.log(Level.WARNING, "Failed to close SQL ResultSet: " + sql, e); } } }
java
public static void closeResultSetStatement(ResultSet resultSet, String sql) { if (resultSet != null) { try { resultSet.getStatement().close(); } catch (SQLException e) { log.log(Level.WARNING, "Failed to close SQL ResultSet: " + sql, e); } } }
[ "public", "static", "void", "closeResultSetStatement", "(", "ResultSet", "resultSet", ",", "String", "sql", ")", "{", "if", "(", "resultSet", "!=", "null", ")", "{", "try", "{", "resultSet", ".", "getStatement", "(", ")", ".", "close", "(", ")", ";", "}"...
Close the ResultSet Statement from which it was created, which closes all ResultSets as well @param resultSet result set @param sql sql statement
[ "Close", "the", "ResultSet", "Statement", "from", "which", "it", "was", "created", "which", "closes", "all", "ResultSets", "as", "well" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L573-L582
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/db/SQLUtils.java
SQLUtils.wrapQuery
public static ResultSetResult wrapQuery(Connection connection, String sql, String[] selectionArgs) { return new ResultSetResult(query(connection, sql, selectionArgs)); }
java
public static ResultSetResult wrapQuery(Connection connection, String sql, String[] selectionArgs) { return new ResultSetResult(query(connection, sql, selectionArgs)); }
[ "public", "static", "ResultSetResult", "wrapQuery", "(", "Connection", "connection", ",", "String", "sql", ",", "String", "[", "]", "selectionArgs", ")", "{", "return", "new", "ResultSetResult", "(", "query", "(", "connection", ",", "sql", ",", "selectionArgs", ...
Perform the query and wrap as a result @param connection connection @param sql sql statement @param selectionArgs selection arguments @return result @since 3.1.0
[ "Perform", "the", "query", "and", "wrap", "as", "a", "result" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/db/SQLUtils.java#L596-L599
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/style/IconRow.java
IconRow.getDerivedDimensions
public double[] getDerivedDimensions() { Double width = getWidth(); Double height = getHeight(); if (width == null || height == null) { int dataWidth; int dataHeight; try { BufferedImage image = getDataImage(); dataWidth = image.getWidth(); dataHeight = image.getHeight(); } catch (IOEx...
java
public double[] getDerivedDimensions() { Double width = getWidth(); Double height = getHeight(); if (width == null || height == null) { int dataWidth; int dataHeight; try { BufferedImage image = getDataImage(); dataWidth = image.getWidth(); dataHeight = image.getHeight(); } catch (IOEx...
[ "public", "double", "[", "]", "getDerivedDimensions", "(", ")", "{", "Double", "width", "=", "getWidth", "(", ")", ";", "Double", "height", "=", "getHeight", "(", ")", ";", "if", "(", "width", "==", "null", "||", "height", "==", "null", ")", "{", "in...
Get the derived width and height from the values and icon data, scaled as needed @return derived dimensions array with two values, width at index 0, height at index 1
[ "Get", "the", "derived", "width", "and", "height", "from", "the", "values", "and", "icon", "data", "scaled", "as", "needed" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/style/IconRow.java#L263-L301
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/io/TileReader.java
TileReader.main
public static void main(String[] args) throws Exception { boolean valid = true; boolean requiredArguments = false; String imageFormat = null; boolean rawImage = false; File inputDirectory = null; TileFormatType tileType = null; File geoPackageFile = null; String tileTable = null; for (int i = 0; va...
java
public static void main(String[] args) throws Exception { boolean valid = true; boolean requiredArguments = false; String imageFormat = null; boolean rawImage = false; File inputDirectory = null; TileFormatType tileType = null; File geoPackageFile = null; String tileTable = null; for (int i = 0; va...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "boolean", "valid", "=", "true", ";", "boolean", "requiredArguments", "=", "false", ";", "String", "imageFormat", "=", "null", ";", "boolean", "rawImage", ...
Main method to read tiles from the file system into a GeoPackage @param args arguments @throws Exception upon failure
[ "Main", "method", "to", "read", "tiles", "from", "the", "file", "system", "into", "a", "GeoPackage" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/TileReader.java#L99-L173
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/user/UserDao.java
UserDao.update
public int update(ContentValues values, String whereClause, String[] whereArgs) { return SQLUtils.update(connection, getTableName(), values, whereClause, whereArgs); }
java
public int update(ContentValues values, String whereClause, String[] whereArgs) { return SQLUtils.update(connection, getTableName(), values, whereClause, whereArgs); }
[ "public", "int", "update", "(", "ContentValues", "values", ",", "String", "whereClause", ",", "String", "[", "]", "whereArgs", ")", "{", "return", "SQLUtils", ".", "update", "(", "connection", ",", "getTableName", "(", ")", ",", "values", ",", "whereClause",...
Update all rows matching the where clause with the provided values @param values content values @param whereClause where clause @param whereArgs where arguments @return updated count
[ "Update", "all", "rows", "matching", "the", "where", "clause", "with", "the", "provided", "values" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/user/UserDao.java#L100-L104
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/io/URLTileGen.java
URLTileGen.finish
private static void finish() { if (progress.getMax() != null) { StringBuilder output = new StringBuilder(); output.append("\nTile Generation: ").append(progress.getProgress()) .append(" of ").append(progress.getMax()); if (geoPackage != null) { try { GeoPackageTextOutput textOutput = new Geo...
java
private static void finish() { if (progress.getMax() != null) { StringBuilder output = new StringBuilder(); output.append("\nTile Generation: ").append(progress.getProgress()) .append(" of ").append(progress.getMax()); if (geoPackage != null) { try { GeoPackageTextOutput textOutput = new Geo...
[ "private", "static", "void", "finish", "(", ")", "{", "if", "(", "progress", ".", "getMax", "(", ")", "!=", "null", ")", "{", "StringBuilder", "output", "=", "new", "StringBuilder", "(", ")", ";", "output", ".", "append", "(", "\"\\nTile Generation: \"", ...
Finish tile generation
[ "Finish", "tile", "generation" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/URLTileGen.java#L434-L458
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.getPixelValue
public short getPixelValue(BufferedImage image, int x, int y) { validateImageType(image); WritableRaster raster = image.getRaster(); short pixelValue = getPixelValue(raster, x, y); return pixelValue; }
java
public short getPixelValue(BufferedImage image, int x, int y) { validateImageType(image); WritableRaster raster = image.getRaster(); short pixelValue = getPixelValue(raster, x, y); return pixelValue; }
[ "public", "short", "getPixelValue", "(", "BufferedImage", "image", ",", "int", "x", ",", "int", "y", ")", "{", "validateImageType", "(", "image", ")", ";", "WritableRaster", "raster", "=", "image", ".", "getRaster", "(", ")", ";", "short", "pixelValue", "=...
Get the pixel value as an "unsigned short" @param image tile image @param x x coordinate @param y y coordinate @return "unsigned short" pixel value
[ "Get", "the", "pixel", "value", "as", "an", "unsigned", "short" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L118-L123
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.getPixelValue
public short getPixelValue(WritableRaster raster, int x, int y) { Object pixelData = raster.getDataElements(x, y, null); short sdata[] = (short[]) pixelData; if (sdata.length != 1) { throw new UnsupportedOperationException( "This method is not supported by this color model"); } short pixelValue = sdat...
java
public short getPixelValue(WritableRaster raster, int x, int y) { Object pixelData = raster.getDataElements(x, y, null); short sdata[] = (short[]) pixelData; if (sdata.length != 1) { throw new UnsupportedOperationException( "This method is not supported by this color model"); } short pixelValue = sdat...
[ "public", "short", "getPixelValue", "(", "WritableRaster", "raster", ",", "int", "x", ",", "int", "y", ")", "{", "Object", "pixelData", "=", "raster", ".", "getDataElements", "(", "x", ",", "y", ",", "null", ")", ";", "short", "sdata", "[", "]", "=", ...
Get the pixel value as an "unsigned short" from the raster and the coordinate @param raster image raster @param x x coordinate @param y y coordinate @return "unsigned short" pixel value
[ "Get", "the", "pixel", "value", "as", "an", "unsigned", "short", "from", "the", "raster", "and", "the", "coordinate" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L154-L164
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.getPixelValues
public short[] getPixelValues(BufferedImage image) { validateImageType(image); WritableRaster raster = image.getRaster(); short[] pixelValues = getPixelValues(raster); return pixelValues; }
java
public short[] getPixelValues(BufferedImage image) { validateImageType(image); WritableRaster raster = image.getRaster(); short[] pixelValues = getPixelValues(raster); return pixelValues; }
[ "public", "short", "[", "]", "getPixelValues", "(", "BufferedImage", "image", ")", "{", "validateImageType", "(", "image", ")", ";", "WritableRaster", "raster", "=", "image", ".", "getRaster", "(", ")", ";", "short", "[", "]", "pixelValues", "=", "getPixelVa...
Get the pixel values of the buffered image as "unsigned shorts" @param image tile image @return "unsigned short" pixel values
[ "Get", "the", "pixel", "values", "of", "the", "buffered", "image", "as", "unsigned", "shorts" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L190-L195
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.getUnsignedPixelValues
public int[] getUnsignedPixelValues(BufferedImage image) { short[] pixelValues = getPixelValues(image); int[] unsignedPixelValues = getUnsignedPixelValues(pixelValues); return unsignedPixelValues; }
java
public int[] getUnsignedPixelValues(BufferedImage image) { short[] pixelValues = getPixelValues(image); int[] unsignedPixelValues = getUnsignedPixelValues(pixelValues); return unsignedPixelValues; }
[ "public", "int", "[", "]", "getUnsignedPixelValues", "(", "BufferedImage", "image", ")", "{", "short", "[", "]", "pixelValues", "=", "getPixelValues", "(", "image", ")", ";", "int", "[", "]", "unsignedPixelValues", "=", "getUnsignedPixelValues", "(", "pixelValue...
Get the pixel values of the buffered image as 16 bit unsigned integer values @param image tile image @return unsigned integer pixel values
[ "Get", "the", "pixel", "values", "of", "the", "buffered", "image", "as", "16", "bit", "unsigned", "integer", "values" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L205-L209
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.getPixelValues
public short[] getPixelValues(WritableRaster raster) { DataBufferUShort buffer = (DataBufferUShort) raster.getDataBuffer(); short[] pixelValues = buffer.getData(); return pixelValues; }
java
public short[] getPixelValues(WritableRaster raster) { DataBufferUShort buffer = (DataBufferUShort) raster.getDataBuffer(); short[] pixelValues = buffer.getData(); return pixelValues; }
[ "public", "short", "[", "]", "getPixelValues", "(", "WritableRaster", "raster", ")", "{", "DataBufferUShort", "buffer", "=", "(", "DataBufferUShort", ")", "raster", ".", "getDataBuffer", "(", ")", ";", "short", "[", "]", "pixelValues", "=", "buffer", ".", "g...
Get the pixel values of the raster as "unsigned shorts" @param raster image raster @return "unsigned short" pixel values
[ "Get", "the", "pixel", "values", "of", "the", "raster", "as", "unsigned", "shorts" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L218-L222
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.getUnsignedPixelValues
public int[] getUnsignedPixelValues(WritableRaster raster) { short[] pixelValues = getPixelValues(raster); int[] unsignedPixelValues = getUnsignedPixelValues(pixelValues); return unsignedPixelValues; }
java
public int[] getUnsignedPixelValues(WritableRaster raster) { short[] pixelValues = getPixelValues(raster); int[] unsignedPixelValues = getUnsignedPixelValues(pixelValues); return unsignedPixelValues; }
[ "public", "int", "[", "]", "getUnsignedPixelValues", "(", "WritableRaster", "raster", ")", "{", "short", "[", "]", "pixelValues", "=", "getPixelValues", "(", "raster", ")", ";", "int", "[", "]", "unsignedPixelValues", "=", "getUnsignedPixelValues", "(", "pixelVa...
Get the pixel values of the raster as 16 bit unsigned integer values @param raster image raster @return unsigned integer pixel values
[ "Get", "the", "pixel", "values", "of", "the", "raster", "as", "16", "bit", "unsigned", "integer", "values" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L231-L235
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.validateImageType
public void validateImageType(BufferedImage image) { if (image == null) { throw new GeoPackageException("The image is null"); } if (image.getColorModel().getTransferType() != DataBuffer.TYPE_USHORT) { throw new GeoPackageException( "The coverage data tile is expected to be a 16 bit unsigned short, actu...
java
public void validateImageType(BufferedImage image) { if (image == null) { throw new GeoPackageException("The image is null"); } if (image.getColorModel().getTransferType() != DataBuffer.TYPE_USHORT) { throw new GeoPackageException( "The coverage data tile is expected to be a 16 bit unsigned short, actu...
[ "public", "void", "validateImageType", "(", "BufferedImage", "image", ")", "{", "if", "(", "image", "==", "null", ")", "{", "throw", "new", "GeoPackageException", "(", "\"The image is null\"", ")", ";", "}", "if", "(", "image", ".", "getColorModel", "(", ")"...
Validate that the image type is an unsigned short @param image tile image
[ "Validate", "that", "the", "image", "type", "is", "an", "unsigned", "short" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L243-L252
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.getImageBytes
public byte[] getImageBytes(BufferedImage image) { byte[] bytes = null; try { bytes = ImageUtils.writeImageToBytes(image, ImageUtils.IMAGE_FORMAT_PNG); } catch (IOException e) { throw new GeoPackageException("Failed to write image to " + ImageUtils.IMAGE_FORMAT_PNG + " bytes", e); } return byt...
java
public byte[] getImageBytes(BufferedImage image) { byte[] bytes = null; try { bytes = ImageUtils.writeImageToBytes(image, ImageUtils.IMAGE_FORMAT_PNG); } catch (IOException e) { throw new GeoPackageException("Failed to write image to " + ImageUtils.IMAGE_FORMAT_PNG + " bytes", e); } return byt...
[ "public", "byte", "[", "]", "getImageBytes", "(", "BufferedImage", "image", ")", "{", "byte", "[", "]", "bytes", "=", "null", ";", "try", "{", "bytes", "=", "ImageUtils", ".", "writeImageToBytes", "(", "image", ",", "ImageUtils", ".", "IMAGE_FORMAT_PNG", "...
Get the image as PNG bytes @param image buffered image @return image bytes
[ "Get", "the", "image", "as", "PNG", "bytes" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L638-L648
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.setPixelValue
public void setPixelValue(WritableRaster raster, int x, int y, short pixelValue) { short data[] = new short[] { pixelValue }; raster.setDataElements(x, y, data); }
java
public void setPixelValue(WritableRaster raster, int x, int y, short pixelValue) { short data[] = new short[] { pixelValue }; raster.setDataElements(x, y, data); }
[ "public", "void", "setPixelValue", "(", "WritableRaster", "raster", ",", "int", "x", ",", "int", "y", ",", "short", "pixelValue", ")", "{", "short", "data", "[", "]", "=", "new", "short", "[", "]", "{", "pixelValue", "}", ";", "raster", ".", "setDataEl...
Set the "unsigned short" pixel value into the image raster @param raster image raster @param x x coordinate @param y y coordinate @param pixelValue "unsigned short" pixel value
[ "Set", "the", "unsigned", "short", "pixel", "value", "into", "the", "image", "raster" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L662-L666
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.setPixelValue
public void setPixelValue(WritableRaster raster, int x, int y, int unsignedPixelValue) { short pixelValue = getPixelValue(unsignedPixelValue); setPixelValue(raster, x, y, pixelValue); }
java
public void setPixelValue(WritableRaster raster, int x, int y, int unsignedPixelValue) { short pixelValue = getPixelValue(unsignedPixelValue); setPixelValue(raster, x, y, pixelValue); }
[ "public", "void", "setPixelValue", "(", "WritableRaster", "raster", ",", "int", "x", ",", "int", "y", ",", "int", "unsignedPixelValue", ")", "{", "short", "pixelValue", "=", "getPixelValue", "(", "unsignedPixelValue", ")", ";", "setPixelValue", "(", "raster", ...
Set the unsigned 16 bit integer pixel value into the image raster @param raster image raster @param x x coordinate @param y y coordinate @param unsignedPixelValue unsigned 16 bit integer pixel value
[ "Set", "the", "unsigned", "16", "bit", "integer", "pixel", "value", "into", "the", "image", "raster" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L680-L684
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/features/Paint.java
Paint.getStroke
public Stroke getStroke() { Stroke theStroke = stroke; if (theStroke == null) { theStroke = new BasicStroke(strokeWidth); stroke = theStroke; } return theStroke; }
java
public Stroke getStroke() { Stroke theStroke = stroke; if (theStroke == null) { theStroke = new BasicStroke(strokeWidth); stroke = theStroke; } return theStroke; }
[ "public", "Stroke", "getStroke", "(", ")", "{", "Stroke", "theStroke", "=", "stroke", ";", "if", "(", "theStroke", "==", "null", ")", "{", "theStroke", "=", "new", "BasicStroke", "(", "strokeWidth", ")", ";", "stroke", "=", "theStroke", ";", "}", "return...
Get the stroke created from the stroke width @return stroke
[ "Get", "the", "stroke", "created", "from", "the", "stroke", "width" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/features/Paint.java#L104-L111
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/extension/style/StyleMappingDao.java
StyleMappingDao.queryByBaseFeatureId
public List<StyleMappingRow> queryByBaseFeatureId(long id) { List<StyleMappingRow> rows = new ArrayList<>(); UserCustomResultSet resultSet = queryByBaseId(id); try { while (resultSet.moveToNext()) { rows.add(getRow(resultSet)); } } finally { resultSet.close(); } return rows; }
java
public List<StyleMappingRow> queryByBaseFeatureId(long id) { List<StyleMappingRow> rows = new ArrayList<>(); UserCustomResultSet resultSet = queryByBaseId(id); try { while (resultSet.moveToNext()) { rows.add(getRow(resultSet)); } } finally { resultSet.close(); } return rows; }
[ "public", "List", "<", "StyleMappingRow", ">", "queryByBaseFeatureId", "(", "long", "id", ")", "{", "List", "<", "StyleMappingRow", ">", "rows", "=", "new", "ArrayList", "<>", "(", ")", ";", "UserCustomResultSet", "resultSet", "=", "queryByBaseId", "(", "id", ...
Query for style mappings by base id @param id base id, feature contents id or feature geometry id @return style mappings rows
[ "Query", "for", "style", "mappings", "by", "base", "id" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/extension/style/StyleMappingDao.java#L75-L86
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/ImageRectangleF.java
ImageRectangleF.round
public ImageRectangle round() { return new ImageRectangle(Math.round(left), Math.round(top), Math.round(right), Math.round(bottom)); }
java
public ImageRectangle round() { return new ImageRectangle(Math.round(left), Math.round(top), Math.round(right), Math.round(bottom)); }
[ "public", "ImageRectangle", "round", "(", ")", "{", "return", "new", "ImageRectangle", "(", "Math", ".", "round", "(", "left", ")", ",", "Math", ".", "round", "(", "top", ")", ",", "Math", ".", "round", "(", "right", ")", ",", "Math", ".", "round", ...
Round the floating point rectangle to an integer rectangle @return image rectangle
[ "Round", "the", "floating", "point", "rectangle", "to", "an", "integer", "rectangle" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageRectangleF.java#L114-L117
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/io/TileWriter.java
TileWriter.writeGeoPackageFormatTiles
private static int writeGeoPackageFormatTiles(TileDao tileDao, File directory, String imageFormat, Integer width, Integer height, boolean rawImage) throws IOException { int tileCount = 0; // Go through each zoom level for (long zoomLevel = tileDao.getMinZoom(); zoomLevel <= tileDao .getMaxZoom(); zoom...
java
private static int writeGeoPackageFormatTiles(TileDao tileDao, File directory, String imageFormat, Integer width, Integer height, boolean rawImage) throws IOException { int tileCount = 0; // Go through each zoom level for (long zoomLevel = tileDao.getMinZoom(); zoomLevel <= tileDao .getMaxZoom(); zoom...
[ "private", "static", "int", "writeGeoPackageFormatTiles", "(", "TileDao", "tileDao", ",", "File", "directory", ",", "String", "imageFormat", ",", "Integer", "width", ",", "Integer", "height", ",", "boolean", "rawImage", ")", "throws", "IOException", "{", "int", ...
Write GeoPackage formatted tiles @param tileDao @param zoomLevel @param tileMatrix @param zDirectory @param imageFormat @param width @param height @param rawImage @return @throws IOException
[ "Write", "GeoPackage", "formatted", "tiles" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/TileWriter.java#L379-L490
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/io/TileWriter.java
TileWriter.getLength
private static double getLength(BoundingBox boundingBox, ProjectionTransform toWebMercatorTransform) { BoundingBox transformedBoundingBox = boundingBox .transform(toWebMercatorTransform); return getLength(transformedBoundingBox); }
java
private static double getLength(BoundingBox boundingBox, ProjectionTransform toWebMercatorTransform) { BoundingBox transformedBoundingBox = boundingBox .transform(toWebMercatorTransform); return getLength(transformedBoundingBox); }
[ "private", "static", "double", "getLength", "(", "BoundingBox", "boundingBox", ",", "ProjectionTransform", "toWebMercatorTransform", ")", "{", "BoundingBox", "transformedBoundingBox", "=", "boundingBox", ".", "transform", "(", "toWebMercatorTransform", ")", ";", "return",...
Get the length of the bounding box projected using the transformation @param boundingBox @param toWebMercatorTransform @return length
[ "Get", "the", "length", "of", "the", "bounding", "box", "projected", "using", "the", "transformation" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/TileWriter.java#L662-L667
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/io/TileWriter.java
TileWriter.getLength
private static double getLength(BoundingBox boundingBox) { double width = boundingBox.getMaxLongitude() - boundingBox.getMinLongitude(); double height = boundingBox.getMaxLatitude() - boundingBox.getMinLatitude(); double length = Math.min(width, height); return length; }
java
private static double getLength(BoundingBox boundingBox) { double width = boundingBox.getMaxLongitude() - boundingBox.getMinLongitude(); double height = boundingBox.getMaxLatitude() - boundingBox.getMinLatitude(); double length = Math.min(width, height); return length; }
[ "private", "static", "double", "getLength", "(", "BoundingBox", "boundingBox", ")", "{", "double", "width", "=", "boundingBox", ".", "getMaxLongitude", "(", ")", "-", "boundingBox", ".", "getMinLongitude", "(", ")", ";", "double", "height", "=", "boundingBox", ...
Get the length of the bounding box @param boundingBox @return length
[ "Get", "the", "length", "of", "the", "bounding", "box" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/io/TileWriter.java#L675-L684
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/GeoPackageCache.java
GeoPackageCache.getOrOpen
public GeoPackage getOrOpen(String name, File file) { return getOrOpen(name, file, true); }
java
public GeoPackage getOrOpen(String name, File file) { return getOrOpen(name, file, true); }
[ "public", "GeoPackage", "getOrOpen", "(", "String", "name", ",", "File", "file", ")", "{", "return", "getOrOpen", "(", "name", ",", "file", ",", "true", ")", ";", "}" ]
Get the cached GeoPackage or open and cache the GeoPackage file @param name GeoPackage name @param file GeoPackage file @return GeoPackage
[ "Get", "the", "cached", "GeoPackage", "or", "open", "and", "cache", "the", "GeoPackage", "file" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/GeoPackageCache.java#L42-L44
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxJavaUtils.java
TileBoundingBoxJavaUtils.getRectangle
public static ImageRectangle getRectangle(long width, long height, BoundingBox boundingBox, BoundingBox boundingBoxSection) { ImageRectangleF rectF = getFloatRectangle(width, height, boundingBox, boundingBoxSection); ImageRectangle rect = rectF.round(); return rect; }
java
public static ImageRectangle getRectangle(long width, long height, BoundingBox boundingBox, BoundingBox boundingBoxSection) { ImageRectangleF rectF = getFloatRectangle(width, height, boundingBox, boundingBoxSection); ImageRectangle rect = rectF.round(); return rect; }
[ "public", "static", "ImageRectangle", "getRectangle", "(", "long", "width", ",", "long", "height", ",", "BoundingBox", "boundingBox", ",", "BoundingBox", "boundingBoxSection", ")", "{", "ImageRectangleF", "rectF", "=", "getFloatRectangle", "(", "width", ",", "height...
Get a rectangle using the tile width, height, bounding box, and the bounding box section within the outer box to build the rectangle from @param width width @param height height @param boundingBox full bounding box @param boundingBoxSection rectangle bounding box section @return rectangle @since 1.2.0
[ "Get", "a", "rectangle", "using", "the", "tile", "width", "height", "bounding", "box", "and", "the", "bounding", "box", "section", "within", "the", "outer", "box", "to", "build", "the", "rectangle", "from" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxJavaUtils.java#L27-L36
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxJavaUtils.java
TileBoundingBoxJavaUtils.getRoundedFloatRectangle
public static ImageRectangleF getRoundedFloatRectangle(long width, long height, BoundingBox boundingBox, BoundingBox boundingBoxSection) { ImageRectangle rect = getRectangle(width, height, boundingBox, boundingBoxSection); ImageRectangleF rectF = new ImageRectangleF(rect); return rectF; }
java
public static ImageRectangleF getRoundedFloatRectangle(long width, long height, BoundingBox boundingBox, BoundingBox boundingBoxSection) { ImageRectangle rect = getRectangle(width, height, boundingBox, boundingBoxSection); ImageRectangleF rectF = new ImageRectangleF(rect); return rectF; }
[ "public", "static", "ImageRectangleF", "getRoundedFloatRectangle", "(", "long", "width", ",", "long", "height", ",", "BoundingBox", "boundingBox", ",", "BoundingBox", "boundingBoxSection", ")", "{", "ImageRectangle", "rect", "=", "getRectangle", "(", "width", ",", "...
Get a rectangle with rounded floating point boundaries using the tile width, height, bounding box, and the bounding box section within the outer box to build the rectangle from @param width width @param height height @param boundingBox full bounding box @param boundingBoxSection rectangle bounding box section @return ...
[ "Get", "a", "rectangle", "with", "rounded", "floating", "point", "boundaries", "using", "the", "tile", "width", "height", "bounding", "box", "and", "the", "bounding", "box", "section", "within", "the", "outer", "box", "to", "build", "the", "rectangle", "from" ...
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxJavaUtils.java#L54-L63
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxJavaUtils.java
TileBoundingBoxJavaUtils.getFloatRectangle
public static ImageRectangleF getFloatRectangle(long width, long height, BoundingBox boundingBox, BoundingBox boundingBoxSection) { float left = TileBoundingBoxUtils.getXPixel(width, boundingBox, boundingBoxSection.getMinLongitude()); float right = TileBoundingBoxUtils.getXPixel(width, boundingBox, boun...
java
public static ImageRectangleF getFloatRectangle(long width, long height, BoundingBox boundingBox, BoundingBox boundingBoxSection) { float left = TileBoundingBoxUtils.getXPixel(width, boundingBox, boundingBoxSection.getMinLongitude()); float right = TileBoundingBoxUtils.getXPixel(width, boundingBox, boun...
[ "public", "static", "ImageRectangleF", "getFloatRectangle", "(", "long", "width", ",", "long", "height", ",", "BoundingBox", "boundingBox", ",", "BoundingBox", "boundingBoxSection", ")", "{", "float", "left", "=", "TileBoundingBoxUtils", ".", "getXPixel", "(", "widt...
Get a rectangle with floating point boundaries using the tile width, height, bounding box, and the bounding box section within the outer box to build the rectangle from @param width width @param height height @param boundingBox full bounding box @param boundingBoxSection rectangle bounding box section @return floating...
[ "Get", "a", "rectangle", "with", "floating", "point", "boundaries", "using", "the", "tile", "width", "height", "bounding", "box", "and", "the", "bounding", "box", "section", "within", "the", "outer", "box", "to", "build", "the", "rectangle", "from" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxJavaUtils.java#L81-L96
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java
GeoPackageJavaProperties.getProperty
public static synchronized String getProperty(String key, boolean required) { if (mProperties == null) { mProperties = initializeConfigurationProperties(); } String value = mProperties.getProperty(key); if (value == null && required) { throw new RuntimeException("Property not found: " + key); } return...
java
public static synchronized String getProperty(String key, boolean required) { if (mProperties == null) { mProperties = initializeConfigurationProperties(); } String value = mProperties.getProperty(key); if (value == null && required) { throw new RuntimeException("Property not found: " + key); } return...
[ "public", "static", "synchronized", "String", "getProperty", "(", "String", "key", ",", "boolean", "required", ")", "{", "if", "(", "mProperties", "==", "null", ")", "{", "mProperties", "=", "initializeConfigurationProperties", "(", ")", ";", "}", "String", "v...
Get a property by key @param key key @param required required flag @return property value
[ "Get", "a", "property", "by", "key" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java#L49-L58
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java
GeoPackageJavaProperties.getProperty
public static String getProperty(String base, String property) { return getProperty(base, property, true); }
java
public static String getProperty(String base, String property) { return getProperty(base, property, true); }
[ "public", "static", "String", "getProperty", "(", "String", "base", ",", "String", "property", ")", "{", "return", "getProperty", "(", "base", ",", "property", ",", "true", ")", ";", "}" ]
Get a required property by base property and property name @param base base property @param property property @return property value
[ "Get", "a", "required", "property", "by", "base", "property", "and", "property", "name" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java#L69-L71
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java
GeoPackageJavaProperties.getIntegerProperty
public static Integer getIntegerProperty(String key, boolean required) { Integer value = null; String stringValue = getProperty(key, required); if (stringValue != null) { value = Integer.valueOf(stringValue); } return value; }
java
public static Integer getIntegerProperty(String key, boolean required) { Integer value = null; String stringValue = getProperty(key, required); if (stringValue != null) { value = Integer.valueOf(stringValue); } return value; }
[ "public", "static", "Integer", "getIntegerProperty", "(", "String", "key", ",", "boolean", "required", ")", "{", "Integer", "value", "=", "null", ";", "String", "stringValue", "=", "getProperty", "(", "key", ",", "required", ")", ";", "if", "(", "stringValue...
Get an integer property by key @param key key @param required required flag @return property value
[ "Get", "an", "integer", "property", "by", "key" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java#L110-L117
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java
GeoPackageJavaProperties.getFloatProperty
public static Float getFloatProperty(String key, boolean required) { Float value = null; String stringValue = getProperty(key, required); if (stringValue != null) { value = Float.valueOf(stringValue); } return value; }
java
public static Float getFloatProperty(String key, boolean required) { Float value = null; String stringValue = getProperty(key, required); if (stringValue != null) { value = Float.valueOf(stringValue); } return value; }
[ "public", "static", "Float", "getFloatProperty", "(", "String", "key", ",", "boolean", "required", ")", "{", "Float", "value", "=", "null", ";", "String", "stringValue", "=", "getProperty", "(", "key", ",", "required", ")", ";", "if", "(", "stringValue", "...
Get a float by key @param key key @param required required flag @return property value
[ "Get", "a", "float", "by", "key" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java#L169-L176
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java
GeoPackageJavaProperties.getBooleanProperty
public static Boolean getBooleanProperty(String key, boolean required) { Boolean value = null; String stringValue = getProperty(key, required); if (stringValue != null) { value = Boolean.valueOf(stringValue); } return value; }
java
public static Boolean getBooleanProperty(String key, boolean required) { Boolean value = null; String stringValue = getProperty(key, required); if (stringValue != null) { value = Boolean.valueOf(stringValue); } return value; }
[ "public", "static", "Boolean", "getBooleanProperty", "(", "String", "key", ",", "boolean", "required", ")", "{", "Boolean", "value", "=", "null", ";", "String", "stringValue", "=", "getProperty", "(", "key", ",", "required", ")", ";", "if", "(", "stringValue...
Get a boolean by key @param key key @param required required flag @return property value
[ "Get", "a", "boolean", "by", "key" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java#L228-L235
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java
GeoPackageJavaProperties.getBooleanProperty
public static Boolean getBooleanProperty(String base, String property, boolean required) { return getBooleanProperty(base + JavaPropertyConstants.PROPERTY_DIVIDER + property, required); }
java
public static Boolean getBooleanProperty(String base, String property, boolean required) { return getBooleanProperty(base + JavaPropertyConstants.PROPERTY_DIVIDER + property, required); }
[ "public", "static", "Boolean", "getBooleanProperty", "(", "String", "base", ",", "String", "property", ",", "boolean", "required", ")", "{", "return", "getBooleanProperty", "(", "base", "+", "JavaPropertyConstants", ".", "PROPERTY_DIVIDER", "+", "property", ",", "...
Get a boolean property by base property and property name @param base base property @param property property @param required required flag @return property value
[ "Get", "a", "boolean", "property", "by", "base", "property", "and", "property", "name" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java#L261-L265
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java
GeoPackageJavaProperties.getColorProperty
public static Color getColorProperty(String key, boolean required) { Color value = null; String redProperty = key + JavaPropertyConstants.PROPERTY_DIVIDER + JavaPropertyConstants.COLOR_RED; String greenProperty = key + JavaPropertyConstants.PROPERTY_DIVIDER + JavaPropertyConstants.COLOR_GREEN; String b...
java
public static Color getColorProperty(String key, boolean required) { Color value = null; String redProperty = key + JavaPropertyConstants.PROPERTY_DIVIDER + JavaPropertyConstants.COLOR_RED; String greenProperty = key + JavaPropertyConstants.PROPERTY_DIVIDER + JavaPropertyConstants.COLOR_GREEN; String b...
[ "public", "static", "Color", "getColorProperty", "(", "String", "key", ",", "boolean", "required", ")", "{", "Color", "value", "=", "null", ";", "String", "redProperty", "=", "key", "+", "JavaPropertyConstants", ".", "PROPERTY_DIVIDER", "+", "JavaPropertyConstants...
Get a color by key @param key key @param required required flag @return property value
[ "Get", "a", "color", "by", "key" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java#L287-L308
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java
GeoPackageJavaProperties.getColorProperty
public static Color getColorProperty(String base, String property) { return getColorProperty(base, property, true); }
java
public static Color getColorProperty(String base, String property) { return getColorProperty(base, property, true); }
[ "public", "static", "Color", "getColorProperty", "(", "String", "base", ",", "String", "property", ")", "{", "return", "getColorProperty", "(", "base", ",", "property", ",", "true", ")", ";", "}" ]
Get a required color property by base property and property name @param base base property @param property property @return property value
[ "Get", "a", "required", "color", "property", "by", "base", "property", "and", "property", "name" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/property/GeoPackageJavaProperties.java#L319-L321
train
ngageoint/geopackage-java
src/main/java/mil/nga/geopackage/features/user/FeatureCacheTables.java
FeatureCacheTables.resize
public void resize(int maxCacheSize) { setMaxCacheSize(maxCacheSize); for (FeatureCache cache : tableCache.values()) { cache.resize(maxCacheSize); } }
java
public void resize(int maxCacheSize) { setMaxCacheSize(maxCacheSize); for (FeatureCache cache : tableCache.values()) { cache.resize(maxCacheSize); } }
[ "public", "void", "resize", "(", "int", "maxCacheSize", ")", "{", "setMaxCacheSize", "(", "maxCacheSize", ")", ";", "for", "(", "FeatureCache", "cache", ":", "tableCache", ".", "values", "(", ")", ")", "{", "cache", ".", "resize", "(", "maxCacheSize", ")",...
Resize all caches and update the max cache size @param maxCacheSize max cache size
[ "Resize", "all", "caches", "and", "update", "the", "max", "cache", "size" ]
889bffb5d18330a3f4bd89443acf7959ebe3a376
https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/features/user/FeatureCacheTables.java#L204-L209
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Configurable.java
Configurable.setFlag
public void setFlag(CodecFlag flag) throws JavaAVException { if (flag == null) throw new JavaAVException("Could not set codec flag. Null provided."); flags.add(flag); }
java
public void setFlag(CodecFlag flag) throws JavaAVException { if (flag == null) throw new JavaAVException("Could not set codec flag. Null provided."); flags.add(flag); }
[ "public", "void", "setFlag", "(", "CodecFlag", "flag", ")", "throws", "JavaAVException", "{", "if", "(", "flag", "==", "null", ")", "throw", "new", "JavaAVException", "(", "\"Could not set codec flag. Null provided.\"", ")", ";", "flags", ".", "add", "(", "flag"...
Set a codec flag. @param flag codec flag. @throws JavaAVException if flag is {@code null}.
[ "Set", "a", "codec", "flag", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Configurable.java#L307-L312
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Decoder.java
Decoder.createImageBuffer
private void createImageBuffer() throws JavaAVException { int format = pixelFormat.value(); int width = avContext.width(); int height = avContext.height(); picture = new AVPicture(); if (avpicture_alloc(picture, format, width, height) < 0) throw new JavaAVException("Could not allocate picture."); }
java
private void createImageBuffer() throws JavaAVException { int format = pixelFormat.value(); int width = avContext.width(); int height = avContext.height(); picture = new AVPicture(); if (avpicture_alloc(picture, format, width, height) < 0) throw new JavaAVException("Could not allocate picture."); }
[ "private", "void", "createImageBuffer", "(", ")", "throws", "JavaAVException", "{", "int", "format", "=", "pixelFormat", ".", "value", "(", ")", ";", "int", "width", "=", "avContext", ".", "width", "(", ")", ";", "int", "height", "=", "avContext", ".", "...
Create resampled picture buffer. This is only needed if the decoded picture format differs from the desired format. @throws JavaAVException if picture buffer could not be allocated.
[ "Create", "resampled", "picture", "buffer", ".", "This", "is", "only", "needed", "if", "the", "decoded", "picture", "format", "differs", "from", "the", "desired", "format", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Decoder.java#L339-L348
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Codec.java
Codec.getEncoderById
public static Codec getEncoderById(CodecID codecId) throws JavaAVException { if (codecId == null) throw new NullPointerException("CodecID is null."); AVCodec avCodec = avcodec_find_encoder(codecId.value()); if (avCodec == null || avCodec.isNull()) throw new JavaAVException("Encoder not found: " + codecId....
java
public static Codec getEncoderById(CodecID codecId) throws JavaAVException { if (codecId == null) throw new NullPointerException("CodecID is null."); AVCodec avCodec = avcodec_find_encoder(codecId.value()); if (avCodec == null || avCodec.isNull()) throw new JavaAVException("Encoder not found: " + codecId....
[ "public", "static", "Codec", "getEncoderById", "(", "CodecID", "codecId", ")", "throws", "JavaAVException", "{", "if", "(", "codecId", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"CodecID is null.\"", ")", ";", "AVCodec", "avCodec", "=", "a...
Create a new encoder with specified codec id. @param codecId the codec id. @return a new encoder. @throws JavaAVException if encoder could not be created.
[ "Create", "a", "new", "encoder", "with", "specified", "codec", "id", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Codec.java#L148-L161
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Codec.java
Codec.getDecoderById
public static Codec getDecoderById(CodecID codecId) throws JavaAVException { if (codecId == null) throw new NullPointerException("CodecID is null."); AVCodec avCodec = avcodec_find_decoder(codecId.value()); if (avCodec == null || avCodec.isNull()) throw new JavaAVException("Decoder not found: " + codecId....
java
public static Codec getDecoderById(CodecID codecId) throws JavaAVException { if (codecId == null) throw new NullPointerException("CodecID is null."); AVCodec avCodec = avcodec_find_decoder(codecId.value()); if (avCodec == null || avCodec.isNull()) throw new JavaAVException("Decoder not found: " + codecId....
[ "public", "static", "Codec", "getDecoderById", "(", "CodecID", "codecId", ")", "throws", "JavaAVException", "{", "if", "(", "codecId", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"CodecID is null.\"", ")", ";", "AVCodec", "avCodec", "=", "a...
Create a new decoder with specified codec id. @param codecId the codec id. @return a new decoder. @throws JavaAVException if decoder could not be created.
[ "Create", "a", "new", "decoder", "with", "specified", "codec", "id", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Codec.java#L172-L185
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Codec.java
Codec.getEncoderByName
public static Codec getEncoderByName(String avCodecName) throws JavaAVException { if (avCodecName == null || avCodecName.isEmpty()) throw new NullPointerException("Codec name is null or empty."); AVCodec avCodec = avcodec_find_encoder_by_name(avCodecName); if (avCodec == null || avCodec.isNull()) throw ne...
java
public static Codec getEncoderByName(String avCodecName) throws JavaAVException { if (avCodecName == null || avCodecName.isEmpty()) throw new NullPointerException("Codec name is null or empty."); AVCodec avCodec = avcodec_find_encoder_by_name(avCodecName); if (avCodec == null || avCodec.isNull()) throw ne...
[ "public", "static", "Codec", "getEncoderByName", "(", "String", "avCodecName", ")", "throws", "JavaAVException", "{", "if", "(", "avCodecName", "==", "null", "||", "avCodecName", ".", "isEmpty", "(", ")", ")", "throw", "new", "NullPointerException", "(", "\"Code...
Create a new encoder with specified codec name. @param avCodecName the codec name. @return a new encoder. @throws JavaAVException if encoder could not be created.
[ "Create", "a", "new", "encoder", "with", "specified", "codec", "name", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Codec.java#L196-L209
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Codec.java
Codec.getDecoderByName
public static Codec getDecoderByName(String avCodecName) throws JavaAVException { if (avCodecName == null || avCodecName.isEmpty()) throw new NullPointerException("Codec name is null or empty."); AVCodec avCodec = avcodec_find_decoder_by_name(avCodecName); if (avCodec == null || avCodec.isNull()) throw ne...
java
public static Codec getDecoderByName(String avCodecName) throws JavaAVException { if (avCodecName == null || avCodecName.isEmpty()) throw new NullPointerException("Codec name is null or empty."); AVCodec avCodec = avcodec_find_decoder_by_name(avCodecName); if (avCodec == null || avCodec.isNull()) throw ne...
[ "public", "static", "Codec", "getDecoderByName", "(", "String", "avCodecName", ")", "throws", "JavaAVException", "{", "if", "(", "avCodecName", "==", "null", "||", "avCodecName", ".", "isEmpty", "(", ")", ")", "throw", "new", "NullPointerException", "(", "\"Code...
Create a new decoder with specified codec name. @param avCodecName the codec name. @return a new decoder. @throws JavaAVException if decoder could not be created.
[ "Create", "a", "new", "decoder", "with", "specified", "codec", "name", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Codec.java#L220-L233
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Codec.java
Codec.getInstalledCodecs
public static String[] getInstalledCodecs() { Set<String> names = new TreeSet<String>(); AVCodec codec = null; while ((codec = av_codec_next(codec)) != null) { String shortName = codec.name().getString(); String type = MediaType.byId(codec.type()).toString().substring(0, 1); String longName = codec.long...
java
public static String[] getInstalledCodecs() { Set<String> names = new TreeSet<String>(); AVCodec codec = null; while ((codec = av_codec_next(codec)) != null) { String shortName = codec.name().getString(); String type = MediaType.byId(codec.type()).toString().substring(0, 1); String longName = codec.long...
[ "public", "static", "String", "[", "]", "getInstalledCodecs", "(", ")", "{", "Set", "<", "String", ">", "names", "=", "new", "TreeSet", "<", "String", ">", "(", ")", ";", "AVCodec", "codec", "=", "null", ";", "while", "(", "(", "codec", "=", "av_code...
Get all names of codecs that are compiled into FFmpeg. @return short codec names that the current FFmpeg version supports.
[ "Get", "all", "names", "of", "codecs", "that", "are", "compiled", "into", "FFmpeg", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Codec.java#L240-L253
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Demuxer.java
Demuxer.readFrame
public MediaFrame readFrame() throws JavaAVException { MediaFrame mediaFrame = new MediaFrame(); while (mediaFrame != null && !mediaFrame.hasFrame()) { if (av_read_frame(formatContext, avPacket) < 0) { if (videoDecoders.get(avPacket.stream_index()) != null) { // video codec may have buffered some frame...
java
public MediaFrame readFrame() throws JavaAVException { MediaFrame mediaFrame = new MediaFrame(); while (mediaFrame != null && !mediaFrame.hasFrame()) { if (av_read_frame(formatContext, avPacket) < 0) { if (videoDecoders.get(avPacket.stream_index()) != null) { // video codec may have buffered some frame...
[ "public", "MediaFrame", "readFrame", "(", ")", "throws", "JavaAVException", "{", "MediaFrame", "mediaFrame", "=", "new", "MediaFrame", "(", ")", ";", "while", "(", "mediaFrame", "!=", "null", "&&", "!", "mediaFrame", ".", "hasFrame", "(", ")", ")", "{", "i...
Consecutively retrieves media frames from previously specified input source. The media type of the returned frame may alter between consecutive calls. One call may return an audio frame and the next call may return a video frame. @return a media frame of audio or video ready to play. @throws JavaAVException if media ...
[ "Consecutively", "retrieves", "media", "frames", "from", "previously", "specified", "input", "source", ".", "The", "media", "type", "of", "the", "returned", "frame", "may", "alter", "between", "consecutive", "calls", ".", "One", "call", "may", "return", "an", ...
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Demuxer.java#L170-L200
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Audio.java
Audio.getFormatDepth
public static int getFormatDepth(SampleFormat format) { switch (format) { case U8: case U8P: return 1; case S16: case S16P: return 2; case S32: case S32P: return 4; case FLT: case FLTP: return 4; case DBL: case DBLP: return 8; default: return 0; } }
java
public static int getFormatDepth(SampleFormat format) { switch (format) { case U8: case U8P: return 1; case S16: case S16P: return 2; case S32: case S32P: return 4; case FLT: case FLTP: return 4; case DBL: case DBLP: return 8; default: return 0; } }
[ "public", "static", "int", "getFormatDepth", "(", "SampleFormat", "format", ")", "{", "switch", "(", "format", ")", "{", "case", "U8", ":", "case", "U8P", ":", "return", "1", ";", "case", "S16", ":", "case", "S16P", ":", "return", "2", ";", "case", "...
Get number of bytes per sample for specified sample format. @param format the sample format. @return number of bytes per sample, or {@code zero} if sample format is unknown.
[ "Get", "number", "of", "bytes", "per", "sample", "for", "specified", "sample", "format", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Audio.java#L48-L69
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/RingBuffer.java
RingBuffer.clear
public synchronized void clear() { for (int i = 0; i < planes; i++) { readPointer[i] = writePointer[i] = 0; bytesToRead[i] = 0; bytesToWrite[i] = buffer[i].capacity(); } }
java
public synchronized void clear() { for (int i = 0; i < planes; i++) { readPointer[i] = writePointer[i] = 0; bytesToRead[i] = 0; bytesToWrite[i] = buffer[i].capacity(); } }
[ "public", "synchronized", "void", "clear", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "planes", ";", "i", "++", ")", "{", "readPointer", "[", "i", "]", "=", "writePointer", "[", "i", "]", "=", "0", ";", "bytesToRead", "[", ...
Resets the read and write pointers. The internal buffer remains unaffected.
[ "Resets", "the", "read", "and", "write", "pointers", ".", "The", "internal", "buffer", "remains", "unaffected", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/RingBuffer.java#L82-L88
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/RingBuffer.java
RingBuffer.read
public synchronized int read(int plane, byte data[], int offset, int length) throws IOException { if (offset < 0 || length < 0 || length > data.length - offset) throw new IndexOutOfBoundsException(); if (bytesToRead[plane] == 0) return 0; if (bytesToRead[plane] < length) length = bytesToRead[plane]; ...
java
public synchronized int read(int plane, byte data[], int offset, int length) throws IOException { if (offset < 0 || length < 0 || length > data.length - offset) throw new IndexOutOfBoundsException(); if (bytesToRead[plane] == 0) return 0; if (bytesToRead[plane] < length) length = bytesToRead[plane]; ...
[ "public", "synchronized", "int", "read", "(", "int", "plane", ",", "byte", "data", "[", "]", ",", "int", "offset", ",", "int", "length", ")", "throws", "IOException", "{", "if", "(", "offset", "<", "0", "||", "length", "<", "0", "||", "length", ">", ...
Read as much data as possible from this buffer. @param plane the audio channel. @param data where to store the read data. @param offset offset of data in array. @param length amount of data to read. @return Amount of data read.
[ "Read", "as", "much", "data", "as", "possible", "from", "this", "buffer", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/RingBuffer.java#L194-L222
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/AudioFrame.java
AudioFrame.clear
public void clear() { if (planePointers != null) { for (int i = 0; i < getPlaneCount(); i++) { av_free(planePointers[i].position(0)); } planePointers = null; } }
java
public void clear() { if (planePointers != null) { for (int i = 0; i < getPlaneCount(); i++) { av_free(planePointers[i].position(0)); } planePointers = null; } }
[ "public", "void", "clear", "(", ")", "{", "if", "(", "planePointers", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getPlaneCount", "(", ")", ";", "i", "++", ")", "{", "av_free", "(", "planePointers", "[", "i", "]", ...
Free the memory of sample buffers.
[ "Free", "the", "memory", "of", "sample", "buffers", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/AudioFrame.java#L166-L173
train
hoary/JavaAV
JavaAV/src/main/java/com/github/hoary/javaav/Camera.java
Camera.open
public void open(int width, int height, double frameRate) throws JavaAVException { if (!open.get()) { String input = "video=" + device; demuxer = new Demuxer(); demuxer.setInputFormat(format); demuxer.setImageWidth(width); demuxer.setImageHeight(height); demuxer.setFramerate(frameRate); demuxer....
java
public void open(int width, int height, double frameRate) throws JavaAVException { if (!open.get()) { String input = "video=" + device; demuxer = new Demuxer(); demuxer.setInputFormat(format); demuxer.setImageWidth(width); demuxer.setImageHeight(height); demuxer.setFramerate(frameRate); demuxer....
[ "public", "void", "open", "(", "int", "width", ",", "int", "height", ",", "double", "frameRate", ")", "throws", "JavaAVException", "{", "if", "(", "!", "open", ".", "get", "(", ")", ")", "{", "String", "input", "=", "\"video=\"", "+", "device", ";", ...
Open the camera with specified image size and capture frame rate. @param width the image width. @param height the image height. @param frameRate the capture frame rate. @throws JavaAVException if camera could not be opened.
[ "Open", "the", "camera", "with", "specified", "image", "size", "and", "capture", "frame", "rate", "." ]
2d42b53d618ba0c663ae9abfd177b3ace41264cb
https://github.com/hoary/JavaAV/blob/2d42b53d618ba0c663ae9abfd177b3ace41264cb/JavaAV/src/main/java/com/github/hoary/javaav/Camera.java#L96-L109
train
groovyfx-project/groovyfx
src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java
FXBindableASTTransformation.visit
@Override public void visit(ASTNode[] nodes, SourceUnit sourceUnit) { if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) { throw new IllegalArgumentException("Internal error: wrong types: " + nodes[0].getClass().getName() + " / " + nodes[1].getClas...
java
@Override public void visit(ASTNode[] nodes, SourceUnit sourceUnit) { if (!(nodes[0] instanceof AnnotationNode) || !(nodes[1] instanceof AnnotatedNode)) { throw new IllegalArgumentException("Internal error: wrong types: " + nodes[0].getClass().getName() + " / " + nodes[1].getClas...
[ "@", "Override", "public", "void", "visit", "(", "ASTNode", "[", "]", "nodes", ",", "SourceUnit", "sourceUnit", ")", "{", "if", "(", "!", "(", "nodes", "[", "0", "]", "instanceof", "AnnotationNode", ")", "||", "!", "(", "nodes", "[", "1", "]", "insta...
This ASTTransformation method is called when the compiler encounters our annotation. @param nodes An array of nodes. Index 0 is the annotation that triggered the call, index 1 is the annotated node. @param sourceUnit The SourceUnit describing the source code in which the annotation was placed.
[ "This", "ASTTransformation", "method", "is", "called", "when", "the", "compiler", "encounters", "our", "annotation", "." ]
7067d76793601ce4de9c642d4c0c0e11db7907cb
https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L178-L199
train
groovyfx-project/groovyfx
src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java
FXBindableASTTransformation.addJavaFXPropertyToClass
private void addJavaFXPropertyToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) { for (PropertyNode propertyNode : classNode.getProperties()) { FieldNode field = propertyNode.getField(); // look to see if per-field handlers will catch this one... if (hasFXB...
java
private void addJavaFXPropertyToClass(SourceUnit source, AnnotationNode node, ClassNode classNode) { for (PropertyNode propertyNode : classNode.getProperties()) { FieldNode field = propertyNode.getField(); // look to see if per-field handlers will catch this one... if (hasFXB...
[ "private", "void", "addJavaFXPropertyToClass", "(", "SourceUnit", "source", ",", "AnnotationNode", "node", ",", "ClassNode", "classNode", ")", "{", "for", "(", "PropertyNode", "propertyNode", ":", "classNode", ".", "getProperties", "(", ")", ")", "{", "FieldNode",...
Iterate through the properties of the class and convert each eligible property to a JavaFX property. @param source The SourceUnit @param node The AnnotationNode @param classNode The declaring class
[ "Iterate", "through", "the", "properties", "of", "the", "class", "and", "convert", "each", "eligible", "property", "to", "a", "JavaFX", "property", "." ]
7067d76793601ce4de9c642d4c0c0e11db7907cb
https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L236-L250
train
groovyfx-project/groovyfx
src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java
FXBindableASTTransformation.createGetterMethod
protected void createGetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String getterName, Statement getterBlock, List<AnnotationNode> annotations) { int mod = propertyNode.getModifiers() | Modifier.FINAL; MethodNode getter = new MethodNode(getterName...
java
protected void createGetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String getterName, Statement getterBlock, List<AnnotationNode> annotations) { int mod = propertyNode.getModifiers() | Modifier.FINAL; MethodNode getter = new MethodNode(getterName...
[ "protected", "void", "createGetterMethod", "(", "ClassNode", "declaringClass", ",", "PropertyNode", "propertyNode", ",", "String", "getterName", ",", "Statement", "getterBlock", ",", "List", "<", "AnnotationNode", ">", "annotations", ")", "{", "int", "mod", "=", "...
Creates a getter method and adds it to the declaring class. @param declaringClass The class to which the method is added @param propertyNode The property node being accessed by this getter @param getterName The name of the getter method @param getterBlock The code body of the method
[ "Creates", "a", "getter", "method", "and", "adds", "it", "to", "the", "declaring", "class", "." ]
7067d76793601ce4de9c642d4c0c0e11db7907cb
https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L413-L421
train
groovyfx-project/groovyfx
src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java
FXBindableASTTransformation.generateSyntaxErrorMessage
private void generateSyntaxErrorMessage(SourceUnit sourceUnit, AnnotationNode node, String msg) { SyntaxException error = new SyntaxException(msg, node.getLineNumber(), node.getColumnNumber()); sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(error, sourceUnit)); }
java
private void generateSyntaxErrorMessage(SourceUnit sourceUnit, AnnotationNode node, String msg) { SyntaxException error = new SyntaxException(msg, node.getLineNumber(), node.getColumnNumber()); sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(error, sourceUnit)); }
[ "private", "void", "generateSyntaxErrorMessage", "(", "SourceUnit", "sourceUnit", ",", "AnnotationNode", "node", ",", "String", "msg", ")", "{", "SyntaxException", "error", "=", "new", "SyntaxException", "(", "msg", ",", "node", ".", "getLineNumber", "(", ")", "...
Generates a SyntaxErrorMessage based on the current SourceUnit, AnnotationNode, and a specified error message. @param sourceUnit The SourceUnit @param node The node that was annotated @param msg The error message to display
[ "Generates", "a", "SyntaxErrorMessage", "based", "on", "the", "current", "SourceUnit", "AnnotationNode", "and", "a", "specified", "error", "message", "." ]
7067d76793601ce4de9c642d4c0c0e11db7907cb
https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L645-L648
train
groovyfx-project/groovyfx
src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java
FXBindableASTTransformation.createFieldNodeCopy
private FieldNode createFieldNodeCopy(String newName, ClassNode newType, FieldNode f) { if (newType == null) newType = f.getType(); newType = newType.getPlainNodeReference(); return new FieldNode(newName, f.getModifiers(), newType, f.getOwner(), f.getInitialValueExpression()); }
java
private FieldNode createFieldNodeCopy(String newName, ClassNode newType, FieldNode f) { if (newType == null) newType = f.getType(); newType = newType.getPlainNodeReference(); return new FieldNode(newName, f.getModifiers(), newType, f.getOwner(), f.getInitialValueExpression()); }
[ "private", "FieldNode", "createFieldNodeCopy", "(", "String", "newName", ",", "ClassNode", "newType", ",", "FieldNode", "f", ")", "{", "if", "(", "newType", "==", "null", ")", "newType", "=", "f", ".", "getType", "(", ")", ";", "newType", "=", "newType", ...
Creates a copy of a FieldNode with a new name and, optionally, a new type. @param newName The name for the new field node. @param newType The new type of the field. If null, the old FieldNode's type will be used. @param f The FieldNode to copy. @return The new FieldNode.
[ "Creates", "a", "copy", "of", "a", "FieldNode", "with", "a", "new", "name", "and", "optionally", "a", "new", "type", "." ]
7067d76793601ce4de9c642d4c0c0e11db7907cb
https://github.com/groovyfx-project/groovyfx/blob/7067d76793601ce4de9c642d4c0c0e11db7907cb/src/main/groovy/groovyx/javafx/beans/FXBindableASTTransformation.java#L658-L664
train
lemonlabs/ExpandableButtonMenu
library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableMenuOverlay.java
ExpandableMenuOverlay.onLayout
@Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); if (mAdjustViewSize) { if (!(getParent() instanceof RelativeLayout)) { throw new IllegalStateException("Only RelativeLayout is supported as parent of thi...
java
@Override protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); if (mAdjustViewSize) { if (!(getParent() instanceof RelativeLayout)) { throw new IllegalStateException("Only RelativeLayout is supported as parent of thi...
[ "@", "Override", "protected", "void", "onLayout", "(", "boolean", "changed", ",", "int", "l", ",", "int", "t", ",", "int", "r", ",", "int", "b", ")", "{", "super", ".", "onLayout", "(", "changed", ",", "l", ",", "t", ",", "r", ",", "b", ")", ";...
Adjusts size of this view to match the underlying button menu. This allows a smooth transition between this view and the close button behind it.
[ "Adjusts", "size", "of", "this", "view", "to", "match", "the", "underlying", "button", "menu", ".", "This", "allows", "a", "smooth", "transition", "between", "this", "view", "and", "the", "close", "button", "behind", "it", "." ]
2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d
https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableMenuOverlay.java#L163-L181
train
lemonlabs/ExpandableButtonMenu
library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java
ExpandableButtonMenu.getMenuButton
public View getMenuButton(MenuButton button) { switch (button) { case MID: return mMidContainer; case LEFT: return mLeftContainer; case RIGHT: return mRightContainer; } return null; }
java
public View getMenuButton(MenuButton button) { switch (button) { case MID: return mMidContainer; case LEFT: return mLeftContainer; case RIGHT: return mRightContainer; } return null; }
[ "public", "View", "getMenuButton", "(", "MenuButton", "button", ")", "{", "switch", "(", "button", ")", "{", "case", "MID", ":", "return", "mMidContainer", ";", "case", "LEFT", ":", "return", "mLeftContainer", ";", "case", "RIGHT", ":", "return", "mRightCont...
Returns the menu button container. The first child of the container is a TextView, the second - an ImageButton @param button one of {@link MenuButton#LEFT}, {@link MenuButton#MID}, {@link MenuButton#RIGHT}
[ "Returns", "the", "menu", "button", "container", ".", "The", "first", "child", "of", "the", "container", "is", "a", "TextView", "the", "second", "-", "an", "ImageButton" ]
2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d
https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L157-L167
train