repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/CellControlsUtility.java
CellControlsUtility.matchParaMeterOfMethod
private static AttributesType matchParaMeterOfMethod(final Object obj, final String methodName) { for (AttributesType attr : AttributesType.values()) { try { obj.getClass().getMethod(methodName, new Class[] { attr.clazz }); return attr; } catch (Exception ex) { LOG.log(Level.FIN...
java
private static AttributesType matchParaMeterOfMethod(final Object obj, final String methodName) { for (AttributesType attr : AttributesType.values()) { try { obj.getClass().getMethod(methodName, new Class[] { attr.clazz }); return attr; } catch (Exception ex) { LOG.log(Level.FIN...
[ "private", "static", "AttributesType", "matchParaMeterOfMethod", "(", "final", "Object", "obj", ",", "final", "String", "methodName", ")", "{", "for", "(", "AttributesType", "attr", ":", "AttributesType", ".", "values", "(", ")", ")", "{", "try", "{", "obj", ...
match parameter of method. @param obj object. @param methodName method name. @return index of paraMatchArray if mached. otherwise return -1.
[ "match", "parameter", "of", "method", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/CellControlsUtility.java#L264-L279
test
Returns the AttributesType object that matches the specified method name.
Of course, here is the Java code you requested: ```java private static AttributesType matchParaMeterOfMethod(final Object obj, final String methodName) { for (AttributesType attr : AttributesType.values()) { try { obj.getClass().getMethod(methodName, new Class[] { attr.clazz }); return at...
rackerlabs/blueflood
blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupService.java
RollupService.removeShard
public void removeShard(Integer shard) { if (shardStateManager.getManagedShards().contains(shard)) context.removeShard(shard); }
java
public void removeShard(Integer shard) { if (shardStateManager.getManagedShards().contains(shard)) context.removeShard(shard); }
[ "public", "void", "removeShard", "(", "Integer", "shard", ")", "{", "if", "(", "shardStateManager", ".", "getManagedShards", "(", ")", ".", "contains", "(", "shard", ")", ")", "context", ".", "removeShard", "(", "shard", ")", ";", "}" ]
Remove a shard from being managed (via JMX) @param shard shard to be removed
[ "Remove", "a", "shard", "from", "being", "managed", "(", "via", "JMX", ")" ]
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupService.java#L386-L389
test
Remove a managed shard from the context.
Of course, here is the Java code you requested: ```java public void removeShard(Integer shard) { if (shardStateManager.getManagedShards().contains(shard)) context.removeShard(shard); } ``` Hope this helps!
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasScasum
public static float cublasScasum(int n, Pointer x, int incx) { float result = cublasScasumNative(n, x, incx); checkResultBLAS(); return result; }
java
public static float cublasScasum(int n, Pointer x, int incx) { float result = cublasScasumNative(n, x, incx); checkResultBLAS(); return result; }
[ "public", "static", "float", "cublasScasum", "(", "int", "n", ",", "Pointer", "x", ",", "int", "incx", ")", "{", "float", "result", "=", "cublasScasumNative", "(", "n", ",", "x", ",", "incx", ")", ";", "checkResultBLAS", "(", ")", ";", "return", "resul...
<pre> float cublasScasum (int n, const cuDouble *x, int incx) takes the sum of the absolute values of a complex vector and returns a single precision result. Note that this is not the L1 norm of the vector. The result is the sum from 0 to n-1 of abs(real(x[ix+i*incx])) + abs(imag(x(ix+i*incx))), where ix = 1 if incx <...
[ "<pre", ">", "float", "cublasScasum", "(", "int", "n", "const", "cuDouble", "*", "x", "int", "incx", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L2284-L2289
test
Compute the sum of a unique set of tokens.
Of course, here is the Java code you requested: ```java public static float cublasScasum(int n, Pointer x, int incx) { float result = cublasScasumNative(n, x, incx); checkResultBLAS(); return result; } ``` Hope this helps!
FitLayout/api
src/main/java/org/fit/layout/impl/AreaGrid.java
AreaGrid.getRowOfs
public int getRowOfs(int row) throws ArrayIndexOutOfBoundsException { if (row < height) { int ofs = 0; for (int i = 0; i < row; i++) ofs += rows[i]; return ofs; } else if (row == height) return abspos.getHeight(); else throw new ArrayIndexOutOfBoundsExce...
java
public int getRowOfs(int row) throws ArrayIndexOutOfBoundsException { if (row < height) { int ofs = 0; for (int i = 0; i < row; i++) ofs += rows[i]; return ofs; } else if (row == height) return abspos.getHeight(); else throw new ArrayIndexOutOfBoundsExce...
[ "public", "int", "getRowOfs", "(", "int", "row", ")", "throws", "ArrayIndexOutOfBoundsException", "{", "if", "(", "row", "<", "height", ")", "{", "int", "ofs", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "row", ";", "i", "++", ...
Finds the offset of the specified row from the grid origin. @param col the row index @return the offset in pixels. Row 0 has always the offset 0.
[ "Finds", "the", "offset", "of", "the", "specified", "row", "from", "the", "grid", "origin", "." ]
fcfa67ce2a7485fbd722576413191fff5d68bae8
https://github.com/FitLayout/api/blob/fcfa67ce2a7485fbd722576413191fff5d68bae8/src/main/java/org/fit/layout/impl/AreaGrid.java#L167-L180
test
Gets the offset of the specified row.
Of course, here is the Java code you requested: ```java public int getRowOfs(int row) throws ArrayIndexOutOfBoundsException { if (row < height) { int ofs = 0; for (int i = 0; i < row; i++) ofs += rows[i]; return ofs; } else if (row == height) return abspos.getHeig...
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java
TransactionalHashMap.removeEntryForKey
Entry<K,V> removeEntryForKey(Object key) throws ConcurrentModificationException { Object k = maskNull(key); int hash = hash(k); int i = indexFor(hash, table.length); Entry<K,V> prev = table[i]; Entry<K,V> e = prev; while (e != null) { ...
java
Entry<K,V> removeEntryForKey(Object key) throws ConcurrentModificationException { Object k = maskNull(key); int hash = hash(k); int i = indexFor(hash, table.length); Entry<K,V> prev = table[i]; Entry<K,V> e = prev; while (e != null) { ...
[ "Entry", "<", "K", ",", "V", ">", "removeEntryForKey", "(", "Object", "key", ")", "throws", "ConcurrentModificationException", "{", "Object", "k", "=", "maskNull", "(", "key", ")", ";", "int", "hash", "=", "hash", "(", "k", ")", ";", "int", "i", "=", ...
Removes and returns the entry associated with the specified key in the HashMap. Returns null if the HashMap contains no mapping for this key.
[ "Removes", "and", "returns", "the", "entry", "associated", "with", "the", "specified", "key", "in", "the", "HashMap", ".", "Returns", "null", "if", "the", "HashMap", "contains", "no", "mapping", "for", "this", "key", "." ]
1b638be51997eafac4d368c14f62a16624a08d3e
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java#L716-L750
test
Remove an entry from the table for the specified key.
Of course, here is the Java code you requested: ```java Entry<K,V> removeEntryForKey(Object key) throws ConcurrentModificationException { Object k = maskNull(key); int hash = hash(k); int i = indexFor(hash, table.length); Entry<K,V> prev = table[i]; Entry<K,V> e = prev...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/grid/GridServiceProvider.java
GridServiceProvider.readXY
private void readXY(Variable v2, int ensIdx, int timeIdx, int levIdx, Range yRange, Range xRange, IndexIterator ii) throws IOException, InvalidRangeException { GridVariable pv = (GridVariable) v2.getSPobject(); GridHorizCoordSys hsys = pv.getHorizCoordSys(); int nx = hsys.getNx(); GridRecord ...
java
private void readXY(Variable v2, int ensIdx, int timeIdx, int levIdx, Range yRange, Range xRange, IndexIterator ii) throws IOException, InvalidRangeException { GridVariable pv = (GridVariable) v2.getSPobject(); GridHorizCoordSys hsys = pv.getHorizCoordSys(); int nx = hsys.getNx(); GridRecord ...
[ "private", "void", "readXY", "(", "Variable", "v2", ",", "int", "ensIdx", ",", "int", "timeIdx", ",", "int", "levIdx", ",", "Range", "yRange", ",", "Range", "xRange", ",", "IndexIterator", "ii", ")", "throws", "IOException", ",", "InvalidRangeException", "{"...
read one YX array @param v2 variable to put the data into @param ensIdx ensemble index @param timeIdx time index @param levIdx level index @param yRange x range @param xRange y range @param ii index iterator @throws IOException problem reading the file @throws InvalidRangeException invalid rang...
[ "read", "one", "YX", "array" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridServiceProvider.java#L225-L258
test
read the xy of a variable.
Of course, here is the Java code you requested: ```java private void readXY(Variable v2, int ensIdx, int timeIdx, int levIdx, Range yRange, Range xRange, IndexIterator ii) throws IOException, InvalidRangeException { GridVariable pv = (GridVariable) v2.getSPobject(); GridHorizCoordSys hsys = pv.getHo...
jboss/jboss-common-core
src/main/java/org/jboss/util/xml/catalog/Catalog.java
Catalog.parseCatalogFile
protected synchronized void parseCatalogFile(String fileName) throws MalformedURLException, IOException, CatalogException { // The base-base is the cwd. If the catalog file is specified // with a relative path, this assures that it gets resolved // properly... try { // tack on a basename beca...
java
protected synchronized void parseCatalogFile(String fileName) throws MalformedURLException, IOException, CatalogException { // The base-base is the cwd. If the catalog file is specified // with a relative path, this assures that it gets resolved // properly... try { // tack on a basename beca...
[ "protected", "synchronized", "void", "parseCatalogFile", "(", "String", "fileName", ")", "throws", "MalformedURLException", ",", "IOException", ",", "CatalogException", "{", "// The base-base is the cwd. If the catalog file is specified", "// with a relative path, this assures that i...
Parse a single catalog file, augmenting internal data structures. @param fileName The filename of the catalog file to process @throws MalformedURLException The fileName cannot be turned into a valid URL. @throws IOException Error reading catalog file. @throws CatalogException for any error
[ "Parse", "a", "single", "catalog", "file", "augmenting", "internal", "data", "structures", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/Catalog.java#L802-L878
test
Parses the specified catalog file into a single entry.
Of course, here is the Java code you requested: ```java protected synchronized void parseCatalogFile(String fileName) throws MalformedURLException, IOException, CatalogException { // The base-base is the cwd. If the catalog file is specified // with a relative path, this assures that it gets resolved ...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java
GridHorizCoordSys.addToNetcdfFile
void addToNetcdfFile(NetcdfFile ncfile) { if (isLatLon) { double dy; if (gds.getDouble(GridDefRecord.DY) == GridDefRecord.UNDEFINED) { dy = setLatLonDxDy(); } else { dy = (gds.getDouble(GridDefRecord.LA2) < gds.getDouble(GridDefRecord.LA1)) ? -gds.getDouble(GridDefReco...
java
void addToNetcdfFile(NetcdfFile ncfile) { if (isLatLon) { double dy; if (gds.getDouble(GridDefRecord.DY) == GridDefRecord.UNDEFINED) { dy = setLatLonDxDy(); } else { dy = (gds.getDouble(GridDefRecord.LA2) < gds.getDouble(GridDefRecord.LA1)) ? -gds.getDouble(GridDefReco...
[ "void", "addToNetcdfFile", "(", "NetcdfFile", "ncfile", ")", "{", "if", "(", "isLatLon", ")", "{", "double", "dy", ";", "if", "(", "gds", ".", "getDouble", "(", "GridDefRecord", ".", "DY", ")", "==", "GridDefRecord", ".", "UNDEFINED", ")", "{", "dy", "...
Add the variables to the netCDF file @param ncfile the netCDF file
[ "Add", "the", "variables", "to", "the", "netCDF", "file" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java#L246-L311
test
Add the data to the NetCDF file.
Of course, here is the Java code you requested: ```java void addToNetcdfFile(NetcdfFile ncfile) { if (isLatLon) { double dy; if (gds.getDouble(GridDefRecord.DY) == GridDefRecord.UNDEFINED) { dy = setLatLonDxDy(); } else { dy = (gds.getDouble(GridDefRecord.LA2) < gds.getDouble(Gri...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/db/OPartitionedDatabasePool.java
OPartitionedDatabasePool.setProperty
public Object setProperty(final String iName, final Object iValue) { if (iValue != null) { return properties.put(iName.toLowerCase(Locale.ENGLISH), iValue); } else { return properties.remove(iName.toLowerCase(Locale.ENGLISH)); } }
java
public Object setProperty(final String iName, final Object iValue) { if (iValue != null) { return properties.put(iName.toLowerCase(Locale.ENGLISH), iValue); } else { return properties.remove(iName.toLowerCase(Locale.ENGLISH)); } }
[ "public", "Object", "setProperty", "(", "final", "String", "iName", ",", "final", "Object", "iValue", ")", "{", "if", "(", "iValue", "!=", "null", ")", "{", "return", "properties", ".", "put", "(", "iName", ".", "toLowerCase", "(", "Locale", ".", "ENGLIS...
Sets a property value @param iName Property name @param iValue new value to set @return The previous value if any, otherwise null
[ "Sets", "a", "property", "value" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/db/OPartitionedDatabasePool.java#L371-L377
test
Set the property.
Of course, here is the Java code you requested: ```java public Object setProperty(final String iName, final Object iValue) { if (iValue != null) { return properties.put(iName.toLowerCase(Locale.ENGLISH), iValue); } else { return properties.remove(iName.toLowerCase(Locale.ENGLISH)); } } ``` H...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializer.java
AbstractSecurityWebApplicationInitializer.onStartup
public final void onStartup(ServletContext servletContext) throws ServletException { beforeSpringSecurityFilterChain(servletContext); if (this.configurationClasses != null) { AnnotationConfigWebApplicationContext rootAppContext = new AnnotationConfigWebApplicationContext(); rootAppContext.register(this.config...
java
public final void onStartup(ServletContext servletContext) throws ServletException { beforeSpringSecurityFilterChain(servletContext); if (this.configurationClasses != null) { AnnotationConfigWebApplicationContext rootAppContext = new AnnotationConfigWebApplicationContext(); rootAppContext.register(this.config...
[ "public", "final", "void", "onStartup", "(", "ServletContext", "servletContext", ")", "throws", "ServletException", "{", "beforeSpringSecurityFilterChain", "(", "servletContext", ")", ";", "if", "(", "this", ".", "configurationClasses", "!=", "null", ")", "{", "Anno...
/* (non-Javadoc) @see org.springframework.web.WebApplicationInitializer#onStartup(javax.servlet. ServletContext)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializer.java#L112-L126
test
This method is called by the Spring Security filter when the application is started.
Of course, here is the Java code you requested: ```java public final void onStartup(ServletContext servletContext) throws ServletException { beforeSpringSecurityFilterChain(servletContext); if (this.configurationClasses != null) { AnnotationConfigWebApplicationContext rootAppContext = new AnnotationConfigWebApp...
fabric8io/fabric8-maven-plugin
core/src/main/java/io/fabric8/maven/core/util/ProfileUtil.java
ProfileUtil.fromYaml
public static List<Profile> fromYaml(InputStream is) throws IOException { TypeReference<List<Profile>> typeRef = new TypeReference<List<Profile>>() {}; return mapper.readValue(is, typeRef); }
java
public static List<Profile> fromYaml(InputStream is) throws IOException { TypeReference<List<Profile>> typeRef = new TypeReference<List<Profile>>() {}; return mapper.readValue(is, typeRef); }
[ "public", "static", "List", "<", "Profile", ">", "fromYaml", "(", "InputStream", "is", ")", "throws", "IOException", "{", "TypeReference", "<", "List", "<", "Profile", ">>", "typeRef", "=", "new", "TypeReference", "<", "List", "<", "Profile", ">", ">", "("...
Load a profile from an input stream. This must be in YAML format @param is inputstream to read the profile from @return the de-serialized profile @throws IOException if deserialization fails
[ "Load", "a", "profile", "from", "an", "input", "stream", ".", "This", "must", "be", "in", "YAML", "format" ]
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/util/ProfileUtil.java#L233-L236
test
Creates a list of profiles from a YAML input stream.
Of course, here is the Java code you requested: ```java public static List<Profile> fromYaml(InputStream is) throws IOException { TypeReference<List<Profile>> typeRef = new TypeReference<List<Profile>>() {}; return mapper.readValue(is, typeRef); } ``` Hope this helps!
Unidata/thredds
opendap/src/main/java/opendap/servlet/www/wwwOutPut.java
wwwOutPut.writeVariableAttributes
public void writeVariableAttributes(BaseType bt, DAS das) { try { AttributeTable attr = das.getAttributeTable(bt.getEncodedName()); if (attr != null) { pWrt.print("<textarea name=\"" + bt.getLongName().replace('.', '_') ...
java
public void writeVariableAttributes(BaseType bt, DAS das) { try { AttributeTable attr = das.getAttributeTable(bt.getEncodedName()); if (attr != null) { pWrt.print("<textarea name=\"" + bt.getLongName().replace('.', '_') ...
[ "public", "void", "writeVariableAttributes", "(", "BaseType", "bt", ",", "DAS", "das", ")", "{", "try", "{", "AttributeTable", "attr", "=", "das", ".", "getAttributeTable", "(", "bt", ".", "getEncodedName", "(", ")", ")", ";", "if", "(", "attr", "!=", "n...
/* void WWWOutput::write_variable_attributes(BaseType *btp, DAS &das) { AttrTable *attr = das.get_table(btp->name()); Don't write anything if there are no attributes. if (!attr) return; _os << "<textarea name=\"" << btp->name() << "_attr" << "\" rows=" << _attr_rows << " cols=" << _attr_cols << ">\n"; write_attributes...
[ "/", "*", "void", "WWWOutput", "::", "write_variable_attributes", "(", "BaseType", "*", "btp", "DAS", "&das", ")", "{", "AttrTable", "*", "attr", "=", "das", ".", "get_table", "(", "btp", "-", ">", "name", "()", ")", ";", "Don", "t", "write", "anything...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servlet/www/wwwOutPut.java#L271-L295
test
Write the variable attributes for a single base type.
Of course, here is the Java code you requested: ```java public void writeVariableAttributes(BaseType bt, DAS das) { try { AttributeTable attr = das.getAttributeTable(bt.getEncodedName()); if (attr != null) { pWrt.print("<textarea name=\"" ...
streamsets/datacollector
container/src/main/java/com/streamsets/datacollector/validation/ValidationUtil.java
ValidationUtil.resolveStageAlias
public static void resolveStageAlias( StageLibraryTask stageLibrary, StageConfiguration stageConf ) { String aliasKey = Joiner.on(",").join(stageConf.getLibrary(), stageConf.getStageName()); String aliasValue = Strings.nullToEmpty(stageLibrary.getStageNameAliases().get(aliasKey)); if (LOG.isTraceE...
java
public static void resolveStageAlias( StageLibraryTask stageLibrary, StageConfiguration stageConf ) { String aliasKey = Joiner.on(",").join(stageConf.getLibrary(), stageConf.getStageName()); String aliasValue = Strings.nullToEmpty(stageLibrary.getStageNameAliases().get(aliasKey)); if (LOG.isTraceE...
[ "public", "static", "void", "resolveStageAlias", "(", "StageLibraryTask", "stageLibrary", ",", "StageConfiguration", "stageConf", ")", "{", "String", "aliasKey", "=", "Joiner", ".", "on", "(", "\",\"", ")", ".", "join", "(", "stageConf", ".", "getLibrary", "(", ...
Resolve stage aliases (e.g. when a stage is renamed).
[ "Resolve", "stage", "aliases", "(", "e", ".", "g", ".", "when", "a", "stage", "is", "renamed", ")", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/validation/ValidationUtil.java#L63-L85
test
Resolve the stage alias.
Of course, here is the Java code you requested: ```java public static void resolveStageAlias( StageLibraryTask stageLibrary, StageConfiguration stageConf ) { String aliasKey = Joiner.on(",").join(stageConf.getLibrary(), stageConf.getStageName()); String aliasValue = Strings.nullToEmpty(stageLibrary.g...
Unidata/thredds
opendap/src/main/java/opendap/util/SortedTable.java
SortedTable.put
public synchronized Object put(Object key, Object value) throws NullPointerException { if (key == null || value == null) throw new NullPointerException(); int index = keys.indexOf(key); if (index != -1) { Object prev = elements.elementAt(index); elemen...
java
public synchronized Object put(Object key, Object value) throws NullPointerException { if (key == null || value == null) throw new NullPointerException(); int index = keys.indexOf(key); if (index != -1) { Object prev = elements.elementAt(index); elemen...
[ "public", "synchronized", "Object", "put", "(", "Object", "key", ",", "Object", "value", ")", "throws", "NullPointerException", "{", "if", "(", "key", "==", "null", "||", "value", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "i...
Maps the specified key to the specified value in this table. @param key the key @param value the value @return the previous value to which the key is mapped, or null if the key did not have a previous mapping. @throws NullPointerException if the key or value is null.
[ "Maps", "the", "specified", "key", "to", "the", "specified", "value", "in", "this", "table", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/util/SortedTable.java#L135-L149
test
Put a single instance of the class.
Of course, here is the Java code you requested: ```java public synchronized Object put(Object key, Object value) throws NullPointerException { if (key == null || value == null) throw new NullPointerException(); int index = keys.indexOf(key); if (index != -1) { Obj...
wildfly/wildfly
webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
WebMetaDataCreator.create
void create(final Deployment dep) { final DeploymentUnit unit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class); WarMetaData warMD = ASHelper.getOptionalAttachment(unit, WarMetaData.ATTACHMENT_KEY); JBossWebMetaData jbossWebMD = warMD != null ? warMD.getMergedJBossWebMetaData() : null;...
java
void create(final Deployment dep) { final DeploymentUnit unit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class); WarMetaData warMD = ASHelper.getOptionalAttachment(unit, WarMetaData.ATTACHMENT_KEY); JBossWebMetaData jbossWebMD = warMD != null ? warMD.getMergedJBossWebMetaData() : null;...
[ "void", "create", "(", "final", "Deployment", "dep", ")", "{", "final", "DeploymentUnit", "unit", "=", "WSHelper", ".", "getRequiredAttachment", "(", "dep", ",", "DeploymentUnit", ".", "class", ")", ";", "WarMetaData", "warMD", "=", "ASHelper", ".", "getOption...
Creates web meta data for EJB deployments. @param dep webservice deployment
[ "Creates", "web", "meta", "data", "for", "EJB", "deployments", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java#L65-L83
test
Create the application descriptor.
Of course, here is the Java code you requested: ```java void create(final Deployment dep) { final DeploymentUnit unit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class); WarMetaData warMD = ASHelper.getOptionalAttachment(unit, WarMetaData.ATTACHMENT_KEY); JBossWebMetaData jbossWebMD = ...
deeplearning4j/nd4j
nd4j-common/src/main/java/org/nd4j/util/ArchiveUtils.java
ArchiveUtils.unzipFileTo
public static void unzipFileTo(String file, String dest) throws IOException { File target = new File(file); if (!target.exists()) throw new IllegalArgumentException("Archive doesnt exist"); FileInputStream fin = new FileInputStream(target); int BUFFER = 2048; byte dat...
java
public static void unzipFileTo(String file, String dest) throws IOException { File target = new File(file); if (!target.exists()) throw new IllegalArgumentException("Archive doesnt exist"); FileInputStream fin = new FileInputStream(target); int BUFFER = 2048; byte dat...
[ "public", "static", "void", "unzipFileTo", "(", "String", "file", ",", "String", "dest", ")", "throws", "IOException", "{", "File", "target", "=", "new", "File", "(", "file", ")", ";", "if", "(", "!", "target", ".", "exists", "(", ")", ")", "throw", ...
Extracts files to the specified destination @param file the file to extract to @param dest the destination directory @throws IOException
[ "Extracts", "files", "to", "the", "specified", "destination" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/util/ArchiveUtils.java#L51-L139
test
Unzip a file to a destination.
Of course, here is the Java code you requested: ```java public static void unzipFileTo(String file, String dest) throws IOException { File target = new File(file); if (!target.exists()) throw new IllegalArgumentException("Archive doesnt exist"); FileInputStream fin = new FileInputSt...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/lossfunctions/impl/LossMixtureDensity.java
LossMixtureDensity.negativeLogLikelihood
private INDArray negativeLogLikelihood(INDArray labels, INDArray alpha, INDArray mu, INDArray sigma) { INDArray labelsMinusMu = labelsMinusMu(labels, mu); INDArray diffsquared = labelsMinusMu.mul(labelsMinusMu).sum(2); INDArray phitimesalphasum = phi(diffsquared, sigma).muli(alpha).sum(1); ...
java
private INDArray negativeLogLikelihood(INDArray labels, INDArray alpha, INDArray mu, INDArray sigma) { INDArray labelsMinusMu = labelsMinusMu(labels, mu); INDArray diffsquared = labelsMinusMu.mul(labelsMinusMu).sum(2); INDArray phitimesalphasum = phi(diffsquared, sigma).muli(alpha).sum(1); ...
[ "private", "INDArray", "negativeLogLikelihood", "(", "INDArray", "labels", ",", "INDArray", "alpha", ",", "INDArray", "mu", ",", "INDArray", "sigma", ")", "{", "INDArray", "labelsMinusMu", "=", "labelsMinusMu", "(", "labels", ",", "mu", ")", ";", "INDArray", "...
This method returns an array consisting of each of the training samples, for each label in each sample, the negative log likelihood of that value falling within the given gaussian mixtures. @param alpha @param mu @param sigma @param labels @return
[ "This", "method", "returns", "an", "array", "consisting", "of", "each", "of", "the", "training", "samples", "for", "each", "label", "in", "each", "sample", "the", "negative", "log", "likelihood", "of", "that", "value", "falling", "within", "the", "given", "g...
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/lossfunctions/impl/LossMixtureDensity.java#L326-L334
test
Returns the negative log likelihood of a set of labels
Of course, here is the Java code you requested: ```java private INDArray negativeLogLikelihood(INDArray labels, INDArray alpha, INDArray mu, INDArray sigma) { INDArray labelsMinusMu = labelsMinusMu(labels, mu); INDArray diffsquared = labelsMinusMu.mul(labelsMinusMu).sum(2); INDArray phitimesalp...
playframework/playframework
web/play-java-forms/src/main/java/play/data/Form.java
Form.globalErrors
public List<ValidationError> globalErrors() { return Collections.unmodifiableList( errors.stream().filter(error -> error.key().isEmpty()).collect(Collectors.toList())); }
java
public List<ValidationError> globalErrors() { return Collections.unmodifiableList( errors.stream().filter(error -> error.key().isEmpty()).collect(Collectors.toList())); }
[ "public", "List", "<", "ValidationError", ">", "globalErrors", "(", ")", "{", "return", "Collections", ".", "unmodifiableList", "(", "errors", ".", "stream", "(", ")", ".", "filter", "(", "error", "->", "error", ".", "key", "(", ")", ".", "isEmpty", "(",...
Retrieve all global errors - errors without a key. @return All global errors.
[ "Retrieve", "all", "global", "errors", "-", "errors", "without", "a", "key", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/web/play-java-forms/src/main/java/play/data/Form.java#L1237-L1240
test
Returns all the errors that occurred in the global validation set.
Of course, here is the Java code you requested: ```java public List<ValidationError> globalErrors() { return Collections.unmodifiableList( errors.stream().filter(error -> error.key().isEmpty()).collect(Collectors.toList())); } ``` Hope this helps!
playframework/playframework
persistence/play-java-jdbc/src/main/java/play/db/Databases.java
Databases.createFrom
public static Database createFrom( String name, String driver, String url, Map<String, ? extends Object> config) { ImmutableMap.Builder<String, Object> dbConfig = new ImmutableMap.Builder<String, Object>(); dbConfig.put("driver", driver); dbConfig.put("url", url); dbConfig.putAll(config); retu...
java
public static Database createFrom( String name, String driver, String url, Map<String, ? extends Object> config) { ImmutableMap.Builder<String, Object> dbConfig = new ImmutableMap.Builder<String, Object>(); dbConfig.put("driver", driver); dbConfig.put("url", url); dbConfig.putAll(config); retu...
[ "public", "static", "Database", "createFrom", "(", "String", "name", ",", "String", "driver", ",", "String", "url", ",", "Map", "<", "String", ",", "?", "extends", "Object", ">", "config", ")", "{", "ImmutableMap", ".", "Builder", "<", "String", ",", "Ob...
Create a pooled database with the given configuration. @param name the database name @param driver the database driver class @param url the database url @param config a map of extra database configuration @return a configured database
[ "Create", "a", "pooled", "database", "with", "the", "given", "configuration", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/persistence/play-java-jdbc/src/main/java/play/db/Databases.java#L31-L38
test
Create a database from a name driver url and configuration.
Of course, here is the Java code you requested: ```java public static Database createFrom( String name, String driver, String url, Map<String, ? extends Object> config) { ImmutableMap.Builder<String, Object> dbConfig = new ImmutableMap.Builder<String, Object>(); dbConfig.put("driver", driver); dbConf...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/ferry/Logger.java
Logger.getStaticLogger
public static Logger getStaticLogger(String aLoggerName) { long cPtr = FerryJNI.Logger_getStaticLogger(aLoggerName); return (cPtr == 0) ? null : new Logger(cPtr, false); }
java
public static Logger getStaticLogger(String aLoggerName) { long cPtr = FerryJNI.Logger_getStaticLogger(aLoggerName); return (cPtr == 0) ? null : new Logger(cPtr, false); }
[ "public", "static", "Logger", "getStaticLogger", "(", "String", "aLoggerName", ")", "{", "long", "cPtr", "=", "FerryJNI", ".", "Logger_getStaticLogger", "(", "aLoggerName", ")", ";", "return", "(", "cPtr", "==", "0", ")", "?", "null", ":", "new", "Logger", ...
Get a Logger object, but ask the Logger code to<br> free it up once the JavaVM shuts down. Use at your<br> own risk.<br> <br> @param aLoggerName A name (no spaces allowed) for this logger.<br> <br> @return A new logger for logging; caller must not call delete<br> and must not use the logger once the JavaVM (or main) h...
[ "Get", "a", "Logger", "object", "but", "ask", "the", "Logger", "code", "to<br", ">", "free", "it", "up", "once", "the", "JavaVM", "shuts", "down", ".", "Use", "at", "your<br", ">", "own", "risk", ".", "<br", ">", "<br", ">" ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/Logger.java#L166-L169
test
Get a static logger.
Of course, here is the Java code you requested: ```java public static Logger getStaticLogger(String aLoggerName) { long cPtr = FerryJNI.Logger_getStaticLogger(aLoggerName); return (cPtr == 0) ? null : new Logger(cPtr, false); } ``` Hope this helps!
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.proxy
public static void proxy(String host) { if (UriValidator.isUri(host)) { try { proxy(new URI(host)); } catch (URISyntaxException e) { throw new RuntimeException("Internal error in REST Assured when constructing URI for Proxy.", e); } } e...
java
public static void proxy(String host) { if (UriValidator.isUri(host)) { try { proxy(new URI(host)); } catch (URISyntaxException e) { throw new RuntimeException("Internal error in REST Assured when constructing URI for Proxy.", e); } } e...
[ "public", "static", "void", "proxy", "(", "String", "host", ")", "{", "if", "(", "UriValidator", ".", "isUri", "(", "host", ")", ")", "{", "try", "{", "proxy", "(", "new", "URI", "(", "host", ")", ")", ";", "}", "catch", "(", "URISyntaxException", ...
Instruct REST Assured to connect to a proxy on the specified host on port <code>8888</code>. @param host The hostname of the proxy to connect to (for example <code>127.0.0.1</code>). Can also be a URI represented as a String. @see #proxy(String, int)
[ "Instruct", "REST", "Assured", "to", "connect", "to", "a", "proxy", "on", "the", "specified", "host", "on", "port", "<code", ">", "8888<", "/", "code", ">", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L1721-L1731
test
Proxy to a host.
Of course, here is the Java code you requested: ```java public static void proxy(String host) { if (UriValidator.isUri(host)) { try { proxy(new URI(host)); } catch (URISyntaxException e) { throw new RuntimeException("Internal error in REST Assured when co...
arnohaase/a-foundation
a-foundation/src/main/java/com/ajjpj/afoundation/collection/immutable/MapAsSetWrapper.java
MapAsSetWrapper.createInternal
@SuppressWarnings ("unchecked") protected <X> ASet<X> createInternal (Iterable<X> elements) { AMap result = inner.clear (); for (X el: elements) { result = result.updated (el, Boolean.TRUE); } return (ASet) wrapAsSet (result); }
java
@SuppressWarnings ("unchecked") protected <X> ASet<X> createInternal (Iterable<X> elements) { AMap result = inner.clear (); for (X el: elements) { result = result.updated (el, Boolean.TRUE); } return (ASet) wrapAsSet (result); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "<", "X", ">", "ASet", "<", "X", ">", "createInternal", "(", "Iterable", "<", "X", ">", "elements", ")", "{", "AMap", "result", "=", "inner", ".", "clear", "(", ")", ";", "for", "(", "X...
-------------------------------------- collection transformations
[ "--------------------------------------", "collection", "transformations" ]
f3eef2ca89d67775f202a4c28140230a6229291e
https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/collection/immutable/MapAsSetWrapper.java#L142-L150
test
Create a set of URIs from the given elements.
Of course, here is the Java code you requested: ```java @SuppressWarnings ("unchecked") protected <X> ASet<X> createInternal (Iterable<X> elements) { AMap result = inner.clear (); for (X el: elements) { result = result.updated (el, Boolean.TRUE); } return (ASet) wrapAsS...
square/retrofit
retrofit/src/main/java/retrofit2/Response.java
Response.success
public static <T> Response<T> success(@Nullable T body) { return success(body, new okhttp3.Response.Builder() // .code(200) .message("OK") .protocol(Protocol.HTTP_1_1) .request(new Request.Builder().url("http://localhost/").build()) .build()); }
java
public static <T> Response<T> success(@Nullable T body) { return success(body, new okhttp3.Response.Builder() // .code(200) .message("OK") .protocol(Protocol.HTTP_1_1) .request(new Request.Builder().url("http://localhost/").build()) .build()); }
[ "public", "static", "<", "T", ">", "Response", "<", "T", ">", "success", "(", "@", "Nullable", "T", "body", ")", "{", "return", "success", "(", "body", ",", "new", "okhttp3", ".", "Response", ".", "Builder", "(", ")", "//", ".", "code", "(", "200",...
Create a synthetic successful response with {@code body} as the deserialized body.
[ "Create", "a", "synthetic", "successful", "response", "with", "{" ]
81a6193a7b3f2b1bf25e78adc2638681b0514fe8
https://github.com/square/retrofit/blob/81a6193a7b3f2b1bf25e78adc2638681b0514fe8/retrofit/src/main/java/retrofit2/Response.java#L29-L36
test
A new HTTP response with 200 status code and message
Of course, here is the Java code you requested: ```java public static <T> Response<T> success(@Nullable T body) { return success(body, new okhttp3.Response.Builder() // .code(200) .message("OK") .protocol(Protocol.HTTP_1_1) .request(new Request.Builder().url("http://localhost/").bui...
kiegroup/droolsjbpm-tools
drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/CompletionUtil.java
CompletionUtil.getCompilableText
public static String getCompilableText(String backText) { String trimed = backText.trim(); if ( trimed.endsWith( ";" ) ) { // RHS expression should compile if it ends with ; but to get the last object, // we do no want it, to simulate a return statement return backTex...
java
public static String getCompilableText(String backText) { String trimed = backText.trim(); if ( trimed.endsWith( ";" ) ) { // RHS expression should compile if it ends with ; but to get the last object, // we do no want it, to simulate a return statement return backTex...
[ "public", "static", "String", "getCompilableText", "(", "String", "backText", ")", "{", "String", "trimed", "=", "backText", ".", "trim", "(", ")", ";", "if", "(", "trimed", ".", "endsWith", "(", "\";\"", ")", ")", "{", "// RHS expression should compile if it ...
Attempt to enhance a consequence backtext such that it should compile in MVEL @param backText @return a substring of the back text, that should be compilable without syntax errors by the mvel compiler TODO: add tests and more use cases
[ "Attempt", "to", "enhance", "a", "consequence", "backtext", "such", "that", "it", "should", "compile", "in", "MVEL", "@param", "backText", "@return", "a", "substring", "of", "the", "back", "text", "that", "should", "be", "compilable", "without", "syntax", "err...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/CompletionUtil.java#L176-L201
test
Get the compilable text for the C ++ RHS.
Of course, here is the Java code you requested: ```java public static String getCompilableText(String backText) { String trimed = backText.trim(); if ( trimed.endsWith( ";" ) ) { // RHS expression should compile if it ends with ; but to get the last object, // we do no want it, ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft2/simpgeometry/SimpleGeometryIndexFinder.java
SimpleGeometryIndexFinder.getEnd
public int getEnd(int index) { // Test if the last beginning is the new end if(index == (pastIndex - 1)) { return previousBegin - 1; } // Otherwise find it! int new_end = 0; for(int i = 0; i < index + 1; i++) { new_end += getNodeCount(i); } pastIndex = index; previousEnd ...
java
public int getEnd(int index) { // Test if the last beginning is the new end if(index == (pastIndex - 1)) { return previousBegin - 1; } // Otherwise find it! int new_end = 0; for(int i = 0; i < index + 1; i++) { new_end += getNodeCount(i); } pastIndex = index; previousEnd ...
[ "public", "int", "getEnd", "(", "int", "index", ")", "{", "// Test if the last beginning is the new end\r", "if", "(", "index", "==", "(", "pastIndex", "-", "1", ")", ")", "{", "return", "previousBegin", "-", "1", ";", "}", "// Otherwise find it!\r", "int", "n...
Gets the ending index of a geometry's points given the index of the geometry within the array. @param index of the geometry within the array @return end of the range
[ "Gets", "the", "ending", "index", "of", "a", "geometry", "s", "points", "given", "the", "index", "of", "the", "geometry", "within", "the", "array", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft2/simpgeometry/SimpleGeometryIndexFinder.java#L59-L76
test
Gets the end value of the N - th node in the list.
Of course, here is the Java code you requested: ```java public int getEnd(int index) { // Test if the last beginning is the new end if(index == (pastIndex - 1)) { return previousBegin - 1; } // Otherwise find it! int new_end = 0; for(int i = 0; i < index + 1; i++) { new_end += getNod...
Unidata/thredds
ui/src/main/java/thredds/ui/catalog/CatalogTreeView.java
CatalogTreeView.makeTreePath
TreePath makeTreePath(TreeNode node) { ArrayList<TreeNode> path = new ArrayList<>(); path.add( node); TreeNode parent = node.getParent(); while (parent != null) { path.add(0, parent); parent = parent.getParent(); } Object[] paths = path.toArray(); return new TreePath(paths); }
java
TreePath makeTreePath(TreeNode node) { ArrayList<TreeNode> path = new ArrayList<>(); path.add( node); TreeNode parent = node.getParent(); while (parent != null) { path.add(0, parent); parent = parent.getParent(); } Object[] paths = path.toArray(); return new TreePath(paths); }
[ "TreePath", "makeTreePath", "(", "TreeNode", "node", ")", "{", "ArrayList", "<", "TreeNode", ">", "path", "=", "new", "ArrayList", "<>", "(", ")", ";", "path", ".", "add", "(", "node", ")", ";", "TreeNode", "parent", "=", "node", ".", "getParent", "(",...
Create the TreePath corresponding to the given TreeNode. @param node the TreeNode; already in the Tree. @return the corresponding TreePath.
[ "Create", "the", "TreePath", "corresponding", "to", "the", "given", "TreeNode", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/thredds/ui/catalog/CatalogTreeView.java#L242-L253
test
Create a tree path from a node.
Of course, here is the Java code you requested: ```java TreePath makeTreePath(TreeNode node) { ArrayList<TreeNode> path = new ArrayList<>(); path.add( node); TreeNode parent = node.getParent(); while (parent != null) { path.add(0, parent); parent = parent.getParent(); } Object[] pa...
oblac/jodd
jodd-core/src/main/java/jodd/util/StringUtil.java
StringUtil.lastIndexOfIgnoreCase
public static int[] lastIndexOfIgnoreCase(final String s, final String... arr) { return lastIndexOfIgnoreCase(s, arr, s.length()); }
java
public static int[] lastIndexOfIgnoreCase(final String s, final String... arr) { return lastIndexOfIgnoreCase(s, arr, s.length()); }
[ "public", "static", "int", "[", "]", "lastIndexOfIgnoreCase", "(", "final", "String", "s", ",", "final", "String", "...", "arr", ")", "{", "return", "lastIndexOfIgnoreCase", "(", "s", ",", "arr", ",", "s", ".", "length", "(", ")", ")", ";", "}" ]
Finds the very last index of a substring from the specified array. It returns an int[2] where int[0] represents the substring index and int[1] represents position where substring was found. Returns <code>null</code> if noting found. @param s source string @param arr string array @return int[2]
[ "Finds", "the", "very", "last", "index", "of", "a", "substring", "from", "the", "specified", "array", ".", "It", "returns", "an", "int", "[", "2", "]", "where", "int", "[", "0", "]", "represents", "the", "substring", "index", "and", "int", "[", "1", ...
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/StringUtil.java#L1540-L1542
test
Returns the last index of s in the array ignoring case.
Of course, here is the Java code you requested: ```java public static int[] lastIndexOfIgnoreCase(final String s, final String... arr) { return lastIndexOfIgnoreCase(s, arr, s.length()); } ``` Hope this helps!
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormContainerClient.java
FormContainerClient.unLockFormContainer
public Form unLockFormContainer( Form formParam, boolean unlockAsyncParam) { return this.unLockFormContainer( formParam, null, unlockAsyncParam, false); }
java
public Form unLockFormContainer( Form formParam, boolean unlockAsyncParam) { return this.unLockFormContainer( formParam, null, unlockAsyncParam, false); }
[ "public", "Form", "unLockFormContainer", "(", "Form", "formParam", ",", "boolean", "unlockAsyncParam", ")", "{", "return", "this", ".", "unLockFormContainer", "(", "formParam", ",", "null", ",", "unlockAsyncParam", ",", "false", ")", ";", "}" ]
Unlock the provided form container from the logged in user. Item will not be removed from users Personal Inventory. @param formParam The form to unlock. @param unlockAsyncParam Should the unlock be performed asynchronous. @return The un-locked form.
[ "Unlock", "the", "provided", "form", "container", "from", "the", "logged", "in", "user", ".", "Item", "will", "not", "be", "removed", "from", "users", "Personal", "Inventory", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormContainerClient.java#L356-L361
test
Unlock a form container.
Of course, here is the Java code you requested: ```java public Form unLockFormContainer( Form formParam, boolean unlockAsyncParam) { return this.unLockFormContainer( formParam, null, unlockAsyncParam, false); } ``` Hope this helps!
google/openrtb
openrtb-core/src/main/java/com/google/openrtb/json/OpenRtbNativeJsonWriter.java
OpenRtbNativeJsonWriter.writeNativeResponse
public String writeNativeResponse(NativeResponse resp) throws IOException { try (StringWriter writer = new StringWriter()) { writeNativeResponse(resp, writer); return writer.toString(); } }
java
public String writeNativeResponse(NativeResponse resp) throws IOException { try (StringWriter writer = new StringWriter()) { writeNativeResponse(resp, writer); return writer.toString(); } }
[ "public", "String", "writeNativeResponse", "(", "NativeResponse", "resp", ")", "throws", "IOException", "{", "try", "(", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ")", "{", "writeNativeResponse", "(", "resp", ",", "writer", ")", ";", "ret...
Serializes a {@link NativeResponse} to JSON, returned as a {@link String}.
[ "Serializes", "a", "{" ]
384ed8dde6bd16ac2faab9afbe5b33367836fdec
https://github.com/google/openrtb/blob/384ed8dde6bd16ac2faab9afbe5b33367836fdec/openrtb-core/src/main/java/com/google/openrtb/json/OpenRtbNativeJsonWriter.java#L257-L262
test
Write a native response to a String
Of course, here is the Java code you requested: ```java public String writeNativeResponse(NativeResponse resp) throws IOException { try (StringWriter writer = new StringWriter()) { writeNativeResponse(resp, writer); return writer.toString(); } } ``` Hope this helps!
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java
FeatureIndexManager.setProgress
public void setProgress(GeoPackageProgress progress) { featureTableIndex.setProgress(progress); featureIndexer.setProgress(progress); rTreeIndexTableDao.setProgress(progress); }
java
public void setProgress(GeoPackageProgress progress) { featureTableIndex.setProgress(progress); featureIndexer.setProgress(progress); rTreeIndexTableDao.setProgress(progress); }
[ "public", "void", "setProgress", "(", "GeoPackageProgress", "progress", ")", "{", "featureTableIndex", ".", "setProgress", "(", "progress", ")", ";", "featureIndexer", ".", "setProgress", "(", "progress", ")", ";", "rTreeIndexTableDao", ".", "setProgress", "(", "p...
Set the GeoPackage Progress @param progress GeoPackage progress
[ "Set", "the", "GeoPackage", "Progress" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/features/index/FeatureIndexManager.java#L254-L258
test
Set the progress for this package
Of course, here is the Java code you requested: ```java public void setProgress(GeoPackageProgress progress) { featureTableIndex.setProgress(progress); featureIndexer.setProgress(progress); rTreeIndexTableDao.setProgress(progress); } ``` Hope this helps!
blademainer/common_utils
spring-email/src/main/java/com/xiongyingqi/email/service/impl/EmailService.java
EmailService.handlerAttachments
private void handlerAttachments(EmailVo emailVo, MimeMessageHelper msgHelper) throws MessagingException { if (emailVo.getAttachmentVos() != null) {// 检查附件 for (AttachmentVo attachmentVo : emailVo.getAttachmentVos()) { File attachment = attachmentVo.getAttachment(); ...
java
private void handlerAttachments(EmailVo emailVo, MimeMessageHelper msgHelper) throws MessagingException { if (emailVo.getAttachmentVos() != null) {// 检查附件 for (AttachmentVo attachmentVo : emailVo.getAttachmentVos()) { File attachment = attachmentVo.getAttachment(); ...
[ "private", "void", "handlerAttachments", "(", "EmailVo", "emailVo", ",", "MimeMessageHelper", "msgHelper", ")", "throws", "MessagingException", "{", "if", "(", "emailVo", ".", "getAttachmentVos", "(", ")", "!=", "null", ")", "{", "// 检查附件", "for", "(", "Attachme...
处理附件 @param emailVo @param msgHelper @throws javax.mail.MessagingException
[ "处理附件" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/spring-email/src/main/java/com/xiongyingqi/email/service/impl/EmailService.java#L290-L317
test
handlerAttachments - add attachments to message helper
Of course, here is the Java code you requested: ```java private void handlerAttachments(EmailVo emailVo, MimeMessageHelper msgHelper) throws MessagingException { if (emailVo.getAttachmentVos() != null) {// 检查附件 for (AttachmentVo attachmentVo : emailVo.getAttachmentVos()) { File atta...
boonproject/boon
slumberdb/slumberdb-service-model/src/main/java/org/boon/slumberdb/stores/log/BatchFileWriter.java
BatchFileWriter.cleanupOutputStream
private void cleanupOutputStream() { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { e.printStackTrace(System.err); } finally { outputStream = null; } } }
java
private void cleanupOutputStream() { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { e.printStackTrace(System.err); } finally { outputStream = null; } } }
[ "private", "void", "cleanupOutputStream", "(", ")", "{", "if", "(", "outputStream", "!=", "null", ")", "{", "try", "{", "outputStream", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", "Sys...
Attempts to close down log stream.
[ "Attempts", "to", "close", "down", "log", "stream", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/slumberdb/slumberdb-service-model/src/main/java/org/boon/slumberdb/stores/log/BatchFileWriter.java#L138-L151
test
Cleanup the output stream.
Of course, here is the Java code you requested: ```java private void cleanupOutputStream() { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { e.printStackTrace(System.err); } finally { outputS...
oblac/jodd
jodd-db/src/main/java/jodd/db/type/CharacterSqlType.java
CharacterSqlType.set
@Override public void set(final PreparedStatement st, final int index, final Character value, final int dbSqlType) throws SQLException { if (TypesUtil.isIntegerType(dbSqlType)) { st.setInt(index, value.charValue()); return; } st.setString(index, value.toString()); }
java
@Override public void set(final PreparedStatement st, final int index, final Character value, final int dbSqlType) throws SQLException { if (TypesUtil.isIntegerType(dbSqlType)) { st.setInt(index, value.charValue()); return; } st.setString(index, value.toString()); }
[ "@", "Override", "public", "void", "set", "(", "final", "PreparedStatement", "st", ",", "final", "int", "index", ",", "final", "Character", "value", ",", "final", "int", "dbSqlType", ")", "throws", "SQLException", "{", "if", "(", "TypesUtil", ".", "isInteger...
{@inheritDoc}
[ "{" ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/type/CharacterSqlType.java#L60-L67
test
Sets the value of an SQL Character object in the PreparedStatement.
Of course, here is the Java code you requested: ```java @Override public void set(final PreparedStatement st, final int index, final Character value, final int dbSqlType) throws SQLException { if (TypesUtil.isIntegerType(dbSqlType)) { st.setInt(index, value.charValue()); return; } st.setString(index, valu...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java
SameDiff.conv1d
public SDVariable conv1d(String name, SDVariable[] inputs, Conv1DConfig conv1DConfig) { SDVariable ret = f().conv1d(inputs, conv1DConfig); return updateVariableNameAndReference(ret, name); }
java
public SDVariable conv1d(String name, SDVariable[] inputs, Conv1DConfig conv1DConfig) { SDVariable ret = f().conv1d(inputs, conv1DConfig); return updateVariableNameAndReference(ret, name); }
[ "public", "SDVariable", "conv1d", "(", "String", "name", ",", "SDVariable", "[", "]", "inputs", ",", "Conv1DConfig", "conv1DConfig", ")", "{", "SDVariable", "ret", "=", "f", "(", ")", ".", "conv1d", "(", "inputs", ",", "conv1DConfig", ")", ";", "return", ...
Conv1d operation. @param name name of the operation in SameDiff @param inputs the inputs to conv1d @param conv1DConfig the configuration @return
[ "Conv1d", "operation", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L1788-L1791
test
Conv1d operation.
Of course, here is the Java code you requested: ```java public SDVariable conv1d(String name, SDVariable[] inputs, Conv1DConfig conv1DConfig) { SDVariable ret = f().conv1d(inputs, conv1DConfig); return updateVariableNameAndReference(ret, name); } ``` Hope this helps!
agentsoz/jill
jill/src/main/java/io/github/agentsoz/jill/core/beliefbase/BeliefBase.java
BeliefBase.main
public static void main(String[] args) throws BeliefBaseException { // Configure logging Log.createLogger("", Level.INFO, "BeliefBase.log"); // BeliefBase bb = new H2BeliefBase("jdbc:h2:mem:agents;CACHE_SIZE=1048576"); String bs1 = "neighbour"; String bs2 = "hascar"; long t0; long t1; ...
java
public static void main(String[] args) throws BeliefBaseException { // Configure logging Log.createLogger("", Level.INFO, "BeliefBase.log"); // BeliefBase bb = new H2BeliefBase("jdbc:h2:mem:agents;CACHE_SIZE=1048576"); String bs1 = "neighbour"; String bs2 = "hascar"; long t0; long t1; ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "BeliefBaseException", "{", "// Configure logging", "Log", ".", "createLogger", "(", "\"\"", ",", "Level", ".", "INFO", ",", "\"BeliefBase.log\"", ")", ";", "// BeliefBase bb = n...
Sample program to test belief base evaluation speeds. @param args command line arguments @throws BeliefBaseException on belief base update or evaluation errors
[ "Sample", "program", "to", "test", "belief", "base", "evaluation", "speeds", "." ]
13126fc78350465b477386132465f84cad719426
https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/core/beliefbase/BeliefBase.java#L89-L170
test
Main method for the BeliefBase class.
Of course, here is the Java code you requested: ```java public static void main(String[] args) throws BeliefBaseException { // Configure logging Log.createLogger("", Level.INFO, "BeliefBase.log"); // BeliefBase bb = new H2BeliefBase("jdbc:h2:mem:agents;CACHE_SIZE=1048576"); String bs1 = "neighbour"; ...
patrickfav/slf4j-timber
slf4j-timber/src/main/java/org/slf4j/impl/TimberAndroidLoggerAdapter.java
TimberAndroidLoggerAdapter.trace
public void trace(String format, Object... argArray) { formatAndLog(Log.VERBOSE, format, argArray); }
java
public void trace(String format, Object... argArray) { formatAndLog(Log.VERBOSE, format, argArray); }
[ "public", "void", "trace", "(", "String", "format", ",", "Object", "...", "argArray", ")", "{", "formatAndLog", "(", "Log", ".", "VERBOSE", ",", "format", ",", "argArray", ")", ";", "}" ]
Log a message at level VERBOSE according to the specified format and arguments. <p> <p> This form avoids superfluous object creation when the logger is disabled for the VERBOSE level. </p> @param format the format string @param argArray an array of arguments
[ "Log", "a", "message", "at", "level", "VERBOSE", "according", "to", "the", "specified", "format", "and", "arguments", ".", "<p", ">", "<p", ">", "This", "form", "avoids", "superfluous", "object", "creation", "when", "the", "logger", "is", "disabled", "for", ...
bb6be99a0ee7c6d764c58b00e7d46f94d5b86160
https://github.com/patrickfav/slf4j-timber/blob/bb6be99a0ee7c6d764c58b00e7d46f94d5b86160/slf4j-timber/src/main/java/org/slf4j/impl/TimberAndroidLoggerAdapter.java#L152-L154
test
Perform single parameter substitution before logging the message of level TRACE according to the format outlined above.
Of course, here is the Java code you requested: ```java public void trace(String format, Object... argArray) { formatAndLog(Log.VERBOSE, format, argArray); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java
ObjectFactory.createGrundstueckEmpfohleneNutzungBuero
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Buero", scope = GrundstueckEmpfohleneNutzung.class) public JAXBElement<Object> createGrundstueckEmpfohleneNutzungBuero(Object value) { return new JAXBElement<Object>(_GrundstueckEmpfohleneNutzungBuero_QNAME, Object.cla...
java
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Buero", scope = GrundstueckEmpfohleneNutzung.class) public JAXBElement<Object> createGrundstueckEmpfohleneNutzungBuero(Object value) { return new JAXBElement<Object>(_GrundstueckEmpfohleneNutzungBuero_QNAME, Object.cla...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immobilienscout24.de/immobilientransfer\"", ",", "name", "=", "\"Buero\"", ",", "scope", "=", "GrundstueckEmpfohleneNutzung", ".", "class", ")", "public", "JAXBElement", "<", "Object", ">", "createGrundstueckEmpf...
Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Object", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java#L972-L975
test
Create an instance of the JAXBElement class which is a sub - class of GrundstueckEmpfohleneNutzung.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Buero", scope = GrundstueckEmpfohleneNutzung.class) public JAXBElement<Object> createGrundstueckEmpfohleneNutzungBuero(Object value) { return new JAXBElement<Obj...
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/PrintHelper.java
PrintHelper.printC
public void printC(Object object) { StackTraceElement[] stackTraceElements = StackTraceHelper.getStackTrace(); StackTraceElement stackTraceElement = stackTraceElements[2]; // 调用本类的对象类型堆栈 StringBuilder builder = new StringBuilder(); builder.append(" ---------------------------------------...
java
public void printC(Object object) { StackTraceElement[] stackTraceElements = StackTraceHelper.getStackTrace(); StackTraceElement stackTraceElement = stackTraceElements[2]; // 调用本类的对象类型堆栈 StringBuilder builder = new StringBuilder(); builder.append(" ---------------------------------------...
[ "public", "void", "printC", "(", "Object", "object", ")", "{", "StackTraceElement", "[", "]", "stackTraceElements", "=", "StackTraceHelper", ".", "getStackTrace", "(", ")", ";", "StackTraceElement", "stackTraceElement", "=", "stackTraceElements", "[", "2", "]", ";...
打印对象同时加入注释 @param object
[ "打印对象同时加入注释" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/PrintHelper.java#L87-L107
test
Print C.
Of course, here is the Java code you requested: ```java public void printC(Object object) { StackTraceElement[] stackTraceElements = StackTraceHelper.getStackTrace(); StackTraceElement stackTraceElement = stackTraceElements[2]; // 调用本类的对象类型堆栈 StringBuilder builder = new StringBuilder(); ...
orientechnologies/orientdb
distributed-v2/src/main/java/com/orientechnologies/orient/distributed/impl/ONodeManager.java
ONodeManager.serializeMessage
protected byte[] serializeMessage(OBroadcastMessage message) throws Exception { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); message.write(new DataOutputStream(buffer)); return encrypt(buffer.toByteArray()); }
java
protected byte[] serializeMessage(OBroadcastMessage message) throws Exception { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); message.write(new DataOutputStream(buffer)); return encrypt(buffer.toByteArray()); }
[ "protected", "byte", "[", "]", "serializeMessage", "(", "OBroadcastMessage", "message", ")", "throws", "Exception", "{", "ByteArrayOutputStream", "buffer", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "message", ".", "write", "(", "new", "DataOutputStream", ...
/* =============== NETWORK UTILITIES =================
[ "/", "*", "===============", "NETWORK", "UTILITIES", "=================" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/distributed-v2/src/main/java/com/orientechnologies/orient/distributed/impl/ONodeManager.java#L506-L510
test
Serialize an OBroadcastMessage.
Of course, here is the Java code you requested: ```java protected byte[] serializeMessage(OBroadcastMessage message) throws Exception { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); message.write(new DataOutputStream(buffer)); return encrypt(buffer.toByteArray()); } ``` Hope this helps!
jboss/jboss-common-core
src/main/java/org/jboss/util/collection/CachedList.java
CachedList.remove
public Object remove(final int index) { maintain(); Object obj = list.remove(index); return Objects.deref(obj); }
java
public Object remove(final int index) { maintain(); Object obj = list.remove(index); return Objects.deref(obj); }
[ "public", "Object", "remove", "(", "final", "int", "index", ")", "{", "maintain", "(", ")", ";", "Object", "obj", "=", "list", ".", "remove", "(", "index", ")", ";", "return", "Objects", ".", "deref", "(", "obj", ")", ";", "}" ]
Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list. @param index The index of the element to remove. @return The element previously at the specified p...
[ "Removes", "the", "element", "at", "the", "specified", "position", "in", "this", "list", "(", "optional", "operation", ")", ".", "Shifts", "any", "subsequent", "elements", "to", "the", "left", "(", "subtracts", "one", "from", "their", "indices", ")", ".", ...
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/collection/CachedList.java#L135-L140
test
Removes the element at the specified index.
Of course, here is the Java code you requested: ```java public Object remove(final int index) { maintain(); Object obj = list.remove(index); return Objects.deref(obj); } ``` Hope this helps!
GojaFramework/goja
goja-web/src/main/java/goja/mvc/datatables/DTDao.java
DTDao.paginate
public static Page<Record> paginate(String where, String sql_columns, DTCriterias criterias, List<Object> params) { int pageSize = criterias.getLength(); int start = criterias.getStart...
java
public static Page<Record> paginate(String where, String sql_columns, DTCriterias criterias, List<Object> params) { int pageSize = criterias.getLength(); int start = criterias.getStart...
[ "public", "static", "Page", "<", "Record", ">", "paginate", "(", "String", "where", ",", "String", "sql_columns", ",", "DTCriterias", "criterias", ",", "List", "<", "Object", ">", "params", ")", "{", "int", "pageSize", "=", "criterias", ".", "getLength", "...
Paging retrieve, default sorted by id, you need to specify the datatables request parameters. @param where FROM WHERE SQL. @param sql_columns SELECT column sql. @param criterias required parameter @return Paging data.
[ "Paging", "retrieve", "default", "sorted", "by", "id", "you", "need", "to", "specify", "the", "datatables", "request", "parameters", "." ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/mvc/datatables/DTDao.java#L82-L117
test
Paginate a page of records based on the given conditions.
Of course, here is the Java code you requested: ```java public static Page<Record> paginate(String where, String sql_columns, DTCriterias criterias, List<Object> params) { int pageSize = crit...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/views/RepositoryContentProvider.java
RepositoryContentProvider.getParent
public Object getParent(Object child) { if (child instanceof TreeObject) { return ((TreeObject)child).getParent(); } return null; }
java
public Object getParent(Object child) { if (child instanceof TreeObject) { return ((TreeObject)child).getParent(); } return null; }
[ "public", "Object", "getParent", "(", "Object", "child", ")", "{", "if", "(", "child", "instanceof", "TreeObject", ")", "{", "return", "(", "(", "TreeObject", ")", "child", ")", ".", "getParent", "(", ")", ";", "}", "return", "null", ";", "}" ]
/* (non-Javadoc) @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/views/RepositoryContentProvider.java#L77-L82
test
Gets the parent of the given child object.
Of course, here is the Java code you requested: ```java public Object getParent(Object child) { if (child instanceof TreeObject) { return ((TreeObject)child).getParent(); } return null; } ``` Hope this helps!
Azure/azure-documentdb-java
bulkimport/src/main/java/com/microsoft/azure/documentdb/bulkimport/DocumentBulkImporter.java
DocumentBulkImporter.close
@Override public void close() { // disable submission of new tasks listeningExecutorService.shutdown(); try { // wait for existing tasks to terminate if (!listeningExecutorService.awaitTermination(60, TimeUnit.SECONDS)) { // cancel any currently runnin...
java
@Override public void close() { // disable submission of new tasks listeningExecutorService.shutdown(); try { // wait for existing tasks to terminate if (!listeningExecutorService.awaitTermination(60, TimeUnit.SECONDS)) { // cancel any currently runnin...
[ "@", "Override", "public", "void", "close", "(", ")", "{", "// disable submission of new tasks", "listeningExecutorService", ".", "shutdown", "(", ")", ";", "try", "{", "// wait for existing tasks to terminate", "if", "(", "!", "listeningExecutorService", ".", "awaitTer...
Releases any internal resources. It is responsibility of the caller to close {@link DocumentClient}.
[ "Releases", "any", "internal", "resources", ".", "It", "is", "responsibility", "of", "the", "caller", "to", "close", "{" ]
37a612a2f0d0e8e5ac0575f6f6f393af5f00d2ff
https://github.com/Azure/azure-documentdb-java/blob/37a612a2f0d0e8e5ac0575f6f6f393af5f00d2ff/bulkimport/src/main/java/com/microsoft/azure/documentdb/bulkimport/DocumentBulkImporter.java#L307-L325
test
Close the application.
Of course, here is the Java code you requested: ```java @Override public void close() { // disable submission of new tasks listeningExecutorService.shutdown(); try { // wait for existing tasks to terminate if (!listeningExecutorService.awaitTermination(60, TimeUnit.S...
RestComm/jain-slee
api/jar/src/main/java/javax/slee/usage/UsageNotification.java
UsageNotification.readObject
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { vendorData = VendorExtensionUtils.readObject(in, vendorDataDeserializationEnabled); }
java
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { vendorData = VendorExtensionUtils.readObject(in, vendorDataDeserializationEnabled); }
[ "private", "void", "readObject", "(", "ObjectInputStream", "in", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "vendorData", "=", "VendorExtensionUtils", ".", "readObject", "(", "in", ",", "vendorDataDeserializationEnabled", ")", ";", "}" ]
special handling of deserialization
[ "special", "handling", "of", "deserialization" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/api/jar/src/main/java/javax/slee/usage/UsageNotification.java#L400-L402
test
Deserializes the object from an input stream.
Of course, here is the Java code you requested: ```java private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { vendorData = VendorExtensionUtils.readObject(in, vendorDataDeserializationEnabled); } ``` Hope this helps!
play2-maven-plugin/play2-maven-plugin
play2-source-watcher-api/src/main/java/com/google/code/play2/watcher/api/FileWatchServices.java
FileWatchServices.getDefaultWatchServiceId
public static String getDefaultWatchServiceId() { String result = "polling"; String osName = System.getProperty( "os.name" ); if ( osName != null ) { osName = osName.toLowerCase( Locale.ENGLISH ); if ( osName.contains( "windows" ) || osName.contains( "linux" )...
java
public static String getDefaultWatchServiceId() { String result = "polling"; String osName = System.getProperty( "os.name" ); if ( osName != null ) { osName = osName.toLowerCase( Locale.ENGLISH ); if ( osName.contains( "windows" ) || osName.contains( "linux" )...
[ "public", "static", "String", "getDefaultWatchServiceId", "(", ")", "{", "String", "result", "=", "\"polling\"", ";", "String", "osName", "=", "System", ".", "getProperty", "(", "\"os.name\"", ")", ";", "if", "(", "osName", "!=", "null", ")", "{", "osName", ...
Returns default watch service identifier based on operating system. @return watch service id
[ "Returns", "default", "watch", "service", "identifier", "based", "on", "operating", "system", "." ]
34e174b02c4245cfad64abd230f3cbeda9d9b2f4
https://github.com/play2-maven-plugin/play2-maven-plugin/blob/34e174b02c4245cfad64abd230f3cbeda9d9b2f4/play2-source-watcher-api/src/main/java/com/google/code/play2/watcher/api/FileWatchServices.java#L34-L51
test
Get the default watch service ID.
Of course, here is the Java code you requested: ```java public static String getDefaultWatchServiceId() { String result = "polling"; String osName = System.getProperty( "os.name" ); if ( osName != null ) { osName = osName.toLowerCase( Locale.ENGLISH ); if ( o...
streamsets/datacollector
container/src/main/java/com/streamsets/datacollector/usagestats/UsageTimer.java
UsageTimer.roll
public UsageTimer roll() { int multiplier; synchronized (this) { multiplier = getMultiplier(); changeMultiplier(-multiplier); //stopAll; } return new UsageTimer().setName(getName()).changeMultiplier(multiplier); }
java
public UsageTimer roll() { int multiplier; synchronized (this) { multiplier = getMultiplier(); changeMultiplier(-multiplier); //stopAll; } return new UsageTimer().setName(getName()).changeMultiplier(multiplier); }
[ "public", "UsageTimer", "roll", "(", ")", "{", "int", "multiplier", ";", "synchronized", "(", "this", ")", "{", "multiplier", "=", "getMultiplier", "(", ")", ";", "changeMultiplier", "(", "-", "multiplier", ")", ";", "//stopAll;", "}", "return", "new", "Us...
returns fresh UsageTimer just reset to zero accumulated time
[ "returns", "fresh", "UsageTimer", "just", "reset", "to", "zero", "accumulated", "time" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/usagestats/UsageTimer.java#L129-L136
test
Roll the usage timer down to the next multiplier.
Of course, here is the Java code you requested: ```java public UsageTimer roll() { int multiplier; synchronized (this) { multiplier = getMultiplier(); changeMultiplier(-multiplier); //stopAll; } return new UsageTimer().setName(getName()).changeMultiplier(multiplier); } ``` Hope this help...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/servlet/JasperLoader.java
JasperLoader.findClass
public Class findClass(String className) throws ClassNotFoundException { // If the class file is in memory, use it byte[] cdata = this.bytecodes.get(className); String path = className.replace('.', '/') + ".class"; if (cdata == null) { // If the bytecode preprocessor is not...
java
public Class findClass(String className) throws ClassNotFoundException { // If the class file is in memory, use it byte[] cdata = this.bytecodes.get(className); String path = className.replace('.', '/') + ".class"; if (cdata == null) { // If the bytecode preprocessor is not...
[ "public", "Class", "findClass", "(", "String", "className", ")", "throws", "ClassNotFoundException", "{", "// If the class file is in memory, use it", "byte", "[", "]", "cdata", "=", "this", ".", "bytecodes", ".", "get", "(", "className", ")", ";", "String", "path...
START OF IASRI 4709374
[ "START", "OF", "IASRI", "4709374" ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/servlet/JasperLoader.java#L197-L235
test
Find a class by name.
Of course, here is the Java code you requested: ```java public Class findClass(String className) throws ClassNotFoundException { // If the class file is in memory, use it byte[] cdata = this.bytecodes.get(className); String path = className.replace('.', '/') + ".class"; if (cdata == n...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/db/FeatureIndexer.java
FeatureIndexer.count
public long count(BoundingBox boundingBox, Projection projection) { BoundingBox featureBoundingBox = getFeatureBoundingBox(boundingBox, projection); long count = count(featureBoundingBox); return count; }
java
public long count(BoundingBox boundingBox, Projection projection) { BoundingBox featureBoundingBox = getFeatureBoundingBox(boundingBox, projection); long count = count(featureBoundingBox); return count; }
[ "public", "long", "count", "(", "BoundingBox", "boundingBox", ",", "Projection", "projection", ")", "{", "BoundingBox", "featureBoundingBox", "=", "getFeatureBoundingBox", "(", "boundingBox", ",", "projection", ")", ";", "long", "count", "=", "count", "(", "featur...
Query for Geometry Metadata count within the bounding box in the provided projection @param boundingBox bounding box @param projection projection of the provided bounding box @return count @since 1.1.0
[ "Query", "for", "Geometry", "Metadata", "count", "within", "the", "bounding", "box", "in", "the", "provided", "projection" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/FeatureIndexer.java#L502-L510
test
Get the count of a sequence of CRASS terms in the bounding box
Of course, here is the Java code you requested: ```java public long count(BoundingBox boundingBox, Projection projection) { BoundingBox featureBoundingBox = getFeatureBoundingBox(boundingBox, projection); long count = count(featureBoundingBox); return count; } ``` Hope t...
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java
StringUtils.substringAfter
public static String substringAfter(final String s, final String separator) { if (isEmpty(s)) { return s; } if (separator == null) { return ""; } final int pos = s.indexOf(separator); if (pos < 0) { return ""; } return s...
java
public static String substringAfter(final String s, final String separator) { if (isEmpty(s)) { return s; } if (separator == null) { return ""; } final int pos = s.indexOf(separator); if (pos < 0) { return ""; } return s...
[ "public", "static", "String", "substringAfter", "(", "final", "String", "s", ",", "final", "String", "separator", ")", "{", "if", "(", "isEmpty", "(", "s", ")", ")", "{", "return", "s", ";", "}", "if", "(", "separator", "==", "null", ")", "{", "retur...
<p> Gets the substring after the first occurrence of a separator. The separator is not returned. </p> <p> A {@code null} string input will return {@code null}. An empty ("") string input will return the empty string. A {@code null} separator will return the empty string if the input string is not {@code null}. </p> <...
[ "<p", ">", "Gets", "the", "substring", "after", "the", "first", "occurrence", "of", "a", "separator", ".", "The", "separator", "is", "not", "returned", ".", "<", "/", "p", ">" ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java#L1267-L1279
test
Get substring after.
Of course, here is the Java code you requested: ```java public static String substringAfter(final String s, final String separator) { if (isEmpty(s)) { return s; } if (separator == null) { return ""; } final int pos = s.indexOf(separator); if (pos...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.doOnSubscribe
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> doOnSubscribe(Consumer<? super Disposable> onSubscribe) { return doOnLifecycle(onSubscribe, Functions.EMPTY_ACTION); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> doOnSubscribe(Consumer<? super Disposable> onSubscribe) { return doOnLifecycle(onSubscribe, Functions.EMPTY_ACTION); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Observable", "<", "T", ">", "doOnSubscribe", "(", "Consumer", "<", "?", "super", "Disposable", ">", "onSubscribe", ")", "{", "return", "doOnLifecycle...
Modifies the source {@code ObservableSource} so that it invokes the given action when it is subscribed from its subscribers. Each subscription will result in an invocation of the given action except when the source {@code ObservableSource} is reference counted, in which case the source {@code ObservableSource} will inv...
[ "Modifies", "the", "source", "{", "@code", "ObservableSource", "}", "so", "that", "it", "invokes", "the", "given", "action", "when", "it", "is", "subscribed", "from", "its", "subscribers", ".", "Each", "subscription", "will", "result", "in", "an", "invocation"...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L8284-L8288
test
Creates an observable that emits all items of the source to the given consumer.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Observable<T> doOnSubscribe(Consumer<? super Disposable> onSubscribe) { return doOnLifecycle(onSubscribe, Functions.EMPTY_ACTION); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/nexrad2/Level2VolumeScan.java
Level2VolumeScan.uncompress
private RandomAccessFile uncompress(RandomAccessFile inputRaf, String ufilename) throws IOException { RandomAccessFile outputRaf = new RandomAccessFile(ufilename, "rw"); FileLock lock; while (true) { // loop waiting for the lock try { lock = outputRaf.getRandomAccessFile().getChannel().lock(0...
java
private RandomAccessFile uncompress(RandomAccessFile inputRaf, String ufilename) throws IOException { RandomAccessFile outputRaf = new RandomAccessFile(ufilename, "rw"); FileLock lock; while (true) { // loop waiting for the lock try { lock = outputRaf.getRandomAccessFile().getChannel().lock(0...
[ "private", "RandomAccessFile", "uncompress", "(", "RandomAccessFile", "inputRaf", ",", "String", "ufilename", ")", "throws", "IOException", "{", "RandomAccessFile", "outputRaf", "=", "new", "RandomAccessFile", "(", "ufilename", ",", "\"rw\"", ")", ";", "FileLock", "...
Write equivilent uncompressed version of the file. @param inputRaf file to uncompress @param ufilename write to this file @return raf of uncompressed file @throws IOException on read error
[ "Write", "equivilent", "uncompressed", "version", "of", "the", "file", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/nexrad2/Level2VolumeScan.java#L622-L744
test
Uncompress the input file to the output file.
Of course, here is the Java code you requested: ```java private RandomAccessFile uncompress(RandomAccessFile inputRaf, String ufilename) throws IOException { RandomAccessFile outputRaf = new RandomAccessFile(ufilename, "rw"); FileLock lock; while (true) { // loop waiting for the lock try { l...
objectify/objectify
src/main/java/com/googlecode/objectify/repackaged/gentyref/TypeFactory.java
TypeFactory.couldHaveCommonSubtype
private static boolean couldHaveCommonSubtype(Type type1, Type type2) { // this is an optimistically naive implementation. // if they are parameterized types their parameters need to be checked,... // so we're just a bit too lenient here Class<?> erased1 = GenericTypeReflector.erase(type1); Class<?> erased...
java
private static boolean couldHaveCommonSubtype(Type type1, Type type2) { // this is an optimistically naive implementation. // if they are parameterized types their parameters need to be checked,... // so we're just a bit too lenient here Class<?> erased1 = GenericTypeReflector.erase(type1); Class<?> erased...
[ "private", "static", "boolean", "couldHaveCommonSubtype", "(", "Type", "type1", ",", "Type", "type2", ")", "{", "// this is an optimistically naive implementation.", "// if they are parameterized types their parameters need to be checked,...", "// so we're just a bit too lenient here", ...
Checks if the intersection of two types is not empty.
[ "Checks", "if", "the", "intersection", "of", "two", "types", "is", "not", "empty", "." ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/repackaged/gentyref/TypeFactory.java#L176-L191
test
Returns true if two types could have a common subtype of the other type.
Of course, here is the Java code you requested: ```java private static boolean couldHaveCommonSubtype(Type type1, Type type2) { // this is an optimistically naive implementation. // if they are parameterized types their parameters need to be checked,... // so we're just a bit too lenient here Class<?> erase...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java
FeatureStyleExtension.setStyleDefault
public void setStyleDefault(String featureTable, long featureId, StyleRow style) { setStyle(featureTable, featureId, null, style); }
java
public void setStyleDefault(String featureTable, long featureId, StyleRow style) { setStyle(featureTable, featureId, null, style); }
[ "public", "void", "setStyleDefault", "(", "String", "featureTable", ",", "long", "featureId", ",", "StyleRow", "style", ")", "{", "setStyle", "(", "featureTable", ",", "featureId", ",", "null", ",", "style", ")", ";", "}" ]
Set the default style of the feature @param featureTable feature table @param featureId feature id @param style style row
[ "Set", "the", "default", "style", "of", "the", "feature" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/style/FeatureStyleExtension.java#L1171-L1174
test
Set the style default for a feature table and feature id.
Of course, here is the Java code you requested: ```java public void setStyleDefault(String featureTable, long featureId, StyleRow style) { setStyle(featureTable, featureId, null, style); } ``` Hope this helps!
hawkular/hawkular-metrics
job-scheduler/src/main/java/org/hawkular/metrics/scheduler/impl/LockManager.java
LockManager.shutdown
public void shutdown() { try { locksExecutor.shutdown(); locksExecutor.awaitTermination(5, TimeUnit.SECONDS); CountDownLatch latch = new CountDownLatch(1); activeLocksLock.writeLock().lock(); Observable.from(activeLocks.entrySet()) ...
java
public void shutdown() { try { locksExecutor.shutdown(); locksExecutor.awaitTermination(5, TimeUnit.SECONDS); CountDownLatch latch = new CountDownLatch(1); activeLocksLock.writeLock().lock(); Observable.from(activeLocks.entrySet()) ...
[ "public", "void", "shutdown", "(", ")", "{", "try", "{", "locksExecutor", ".", "shutdown", "(", ")", ";", "locksExecutor", ".", "awaitTermination", "(", "5", ",", "TimeUnit", ".", "SECONDS", ")", ";", "CountDownLatch", "latch", "=", "new", "CountDownLatch", ...
Attempt to release any locks on shutdown so that other clients can obtain those locks without having to wait for them to expire.
[ "Attempt", "to", "release", "any", "locks", "on", "shutdown", "so", "that", "other", "clients", "can", "obtain", "those", "locks", "without", "having", "to", "wait", "for", "them", "to", "expire", "." ]
6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c
https://github.com/hawkular/hawkular-metrics/blob/6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c/job-scheduler/src/main/java/org/hawkular/metrics/scheduler/impl/LockManager.java#L104-L132
test
Shutdown the application.
Of course, here is the Java code you requested: ```java public void shutdown() { try { locksExecutor.shutdown(); locksExecutor.awaitTermination(5, TimeUnit.SECONDS); CountDownLatch latch = new CountDownLatch(1); activeLocksLock.writeLock().lock(); Obs...
orientechnologies/orientdb
graphdb/src/main/java/com/orientechnologies/orient/graph/graphml/OGraphSONReader.java
OGraphSONReader.inputGraph
public void inputGraph(final String filename, int bufferSize, final Set<String> edgePropertyKeys, final Set<String> vertexPropertyKeys) throws IOException { final File file = new File(filename); if (!file.exists()) throw new ODatabaseImportException("File '" + filename + "' not found"); inputSi...
java
public void inputGraph(final String filename, int bufferSize, final Set<String> edgePropertyKeys, final Set<String> vertexPropertyKeys) throws IOException { final File file = new File(filename); if (!file.exists()) throw new ODatabaseImportException("File '" + filename + "' not found"); inputSi...
[ "public", "void", "inputGraph", "(", "final", "String", "filename", ",", "int", "bufferSize", ",", "final", "Set", "<", "String", ">", "edgePropertyKeys", ",", "final", "Set", "<", "String", ">", "vertexPropertyKeys", ")", "throws", "IOException", "{", "final"...
Input the JSON stream data into the graph. More control over how data is streamed is provided by this method. @param filename name of a file of JSON data @param bufferSize the amount of elements to hold in memory before committing a transactions (only valid for TransactionalGraphs) @throws IOException thrown when the ...
[ "Input", "the", "JSON", "stream", "data", "into", "the", "graph", ".", "More", "control", "over", "how", "data", "is", "streamed", "is", "provided", "by", "this", "method", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/orientechnologies/orient/graph/graphml/OGraphSONReader.java#L89-L102
test
Input a CRS graph from a file.
Of course, here is the Java code you requested: ```java public void inputGraph(final String filename, int bufferSize, final Set<String> edgePropertyKeys, final Set<String> vertexPropertyKeys) throws IOException { final File file = new File(filename); if (!file.exists()) throw new ODatabaseImportExc...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/mcidas/AreaServiceProvider.java
AreaServiceProvider.reacquire
public void reacquire() throws IOException { try { areaReader.af = new AreaFile(location); } catch (Throwable e) { throw new IOException(e); } }
java
public void reacquire() throws IOException { try { areaReader.af = new AreaFile(location); } catch (Throwable e) { throw new IOException(e); } }
[ "public", "void", "reacquire", "(", ")", "throws", "IOException", "{", "try", "{", "areaReader", ".", "af", "=", "new", "AreaFile", "(", "location", ")", ";", "}", "catch", "(", "Throwable", "e", ")", "{", "throw", "new", "IOException", "(", "e", ")", ...
reacquire any resources like file handles
[ "reacquire", "any", "resources", "like", "file", "handles" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/mcidas/AreaServiceProvider.java#L111-L117
test
Reacquire the area file.
Of course, here is the Java code you requested: ```java public void reacquire() throws IOException { try { areaReader.af = new AreaFile(location); } catch (Throwable e) { throw new IOException(e); } } ``` Hope this helps!
fabric8io/fabric8-maven-plugin
core/src/main/java/io/fabric8/maven/core/util/PluginServiceFactory.java
PluginServiceFactory.createServiceObjects
public <T> List<T> createServiceObjects(String... descriptorPaths) { try { ServiceEntry.initDefaultOrder(); TreeMap<ServiceEntry,T> serviceMap = new TreeMap<ServiceEntry,T>(); for (String descriptor : descriptorPaths) { readServiceDefinitions(serviceMap, descr...
java
public <T> List<T> createServiceObjects(String... descriptorPaths) { try { ServiceEntry.initDefaultOrder(); TreeMap<ServiceEntry,T> serviceMap = new TreeMap<ServiceEntry,T>(); for (String descriptor : descriptorPaths) { readServiceDefinitions(serviceMap, descr...
[ "public", "<", "T", ">", "List", "<", "T", ">", "createServiceObjects", "(", "String", "...", "descriptorPaths", ")", "{", "try", "{", "ServiceEntry", ".", "initDefaultOrder", "(", ")", ";", "TreeMap", "<", "ServiceEntry", ",", "T", ">", "serviceMap", "=",...
Create a list of services ordered according to the ordering given in the service descriptor files. Note, that the descriptor will be looked up in the whole classpath space, which can result in reading in multiple descriptors with a single path. Note, that the reading order for multiple resources with the same name is n...
[ "Create", "a", "list", "of", "services", "ordered", "according", "to", "the", "ordering", "given", "in", "the", "service", "descriptor", "files", ".", "Note", "that", "the", "descriptor", "will", "be", "looked", "up", "in", "the", "whole", "classpath", "spac...
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/util/PluginServiceFactory.java#L75-L90
test
Creates a list of service objects from the given descriptor paths.
Of course, here is the Java code you requested: ```java public <T> List<T> createServiceObjects(String... descriptorPaths) { try { ServiceEntry.initDefaultOrder(); TreeMap<ServiceEntry,T> serviceMap = new TreeMap<ServiceEntry,T>(); for (String descriptor : descriptorPaths) {...
Unidata/thredds
cdm/src/main/java/ucar/unidata/geoloc/projection/Sinusoidal.java
Sinusoidal.getMapEdgeInterceptsAtX
public List<ProjectionPoint> getMapEdgeInterceptsAtX(double x0) { List<ProjectionPoint> mapEdgeIntercepts = new LinkedList<>(); if (projToLatLon(x0, falseNorthing) == INVALID) { // The line {@code x = x0} does not intersect the map. return mapEdgeIntercepts; // Empty list. } ...
java
public List<ProjectionPoint> getMapEdgeInterceptsAtX(double x0) { List<ProjectionPoint> mapEdgeIntercepts = new LinkedList<>(); if (projToLatLon(x0, falseNorthing) == INVALID) { // The line {@code x = x0} does not intersect the map. return mapEdgeIntercepts; // Empty list. } ...
[ "public", "List", "<", "ProjectionPoint", ">", "getMapEdgeInterceptsAtX", "(", "double", "x0", ")", "{", "List", "<", "ProjectionPoint", ">", "mapEdgeIntercepts", "=", "new", "LinkedList", "<>", "(", ")", ";", "if", "(", "projToLatLon", "(", "x0", ",", "fals...
Returns the points at which the line {@code x = x0} intersects the map edge. @param x0 defines a line that may intersect the map edge, in projection coordinates. @return the points at which the line {@code x = x0} intersects the map edge. May be empty.
[ "Returns", "the", "points", "at", "which", "the", "line", "{", "@code", "x", "=", "x0", "}", "intersects", "the", "map", "edge", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/Sinusoidal.java#L355-L372
test
Gets the list of projection points at the given x0.
Of course, here is the Java code you requested: ```java public List<ProjectionPoint> getMapEdgeInterceptsAtX(double x0) { List<ProjectionPoint> mapEdgeIntercepts = new LinkedList<>(); if (projToLatLon(x0, falseNorthing) == INVALID) { // The line {@code x = x0} does not intersect the map. ...
jryans/jless
src/main/java/com/bazaarvoice/jless/parser/Parser.java
Parser.Declaration
Rule Declaration() { return FirstOf( Sequence( FirstOf( Sequence(PropertyName(), push(new PropertyNode(match()))), Sequence(Variable(), push(new VariableDefinitionNode(match())), peek().setVisible(!isParserTr...
java
Rule Declaration() { return FirstOf( Sequence( FirstOf( Sequence(PropertyName(), push(new PropertyNode(match()))), Sequence(Variable(), push(new VariableDefinitionNode(match())), peek().setVisible(!isParserTr...
[ "Rule", "Declaration", "(", ")", "{", "return", "FirstOf", "(", "Sequence", "(", "FirstOf", "(", "Sequence", "(", "PropertyName", "(", ")", ",", "push", "(", "new", "PropertyNode", "(", "match", "(", ")", ")", ")", ")", ",", "Sequence", "(", "Variable"...
(Ident / Variable) Ws0 ':' Ws0 ExpressionPhrase (Ws0 ',' Ws0 ExpressionPhrase)* Sp0 (';' / Ws0 &'}') / Ident Ws0 ':' Ws0 ';' Ex: @my-var: 12px; height: 100%;
[ "(", "Ident", "/", "Variable", ")", "Ws0", ":", "Ws0", "ExpressionPhrase", "(", "Ws0", "Ws0", "ExpressionPhrase", ")", "*", "Sp0", "(", ";", "/", "Ws0", "&", "}", ")", "/", "Ident", "Ws0", ":", "Ws0", ";" ]
0e448fac752b4fc7bfef6b220ed1c64a490c29c0
https://github.com/jryans/jless/blob/0e448fac752b4fc7bfef6b220ed1c64a490c29c0/src/main/java/com/bazaarvoice/jless/parser/Parser.java#L410-L434
test
Declaration of a CTC - related rule.
Of course, here is the Java code you requested: ```java Rule Declaration() { return FirstOf( Sequence( FirstOf( Sequence(PropertyName(), push(new PropertyNode(match()))), Sequence(Variable(), push(new Variab...
oblac/jodd
jodd-lagarto/src/main/java/jodd/lagarto/dom/HtmlImplicitClosingRules.java
HtmlImplicitClosingRules.implicitlyCloseParentTagOnNewTag
public boolean implicitlyCloseParentTagOnNewTag(String parentNodeName, String nodeName) { if (parentNodeName == null) { return false; } parentNodeName = parentNodeName.toLowerCase(); nodeName = nodeName.toLowerCase(); for (int i = 0; i < IMPLIED_ON_START.length; i+=2) { if (StringUtil.equalsOne(parentN...
java
public boolean implicitlyCloseParentTagOnNewTag(String parentNodeName, String nodeName) { if (parentNodeName == null) { return false; } parentNodeName = parentNodeName.toLowerCase(); nodeName = nodeName.toLowerCase(); for (int i = 0; i < IMPLIED_ON_START.length; i+=2) { if (StringUtil.equalsOne(parentN...
[ "public", "boolean", "implicitlyCloseParentTagOnNewTag", "(", "String", "parentNodeName", ",", "String", "nodeName", ")", "{", "if", "(", "parentNodeName", "==", "null", ")", "{", "return", "false", ";", "}", "parentNodeName", "=", "parentNodeName", ".", "toLowerC...
Returns <code>true</code> if parent node tag can be closed implicitly.
[ "Returns", "<code", ">", "true<", "/", "code", ">", "if", "parent", "node", "tag", "can", "be", "closed", "implicitly", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/HtmlImplicitClosingRules.java#L91-L107
test
Returns true if the parent node name and nodeName are implicitly closed on a new tag.
Of course, here is the Java code you requested: ```java public boolean implicitlyCloseParentTagOnNewTag(String parentNodeName, String nodeName) { if (parentNodeName == null) { return false; } parentNodeName = parentNodeName.toLowerCase(); nodeName = nodeName.toLowerCase(); for (int i = 0; i < IMPLIED_ON_...
ieb/sparsemapcontent
app/src/main/java/org/sakaiproject/nakamura/app/LaunchNakamura.java
LaunchNakamura.getLabelText
protected String getLabelText(String path) throws IOException { InputStream is = this.getClass().getResourceAsStream(path); if (is != null) { Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")...
java
protected String getLabelText(String path) throws IOException { InputStream is = this.getClass().getResourceAsStream(path); if (is != null) { Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")...
[ "protected", "String", "getLabelText", "(", "String", "path", ")", "throws", "IOException", "{", "InputStream", "is", "=", "this", ".", "getClass", "(", ")", ".", "getResourceAsStream", "(", "path", ")", ";", "if", "(", "is", "!=", "null", ")", "{", "Wri...
Returns the full contents of a (assumed) text file for use in a label. @param path The path to the text file. @return The contents of the file as a String. @throws IOException thrown if the file is unable to be read.
[ "Returns", "the", "full", "contents", "of", "a", "(", "assumed", ")", "text", "file", "for", "use", "in", "a", "label", "." ]
0570fdf868adbbf7734790cbc09fe66480e5f2dc
https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/app/src/main/java/org/sakaiproject/nakamura/app/LaunchNakamura.java#L345-L365
test
Get the label text from the file specified by the path.
Of course, here is the Java code you requested: ```java protected String getLabelText(String path) throws IOException { InputStream is = this.getClass().getResourceAsStream(path); if (is != null) { Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reade...
real-logic/aeron
aeron-samples/src/main/java/io/aeron/samples/SamplesUtil.java
SamplesUtil.rateReporterHandler
public static FragmentHandler rateReporterHandler(final RateReporter reporter) { return (buffer, offset, length, header) -> reporter.onMessage(1, length); }
java
public static FragmentHandler rateReporterHandler(final RateReporter reporter) { return (buffer, offset, length, header) -> reporter.onMessage(1, length); }
[ "public", "static", "FragmentHandler", "rateReporterHandler", "(", "final", "RateReporter", "reporter", ")", "{", "return", "(", "buffer", ",", "offset", ",", "length", ",", "header", ")", "->", "reporter", ".", "onMessage", "(", "1", ",", "length", ")", ";"...
Return a reusable, parametrised {@link FragmentHandler} that calls into a {@link RateReporter}. @param reporter for the rate @return {@link FragmentHandler} that records the rate information
[ "Return", "a", "reusable", "parametrised", "{", "@link", "FragmentHandler", "}", "that", "calls", "into", "a", "{", "@link", "RateReporter", "}", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-samples/src/main/java/io/aeron/samples/SamplesUtil.java#L120-L123
test
Create a FragmentHandler that will report a single message in a SECTYPE.
Of course, here is the Java code you requested: ```java public static FragmentHandler rateReporterHandler(final RateReporter reporter) { return (buffer, offset, length, header) -> reporter.onMessage(1, length); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/internal/util/BackpressureHelper.java
BackpressureHelper.multiplyCap
public static long multiplyCap(long a, long b) { long u = a * b; if (((a | b) >>> 31) != 0) { if (u / a != b) { return Long.MAX_VALUE; } } return u; }
java
public static long multiplyCap(long a, long b) { long u = a * b; if (((a | b) >>> 31) != 0) { if (u / a != b) { return Long.MAX_VALUE; } } return u; }
[ "public", "static", "long", "multiplyCap", "(", "long", "a", ",", "long", "b", ")", "{", "long", "u", "=", "a", "*", "b", ";", "if", "(", "(", "(", "a", "|", "b", ")", ">>>", "31", ")", "!=", "0", ")", "{", "if", "(", "u", "/", "a", "!=",...
Multiplies two long values and caps the product at Long.MAX_VALUE. @param a the first value @param b the second value @return the product capped at Long.MAX_VALUE
[ "Multiplies", "two", "long", "values", "and", "caps", "the", "product", "at", "Long", ".", "MAX_VALUE", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/util/BackpressureHelper.java#L48-L56
test
Multiplies two counts.
Of course, here is the Java code you requested: ```java public static long multiplyCap(long a, long b) { long u = a * b; if (((a | b) >>> 31) != 0) { if (u / a != b) { return Long.MAX_VALUE; } } return u; } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/plugins/RxJavaPlugins.java
RxJavaPlugins.initIoScheduler
@NonNull public static Scheduler initIoScheduler(@NonNull Callable<Scheduler> defaultScheduler) { ObjectHelper.requireNonNull(defaultScheduler, "Scheduler Callable can't be null"); Function<? super Callable<Scheduler>, ? extends Scheduler> f = onInitIoHandler; if (f == null) { re...
java
@NonNull public static Scheduler initIoScheduler(@NonNull Callable<Scheduler> defaultScheduler) { ObjectHelper.requireNonNull(defaultScheduler, "Scheduler Callable can't be null"); Function<? super Callable<Scheduler>, ? extends Scheduler> f = onInitIoHandler; if (f == null) { re...
[ "@", "NonNull", "public", "static", "Scheduler", "initIoScheduler", "(", "@", "NonNull", "Callable", "<", "Scheduler", ">", "defaultScheduler", ")", "{", "ObjectHelper", ".", "requireNonNull", "(", "defaultScheduler", ",", "\"Scheduler Callable can't be null\"", ")", ...
Calls the associated hook function. @param defaultScheduler a {@link Callable} which returns the hook's input value @return the value returned by the hook, not null @throws NullPointerException if the callable parameter or its result are null
[ "Calls", "the", "associated", "hook", "function", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L283-L291
test
Initializes an IO Scheduler.
Of course, here is the Java code you requested: ```java @NonNull public static Scheduler initIoScheduler(@NonNull Callable<Scheduler> defaultScheduler) { ObjectHelper.requireNonNull(defaultScheduler, "Scheduler Callable can't be null"); Function<? super Callable<Scheduler>, ? extends Scheduler> f =...
RestComm/jain-slee
tools/statistics/ra/src/main/java/org/restcomm/slee/resource/statistics/StatisticsResourceAdaptor.java
StatisticsResourceAdaptor.setResourceAdaptorContext
public void setResourceAdaptorContext(ResourceAdaptorContext raContext) { this.raContext = raContext; this.tracer = raContext.getTracer(StatisticsResourceAdaptor.class.getSimpleName()); this.sleeContainer = SleeContainer.lookupFromJndi(); if (this.sleeContainer != null) { this.resourceManagement = sle...
java
public void setResourceAdaptorContext(ResourceAdaptorContext raContext) { this.raContext = raContext; this.tracer = raContext.getTracer(StatisticsResourceAdaptor.class.getSimpleName()); this.sleeContainer = SleeContainer.lookupFromJndi(); if (this.sleeContainer != null) { this.resourceManagement = sle...
[ "public", "void", "setResourceAdaptorContext", "(", "ResourceAdaptorContext", "raContext", ")", "{", "this", ".", "raContext", "=", "raContext", ";", "this", ".", "tracer", "=", "raContext", ".", "getTracer", "(", "StatisticsResourceAdaptor", ".", "class", ".", "g...
lifecycle methods
[ "lifecycle", "methods" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/tools/statistics/ra/src/main/java/org/restcomm/slee/resource/statistics/StatisticsResourceAdaptor.java#L83-L91
test
Sets the ResourceAdaptorContext instance.
Of course, here is the Java code you requested: ```java public void setResourceAdaptorContext(ResourceAdaptorContext raContext) { this.raContext = raContext; this.tracer = raContext.getTracer(StatisticsResourceAdaptor.class.getSimpleName()); this.sleeContainer = SleeContainer.lookupFromJndi(); if (this.s...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java
BaseComplexNDArray.distance1
@Override public double distance1(INDArray other) { float d = 0.0f; if (other instanceof IComplexNDArray) { IComplexNDArray n2 = (IComplexNDArray) other; IComplexNDArray n2Linear = n2.linearView(); for (int i = 0; i < length(); i++) { IComplexNumbe...
java
@Override public double distance1(INDArray other) { float d = 0.0f; if (other instanceof IComplexNDArray) { IComplexNDArray n2 = (IComplexNDArray) other; IComplexNDArray n2Linear = n2.linearView(); for (int i = 0; i < length(); i++) { IComplexNumbe...
[ "@", "Override", "public", "double", "distance1", "(", "INDArray", "other", ")", "{", "float", "d", "=", "0.0f", ";", "if", "(", "other", "instanceof", "IComplexNDArray", ")", "{", "IComplexNDArray", "n2", "=", "(", "IComplexNDArray", ")", "other", ";", "I...
Returns the (1-norm) distance.
[ "Returns", "the", "(", "1", "-", "norm", ")", "distance", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/complex/BaseComplexNDArray.java#L1124-L1144
test
Compute the distance between two arrays of complex numbers
Of course, here is the Java code you requested: ```java @Override public double distance1(INDArray other) { float d = 0.0f; if (other instanceof IComplexNDArray) { IComplexNDArray n2 = (IComplexNDArray) other; IComplexNDArray n2Linear = n2.linearView(); for (int ...
fabric8io/fabric8-maven-plugin
plugin/src/main/java/io/fabric8/maven/plugin/enricher/EnricherManager.java
EnricherManager.enrich
private void enrich(PlatformMode platformMode, final ProcessorConfig enricherConfig, final KubernetesListBuilder builder, final List<Enricher> enricherList) { loop(enricherConfig, enricher -> { enricher.enrich(platformMode, builder); return null; }); }
java
private void enrich(PlatformMode platformMode, final ProcessorConfig enricherConfig, final KubernetesListBuilder builder, final List<Enricher> enricherList) { loop(enricherConfig, enricher -> { enricher.enrich(platformMode, builder); return null; }); }
[ "private", "void", "enrich", "(", "PlatformMode", "platformMode", ",", "final", "ProcessorConfig", "enricherConfig", ",", "final", "KubernetesListBuilder", "builder", ",", "final", "List", "<", "Enricher", ">", "enricherList", ")", "{", "loop", "(", "enricherConfig"...
Allow enricher to add Metadata to the resources. @param builder builder to customize @param enricherList list of enrichers
[ "Allow", "enricher", "to", "add", "Metadata", "to", "the", "resources", "." ]
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/plugin/src/main/java/io/fabric8/maven/plugin/enricher/EnricherManager.java#L92-L97
test
Enrich the resources.
Of course, here is the Java code you requested: ```java private void enrich(PlatformMode platformMode, final ProcessorConfig enricherConfig, final KubernetesListBuilder builder, final List<Enricher> enricherList) { loop(enricherConfig, enricher -> { enricher.enrich(platformMode, builder); ...
ieb/sparsemapcontent
core/src/main/java/org/sakaiproject/nakamura/api/lite/accesscontrol/AclModification.java
AclModification.filterAcl
public static void filterAcl(Map<String, Object> acl, boolean grant, Permission permission, boolean set, List<AclModification> modifications) { int perm = permission.getPermission(); Operation op = Operation.OP_OR; if (!set) { perm = 0xffff ^ perm; op = Operat...
java
public static void filterAcl(Map<String, Object> acl, boolean grant, Permission permission, boolean set, List<AclModification> modifications) { int perm = permission.getPermission(); Operation op = Operation.OP_OR; if (!set) { perm = 0xffff ^ perm; op = Operat...
[ "public", "static", "void", "filterAcl", "(", "Map", "<", "String", ",", "Object", ">", "acl", ",", "boolean", "grant", ",", "Permission", "permission", ",", "boolean", "set", ",", "List", "<", "AclModification", ">", "modifications", ")", "{", "int", "per...
TODO: Unit test
[ "TODO", ":", "Unit", "test" ]
0570fdf868adbbf7734790cbc09fe66480e5f2dc
https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/core/src/main/java/org/sakaiproject/nakamura/api/lite/accesscontrol/AclModification.java#L165-L180
test
Filter the acl.
Of course, here is the Java code you requested: ```java public static void filterAcl(Map<String, Object> acl, boolean grant, Permission permission, boolean set, List<AclModification> modifications) { int perm = permission.getPermission(); Operation op = Operation.OP_OR; if (!set) { ...
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMResolvingJavaMachine.java
WAMResolvingJavaMachine.printSlot
private String printSlot(int xi, int mode) { return ((mode == STACK_ADDR) ? "Y" : "X") + ((mode == STACK_ADDR) ? (xi - ep - 3) : xi); }
java
private String printSlot(int xi, int mode) { return ((mode == STACK_ADDR) ? "Y" : "X") + ((mode == STACK_ADDR) ? (xi - ep - 3) : xi); }
[ "private", "String", "printSlot", "(", "int", "xi", ",", "int", "mode", ")", "{", "return", "(", "(", "mode", "==", "STACK_ADDR", ")", "?", "\"Y\"", ":", "\"X\"", ")", "+", "(", "(", "mode", "==", "STACK_ADDR", ")", "?", "(", "xi", "-", "ep", "-"...
Pretty prints a variable allocation slot for tracing purposes. @param xi The allocation slot to print. @param mode The addressing mode, stack or register. @return The pretty printed slot.
[ "Pretty", "prints", "a", "variable", "allocation", "slot", "for", "tracing", "purposes", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMResolvingJavaMachine.java#L2395-L2398
test
Print the slot of a segment.
Of course, here is the Java code you requested: ```java private String printSlot(int xi, int mode) { return ((mode == STACK_ADDR) ? "Y" : "X") + ((mode == STACK_ADDR) ? (xi - ep - 3) : xi); } ``` Hope this helps!
oblac/jodd
jodd-madvoc/src/main/java/jodd/madvoc/component/WrapperManager.java
WrapperManager.getAll
protected Set<T> getAll() { final Set<T> set = new HashSet<>(wrappers.size()); set.addAll(wrappers.values()); return set; }
java
protected Set<T> getAll() { final Set<T> set = new HashSet<>(wrappers.size()); set.addAll(wrappers.values()); return set; }
[ "protected", "Set", "<", "T", ">", "getAll", "(", ")", "{", "final", "Set", "<", "T", ">", "set", "=", "new", "HashSet", "<>", "(", "wrappers", ".", "size", "(", ")", ")", ";", "set", ".", "addAll", "(", "wrappers", ".", "values", "(", ")", ")"...
Returns all action wrappers. Returns a copy in new set.
[ "Returns", "all", "action", "wrappers", ".", "Returns", "a", "copy", "in", "new", "set", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/WrapperManager.java#L61-L65
test
Returns all the objects in this collection.
Of course, here is the Java code you requested: ```java protected Set<T> getAll() { final Set<T> set = new HashSet<>(wrappers.size()); set.addAll(wrappers.values()); return set; } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/io/PathUtil.java
PathUtil.resolve
public static Path resolve(final Path base, String child) { if (StringUtil.startsWithChar(child, File.separatorChar)) { child = child.substring(1); } return base.resolve(child); }
java
public static Path resolve(final Path base, String child) { if (StringUtil.startsWithChar(child, File.separatorChar)) { child = child.substring(1); } return base.resolve(child); }
[ "public", "static", "Path", "resolve", "(", "final", "Path", "base", ",", "String", "child", ")", "{", "if", "(", "StringUtil", ".", "startsWithChar", "(", "child", ",", "File", ".", "separatorChar", ")", ")", "{", "child", "=", "child", ".", "substring"...
Resolves subpath in safer way. For some reason, if child starts with a separator it gets resolved as a full path, ignoring the base. This method acts different.
[ "Resolves", "subpath", "in", "safer", "way", ".", "For", "some", "reason", "if", "child", "starts", "with", "a", "separator", "it", "gets", "resolved", "as", "a", "full", "path", "ignoring", "the", "base", ".", "This", "method", "acts", "different", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/PathUtil.java#L48-L53
test
Resolves a path to a base path.
Of course, here is the Java code you requested: ```java public static Path resolve(final Path base, String child) { if (StringUtil.startsWithChar(child, File.separatorChar)) { child = child.substring(1); } return base.resolve(child); } ``` Hope this helps!
dschulten/hydra-java
spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/SpringActionInputParameter.java
SpringActionInputParameter.getValues
public Object[] getValues() { Object[] callValues; if (!isArrayOrCollection()) { throw new UnsupportedOperationException("parameter is not an array or collection"); } Object callValue = getValue(); if (callValue == null) { callValues = new Object[0]; ...
java
public Object[] getValues() { Object[] callValues; if (!isArrayOrCollection()) { throw new UnsupportedOperationException("parameter is not an array or collection"); } Object callValue = getValue(); if (callValue == null) { callValues = new Object[0]; ...
[ "public", "Object", "[", "]", "getValues", "(", ")", "{", "Object", "[", "]", "callValues", ";", "if", "(", "!", "isArrayOrCollection", "(", ")", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"parameter is not an array or collection\"", ")", ...
Allows convenient access to multiple call values in case that this input parameter is an array or collection. Make sure to check {@link #isArrayOrCollection()} before calling this method. @return call values or empty array @throws UnsupportedOperationException if this input parameter is not an array or collection
[ "Allows", "convenient", "access", "to", "multiple", "call", "values", "in", "case", "that", "this", "input", "parameter", "is", "an", "array", "or", "collection", ".", "Make", "sure", "to", "check", "{", "@link", "#isArrayOrCollection", "()", "}", "before", ...
21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a
https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/spring-hateoas-ext/src/main/java/de/escalon/hypermedia/spring/SpringActionInputParameter.java#L396-L413
test
Gets the value of the attribute.
Of course, here is the Java code you requested: ```java public Object[] getValues() { Object[] callValues; if (!isArrayOrCollection()) { throw new UnsupportedOperationException("parameter is not an array or collection"); } Object callValue = getValue(); if (callValue...
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/reflect/TypeResolverUtils.java
TypeResolverUtils.getComponentType
public static Class<?> getComponentType(Type type, Class<?> implClass, int index) { if (type instanceof Class) { Class<?> clazz = (Class<?>) type; if (clazz.isArray()) { return clazz.getComponentType(); } } else if (type instanceof ParameterizedType) {...
java
public static Class<?> getComponentType(Type type, Class<?> implClass, int index) { if (type instanceof Class) { Class<?> clazz = (Class<?>) type; if (clazz.isArray()) { return clazz.getComponentType(); } } else if (type instanceof ParameterizedType) {...
[ "public", "static", "Class", "<", "?", ">", "getComponentType", "(", "Type", "type", ",", "Class", "<", "?", ">", "implClass", ",", "int", "index", ")", "{", "if", "(", "type", "instanceof", "Class", ")", "{", "Class", "<", "?", ">", "clazz", "=", ...
Returns the component type of the given type. Returns <code>null</code> if given type does not have a single component type. For example the following types all have the component-type MyClass: <ul> <li>MyClass[]</li> <li>List&lt;MyClass&gt;</li> <li>Foo&lt;? extends MyClass&gt;</li> <li>Bar&lt;? super MyClass&gt;</li>...
[ "Returns", "the", "component", "type", "of", "the", "given", "type", ".", "Returns", "<code", ">", "null<", "/", "code", ">", "if", "given", "type", "does", "not", "have", "a", "single", "component", "type", ".", "For", "example", "the", "following", "ty...
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/reflect/TypeResolverUtils.java#L186-L206
test
Get the component type of a type.
Of course, here is the Java code you requested: ```java public static Class<?> getComponentType(Type type, Class<?> implClass, int index) { if (type instanceof Class) { Class<?> clazz = (Class<?>) type; if (clazz.isArray()) { return clazz.getComponentType(); ...
oblac/jodd
jodd-core/src/main/java/jodd/util/collection/CompositeIterator.java
CompositeIterator.hasNext
@Override public boolean hasNext() { if (currentIterator == -1) { currentIterator = 0; } for (int i = currentIterator; i < allIterators.size(); i++) { Iterator iterator = allIterators.get(i); if (iterator.hasNext()) { currentIterator = i; return true; } } return false; }
java
@Override public boolean hasNext() { if (currentIterator == -1) { currentIterator = 0; } for (int i = currentIterator; i < allIterators.size(); i++) { Iterator iterator = allIterators.get(i); if (iterator.hasNext()) { currentIterator = i; return true; } } return false; }
[ "@", "Override", "public", "boolean", "hasNext", "(", ")", "{", "if", "(", "currentIterator", "==", "-", "1", ")", "{", "currentIterator", "=", "0", ";", "}", "for", "(", "int", "i", "=", "currentIterator", ";", "i", "<", "allIterators", ".", "size", ...
Returns <code>true</code> if next element is available.
[ "Returns", "<code", ">", "true<", "/", "code", ">", "if", "next", "element", "is", "available", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/collection/CompositeIterator.java#L72-L85
test
Returns true if the iterator has more elements.
Of course, here is the Java code you requested: ```java @Override public boolean hasNext() { if (currentIterator == -1) { currentIterator = 0; } for (int i = currentIterator; i < allIterators.size(); i++) { Iterator iterator = allIterators.get(i); if (iterator.hasNext()) { currentIterator = i; ...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java
ElementEditor.getNamespaces
protected static Namespaces getNamespaces(Element element, Namespaces namespaces, boolean removeDuplicateNSDeclarations) { // Create a container to hold the new namespace definitions. Namespaces newNamespaces = null; if (namespaces == null) newNamespaces = new Namespaces(); ...
java
protected static Namespaces getNamespaces(Element element, Namespaces namespaces, boolean removeDuplicateNSDeclarations) { // Create a container to hold the new namespace definitions. Namespaces newNamespaces = null; if (namespaces == null) newNamespaces = new Namespaces(); ...
[ "protected", "static", "Namespaces", "getNamespaces", "(", "Element", "element", ",", "Namespaces", "namespaces", ",", "boolean", "removeDuplicateNSDeclarations", ")", "{", "// Create a container to hold the new namespace definitions.", "Namespaces", "newNamespaces", "=", "null...
Returns the given element's namespace declarations. The given namespace declarations should be the element's parent's, or <code>null</code> if the element has no parent. If removeDuplicateNSDeclarations is <code>true</code>, duplicate namespace declarations are removed from the element's attributes. The element must no...
[ "Returns", "the", "given", "element", "s", "namespace", "declarations", ".", "The", "given", "namespace", "declarations", "should", "be", "the", "element", "s", "parent", "s", "or", "<code", ">", "null<", "/", "code", ">", "if", "the", "element", "has", "n...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java#L965-L1017
test
Get the namespaces for the given element.
Of course, here is the Java code you requested: ```java protected static Namespaces getNamespaces(Element element, Namespaces namespaces, boolean removeDuplicateNSDeclarations) { // Create a container to hold the new namespace definitions. Namespaces newNamespaces = null; if (namespaces == nul...
Unidata/thredds
cdm/src/main/java/ucar/nc2/time/CalendarDate.java
CalendarDate.of
public static CalendarDate of(long msecs) { // Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z using ISOChronology in the specified time zone. DateTime dt = new DateTime(msecs, DateTimeZone.UTC) ; return new CalendarDate(null, dt); }
java
public static CalendarDate of(long msecs) { // Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z using ISOChronology in the specified time zone. DateTime dt = new DateTime(msecs, DateTimeZone.UTC) ; return new CalendarDate(null, dt); }
[ "public", "static", "CalendarDate", "of", "(", "long", "msecs", ")", "{", "// Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z using ISOChronology in the specified time zone.\r", "DateTime", "dt", "=", "new", "DateTime", "(", "msecs", ",", "DateTimeZone", ...
Create CalendarDate from msecs since epoch Uses standard Calendar. @param msecs milliseconds from 1970-01-01T00:00:00Z @return CalendarDate in UTC
[ "Create", "CalendarDate", "from", "msecs", "since", "epoch", "Uses", "standard", "Calendar", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/time/CalendarDate.java#L101-L105
test
Creates a calendar date from the given milliseconds.
Of course, here is the Java code you requested: ```java public static CalendarDate of(long msecs) { // Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z using ISOChronology in the specified time zone. DateTime dt = new DateTime(msecs, DateTimeZone.UTC) ; return new CalendarDate(nu...
oblac/jodd
jodd-proxetta/src/main/java/jodd/asm7/ClassReader.java
ClassReader.readField
private int readField( final ClassVisitor classVisitor, final Context context, final int fieldInfoOffset) { char[] charBuffer = context.charBuffer; // Read the access_flags, name_index and descriptor_index fields. int currentOffset = fieldInfoOffset; int accessFlags = readUnsignedShort(currentOff...
java
private int readField( final ClassVisitor classVisitor, final Context context, final int fieldInfoOffset) { char[] charBuffer = context.charBuffer; // Read the access_flags, name_index and descriptor_index fields. int currentOffset = fieldInfoOffset; int accessFlags = readUnsignedShort(currentOff...
[ "private", "int", "readField", "(", "final", "ClassVisitor", "classVisitor", ",", "final", "Context", "context", ",", "final", "int", "fieldInfoOffset", ")", "{", "char", "[", "]", "charBuffer", "=", "context", ".", "charBuffer", ";", "// Read the access_flags, na...
Reads a JVMS field_info structure and makes the given visitor visit it. @param classVisitor the visitor that must visit the field. @param context information about the class being parsed. @param fieldInfoOffset the start offset of the field_info structure. @return the offset of the first byte following the field_info ...
[ "Reads", "a", "JVMS", "field_info", "structure", "and", "makes", "the", "given", "visitor", "visit", "it", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ClassReader.java#L824-L998
test
Read a field from the bytecode.
Of course, here is the Java code you requested: ```java private int readField( final ClassVisitor classVisitor, final Context context, final int fieldInfoOffset) { char[] charBuffer = context.charBuffer; // Read the access_flags, name_index and descriptor_index fields. int currentOffset = fieldInfoO...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/serialization/types/OBinaryTypeSerializer.java
OBinaryTypeSerializer.getObjectSizeInByteBuffer
@Override public int getObjectSizeInByteBuffer(ByteBuffer buffer, OWALChanges walChanges, int offset) { return walChanges.getIntValue(buffer, offset) + OIntegerSerializer.INT_SIZE; }
java
@Override public int getObjectSizeInByteBuffer(ByteBuffer buffer, OWALChanges walChanges, int offset) { return walChanges.getIntValue(buffer, offset) + OIntegerSerializer.INT_SIZE; }
[ "@", "Override", "public", "int", "getObjectSizeInByteBuffer", "(", "ByteBuffer", "buffer", ",", "OWALChanges", "walChanges", ",", "int", "offset", ")", "{", "return", "walChanges", ".", "getIntValue", "(", "buffer", ",", "offset", ")", "+", "OIntegerSerializer", ...
{@inheritDoc}
[ "{" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/serialization/types/OBinaryTypeSerializer.java#L141-L144
test
Get the size of the object in the buffer.
Of course, here is the Java code you requested: ```java @Override public int getObjectSizeInByteBuffer(ByteBuffer buffer, OWALChanges walChanges, int offset) { return walChanges.getIntValue(buffer, offset) + OIntegerSerializer.INT_SIZE; } ``` Hope this helps!
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java
DateHelper.getNowMonth
public static String getNowMonth(String sdate) { // 取该时间所在月的一号 sdate = sdate.substring(0, 8) + "01"; // 得到这个月的1号是星期几 Date date = DateHelper.strToDate(sdate); Calendar c = Calendar.getInstance(); c.setTime(date); int u = c.get(Calendar.DAY_OF_WEEK); String...
java
public static String getNowMonth(String sdate) { // 取该时间所在月的一号 sdate = sdate.substring(0, 8) + "01"; // 得到这个月的1号是星期几 Date date = DateHelper.strToDate(sdate); Calendar c = Calendar.getInstance(); c.setTime(date); int u = c.get(Calendar.DAY_OF_WEEK); String...
[ "public", "static", "String", "getNowMonth", "(", "String", "sdate", ")", "{", "// 取该时间所在月的一号", "sdate", "=", "sdate", ".", "substring", "(", "0", ",", "8", ")", "+", "\"01\"", ";", "// 得到这个月的1号是星期几", "Date", "date", "=", "DateHelper", ".", "strToDate", "(...
形成如下的日历 , 根据传入的一个时间返回一个结构 星期日 星期一 星期二 星期三 星期四 星期五 星期六 下面是当月的各个时间 此函数返回该日历第一行星期日所在的日期 @param sdate @return
[ "形成如下的日历", ",", "根据传入的一个时间返回一个结构", "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "下面是当月的各个时间", "此函数返回该日历第一行星期日所在的日期" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java#L542-L553
test
getNowMonth This method returns the month of the year that the given date is in.
Of course, here is the Java code you requested: ```java public static String getNowMonth(String sdate) { // 取该时间所在月的一号 sdate = sdate.substring(0, 8) + "01"; // 得到这个月的1号是星期几 Date date = DateHelper.strToDate(sdate); Calendar c = Calendar.getInstance(); c.setTime(date); ...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.timestamp
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) // Supplied scheduler is only used for creating timestamps. public final Observable<Timed<T>> timestamp(Scheduler scheduler) { return timestamp(TimeUnit.MILLISECONDS, scheduler); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) // Supplied scheduler is only used for creating timestamps. public final Observable<Timed<T>> timestamp(Scheduler scheduler) { return timestamp(TimeUnit.MILLISECONDS, scheduler); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "// Supplied scheduler is only used for creating timestamps.", "public", "final", "Observable", "<", "Timed", "<", "T", ">", ">", "timestamp", "(", "Scheduler", "scheduler", ")"...
Returns an Observable that emits each item emitted by the source ObservableSource, wrapped in a {@link Timed} object whose timestamps are provided by a specified Scheduler. <p> <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timestamp.s.png" alt=""> <dl> <dt><b>Schedu...
[ "Returns", "an", "Observable", "that", "emits", "each", "item", "emitted", "by", "the", "source", "ObservableSource", "wrapped", "in", "a", "{", "@link", "Timed", "}", "object", "whose", "timestamps", "are", "provided", "by", "a", "specified", "Scheduler", "."...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L13855-L13859
test
Creates an observable that emits the timestamps of the sequence of events.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) // Supplied scheduler is only used for creating timestamps. public final Observable<Timed<T>> timestamp(Scheduler scheduler) { return timestamp(TimeUnit.MILLISECONDS, scheduler); } ```...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/manager/ResourceBundleProcessor.java
ResourceBundleProcessor.serveProcessedBundle
public void serveProcessedBundle() throws IOException { final WroConfiguration configuration = context.getConfig(); final HttpServletRequest request = context.getRequest(); final HttpServletResponse response = context.getResponse(); OutputStream os = null; try { final CacheKey cacheKey...
java
public void serveProcessedBundle() throws IOException { final WroConfiguration configuration = context.getConfig(); final HttpServletRequest request = context.getRequest(); final HttpServletResponse response = context.getResponse(); OutputStream os = null; try { final CacheKey cacheKey...
[ "public", "void", "serveProcessedBundle", "(", ")", "throws", "IOException", "{", "final", "WroConfiguration", "configuration", "=", "context", ".", "getConfig", "(", ")", ";", "final", "HttpServletRequest", "request", "=", "context", ".", "getRequest", "(", ")", ...
Write to stream the content of the processed resource bundle.
[ "Write", "to", "stream", "the", "content", "of", "the", "processed", "resource", "bundle", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/manager/ResourceBundleProcessor.java#L52-L106
test
serveProcessedBundle This method is called by the servlet to serve the bundle.
Of course, here is the Java code you requested: ```java public void serveProcessedBundle() throws IOException { final WroConfiguration configuration = context.getConfig(); final HttpServletRequest request = context.getRequest(); final HttpServletResponse response = context.getResponse(); OutputS...
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java
DateHelper.getStringDateShort
public static String getStringDateShort() { Date currentTime = new Date(); String dateString = FORMATTER_SHORT.format(currentTime); return dateString; }
java
public static String getStringDateShort() { Date currentTime = new Date(); String dateString = FORMATTER_SHORT.format(currentTime); return dateString; }
[ "public", "static", "String", "getStringDateShort", "(", ")", "{", "Date", "currentTime", "=", "new", "Date", "(", ")", ";", "String", "dateString", "=", "FORMATTER_SHORT", ".", "format", "(", "currentTime", ")", ";", "return", "dateString", ";", "}" ]
获取现在时间 @return 返回短时间字符串格式yyyy-MM-dd
[ "获取现在时间" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java#L87-L91
test
Get a short date string.
Of course, here is the Java code you requested: ```java public static String getStringDateShort() { Date currentTime = new Date(); String dateString = FORMATTER_SHORT.format(currentTime); return dateString; } ``` Hope this helps!
braintree/braintree_android
Braintree/src/main/java/com/braintreepayments/api/DataCollector.java
DataCollector.collectDeviceData
public static void collectDeviceData(BraintreeFragment fragment, BraintreeResponseListener<String> listener) { collectDeviceData(fragment, null, listener); }
java
public static void collectDeviceData(BraintreeFragment fragment, BraintreeResponseListener<String> listener) { collectDeviceData(fragment, null, listener); }
[ "public", "static", "void", "collectDeviceData", "(", "BraintreeFragment", "fragment", ",", "BraintreeResponseListener", "<", "String", ">", "listener", ")", "{", "collectDeviceData", "(", "fragment", ",", "null", ",", "listener", ")", ";", "}" ]
Collect device information for fraud identification purposes. @param fragment {@link BraintreeFragment} @param listener to be called with the device data String to send to Braintree.
[ "Collect", "device", "information", "for", "fraud", "identification", "purposes", "." ]
07b32e6fad73f9fb8432971b0e79fc8c94b11873
https://github.com/braintree/braintree_android/blob/07b32e6fad73f9fb8432971b0e79fc8c94b11873/Braintree/src/main/java/com/braintreepayments/api/DataCollector.java#L40-L42
test
Collect the device data from a BraintreeFragment.
Of course, here is the Java code you requested: ```java public static void collectDeviceData(BraintreeFragment fragment, BraintreeResponseListener<String> listener) { collectDeviceData(fragment, null, listener); } ``` Hope this helps!
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/CssVariablesProcessor.java
CssVariablesProcessor.extractVariables
private Map<String, String> extractVariables(final String variablesBody) { final Map<String, String> map = new HashMap<String, String>(); final Matcher m = PATTERN_VARIABLES_BODY.matcher(variablesBody); LOG.debug("parsing variables body"); while (m.find()) { final String key = m.group(1); ...
java
private Map<String, String> extractVariables(final String variablesBody) { final Map<String, String> map = new HashMap<String, String>(); final Matcher m = PATTERN_VARIABLES_BODY.matcher(variablesBody); LOG.debug("parsing variables body"); while (m.find()) { final String key = m.group(1); ...
[ "private", "Map", "<", "String", ",", "String", ">", "extractVariables", "(", "final", "String", "variablesBody", ")", "{", "final", "Map", "<", "String", ",", "String", ">", "map", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";...
Extract variables map from variables body. @param variablesBody string containing variables mappings. @return map with extracted variables.
[ "Extract", "variables", "map", "from", "variables", "body", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/CssVariablesProcessor.java#L60-L73
test
Extract the variables from the body of a banner.
Of course, here is the Java code you requested: ```java private Map<String, String> extractVariables(final String variablesBody) { final Map<String, String> map = new HashMap<String, String>(); final Matcher m = PATTERN_VARIABLES_BODY.matcher(variablesBody); LOG.debug("parsing variables body"); whi...
FitLayout/api
src/main/java/org/fit/layout/impl/AreaGrid.java
AreaGrid.findCellX
public int findCellX(int x) { int ofs = abspos.getX1(); for (int i = 0; i < cols.length; i++) { ofs += cols[i]; if (x < ofs) return i; } return -1; }
java
public int findCellX(int x) { int ofs = abspos.getX1(); for (int i = 0; i < cols.length; i++) { ofs += cols[i]; if (x < ofs) return i; } return -1; }
[ "public", "int", "findCellX", "(", "int", "x", ")", "{", "int", "ofs", "=", "abspos", ".", "getX1", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cols", ".", "length", ";", "i", "++", ")", "{", "ofs", "+=", "cols", "[", "...
Finds a grid cell that contains the specified point @param x the x coordinate of the specified point @return the X offset of the grid cell that contains the specified absolute x coordinate or -1 when there is no such cell
[ "Finds", "a", "grid", "cell", "that", "contains", "the", "specified", "point" ]
fcfa67ce2a7485fbd722576413191fff5d68bae8
https://github.com/FitLayout/api/blob/fcfa67ce2a7485fbd722576413191fff5d68bae8/src/main/java/org/fit/layout/impl/AreaGrid.java#L243-L253
test
Find cell X.
Of course, here is the Java code you requested: ```java public int findCellX(int x) { int ofs = abspos.getX1(); for (int i = 0; i < cols.length; i++) { ofs += cols[i]; if (x < ofs) return i; } return -1; } ``` Hope this helps!
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java
ABaseClientWS.executeTxtReceiveTxt
protected String executeTxtReceiveTxt( HttpMethod httpMethodParam, List<HeaderNameValue> headerNameValuesParam, boolean checkConnectionValidParam, String stringParam, ContentType contentTypeParam, String postfixUrlParam ) { if(stringParam == null || stringParam.isEmpty()) { throw new FluidClient...
java
protected String executeTxtReceiveTxt( HttpMethod httpMethodParam, List<HeaderNameValue> headerNameValuesParam, boolean checkConnectionValidParam, String stringParam, ContentType contentTypeParam, String postfixUrlParam ) { if(stringParam == null || stringParam.isEmpty()) { throw new FluidClient...
[ "protected", "String", "executeTxtReceiveTxt", "(", "HttpMethod", "httpMethodParam", ",", "List", "<", "HeaderNameValue", ">", "headerNameValuesParam", ",", "boolean", "checkConnectionValidParam", ",", "String", "stringParam", ",", "ContentType", "contentTypeParam", ",", ...
Submit the {@code stringParam} as HTTP request body with JSON as a response. @param httpMethodParam The HTTP method to use. @param headerNameValuesParam The additional HTTP headers. @param checkConnectionValidParam Check if connection to base endpoint is valid. @param stringParam The Text to submit. @param contentType...
[ "Submit", "the", "{", "@code", "stringParam", "}", "as", "HTTP", "request", "body", "with", "JSON", "as", "a", "response", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java#L761-L874
test
Execute a TXT receive request.
Of course, here is the Java code you requested: ```java protected String executeTxtReceiveTxt( HttpMethod httpMethodParam, List<HeaderNameValue> headerNameValuesParam, boolean checkConnectionValidParam, String stringParam, ContentType contentTypeParam, String postfixUrlParam ) { if(stringParam == ...
RestComm/jain-slee
tools/slee-management-console/server/src/main/java/org/mobicents/slee/container/management/console/server/mbeans/LogManagementMBeanUtils.java
LogManagementMBeanUtils.addSocketHandler
public void addSocketHandler(String loggerName, Level handlerLevel, String handlerName, String formaterClassName, String filterClassName, String host, int port) throws ManagementConsoleException { try { this.mbeanServer.invoke(logMgmtMBeanName, "addSocketHandler", new Object[] { loggerName, handler...
java
public void addSocketHandler(String loggerName, Level handlerLevel, String handlerName, String formaterClassName, String filterClassName, String host, int port) throws ManagementConsoleException { try { this.mbeanServer.invoke(logMgmtMBeanName, "addSocketHandler", new Object[] { loggerName, handler...
[ "public", "void", "addSocketHandler", "(", "String", "loggerName", ",", "Level", "handlerLevel", ",", "String", "handlerName", ",", "String", "formaterClassName", ",", "String", "filterClassName", ",", "String", "host", ",", "int", "port", ")", "throws", "Manageme...
Adds SocketHandler to certain logger, this logger must exist prior this function is called @param loggerName - name of the logger, cant be null @param handlerLevel - level for this handler, if its null default level for handlers will be used @param handlerName - name for this handler, cant be duplicate. @param formate...
[ "Adds", "SocketHandler", "to", "certain", "logger", "this", "logger", "must", "exist", "prior", "this", "function", "is", "called" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/tools/slee-management-console/server/src/main/java/org/mobicents/slee/container/management/console/server/mbeans/LogManagementMBeanUtils.java#L379-L392
test
Add a socket handler to the log.
Of course, here is the Java code you requested: ```java public void addSocketHandler(String loggerName, Level handlerLevel, String handlerName, String formaterClassName, String filterClassName, String host, int port) throws ManagementConsoleException { try { this.mbeanServer.invoke(logMgmtMBeanNam...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.getValue
@Override public double getValue(GriddedTile griddedTile, TileRow tileRow, int x, int y) { byte[] imageBytes = tileRow.getTileData(); double value = getValue(griddedTile, imageBytes, x, y); return value; }
java
@Override public double getValue(GriddedTile griddedTile, TileRow tileRow, int x, int y) { byte[] imageBytes = tileRow.getTileData(); double value = getValue(griddedTile, imageBytes, x, y); return value; }
[ "@", "Override", "public", "double", "getValue", "(", "GriddedTile", "griddedTile", ",", "TileRow", "tileRow", ",", "int", "x", ",", "int", "y", ")", "{", "byte", "[", "]", "imageBytes", "=", "tileRow", ".", "getTileData", "(", ")", ";", "double", "value...
{@inheritDoc}
[ "{" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L75-L81
test
Get the value of a single page in the image.
Of course, here is the Java code you requested: ```java @Override public double getValue(GriddedTile griddedTile, TileRow tileRow, int x, int y) { byte[] imageBytes = tileRow.getTileData(); double value = getValue(griddedTile, imageBytes, x, y); return value; ...
Enterprise-Content-Management/infoarchive-sip-sdk
core/src/main/java/com/opentext/ia/sdk/sip/Generator.java
Generator.generate
public Metrics generate(Iterable<C> components, DataBuffer product) throws IOException { return generate(components.iterator(), product); }
java
public Metrics generate(Iterable<C> components, DataBuffer product) throws IOException { return generate(components.iterator(), product); }
[ "public", "Metrics", "generate", "(", "Iterable", "<", "C", ">", "components", ",", "DataBuffer", "product", ")", "throws", "IOException", "{", "return", "generate", "(", "components", ".", "iterator", "(", ")", ",", "product", ")", ";", "}" ]
Generate a product by assembling components. @param components The components to assemble @param product The output to write the assembled product to @return Metrics about the generation process @throws IOException When an I/O error occurs
[ "Generate", "a", "product", "by", "assembling", "components", "." ]
3c84a4d9ce569139e9a442034526944d3e63436e
https://github.com/Enterprise-Content-Management/infoarchive-sip-sdk/blob/3c84a4d9ce569139e9a442034526944d3e63436e/core/src/main/java/com/opentext/ia/sdk/sip/Generator.java#L36-L38
test
Generate a CID from a collection of components.
Of course, here is the Java code you requested: ```java public Metrics generate(Iterable<C> components, DataBuffer product) throws IOException { return generate(components.iterator(), product); } ``` Hope this helps!
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/core/memory/ThreadSafeBitSet.java
ThreadSafeBitSet.clearAll
public void clearAll() { ThreadSafeBitSetSegments segments = this.segments.get(); for(int i=0;i<segments.numSegments();i++) { AtomicLongArray segment = segments.getSegment(i); for(int j=0;j<segment.length();j++) { segment.set(j, 0L); } } ...
java
public void clearAll() { ThreadSafeBitSetSegments segments = this.segments.get(); for(int i=0;i<segments.numSegments();i++) { AtomicLongArray segment = segments.getSegment(i); for(int j=0;j<segment.length();j++) { segment.set(j, 0L); } } ...
[ "public", "void", "clearAll", "(", ")", "{", "ThreadSafeBitSetSegments", "segments", "=", "this", ".", "segments", ".", "get", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "segments", ".", "numSegments", "(", ")", ";", "i", "++", ...
Clear all bits to 0.
[ "Clear", "all", "bits", "to", "0", "." ]
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/memory/ThreadSafeBitSet.java#L199-L209
test
Clear all the records in the cache.
Of course, here is the Java code you requested: ```java public void clearAll() { ThreadSafeBitSetSegments segments = this.segments.get(); for(int i=0;i<segments.numSegments();i++) { AtomicLongArray segment = segments.getSegment(i); for(int j=0;j<segment.length();j++) { ...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/js/ConsoleStripperProcessor.java
ConsoleStripperProcessor.process
public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { try { final String content = IOUtils.toString(reader); String result = ConsoleStripperProcessor.PATTERN.matcher(content).replaceAll(""); writer.write(result); } finally { read...
java
public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { try { final String content = IOUtils.toString(reader); String result = ConsoleStripperProcessor.PATTERN.matcher(content).replaceAll(""); writer.write(result); } finally { read...
[ "public", "void", "process", "(", "final", "Resource", "resource", ",", "final", "Reader", "reader", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "try", "{", "final", "String", "content", "=", "IOUtils", ".", "toString", "(", "reader"...
{@inheritDoc}
[ "{" ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/js/ConsoleStripperProcessor.java#L33-L43
test
Process a single resource.
Of course, here is the Java code you requested: ```java public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { try { final String content = IOUtils.toString(reader); String result = ConsoleStripperProcessor.PATTERN.matcher(content).replaceAll(""...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/sql/parser/OExecutionPlanCache.java
OExecutionPlanCache.get
public static OExecutionPlan get(String statement, OCommandContext ctx, ODatabaseDocumentInternal db) { if (db == null) { throw new IllegalArgumentException("DB cannot be null"); } if (statement == null) { return null; } OExecutionPlanCache resource = db.getSharedContext().getExecutionP...
java
public static OExecutionPlan get(String statement, OCommandContext ctx, ODatabaseDocumentInternal db) { if (db == null) { throw new IllegalArgumentException("DB cannot be null"); } if (statement == null) { return null; } OExecutionPlanCache resource = db.getSharedContext().getExecutionP...
[ "public", "static", "OExecutionPlan", "get", "(", "String", "statement", ",", "OCommandContext", "ctx", ",", "ODatabaseDocumentInternal", "db", ")", "{", "if", "(", "db", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"DB cannot be null...
returns an already prepared SQL execution plan, taking it from the cache if it exists or creating a new one if it doesn't @param statement the SQL statement @param ctx @param db the current DB instance @return a statement executor from the cache
[ "returns", "an", "already", "prepared", "SQL", "execution", "plan", "taking", "it", "from", "the", "cache", "if", "it", "exists", "or", "creating", "a", "new", "one", "if", "it", "doesn", "t" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OExecutionPlanCache.java#L74-L85
test
Get an execution plan for the given statement.
Of course, here is the Java code you requested: ```java public static OExecutionPlan get(String statement, OCommandContext ctx, ODatabaseDocumentInternal db) { if (db == null) { throw new IllegalArgumentException("DB cannot be null"); } if (statement == null) { return null; } OExecutio...
wildfly/wildfly
iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/Util.java
Util.primitiveTypeIDLName
static String primitiveTypeIDLName(Class type) { if (type == Void.TYPE) return "void"; if (type == Boolean.TYPE) return "boolean"; if (type == Character.TYPE) return "wchar"; if (type == Byte.TYPE) return "octet"; if (type == Short....
java
static String primitiveTypeIDLName(Class type) { if (type == Void.TYPE) return "void"; if (type == Boolean.TYPE) return "boolean"; if (type == Character.TYPE) return "wchar"; if (type == Byte.TYPE) return "octet"; if (type == Short....
[ "static", "String", "primitiveTypeIDLName", "(", "Class", "type", ")", "{", "if", "(", "type", "==", "Void", ".", "TYPE", ")", "return", "\"void\"", ";", "if", "(", "type", "==", "Boolean", ".", "TYPE", ")", "return", "\"boolean\"", ";", "if", "(", "ty...
Handle mappings for primitive types, as per section 1.3.3.
[ "Handle", "mappings", "for", "primitive", "types", "as", "per", "section", "1", ".", "3", ".", "3", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/Util.java#L582-L602
test
Returns the IDL name for a primitive type.
Of course, here is the Java code you requested: ```java static String primitiveTypeIDLName(Class type) { if (type == Void.TYPE) return "void"; if (type == Boolean.TYPE) return "boolean"; if (type == Character.TYPE) return "wchar"; if (type == Byte.TYP...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
PerThreadTagHandlerPool.reuse
public void reuse(Tag handler) { PerThreadData ptd=perThread.get(); if (ptd.current < (ptd.handlers.length - 1)) { ptd.handlers[++ptd.current] = handler; } else { handler.release(); } }
java
public void reuse(Tag handler) { PerThreadData ptd=perThread.get(); if (ptd.current < (ptd.handlers.length - 1)) { ptd.handlers[++ptd.current] = handler; } else { handler.release(); } }
[ "public", "void", "reuse", "(", "Tag", "handler", ")", "{", "PerThreadData", "ptd", "=", "perThread", ".", "get", "(", ")", ";", "if", "(", "ptd", ".", "current", "<", "(", "ptd", ".", "handlers", ".", "length", "-", "1", ")", ")", "{", "ptd", "....
Adds the given tag handler to this tag handler pool, unless this tag handler pool has already reached its capacity, in which case the tag handler's release() method is called. @param handler Tag handler to add to this tag handler pool
[ "Adds", "the", "given", "tag", "handler", "to", "this", "tag", "handler", "pool", "unless", "this", "tag", "handler", "pool", "has", "already", "reached", "its", "capacity", "in", "which", "case", "the", "tag", "handler", "s", "release", "()", "method", "i...
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/PerThreadTagHandlerPool.java#L150-L157
test
Reuse a tag.
Of course, here is the Java code you requested: ```java public void reuse(Tag handler) { PerThreadData ptd=perThread.get(); if (ptd.current < (ptd.handlers.length - 1)) { ptd.handlers[++ptd.current] = handler; } else { handler.release(); } } ``` Hope this helps!
RestComm/jain-slee
container/services/src/main/java/org/mobicents/slee/container/deployment/ConcreteActivityContextInterfaceGenerator.java
ConcreteActivityContextInterfaceGenerator.generateActivityContextInterfaceConcreteClass
public Class generateActivityContextInterfaceConcreteClass() throws DeploymentException { String tmpClassName = ConcreteClassGeneratorUtils.CONCRETE_ACTIVITY_INTERFACE_CLASS_NAME_PREFIX + activityContextInterfaceName + ConcreteClassGeneratorUtils.CONCRETE_ACTIVITY_INTERFACE_CLASS_NAME_SUFFIX; co...
java
public Class generateActivityContextInterfaceConcreteClass() throws DeploymentException { String tmpClassName = ConcreteClassGeneratorUtils.CONCRETE_ACTIVITY_INTERFACE_CLASS_NAME_PREFIX + activityContextInterfaceName + ConcreteClassGeneratorUtils.CONCRETE_ACTIVITY_INTERFACE_CLASS_NAME_SUFFIX; co...
[ "public", "Class", "generateActivityContextInterfaceConcreteClass", "(", ")", "throws", "DeploymentException", "{", "String", "tmpClassName", "=", "ConcreteClassGeneratorUtils", ".", "CONCRETE_ACTIVITY_INTERFACE_CLASS_NAME_PREFIX", "+", "activityContextInterfaceName", "+", "Concret...
Generate the Activity Context Interface Class @param activityContextInterfaceName the name of the Activity Context Interface @return the concrete Activity Context Interface class implementing the Activity Context Interface
[ "Generate", "the", "Activity", "Context", "Interface", "Class" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/container/deployment/ConcreteActivityContextInterfaceGenerator.java#L105-L168
test
Generate the concrete activity context interface class.
Of course, here is the Java code you requested: ```java public Class generateActivityContextInterfaceConcreteClass() throws DeploymentException { String tmpClassName = ConcreteClassGeneratorUtils.CONCRETE_ACTIVITY_INTERFACE_CLASS_NAME_PREFIX + activityContextInterfaceName + ConcreteClassGeneratorUti...
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/EntityHelper.java
EntityHelper.getConstructor
public static Constructor<?> getConstructor(Class<?> clazz, Object... args) throws SecurityException, NoSuchMethodException { Constructor<?> constructor = null; int length = args.length; Class<?>[] classes = new Class<?>[length]; for (int i = 0; i < length; i++) { ...
java
public static Constructor<?> getConstructor(Class<?> clazz, Object... args) throws SecurityException, NoSuchMethodException { Constructor<?> constructor = null; int length = args.length; Class<?>[] classes = new Class<?>[length]; for (int i = 0; i < length; i++) { ...
[ "public", "static", "Constructor", "<", "?", ">", "getConstructor", "(", "Class", "<", "?", ">", "clazz", ",", "Object", "...", "args", ")", "throws", "SecurityException", ",", "NoSuchMethodException", "{", "Constructor", "<", "?", ">", "constructor", "=", "...
根据传入的给予构造参数的传入值获取构造方法 <br> 2013-10-21 上午11:03:13 @param clazz 调用的类对象 @param args 传入的参数 @return 如果存在,则返回构造方法,如果不存在,则返回空 @throws NoSuchMethodException @throws SecurityException
[ "根据传入的给予构造参数的传入值获取构造方法", "<br", ">", "2013", "-", "10", "-", "21", "上午11", ":", "03", ":", "13" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/EntityHelper.java#L238-L249
test
Get the Constructor of a class.
Of course, here is the Java code you requested: ```java public static Constructor<?> getConstructor(Class<?> clazz, Object... args) throws SecurityException, NoSuchMethodException { Constructor<?> constructor = null; int length = args.length; Class<?>[] classes = new Class<?>[length...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/ConvertRotation3D_F64.java
ConvertRotation3D_F64.quaternionToMatrix
public static DMatrixRMaj quaternionToMatrix( Quaternion_F64 quat, DMatrixRMaj R ) { return quaternionToMatrix(quat.w,quat.x,quat.y,quat.z,R); }
java
public static DMatrixRMaj quaternionToMatrix( Quaternion_F64 quat, DMatrixRMaj R ) { return quaternionToMatrix(quat.w,quat.x,quat.y,quat.z,R); }
[ "public", "static", "DMatrixRMaj", "quaternionToMatrix", "(", "Quaternion_F64", "quat", ",", "DMatrixRMaj", "R", ")", "{", "return", "quaternionToMatrix", "(", "quat", ".", "w", ",", "quat", ".", "x", ",", "quat", ".", "y", ",", "quat", ".", "z", ",", "R...
<p>Converts a unit quaternion into a rotation matrix.</p> <p> Equations is taken from: Paul J. Besl and Neil D. McKay, "A Method for Registration of 3-D Shapes" IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol 14, No. 2, Feb. 1992 </p> @param quat Unit quaternion. @param R Storage for rotation matr...
[ "<p", ">", "Converts", "a", "unit", "quaternion", "into", "a", "rotation", "matrix", ".", "<", "/", "p", ">" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/ConvertRotation3D_F64.java#L727-L729
test
Converts a quaternion into a matrix.
Of course, here is the Java code you requested: ```java public static DMatrixRMaj quaternionToMatrix( Quaternion_F64 quat, DMatrixRMaj R ) { return quaternionToMatrix(quat.w,quat.x,quat.y,quat.z,R); } ``` Hope this helps!
rackerlabs/blueflood
blueflood-core/src/main/java/com/rackspacecloud/blueflood/inputs/formats/AggregatedPayload.java
AggregatedPayload.isValid
@AssertTrue(message="At least one of the aggregated metrics(gauges, counters, timers, sets) are expected") private boolean isValid() { boolean isGaugePresent = gauges != null && gauges.length > 0; boolean isCounterPresent = counters != null && counters.length > 0; boolean isTimerPresent = ti...
java
@AssertTrue(message="At least one of the aggregated metrics(gauges, counters, timers, sets) are expected") private boolean isValid() { boolean isGaugePresent = gauges != null && gauges.length > 0; boolean isCounterPresent = counters != null && counters.length > 0; boolean isTimerPresent = ti...
[ "@", "AssertTrue", "(", "message", "=", "\"At least one of the aggregated metrics(gauges, counters, timers, sets) are expected\"", ")", "private", "boolean", "isValid", "(", ")", "{", "boolean", "isGaugePresent", "=", "gauges", "!=", "null", "&&", "gauges", ".", "length",...
This method is invoked by the validator automatically
[ "This", "method", "is", "invoked", "by", "the", "validator", "automatically" ]
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/inputs/formats/AggregatedPayload.java#L156-L164
test
Checks if the aggregated metrics are present in the cache.
Of course, here is the Java code you requested: ```java @AssertTrue(message="At least one of the aggregated metrics(gauges, counters, timers, sets) are expected") private boolean isValid() { boolean isGaugePresent = gauges != null && gauges.length > 0; boolean isCounterPresent = counters != null &&...
deeplearning4j/nd4j
nd4j-common/src/main/java/org/nd4j/util/StringUtils.java
StringUtils.findNext
public static int findNext(String str, char separator, char escapeChar, int start, StringBuilder split) { int numPreEscapes = 0; for (int i = start; i < str.length(); i++) { char curChar = str.charAt(i); if (numPreEscapes == 0 && curChar == separato...
java
public static int findNext(String str, char separator, char escapeChar, int start, StringBuilder split) { int numPreEscapes = 0; for (int i = start; i < str.length(); i++) { char curChar = str.charAt(i); if (numPreEscapes == 0 && curChar == separato...
[ "public", "static", "int", "findNext", "(", "String", "str", ",", "char", "separator", ",", "char", "escapeChar", ",", "int", "start", ",", "StringBuilder", "split", ")", "{", "int", "numPreEscapes", "=", "0", ";", "for", "(", "int", "i", "=", "start", ...
Finds the first occurrence of the separator character ignoring the escaped separators starting from the index. Note the substring between the index and the position of the separator is passed. @param str the source string @param separator the character to find @param escapeChar character used to escape @param start fro...
[ "Finds", "the", "first", "occurrence", "of", "the", "separator", "character", "ignoring", "the", "escaped", "separators", "starting", "from", "the", "index", ".", "Note", "the", "substring", "between", "the", "index", "and", "the", "position", "of", "the", "se...
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/util/StringUtils.java#L477-L492
test
Find the next separator or escape char in a string.
Of course, here is the Java code you requested: ```java public static int findNext(String str, char separator, char escapeChar, int start, StringBuilder split) { int numPreEscapes = 0; for (int i = start; i < str.length(); i++) { char curChar = str.charAt(i); ...
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/HTMLWriter.java
HTMLWriter.writeEscUTF16
private void writeEscUTF16(String s, int start, int length, boolean isAttVal) throws SAXException { String subString = s.substring(start, start + length); write(StringEscapeUtils.escapeHtml4(subString)); }
java
private void writeEscUTF16(String s, int start, int length, boolean isAttVal) throws SAXException { String subString = s.substring(start, start + length); write(StringEscapeUtils.escapeHtml4(subString)); }
[ "private", "void", "writeEscUTF16", "(", "String", "s", ",", "int", "start", ",", "int", "length", ",", "boolean", "isAttVal", ")", "throws", "SAXException", "{", "String", "subString", "=", "s", ".", "substring", "(", "start", ",", "start", "+", "length",...
Write an array of data characters with escaping. @param ch The array of characters. @param start The starting position. @param length The number of characters to use. @param isAttVal true if this is an attribute value literal. @throws org.xml.SAXException If there is an error writing the characters, this me...
[ "Write", "an", "array", "of", "data", "characters", "with", "escaping", "." ]
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/HTMLWriter.java#L934-L937
test
Write escape UTF16 sequence.
Of course, here is the Java code you requested: ```java private void writeEscUTF16(String s, int start, int length, boolean isAttVal) throws SAXException { String subString = s.substring(start, start + length); write(StringEscapeUtils.escapeHtml4(subString)); } ``` Hope this helps!