id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
105,300 | 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 |
105,301 | 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 |
105,302 | 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 |
105,303 | 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 |
105,304 | 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 |
105,305 | 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 |
105,306 | 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 |
105,307 | 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 |
105,308 | 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 |
105,309 | 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 |
105,310 | 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 |
105,311 | 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 |
105,312 | 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 |
105,313 | 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 |
105,314 | 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 |
105,315 | 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 |
105,316 | 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 |
105,317 | 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 |
105,318 | 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 |
105,319 | 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 |
105,320 | 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 |
105,321 | 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 |
105,322 | 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 |
105,323 | 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 |
105,324 | 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 |
105,325 | 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 |
105,326 | 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 |
105,327 | 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 |
105,328 | 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 |
105,329 | 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 |
105,330 | 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 |
105,331 | 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 |
105,332 | 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 |
105,333 | 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 |
105,334 | 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 |
105,335 | 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 |
105,336 | 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 |
105,337 | 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 |
105,338 | 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 |
105,339 | 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 |
105,340 | 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 |
105,341 | 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 |
105,342 | 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 |
105,343 | 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 |
105,344 | 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 |
105,345 | 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 |
105,346 | 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 |
105,347 | 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 |
105,348 | 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 |
105,349 | 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 |
105,350 | 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 |
105,351 | 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 |
105,352 | 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 |
105,353 | 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 |
105,354 | 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 |
105,355 | 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 |
105,356 | 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 |
105,357 | 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 |
105,358 | 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 |
105,359 | 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 |
105,360 | 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 |
105,361 | 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 |
105,362 | 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 |
105,363 | 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 |
105,364 | 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 |
105,365 | 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 |
105,366 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.setMenuTextAppearance | public void setMenuTextAppearance(int appearanceResource) {
mLeftText.setTextAppearance(getContext(), appearanceResource);
mMidText.setTextAppearance(getContext(), appearanceResource);
mRightText.setTextAppearance(getContext(), appearanceResource);
} | java | public void setMenuTextAppearance(int appearanceResource) {
mLeftText.setTextAppearance(getContext(), appearanceResource);
mMidText.setTextAppearance(getContext(), appearanceResource);
mRightText.setTextAppearance(getContext(), appearanceResource);
} | [
"public",
"void",
"setMenuTextAppearance",
"(",
"int",
"appearanceResource",
")",
"{",
"mLeftText",
".",
"setTextAppearance",
"(",
"getContext",
"(",
")",
",",
"appearanceResource",
")",
";",
"mMidText",
".",
"setTextAppearance",
"(",
"getContext",
"(",
")",
",",
... | Set text appearance for button text views
@param appearanceResource | [
"Set",
"text",
"appearance",
"for",
"button",
"text",
"views"
] | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L174-L178 |
105,367 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.setMenuButtonImage | public void setMenuButtonImage(MenuButton button, Drawable drawable) {
switch (button) {
case MID:
mMidBtn.setImageDrawable(drawable);
break;
case LEFT:
mLeftBtn.setImageDrawable(drawable);
break;
case RIGHT:
... | java | public void setMenuButtonImage(MenuButton button, Drawable drawable) {
switch (button) {
case MID:
mMidBtn.setImageDrawable(drawable);
break;
case LEFT:
mLeftBtn.setImageDrawable(drawable);
break;
case RIGHT:
... | [
"public",
"void",
"setMenuButtonImage",
"(",
"MenuButton",
"button",
",",
"Drawable",
"drawable",
")",
"{",
"switch",
"(",
"button",
")",
"{",
"case",
"MID",
":",
"mMidBtn",
".",
"setImageDrawable",
"(",
"drawable",
")",
";",
"break",
";",
"case",
"LEFT",
... | Set image drawable for a menu button
@param button
@param drawable | [
"Set",
"image",
"drawable",
"for",
"a",
"menu",
"button"
] | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L196-L208 |
105,368 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.setMenuButtonText | public void setMenuButtonText(MenuButton button, String text) {
switch (button) {
case MID:
mMidText.setText(text);
break;
case LEFT:
mLeftText.setText(text);
break;
case RIGHT:
mRightText.setText... | java | public void setMenuButtonText(MenuButton button, String text) {
switch (button) {
case MID:
mMidText.setText(text);
break;
case LEFT:
mLeftText.setText(text);
break;
case RIGHT:
mRightText.setText... | [
"public",
"void",
"setMenuButtonText",
"(",
"MenuButton",
"button",
",",
"String",
"text",
")",
"{",
"switch",
"(",
"button",
")",
"{",
"case",
"MID",
":",
"mMidText",
".",
"setText",
"(",
"text",
")",
";",
"break",
";",
"case",
"LEFT",
":",
"mLeftText",... | Set text displayed under a menu button
@param button
@param text | [
"Set",
"text",
"displayed",
"under",
"a",
"menu",
"button"
] | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L226-L238 |
105,369 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.inflate | private void inflate() {
((LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.ebm__menu, this, true);
mOverlay = findViewById(R.id.ebm__menu_overlay);
mMidContainer = findViewById(R.id.ebm__menu_middle_container);
mLeftContainer = findViewB... | java | private void inflate() {
((LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.ebm__menu, this, true);
mOverlay = findViewById(R.id.ebm__menu_overlay);
mMidContainer = findViewById(R.id.ebm__menu_middle_container);
mLeftContainer = findViewB... | [
"private",
"void",
"inflate",
"(",
")",
"{",
"(",
"(",
"LayoutInflater",
")",
"getContext",
"(",
")",
".",
"getSystemService",
"(",
"Context",
".",
"LAYOUT_INFLATER_SERVICE",
")",
")",
".",
"inflate",
"(",
"R",
".",
"layout",
".",
"ebm__menu",
",",
"this",... | Inflates the view | [
"Inflates",
"the",
"view"
] | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L307-L337 |
105,370 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.parseAttributes | private void parseAttributes(AttributeSet attrs) {
if (attrs != null) {
TypedArray a = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.ExpandableMenuOverlay, 0, 0);
try {
// button metrics
mainButtonSize = a.getFloat(R.styleable.Expandabl... | java | private void parseAttributes(AttributeSet attrs) {
if (attrs != null) {
TypedArray a = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.ExpandableMenuOverlay, 0, 0);
try {
// button metrics
mainButtonSize = a.getFloat(R.styleable.Expandabl... | [
"private",
"void",
"parseAttributes",
"(",
"AttributeSet",
"attrs",
")",
"{",
"if",
"(",
"attrs",
"!=",
"null",
")",
"{",
"TypedArray",
"a",
"=",
"getContext",
"(",
")",
".",
"getTheme",
"(",
")",
".",
"obtainStyledAttributes",
"(",
"attrs",
",",
"R",
".... | Parses custom XML attributes
@param attrs | [
"Parses",
"custom",
"XML",
"attributes"
] | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L344-L370 |
105,371 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.setViewLayoutParams | private void setViewLayoutParams() {
// Some extra margin to center other buttons in the center of the main button
final int EXTRA_MARGIN = (int) (sWidth * (mainButtonSize - otherButtonSize) / 2);
Log.d(TAG, "otherButton: " + otherButtonSize);
Log.d(TAG, "mainButton: " + mainButtonSize... | java | private void setViewLayoutParams() {
// Some extra margin to center other buttons in the center of the main button
final int EXTRA_MARGIN = (int) (sWidth * (mainButtonSize - otherButtonSize) / 2);
Log.d(TAG, "otherButton: " + otherButtonSize);
Log.d(TAG, "mainButton: " + mainButtonSize... | [
"private",
"void",
"setViewLayoutParams",
"(",
")",
"{",
"// Some extra margin to center other buttons in the center of the main button",
"final",
"int",
"EXTRA_MARGIN",
"=",
"(",
"int",
")",
"(",
"sWidth",
"*",
"(",
"mainButtonSize",
"-",
"otherButtonSize",
")",
"/",
"... | Initialized the layout of menu buttons. Sets button sizes and distances between them
by a % of screen width or height accordingly.
Some extra padding between buttons is added by default to avoid intersections. | [
"Initialized",
"the",
"layout",
"of",
"menu",
"buttons",
".",
"Sets",
"button",
"sizes",
"and",
"distances",
"between",
"them",
"by",
"a",
"%",
"of",
"screen",
"width",
"or",
"height",
"accordingly",
".",
"Some",
"extra",
"padding",
"between",
"buttons",
"is... | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L377-L408 |
105,372 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.calculateAnimationProportions | private void calculateAnimationProportions() {
TRANSLATION_Y = sHeight * buttonDistanceY;
TRANSLATION_X = sWidth * buttonDistanceX;
anticipation = new AnticipateInterpolator(INTERPOLATOR_WEIGHT);
overshoot = new OvershootInterpolator(INTERPOLATOR_WEIGHT);
} | java | private void calculateAnimationProportions() {
TRANSLATION_Y = sHeight * buttonDistanceY;
TRANSLATION_X = sWidth * buttonDistanceX;
anticipation = new AnticipateInterpolator(INTERPOLATOR_WEIGHT);
overshoot = new OvershootInterpolator(INTERPOLATOR_WEIGHT);
} | [
"private",
"void",
"calculateAnimationProportions",
"(",
")",
"{",
"TRANSLATION_Y",
"=",
"sHeight",
"*",
"buttonDistanceY",
";",
"TRANSLATION_X",
"=",
"sWidth",
"*",
"buttonDistanceX",
";",
"anticipation",
"=",
"new",
"AnticipateInterpolator",
"(",
"INTERPOLATOR_WEIGHT"... | Initialized animation properties | [
"Initialized",
"animation",
"properties"
] | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L446-L452 |
105,373 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.animateExpand | private void animateExpand() {
mCloseBtn.setVisibility(View.VISIBLE);
mMidContainer.setVisibility(View.VISIBLE);
mRightContainer.setVisibility(View.VISIBLE);
mLeftContainer.setVisibility(View.VISIBLE);
setButtonsVisibleForPreHC();
ANIMATION_COUNTER = 0;
ViewPro... | java | private void animateExpand() {
mCloseBtn.setVisibility(View.VISIBLE);
mMidContainer.setVisibility(View.VISIBLE);
mRightContainer.setVisibility(View.VISIBLE);
mLeftContainer.setVisibility(View.VISIBLE);
setButtonsVisibleForPreHC();
ANIMATION_COUNTER = 0;
ViewPro... | [
"private",
"void",
"animateExpand",
"(",
")",
"{",
"mCloseBtn",
".",
"setVisibility",
"(",
"View",
".",
"VISIBLE",
")",
";",
"mMidContainer",
".",
"setVisibility",
"(",
"View",
".",
"VISIBLE",
")",
";",
"mRightContainer",
".",
"setVisibility",
"(",
"View",
"... | Start expand animation | [
"Start",
"expand",
"animation"
] | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L457-L470 |
105,374 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.animateCollapse | private void animateCollapse() {
mCloseBtn.setVisibility(View.VISIBLE);
ANIMATION_COUNTER = 0;
ViewPropertyAnimator.animate(mMidContainer).setDuration(ANIMATION_DURATION).translationYBy(TRANSLATION_Y).setInterpolator(anticipation).setListener(ON_EXPAND_COLLAPSE_LISTENER);
ViewPropertyA... | java | private void animateCollapse() {
mCloseBtn.setVisibility(View.VISIBLE);
ANIMATION_COUNTER = 0;
ViewPropertyAnimator.animate(mMidContainer).setDuration(ANIMATION_DURATION).translationYBy(TRANSLATION_Y).setInterpolator(anticipation).setListener(ON_EXPAND_COLLAPSE_LISTENER);
ViewPropertyA... | [
"private",
"void",
"animateCollapse",
"(",
")",
"{",
"mCloseBtn",
".",
"setVisibility",
"(",
"View",
".",
"VISIBLE",
")",
";",
"ANIMATION_COUNTER",
"=",
"0",
";",
"ViewPropertyAnimator",
".",
"animate",
"(",
"mMidContainer",
")",
".",
"setDuration",
"(",
"ANIM... | Start collapse animation | [
"Start",
"collapse",
"animation"
] | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L475-L484 |
105,375 | lemonlabs/ExpandableButtonMenu | library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java | ExpandableButtonMenu.setButtonsVisibleForPreHC | private void setButtonsVisibleForPreHC() {
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
ViewHelper.setAlpha(mMidContainer, 1.0f);
ViewHelper.setAlpha(mLeftContainer, 1.0f);
ViewHelper.setAlpha(mRightContainer, 1.0f);
}
} | java | private void setButtonsVisibleForPreHC() {
if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
ViewHelper.setAlpha(mMidContainer, 1.0f);
ViewHelper.setAlpha(mLeftContainer, 1.0f);
ViewHelper.setAlpha(mRightContainer, 1.0f);
}
} | [
"private",
"void",
"setButtonsVisibleForPreHC",
"(",
")",
"{",
"if",
"(",
"android",
".",
"os",
".",
"Build",
".",
"VERSION",
".",
"SDK_INT",
"<",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"{",
"ViewHelper",
".",
"setAlpha",
"(",
"mMidContainer",... | Hide views for pre-Honeycomb devices | [
"Hide",
"views",
"for",
"pre",
"-",
"Honeycomb",
"devices"
] | 2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d | https://github.com/lemonlabs/ExpandableButtonMenu/blob/2284593fc76b9bf7cc6b4aec311f24ee2bbbaa9d/library/src/main/java/lt/lemonlabs/android/expandablebuttonmenu/ExpandableButtonMenu.java#L545-L551 |
105,376 | kaazing/gateway | service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java | HttpProxyServiceHandler.validateNoLoopDetected | private boolean validateNoLoopDetected(DefaultHttpSession acceptSession) {
List<String> viaHeaders = acceptSession.getReadHeaders(HEADER_VIA);
if (viaHeaders != null && viaHeaders.stream().anyMatch(h -> h.equals(viaHeader))) {
LOGGER.warn("Connection to " + getConnectURIs().iterator().ne... | java | private boolean validateNoLoopDetected(DefaultHttpSession acceptSession) {
List<String> viaHeaders = acceptSession.getReadHeaders(HEADER_VIA);
if (viaHeaders != null && viaHeaders.stream().anyMatch(h -> h.equals(viaHeader))) {
LOGGER.warn("Connection to " + getConnectURIs().iterator().ne... | [
"private",
"boolean",
"validateNoLoopDetected",
"(",
"DefaultHttpSession",
"acceptSession",
")",
"{",
"List",
"<",
"String",
">",
"viaHeaders",
"=",
"acceptSession",
".",
"getReadHeaders",
"(",
"HEADER_VIA",
")",
";",
"if",
"(",
"viaHeaders",
"!=",
"null",
"&&",
... | Helper method performing loop detection
@param acceptSession - session parameter
@return - whether a loop was detected or not | [
"Helper",
"method",
"performing",
"loop",
"detection"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java#L252-L262 |
105,377 | kaazing/gateway | service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java | HttpProxyServiceHandler.setupForwardedHeaders | private void setupForwardedHeaders(HttpAcceptSession acceptSession, HttpConnectSession connectSession) {
if (FORWARDED_EXCLUDE.equalsIgnoreCase(useForwarded)) {
excludeForwardedHeaders(connectSession);
return;
}
if (FORWARDED_INJECT.equalsIgnoreCase(useForwarded)) {
... | java | private void setupForwardedHeaders(HttpAcceptSession acceptSession, HttpConnectSession connectSession) {
if (FORWARDED_EXCLUDE.equalsIgnoreCase(useForwarded)) {
excludeForwardedHeaders(connectSession);
return;
}
if (FORWARDED_INJECT.equalsIgnoreCase(useForwarded)) {
... | [
"private",
"void",
"setupForwardedHeaders",
"(",
"HttpAcceptSession",
"acceptSession",
",",
"HttpConnectSession",
"connectSession",
")",
"{",
"if",
"(",
"FORWARDED_EXCLUDE",
".",
"equalsIgnoreCase",
"(",
"useForwarded",
")",
")",
"{",
"excludeForwardedHeaders",
"(",
"co... | Compose the Forwarded header and the X-Forwarded headers and add them to the connect session write headers.
@param acceptSession
@param connectSession
@param forwardedProperty the value of the 'use-forwarded' property used for http.proxy type in gateway-config:
inject (add the corresponding data to the Forwarded/X-For... | [
"Compose",
"the",
"Forwarded",
"header",
"and",
"the",
"X",
"-",
"Forwarded",
"headers",
"and",
"add",
"them",
"to",
"the",
"connect",
"session",
"write",
"headers",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java#L500-L529 |
105,378 | kaazing/gateway | service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java | HttpProxyServiceHandler.excludeForwardedHeaders | private static void excludeForwardedHeaders(HttpConnectSession connectSession) {
connectSession.clearWriteHeaders(HEADER_FORWARDED);
connectSession.clearWriteHeaders(HEADER_X_FORWARDED_FOR);
connectSession.clearWriteHeaders(HEADER_X_FORWARDED_SERVER);
connectSession.clearWriteHeaders(HEA... | java | private static void excludeForwardedHeaders(HttpConnectSession connectSession) {
connectSession.clearWriteHeaders(HEADER_FORWARDED);
connectSession.clearWriteHeaders(HEADER_X_FORWARDED_FOR);
connectSession.clearWriteHeaders(HEADER_X_FORWARDED_SERVER);
connectSession.clearWriteHeaders(HEA... | [
"private",
"static",
"void",
"excludeForwardedHeaders",
"(",
"HttpConnectSession",
"connectSession",
")",
"{",
"connectSession",
".",
"clearWriteHeaders",
"(",
"HEADER_FORWARDED",
")",
";",
"connectSession",
".",
"clearWriteHeaders",
"(",
"HEADER_X_FORWARDED_FOR",
")",
";... | Remove the Forwarded headers from the connect session if the 'use-forwarded' property for the http.proxy type is
set to 'exclude'.
@param connectSession | [
"Remove",
"the",
"Forwarded",
"headers",
"from",
"the",
"connect",
"session",
"if",
"the",
"use",
"-",
"forwarded",
"property",
"for",
"the",
"http",
".",
"proxy",
"type",
"is",
"set",
"to",
"exclude",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java#L537-L543 |
105,379 | kaazing/gateway | service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java | HttpProxyServiceHandler.getResourceIpAddress | private static String getResourceIpAddress(HttpAcceptSession acceptSession, String parameterName) {
String resourceIpAddress = null;
ResourceAddress resourceAddress = null;
switch (parameterName) {
case FORWARDED_FOR:
resourceAddress = acceptSession.getRemoteAddress();
... | java | private static String getResourceIpAddress(HttpAcceptSession acceptSession, String parameterName) {
String resourceIpAddress = null;
ResourceAddress resourceAddress = null;
switch (parameterName) {
case FORWARDED_FOR:
resourceAddress = acceptSession.getRemoteAddress();
... | [
"private",
"static",
"String",
"getResourceIpAddress",
"(",
"HttpAcceptSession",
"acceptSession",
",",
"String",
"parameterName",
")",
"{",
"String",
"resourceIpAddress",
"=",
"null",
";",
"ResourceAddress",
"resourceAddress",
"=",
"null",
";",
"switch",
"(",
"paramet... | Get the IP address of the resource based on the parameter name
@param acceptSession
@param parameterName can be either 'for' (the IP address of the client/server making the request to this
service), or 'by' (the IP address of this proxy)
@return the IP address based on the parameter name received | [
"Get",
"the",
"IP",
"address",
"of",
"the",
"resource",
"based",
"on",
"the",
"parameter",
"name"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyServiceHandler.java#L553-L571 |
105,380 | kaazing/gateway | mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioServerDatagramChannelFactory.java | NioServerDatagramChannelFactory.newChildChannel | public NioChildDatagramChannel newChildChannel(Channel parent, final ChannelPipeline pipeline) {
return new NioChildDatagramChannel(parent, this, pipeline, childSink, workerPool.nextWorker(), family);
} | java | public NioChildDatagramChannel newChildChannel(Channel parent, final ChannelPipeline pipeline) {
return new NioChildDatagramChannel(parent, this, pipeline, childSink, workerPool.nextWorker(), family);
} | [
"public",
"NioChildDatagramChannel",
"newChildChannel",
"(",
"Channel",
"parent",
",",
"final",
"ChannelPipeline",
"pipeline",
")",
"{",
"return",
"new",
"NioChildDatagramChannel",
"(",
"parent",
",",
"this",
",",
"pipeline",
",",
"childSink",
",",
"workerPool",
"."... | mina.netty change - adding this to create child datagram channels | [
"mina",
".",
"netty",
"change",
"-",
"adding",
"this",
"to",
"create",
"child",
"datagram",
"channels"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/jboss/netty/channel/socket/nio/NioServerDatagramChannelFactory.java#L91-L93 |
105,381 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/codec/ProtocolDecoderException.java | ProtocolDecoderException.getMessage | @Override
public String getMessage() {
String message = super.getMessage();
if (message == null) {
message = "";
}
if (hexdump != null) {
return message + (message.length() > 0 ? " " : "") + "(Hexdump: "
+ hexdump + ')';
}
... | java | @Override
public String getMessage() {
String message = super.getMessage();
if (message == null) {
message = "";
}
if (hexdump != null) {
return message + (message.length() > 0 ? " " : "") + "(Hexdump: "
+ hexdump + ')';
}
... | [
"@",
"Override",
"public",
"String",
"getMessage",
"(",
")",
"{",
"String",
"message",
"=",
"super",
".",
"getMessage",
"(",
")",
";",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"message",
"=",
"\"\"",
";",
"}",
"if",
"(",
"hexdump",
"!=",
"null",... | Returns the message and the hexdump of the unknown part. | [
"Returns",
"the",
"message",
"and",
"the",
"hexdump",
"of",
"the",
"unknown",
"part",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/codec/ProtocolDecoderException.java#L64-L78 |
105,382 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/session/SessionManagementBeanImpl.java | SessionManagementBeanImpl.setUserPrincipals | @Override
public void setUserPrincipals(Map<String, String> userPrincipals) {
this.userPrincipals = userPrincipals;
this.serviceManagementBean.addUserPrincipals(session, userPrincipals);
} | java | @Override
public void setUserPrincipals(Map<String, String> userPrincipals) {
this.userPrincipals = userPrincipals;
this.serviceManagementBean.addUserPrincipals(session, userPrincipals);
} | [
"@",
"Override",
"public",
"void",
"setUserPrincipals",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"userPrincipals",
")",
"{",
"this",
".",
"userPrincipals",
"=",
"userPrincipals",
";",
"this",
".",
"serviceManagementBean",
".",
"addUserPrincipals",
"(",
"se... | The following is intended to run ON the IO thread | [
"The",
"following",
"is",
"intended",
"to",
"run",
"ON",
"the",
"IO",
"thread"
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/session/SessionManagementBeanImpl.java#L92-L96 |
105,383 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/session/SessionManagementBeanImpl.java | SessionManagementBeanImpl.getUserPrincipals | @Override
public String getUserPrincipals() {
if (userPrincipals == null) {
return null;
}
JSONObject jsonObj = new JSONObject(userPrincipals);
return jsonObj.toString();
} | java | @Override
public String getUserPrincipals() {
if (userPrincipals == null) {
return null;
}
JSONObject jsonObj = new JSONObject(userPrincipals);
return jsonObj.toString();
} | [
"@",
"Override",
"public",
"String",
"getUserPrincipals",
"(",
")",
"{",
"if",
"(",
"userPrincipals",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"JSONObject",
"jsonObj",
"=",
"new",
"JSONObject",
"(",
"userPrincipals",
")",
";",
"return",
"jsonObj",... | In contrast to getPrincipals, this is for sending a JSON value back. | [
"In",
"contrast",
"to",
"getPrincipals",
"this",
"is",
"for",
"sending",
"a",
"JSON",
"value",
"back",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/session/SessionManagementBeanImpl.java#L146-L155 |
105,384 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java | NTLMResponses.getLMResponse | public static byte[] getLMResponse(String password, byte[] challenge)
throws Exception {
byte[] lmHash = lmHash(password);
return lmResponse(lmHash, challenge);
} | java | public static byte[] getLMResponse(String password, byte[] challenge)
throws Exception {
byte[] lmHash = lmHash(password);
return lmResponse(lmHash, challenge);
} | [
"public",
"static",
"byte",
"[",
"]",
"getLMResponse",
"(",
"String",
"password",
",",
"byte",
"[",
"]",
"challenge",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"lmHash",
"=",
"lmHash",
"(",
"password",
")",
";",
"return",
"lmResponse",
"(",
"lmH... | Calculates the LM Response for the given challenge, using the specified
password.
@param password The user's password.
@param challenge The Type 2 challenge from the server.
@return The LM Response. | [
"Calculates",
"the",
"LM",
"Response",
"for",
"the",
"given",
"challenge",
"using",
"the",
"specified",
"password",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java#L61-L65 |
105,385 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java | NTLMResponses.getNTLMResponse | public static byte[] getNTLMResponse(String password, byte[] challenge)
throws Exception {
byte[] ntlmHash = ntlmHash(password);
return lmResponse(ntlmHash, challenge);
} | java | public static byte[] getNTLMResponse(String password, byte[] challenge)
throws Exception {
byte[] ntlmHash = ntlmHash(password);
return lmResponse(ntlmHash, challenge);
} | [
"public",
"static",
"byte",
"[",
"]",
"getNTLMResponse",
"(",
"String",
"password",
",",
"byte",
"[",
"]",
"challenge",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"ntlmHash",
"=",
"ntlmHash",
"(",
"password",
")",
";",
"return",
"lmResponse",
"(",
... | Calculates the NTLM Response for the given challenge, using the
specified password.
@param password The user's password.
@param challenge The Type 2 challenge from the server.
@return The NTLM Response. | [
"Calculates",
"the",
"NTLM",
"Response",
"for",
"the",
"given",
"challenge",
"using",
"the",
"specified",
"password",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java#L76-L80 |
105,386 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java | NTLMResponses.getLMv2Response | public static byte[] getLMv2Response(String target, String user,
String password, byte[] challenge, byte[] clientNonce)
throws Exception {
byte[] ntlmv2Hash = ntlmv2Hash(target, user, password);
return lmv2Response(ntlmv2Hash, clientNonce, challenge);
} | java | public static byte[] getLMv2Response(String target, String user,
String password, byte[] challenge, byte[] clientNonce)
throws Exception {
byte[] ntlmv2Hash = ntlmv2Hash(target, user, password);
return lmv2Response(ntlmv2Hash, clientNonce, challenge);
} | [
"public",
"static",
"byte",
"[",
"]",
"getLMv2Response",
"(",
"String",
"target",
",",
"String",
"user",
",",
"String",
"password",
",",
"byte",
"[",
"]",
"challenge",
",",
"byte",
"[",
"]",
"clientNonce",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]... | Calculates the LMv2 Response for the given challenge, using the
specified authentication target, username, password, and client
challenge.
@param target The authentication target (i.e., domain).
@param user The username.
@param password The user's password.
@param challenge The Type 2 challenge from the server.
@param... | [
"Calculates",
"the",
"LMv2",
"Response",
"for",
"the",
"given",
"challenge",
"using",
"the",
"specified",
"authentication",
"target",
"username",
"password",
"and",
"client",
"challenge",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java#L142-L147 |
105,387 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java | NTLMResponses.getNTLM2SessionResponse | public static byte[] getNTLM2SessionResponse(String password,
byte[] challenge, byte[] clientNonce) throws Exception {
byte[] ntlmHash = ntlmHash(password);
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(challenge);
md5.update(clientNonce);
byte[] se... | java | public static byte[] getNTLM2SessionResponse(String password,
byte[] challenge, byte[] clientNonce) throws Exception {
byte[] ntlmHash = ntlmHash(password);
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(challenge);
md5.update(clientNonce);
byte[] se... | [
"public",
"static",
"byte",
"[",
"]",
"getNTLM2SessionResponse",
"(",
"String",
"password",
",",
"byte",
"[",
"]",
"challenge",
",",
"byte",
"[",
"]",
"clientNonce",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"ntlmHash",
"=",
"ntlmHash",
"(",
"pass... | Calculates the NTLM2 Session Response for the given challenge, using the
specified password and client nonce.
@param password The user's password.
@param challenge The Type 2 challenge from the server.
@param clientNonce The random 8-byte client nonce.
@return The NTLM2 Session Response. This is placed in the NTLM
r... | [
"Calculates",
"the",
"NTLM2",
"Session",
"Response",
"for",
"the",
"given",
"challenge",
"using",
"the",
"specified",
"password",
"and",
"client",
"nonce",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java#L161-L170 |
105,388 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java | NTLMResponses.createBlob | private static byte[] createBlob(byte[] targetInformation,
byte[] clientNonce, long time) {
byte[] blobSignature = new byte[] { (byte) 0x01, (byte) 0x01,
(byte) 0x00, (byte) 0x00 };
byte[] reserved = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00,
(byte) 0... | java | private static byte[] createBlob(byte[] targetInformation,
byte[] clientNonce, long time) {
byte[] blobSignature = new byte[] { (byte) 0x01, (byte) 0x01,
(byte) 0x00, (byte) 0x00 };
byte[] reserved = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00,
(byte) 0... | [
"private",
"static",
"byte",
"[",
"]",
"createBlob",
"(",
"byte",
"[",
"]",
"targetInformation",
",",
"byte",
"[",
"]",
"clientNonce",
",",
"long",
"time",
")",
"{",
"byte",
"[",
"]",
"blobSignature",
"=",
"new",
"byte",
"[",
"]",
"{",
"(",
"byte",
"... | Creates the NTLMv2 blob from the given target information block and
client nonce.
@param targetInformation The target information block from the Type 2
message.
@param clientNonce The random 8-byte client nonce.
@param time the time stamp.
@return The blob, used in the calculation of the NTLMv2 Response. | [
"Creates",
"the",
"NTLMv2",
"blob",
"from",
"the",
"given",
"target",
"information",
"block",
"and",
"client",
"nonce",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java#L295-L332 |
105,389 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java | NTLMResponses.hmacMD5 | public static byte[] hmacMD5(byte[] data, byte[] key) throws Exception {
byte[] ipad = new byte[64];
byte[] opad = new byte[64];
// Stores key in pads and XOR it with ipad and opad values
for (int i = 0; i < 64; i++) {
if (i < key.length) {
ipad[i] = (byte) (... | java | public static byte[] hmacMD5(byte[] data, byte[] key) throws Exception {
byte[] ipad = new byte[64];
byte[] opad = new byte[64];
// Stores key in pads and XOR it with ipad and opad values
for (int i = 0; i < 64; i++) {
if (i < key.length) {
ipad[i] = (byte) (... | [
"public",
"static",
"byte",
"[",
"]",
"hmacMD5",
"(",
"byte",
"[",
"]",
"data",
",",
"byte",
"[",
"]",
"key",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"ipad",
"=",
"new",
"byte",
"[",
"64",
"]",
";",
"byte",
"[",
"]",
"opad",
"=",
"ne... | Calculates the HMAC-MD5 hash of the given data using the specified
hashing key.
@param data The data for which the hash will be calculated.
@param key The hashing key.
@return The HMAC-MD5 hash of the given data. | [
"Calculates",
"the",
"HMAC",
"-",
"MD5",
"hash",
"of",
"the",
"given",
"data",
"using",
"the",
"specified",
"hashing",
"key",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java#L343-L367 |
105,390 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java | NTLMResponses.oddParity | private static void oddParity(byte[] bytes) {
for (int i = 0; i < bytes.length; i++) {
byte b = bytes[i];
boolean needsParity = (((b >>> 7) ^ (b >>> 6) ^ (b >>> 5)
^ (b >>> 4) ^ (b >>> 3) ^ (b >>> 2) ^ (b >>> 1)) & 0x01) == 0;
if (needsParity) {
... | java | private static void oddParity(byte[] bytes) {
for (int i = 0; i < bytes.length; i++) {
byte b = bytes[i];
boolean needsParity = (((b >>> 7) ^ (b >>> 6) ^ (b >>> 5)
^ (b >>> 4) ^ (b >>> 3) ^ (b >>> 2) ^ (b >>> 1)) & 0x01) == 0;
if (needsParity) {
... | [
"private",
"static",
"void",
"oddParity",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bytes",
".",
"length",
";",
"i",
"++",
")",
"{",
"byte",
"b",
"=",
"bytes",
"[",
"i",
"]",
";",
"boolean",
"... | Applies odd parity to the given byte array.
@param bytes The data whose parity bits are to be adjusted for
odd parity. | [
"Applies",
"odd",
"parity",
"to",
"the",
"given",
"byte",
"array",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java#L401-L412 |
105,391 | kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/jmx/ServiceMXBeanImpl.java | ServiceMXBeanImpl.getLoggedInSessions | @Override
public Map<String, Map<String, String>> getLoggedInSessions() {
// First, get the map of session ID to user principals for that session.
Map<Long, Map<String, String>> sessionPrincipalMap = serviceManagementBean.getLoggedInSessions();
Map<String, Map<String, String>> result = new ... | java | @Override
public Map<String, Map<String, String>> getLoggedInSessions() {
// First, get the map of session ID to user principals for that session.
Map<Long, Map<String, String>> sessionPrincipalMap = serviceManagementBean.getLoggedInSessions();
Map<String, Map<String, String>> result = new ... | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"getLoggedInSessions",
"(",
")",
"{",
"// First, get the map of session ID to user principals for that session.",
"Map",
"<",
"Long",
",",
"Map",
"<",
"String",
",... | Return a map of session mbean names to the user principals for those sessions. The serviceManagementBean stores them as
session ID to user principals, and we have to convert the session ID to mbean name here. Gross, but it's the only way to
not have JMX-specific stuff in the ServiceManagementBean. | [
"Return",
"a",
"map",
"of",
"session",
"mbean",
"names",
"to",
"the",
"user",
"principals",
"for",
"those",
"sessions",
".",
"The",
"serviceManagementBean",
"stores",
"them",
"as",
"session",
"ID",
"to",
"user",
"principals",
"and",
"we",
"have",
"to",
"conv... | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/jmx/ServiceMXBeanImpl.java#L140-L155 |
105,392 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/WsScheduledCommand.java | WsScheduledCommand.cancel | public void cancel(ScheduledFuture<?> scheduledFuture) {
clear();
if (scheduledFuture != null && !scheduledFuture.isDone()) {
scheduledFuture.cancel(false);
}
} | java | public void cancel(ScheduledFuture<?> scheduledFuture) {
clear();
if (scheduledFuture != null && !scheduledFuture.isDone()) {
scheduledFuture.cancel(false);
}
} | [
"public",
"void",
"cancel",
"(",
"ScheduledFuture",
"<",
"?",
">",
"scheduledFuture",
")",
"{",
"clear",
"(",
")",
";",
"if",
"(",
"scheduledFuture",
"!=",
"null",
"&&",
"!",
"scheduledFuture",
".",
"isDone",
"(",
")",
")",
"{",
"scheduledFuture",
".",
"... | Cancel the scheduled command.
@param scheduledFuture the scheduled future used to schedule the command. | [
"Cancel",
"the",
"scheduled",
"command",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/WsScheduledCommand.java#L56-L61 |
105,393 | kaazing/gateway | transport/ws/src/main/java/org/kaazing/gateway/transport/ws/WsScheduledCommand.java | WsScheduledCommand.schedule | public ScheduledFuture<?> schedule(ScheduledExecutorService scheduler,
long delay, final TimeUnit unit) {
return scheduler.schedule(
this,
delay, unit);
} | java | public ScheduledFuture<?> schedule(ScheduledExecutorService scheduler,
long delay, final TimeUnit unit) {
return scheduler.schedule(
this,
delay, unit);
} | [
"public",
"ScheduledFuture",
"<",
"?",
">",
"schedule",
"(",
"ScheduledExecutorService",
"scheduler",
",",
"long",
"delay",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"return",
"scheduler",
".",
"schedule",
"(",
"this",
",",
"delay",
",",
"unit",
")",
";",
... | Schedule this command using the scheduler, delay and time units provided.
@param scheduler the scheduler for scheduling this command
@param delay the delay
@param unit the time units for the delay
@return a scheduled future representing the scheduled command. | [
"Schedule",
"this",
"command",
"using",
"the",
"scheduler",
"delay",
"and",
"time",
"units",
"provided",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/WsScheduledCommand.java#L81-L86 |
105,394 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/handler/stream/StreamIoHandler.java | StreamIoHandler.sessionOpened | @Override
public void sessionOpened(IoSession session) {
// Set timeouts
session.getConfig().setWriteTimeout(writeTimeout);
session.getConfig().setIdleTime(IdleStatus.READER_IDLE, readTimeout);
// Create streams
InputStream in = new IoSessionInputStream();
OutputStre... | java | @Override
public void sessionOpened(IoSession session) {
// Set timeouts
session.getConfig().setWriteTimeout(writeTimeout);
session.getConfig().setIdleTime(IdleStatus.READER_IDLE, readTimeout);
// Create streams
InputStream in = new IoSessionInputStream();
OutputStre... | [
"@",
"Override",
"public",
"void",
"sessionOpened",
"(",
"IoSession",
"session",
")",
"{",
"// Set timeouts",
"session",
".",
"getConfig",
"(",
")",
".",
"setWriteTimeout",
"(",
"writeTimeout",
")",
";",
"session",
".",
"getConfig",
"(",
")",
".",
"setIdleTime... | Initializes streams and timeout settings. | [
"Initializes",
"streams",
"and",
"timeout",
"settings",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/handler/stream/StreamIoHandler.java#L99-L111 |
105,395 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/handler/stream/StreamIoHandler.java | StreamIoHandler.messageReceived | @Override
public void messageReceived(IoSession session, Object buf) {
final IoSessionInputStream in = (IoSessionInputStream) session
.getAttribute(KEY_IN);
in.write((IoBuffer) buf);
} | java | @Override
public void messageReceived(IoSession session, Object buf) {
final IoSessionInputStream in = (IoSessionInputStream) session
.getAttribute(KEY_IN);
in.write((IoBuffer) buf);
} | [
"@",
"Override",
"public",
"void",
"messageReceived",
"(",
"IoSession",
"session",
",",
"Object",
"buf",
")",
"{",
"final",
"IoSessionInputStream",
"in",
"=",
"(",
"IoSessionInputStream",
")",
"session",
".",
"getAttribute",
"(",
"KEY_IN",
")",
";",
"in",
".",... | Forwards read data to input stream. | [
"Forwards",
"read",
"data",
"to",
"input",
"stream",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/handler/stream/StreamIoHandler.java#L130-L135 |
105,396 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/handler/stream/StreamIoHandler.java | StreamIoHandler.exceptionCaught | @Override
public void exceptionCaught(IoSession session, Throwable cause) {
final IoSessionInputStream in = (IoSessionInputStream) session
.getAttribute(KEY_IN);
IOException e = null;
if (cause instanceof StreamIoException) {
e = (IOException) cause.getCause();
... | java | @Override
public void exceptionCaught(IoSession session, Throwable cause) {
final IoSessionInputStream in = (IoSessionInputStream) session
.getAttribute(KEY_IN);
IOException e = null;
if (cause instanceof StreamIoException) {
e = (IOException) cause.getCause();
... | [
"@",
"Override",
"public",
"void",
"exceptionCaught",
"(",
"IoSession",
"session",
",",
"Throwable",
"cause",
")",
"{",
"final",
"IoSessionInputStream",
"in",
"=",
"(",
"IoSessionInputStream",
")",
"session",
".",
"getAttribute",
"(",
"KEY_IN",
")",
";",
"IOExce... | Forwards caught exceptions to input stream. | [
"Forwards",
"caught",
"exceptions",
"to",
"input",
"stream",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/handler/stream/StreamIoHandler.java#L140-L158 |
105,397 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/handler/stream/StreamIoHandler.java | StreamIoHandler.sessionIdle | @Override
public void sessionIdle(IoSession session, IdleStatus status) {
if (status == IdleStatus.READER_IDLE) {
throw new StreamIoException(new SocketTimeoutException(
"Read timeout"));
}
} | java | @Override
public void sessionIdle(IoSession session, IdleStatus status) {
if (status == IdleStatus.READER_IDLE) {
throw new StreamIoException(new SocketTimeoutException(
"Read timeout"));
}
} | [
"@",
"Override",
"public",
"void",
"sessionIdle",
"(",
"IoSession",
"session",
",",
"IdleStatus",
"status",
")",
"{",
"if",
"(",
"status",
"==",
"IdleStatus",
".",
"READER_IDLE",
")",
"{",
"throw",
"new",
"StreamIoException",
"(",
"new",
"SocketTimeoutException"... | Handles read timeout. | [
"Handles",
"read",
"timeout",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/handler/stream/StreamIoHandler.java#L163-L169 |
105,398 | kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks4LogicHandler.java | Socks4LogicHandler.messageReceived | public void messageReceived(final NextFilter nextFilter,
final IoBuffer buf) {
try {
if (buf.remaining() >= SocksProxyConstants.SOCKS_4_RESPONSE_SIZE) {
handleResponse(buf);
}
} catch (Exception ex) {
closeSession("Proxy handshake failed: "... | java | public void messageReceived(final NextFilter nextFilter,
final IoBuffer buf) {
try {
if (buf.remaining() >= SocksProxyConstants.SOCKS_4_RESPONSE_SIZE) {
handleResponse(buf);
}
} catch (Exception ex) {
closeSession("Proxy handshake failed: "... | [
"public",
"void",
"messageReceived",
"(",
"final",
"NextFilter",
"nextFilter",
",",
"final",
"IoBuffer",
"buf",
")",
"{",
"try",
"{",
"if",
"(",
"buf",
".",
"remaining",
"(",
")",
">=",
"SocksProxyConstants",
".",
"SOCKS_4_RESPONSE_SIZE",
")",
"{",
"handleResp... | Handle incoming data during the handshake process. Should consume only the
handshake data from the buffer, leaving any extra data in place.
@param nextFilter the next filter
@param buf the server response data buffer | [
"Handle",
"incoming",
"data",
"during",
"the",
"handshake",
"process",
".",
"Should",
"consume",
"only",
"the",
"handshake",
"data",
"from",
"the",
"buffer",
"leaving",
"any",
"extra",
"data",
"in",
"place",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/socks/Socks4LogicHandler.java#L110-L119 |
105,399 | kaazing/gateway | server/src/main/java/org/kaazing/gateway/server/util/version/DuplicateJarFinder.java | DuplicateJarFinder.findDuplicateJars | public void findDuplicateJars() throws IOException, DuplicateJarsException {
Map<String, List<String>> artifactsToVersion = new HashMap<>();
Enumeration<URL> manifestURLs = classPathParser.getManifestURLs();
while (manifestURLs.hasMoreElements()) {
parseManifestFileFromClassPathEntry... | java | public void findDuplicateJars() throws IOException, DuplicateJarsException {
Map<String, List<String>> artifactsToVersion = new HashMap<>();
Enumeration<URL> manifestURLs = classPathParser.getManifestURLs();
while (manifestURLs.hasMoreElements()) {
parseManifestFileFromClassPathEntry... | [
"public",
"void",
"findDuplicateJars",
"(",
")",
"throws",
"IOException",
",",
"DuplicateJarsException",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"artifactsToVersion",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Enumeration",
"<",
"U... | Parses the class path system attribute and the manifest files
and if there are duplicate jar a DuplicateJarsException is thrown.
@throws IOException
@throws DuplicateJarsException | [
"Parses",
"the",
"class",
"path",
"system",
"attribute",
"and",
"the",
"manifest",
"files",
"and",
"if",
"there",
"are",
"duplicate",
"jar",
"a",
"DuplicateJarsException",
"is",
"thrown",
"."
] | 06017b19273109b3b992e528e702586446168d57 | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/util/version/DuplicateJarFinder.java#L54-L61 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.