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
oblac/jodd
jodd-proxetta/src/main/java/jodd/proxetta/asm/ProxettaMethodBuilder.java
ProxettaMethodBuilder.visitEnd
@Override public void visitEnd() { createFirstChainDelegate_Continue(tmd); for (int p = 0; p < tmd.proxyData.length; p++) { tmd.selectCurrentProxy(p); createProxyMethod(tmd); } }
java
@Override public void visitEnd() { createFirstChainDelegate_Continue(tmd); for (int p = 0; p < tmd.proxyData.length; p++) { tmd.selectCurrentProxy(p); createProxyMethod(tmd); } }
[ "@", "Override", "public", "void", "visitEnd", "(", ")", "{", "createFirstChainDelegate_Continue", "(", "tmd", ")", ";", "for", "(", "int", "p", "=", "0", ";", "p", "<", "tmd", ".", "proxyData", ".", "length", ";", "p", "++", ")", "{", "tmd", ".", ...
Finally, builds proxy methods if applied to current method.
[ "Finally", "builds", "proxy", "methods", "if", "applied", "to", "current", "method", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/asm/ProxettaMethodBuilder.java#L124-L131
test
Override to create the proxy methods.
Of course, here is the Java code you requested: ```java @Override public void visitEnd() { createFirstChainDelegate_Continue(tmd); for (int p = 0; p < tmd.proxyData.length; p++) { tmd.selectCurrentProxy(p); createProxyMethod(tmd); } } ``` Hope this helps!
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib1/Grib1SectionGridDefinition.java
Grib1SectionGridDefinition.getNptsInLine
private int[] getNptsInLine(Grib1Gds gds) { int numPts; if ((gds.getScanMode() & 32) == 0) { // bit3 = 0 : Adjacent points in i direction are consecutive numPts = gds.getNy(); } else { // bit3 = 1 : Adjacent points in j direction are consecutive numPts = gds.getN...
java
private int[] getNptsInLine(Grib1Gds gds) { int numPts; if ((gds.getScanMode() & 32) == 0) { // bit3 = 0 : Adjacent points in i direction are consecutive numPts = gds.getNy(); } else { // bit3 = 1 : Adjacent points in j direction are consecutive numPts = gds.getN...
[ "private", "int", "[", "]", "getNptsInLine", "(", "Grib1Gds", "gds", ")", "{", "int", "numPts", ";", "if", "(", "(", "gds", ".", "getScanMode", "(", ")", "&", "32", ")", "==", "0", ")", "{", "// bit3 = 0 : Adjacent points in i direction are consecutive\r", "...
Gets the number of points in each line for Quasi/Thin grids "List of numbers of points in each row (length = NROWS x 2 octets, where NROWS is the total number of rows defined within the grid description)" @return number of points in each line as int[]
[ "Gets", "the", "number", "of", "points", "in", "each", "line", "for", "Quasi", "/", "Thin", "grids", "List", "of", "numbers", "of", "points", "in", "each", "row", "(", "length", "=", "NROWS", "x", "2", "octets", "where", "NROWS", "is", "the", "total", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib1/Grib1SectionGridDefinition.java#L175-L189
test
Gets the number of consecutive points in a line.
Of course, here is the Java code you requested: ```java private int[] getNptsInLine(Grib1Gds gds) { int numPts; if ((gds.getScanMode() & 32) == 0) { // bit3 = 0 : Adjacent points in i direction are consecutive numPts = gds.getNy(); } else { // bit3 = 1 : Adjacent point...
alipay/sofa-bolt
src/main/java/com/alipay/remoting/util/FutureTaskUtil.java
FutureTaskUtil.getFutureTaskResult
public static <T> T getFutureTaskResult(RunStateRecordedFutureTask<T> task, Logger logger) { T t = null; if (null != task) { try { t = task.getAfterRun(); } catch (InterruptedException e) { logger.error("Future task interrupted!", e); }...
java
public static <T> T getFutureTaskResult(RunStateRecordedFutureTask<T> task, Logger logger) { T t = null; if (null != task) { try { t = task.getAfterRun(); } catch (InterruptedException e) { logger.error("Future task interrupted!", e); }...
[ "public", "static", "<", "T", ">", "T", "getFutureTaskResult", "(", "RunStateRecordedFutureTask", "<", "T", ">", "task", ",", "Logger", "logger", ")", "{", "T", "t", "=", "null", ";", "if", "(", "null", "!=", "task", ")", "{", "try", "{", "t", "=", ...
get the result of a future task Notice: the run method of this task should have been called at first. @param task @param <T> @return
[ "get", "the", "result", "of", "a", "future", "task" ]
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/util/FutureTaskUtil.java#L39-L55
test
Get the result of a future task.
Of course, here is the Java code you requested: ```java public static <T> T getFutureTaskResult(RunStateRecordedFutureTask<T> task, Logger logger) { T t = null; if (null != task) { try { t = task.getAfterRun(); } catch (InterruptedException e) { l...
cglib/cglib
cglib/src/main/java/net/sf/cglib/core/EmitUtils.java
EmitUtils.nullcmp
private static void nullcmp(CodeEmitter e, Label oneNull, Label bothNull) { e.dup2(); Label nonNull = e.make_label(); Label oneNullHelper = e.make_label(); Label end = e.make_label(); e.ifnonnull(nonNull); e.ifnonnull(oneNullHelper); e.pop2(); e.goTo(bothN...
java
private static void nullcmp(CodeEmitter e, Label oneNull, Label bothNull) { e.dup2(); Label nonNull = e.make_label(); Label oneNullHelper = e.make_label(); Label end = e.make_label(); e.ifnonnull(nonNull); e.ifnonnull(oneNullHelper); e.pop2(); e.goTo(bothN...
[ "private", "static", "void", "nullcmp", "(", "CodeEmitter", "e", ",", "Label", "oneNull", ",", "Label", "bothNull", ")", "{", "e", ".", "dup2", "(", ")", ";", "Label", "nonNull", "=", "e", ".", "make_label", "(", ")", ";", "Label", "oneNullHelper", "="...
If both objects on the top of the stack are non-null, does nothing. If one is null, or both are null, both are popped off and execution branches to the respective label. @param oneNull label to branch to if only one of the objects is null @param bothNull label to branch to if both of the objects are null
[ "If", "both", "objects", "on", "the", "top", "of", "the", "stack", "are", "non", "-", "null", "does", "nothing", ".", "If", "one", "is", "null", "or", "both", "are", "null", "both", "are", "popped", "off", "and", "execution", "branches", "to", "the", ...
cd01695c11fd3c66641b295b9596f74cf13c548b
https://github.com/cglib/cglib/blob/cd01695c11fd3c66641b295b9596f74cf13c548b/cglib/src/main/java/net/sf/cglib/core/EmitUtils.java#L560-L579
test
Compare two null labels.
Of course, here is the Java code you requested: ```java private static void nullcmp(CodeEmitter e, Label oneNull, Label bothNull) { e.dup2(); Label nonNull = e.make_label(); Label oneNullHelper = e.make_label(); Label end = e.make_label(); e.ifnonnull(nonNull); e.ifnonnu...
fizzed/jne
src/main/java/com/fizzed/jne/JNE.java
JNE.requireExecutable
synchronized static public File requireExecutable(String name, Options options) throws IOException { return requireExecutable(name, null, options); }
java
synchronized static public File requireExecutable(String name, Options options) throws IOException { return requireExecutable(name, null, options); }
[ "synchronized", "static", "public", "File", "requireExecutable", "(", "String", "name", ",", "Options", "options", ")", "throws", "IOException", "{", "return", "requireExecutable", "(", "name", ",", "null", ",", "options", ")", ";", "}" ]
Same as findExecutable but throws an exception if the executable was not found.
[ "Same", "as", "findExecutable", "but", "throws", "an", "exception", "if", "the", "executable", "was", "not", "found", "." ]
783226a1fb002d304d22f841870c5c73575fc994
https://github.com/fizzed/jne/blob/783226a1fb002d304d22f841870c5c73575fc994/src/main/java/com/fizzed/jne/JNE.java#L162-L164
test
Require executable.
Of course, here is the Java code you requested: ```java synchronized static public File requireExecutable(String name, Options options) throws IOException { return requireExecutable(name, null, options); } ``` Hope this helps!
khennig/jpql-querybuilder
src/main/java/com/tri/persistence/jpql/WhereItems.java
WhereItems.notIn
public <V extends Object> WhereItems notIn(final String expression, final V... array) { items.add(new WhereIn(builder(), expression, true, array)); return this; }
java
public <V extends Object> WhereItems notIn(final String expression, final V... array) { items.add(new WhereIn(builder(), expression, true, array)); return this; }
[ "public", "<", "V", "extends", "Object", ">", "WhereItems", "notIn", "(", "final", "String", "expression", ",", "final", "V", "...", "array", ")", "{", "items", ".", "add", "(", "new", "WhereIn", "(", "builder", "(", ")", ",", "expression", ",", "true"...
Adds a "NOT IN" predicate. @param expression SQL expression, e.g. "expression" of "expression NOT IN (...)", actually the left part of the predicate @param array array of literal values @return this object
[ "Adds", "a", "NOT", "IN", "predicate", "." ]
61206f7c42631c67a49603b9beddccf48a8112e8
https://github.com/khennig/jpql-querybuilder/blob/61206f7c42631c67a49603b9beddccf48a8112e8/src/main/java/com/tri/persistence/jpql/WhereItems.java#L170-L174
test
Add a where in clause.
Of course, here is the Java code you requested: ```java public <V extends Object> WhereItems notIn(final String expression, final V... array) { items.add(new WhereIn(builder(), expression, true, array)); return this; } ``` Hope this helps!
kocakosm/pitaya
src/org/kocakosm/pitaya/math/Fraction.java
Fraction.valueOf
public static Fraction valueOf(Integer val) { return new Fraction(BigInteger.valueOf(val), BigInteger.ONE); }
java
public static Fraction valueOf(Integer val) { return new Fraction(BigInteger.valueOf(val), BigInteger.ONE); }
[ "public", "static", "Fraction", "valueOf", "(", "Integer", "val", ")", "{", "return", "new", "Fraction", "(", "BigInteger", ".", "valueOf", "(", "val", ")", ",", "BigInteger", ".", "ONE", ")", ";", "}" ]
Returns the {@code Fraction} representation of the given value. @param val an {@link Integer} value. @return the {@code Fraction} representation of the given value. @throws NullPointerException if {@code val} is {@code null}.
[ "Returns", "the", "{", "@code", "Fraction", "}", "representation", "of", "the", "given", "value", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/math/Fraction.java#L81-L84
test
Create a Fraction from Integer.
Of course, here is the Java code you requested: ```java public static Fraction valueOf(Integer val) { return new Fraction(BigInteger.valueOf(val), BigInteger.ONE); } ``` Hope this helps!
wildfly/wildfly
web-common/src/main/java/org/jboss/as/web/common/ConcurrentReferenceHashMap.java
ConcurrentReferenceHashMap.containsValue
public boolean containsValue(Object value) { if (value == null) throw new NullPointerException(); // See explanation of modCount use above final Segment<K,V>[] segments = this.segments; int[] mc = new int[segments.length]; // Try a few times without locking ...
java
public boolean containsValue(Object value) { if (value == null) throw new NullPointerException(); // See explanation of modCount use above final Segment<K,V>[] segments = this.segments; int[] mc = new int[segments.length]; // Try a few times without locking ...
[ "public", "boolean", "containsValue", "(", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "throw", "new", "NullPointerException", "(", ")", ";", "// See explanation of modCount use above", "final", "Segment", "<", "K", ",", "V", ">", "[", ...
Returns <tt>true</tt> if this map maps one or more keys to the specified value. Note: This method requires a full internal traversal of the hash table, and so is much slower than method <tt>containsKey</tt>. @param value value whose presence in this map is to be tested @return <tt>true</tt> if this map maps one or mor...
[ "Returns", "<tt", ">", "true<", "/", "tt", ">", "if", "this", "map", "maps", "one", "or", "more", "keys", "to", "the", "specified", "value", ".", "Note", ":", "This", "method", "requires", "a", "full", "internal", "traversal", "of", "the", "hash", "tab...
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/web-common/src/main/java/org/jboss/as/web/common/ConcurrentReferenceHashMap.java#L1140-L1185
test
Check if the value is contained in this set.
Of course, here is the Java code you requested: ```java public boolean containsValue(Object value) { if (value == null) throw new NullPointerException(); // See explanation of modCount use above final Segment<K,V>[] segments = this.segments; int[] mc = new int[segments.len...
marc-christian-schulze/structs4java
structs4java-maven-plugin/src/main/java/org/structs4java/StructsBatchCompiler.java
StructsBatchCompiler.installJvmTypeProvider
protected void installJvmTypeProvider(XtextResourceSet resourceSet, File tmpClassDirectory, boolean skipIndexLookup) { if (skipIndexLookup) { internalInstallJvmTypeProvider(resourceSet, tmpClassDirectory, skipIndexLookup); } else { // delegate to the deprecated signature in case it was overridden by // ...
java
protected void installJvmTypeProvider(XtextResourceSet resourceSet, File tmpClassDirectory, boolean skipIndexLookup) { if (skipIndexLookup) { internalInstallJvmTypeProvider(resourceSet, tmpClassDirectory, skipIndexLookup); } else { // delegate to the deprecated signature in case it was overridden by // ...
[ "protected", "void", "installJvmTypeProvider", "(", "XtextResourceSet", "resourceSet", ",", "File", "tmpClassDirectory", ",", "boolean", "skipIndexLookup", ")", "{", "if", "(", "skipIndexLookup", ")", "{", "internalInstallJvmTypeProvider", "(", "resourceSet", ",", "tmpC...
Installs the JvmTypeProvider optionally including index access into the {@link ResourceSet}. The lookup classpath is enhanced with the given tmp directory.
[ "Installs", "the", "JvmTypeProvider", "optionally", "including", "index", "access", "into", "the", "{" ]
74fbda7782c07f6051c75c00ad1d63a6dcc0829f
https://github.com/marc-christian-schulze/structs4java/blob/74fbda7782c07f6051c75c00ad1d63a6dcc0829f/structs4java-maven-plugin/src/main/java/org/structs4java/StructsBatchCompiler.java#L368-L377
test
Install the jvm type provider.
Of course, here is the Java code you requested: ```java protected void installJvmTypeProvider(XtextResourceSet resourceSet, File tmpClassDirectory, boolean skipIndexLookup) { if (skipIndexLookup) { internalInstallJvmTypeProvider(resourceSet, tmpClassDirectory, skipIndexLookup); } else { // delegate to the...
groupon/Novie
novie-core/src/main/java/com/groupon/novie/internal/controllers/ApiController.java
ApiController.processRequest
@SuppressWarnings("unchecked") private Report processRequest(String schema, HttpServletRequest request) throws ServiceException, InvalidParameterException, InvalidSchemaException { long begin = System.currentTimeMillis(); SchemaDefinition config = schemaRepository.getStarSchemaConfig(s...
java
@SuppressWarnings("unchecked") private Report processRequest(String schema, HttpServletRequest request) throws ServiceException, InvalidParameterException, InvalidSchemaException { long begin = System.currentTimeMillis(); SchemaDefinition config = schemaRepository.getStarSchemaConfig(s...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "Report", "processRequest", "(", "String", "schema", ",", "HttpServletRequest", "request", ")", "throws", "ServiceException", ",", "InvalidParameterException", ",", "InvalidSchemaException", "{", "long", "be...
<p> Generic processor of all types of requests. </p> <p> Validates schema availability, mandatory fields for the specified schema and creates chains of {@link QueryParameterAware} to be processed by the underlying {@link GenericSchemaService}. </p> @param schema Schema from where to extract the information. @param re...
[ "<p", ">", "Generic", "processor", "of", "all", "types", "of", "requests", ".", "<", "/", "p", ">", "<p", ">", "Validates", "schema", "availability", "mandatory", "fields", "for", "the", "specified", "schema", "and", "creates", "chains", "of", "{", "@link"...
dc0a96652499c8abfc2b990b864a378d794a5234
https://github.com/groupon/Novie/blob/dc0a96652499c8abfc2b990b864a378d794a5234/novie-core/src/main/java/com/groupon/novie/internal/controllers/ApiController.java#L211-L262
test
Process a request to retrieve a report object from the database.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") private Report processRequest(String schema, HttpServletRequest request) throws ServiceException, InvalidParameterException, InvalidSchemaException { long begin = System.currentTimeMillis(); SchemaD...
spring-projects/spring-security
core/src/main/java/org/springframework/security/provisioning/JdbcUserDetailsManager.java
JdbcUserDetailsManager.loadUsersByUsername
protected List<UserDetails> loadUsersByUsername(String username) { return getJdbcTemplate().query(getUsersByUsernameQuery(), new String[]{username}, (rs, rowNum) -> { String userName = rs.getString(1); String password = rs.getString(2); boolean enabled = rs.getBoolean(3); boolean accLocked =...
java
protected List<UserDetails> loadUsersByUsername(String username) { return getJdbcTemplate().query(getUsersByUsernameQuery(), new String[]{username}, (rs, rowNum) -> { String userName = rs.getString(1); String password = rs.getString(2); boolean enabled = rs.getBoolean(3); boolean accLocked =...
[ "protected", "List", "<", "UserDetails", ">", "loadUsersByUsername", "(", "String", "username", ")", "{", "return", "getJdbcTemplate", "(", ")", ".", "query", "(", "getUsersByUsernameQuery", "(", ")", ",", "new", "String", "[", "]", "{", "username", "}", ","...
Executes the SQL <tt>usersByUsernameQuery</tt> and returns a list of UserDetails objects. There should normally only be one matching user.
[ "Executes", "the", "SQL", "<tt", ">", "usersByUsernameQuery<", "/", "tt", ">", "and", "returns", "a", "list", "of", "UserDetails", "objects", ".", "There", "should", "normally", "only", "be", "one", "matching", "user", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/provisioning/JdbcUserDetailsManager.java#L153-L174
test
Load users by username.
Of course, here is the Java code you requested: ```java protected List<UserDetails> loadUsersByUsername(String username) { return getJdbcTemplate().query(getUsersByUsernameQuery(), new String[]{username}, (rs, rowNum) -> { String userName = rs.getString(1); String password = rs.getString(2); bool...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java
Generator.toGetterMethod
private String toGetterMethod(String attrName) { char[] attrChars = attrName.toCharArray(); attrChars[0] = Character.toUpperCase(attrChars[0]); return "get" + new String(attrChars) + "()"; }
java
private String toGetterMethod(String attrName) { char[] attrChars = attrName.toCharArray(); attrChars[0] = Character.toUpperCase(attrChars[0]); return "get" + new String(attrChars) + "()"; }
[ "private", "String", "toGetterMethod", "(", "String", "attrName", ")", "{", "char", "[", "]", "attrChars", "=", "attrName", ".", "toCharArray", "(", ")", ";", "attrChars", "[", "0", "]", "=", "Character", ".", "toUpperCase", "(", "attrChars", "[", "0", "...
/* Generates the getter method for the given attribute name.
[ "/", "*", "Generates", "the", "getter", "method", "for", "the", "given", "attribute", "name", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Generator.java#L3877-L3881
test
To get getter method.
Of course, here is the Java code you requested: ```java private String toGetterMethod(String attrName) { char[] attrChars = attrName.toCharArray(); attrChars[0] = Character.toUpperCase(attrChars[0]); return "get" + new String(attrChars) + "()"; } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java
ElementEditor.getNextSibling
public static Element getNextSibling(Element element, String[] names) { Assert.isTrue(isDAVElement(element)); Assert.isNotNull(names); Node sibling = element.getNextSibling(); while (sibling != null) { for (int i = 0; i < names.length; ++i) if (isDAVElement(si...
java
public static Element getNextSibling(Element element, String[] names) { Assert.isTrue(isDAVElement(element)); Assert.isNotNull(names); Node sibling = element.getNextSibling(); while (sibling != null) { for (int i = 0; i < names.length; ++i) if (isDAVElement(si...
[ "public", "static", "Element", "getNextSibling", "(", "Element", "element", ",", "String", "[", "]", "names", ")", "{", "Assert", ".", "isTrue", "(", "isDAVElement", "(", "element", ")", ")", ";", "Assert", ".", "isNotNull", "(", "names", ")", ";", "Node...
Returns the first WebDAV sibling of the given element that has one of the given names, or <code>null</code> if no such sibling exists. Only the sibling's next children (not the previous children) are searched. The element must not be <code>null</code> and must be a WebDAV element. The possible names of the sibling to ...
[ "Returns", "the", "first", "WebDAV", "sibling", "of", "the", "given", "element", "that", "has", "one", "of", "the", "given", "names", "or", "<code", ">", "null<", "/", "code", ">", "if", "no", "such", "sibling", "exists", ".", "Only", "the", "sibling", ...
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java#L1050-L1061
test
Get the next sibling element.
Of course, here is the Java code you requested: ```java public static Element getNextSibling(Element element, String[] names) { Assert.isTrue(isDAVElement(element)); Assert.isNotNull(names); Node sibling = element.getNextSibling(); while (sibling != null) { for (int i = 0; i...
Unidata/thredds
cdm/src/main/java/ucar/nc2/Variable.java
Variable.getShape
public int[] getShape() { int[] result = new int[shape.length]; // optimization over clone() System.arraycopy(shape, 0, result, 0, shape.length); return result; }
java
public int[] getShape() { int[] result = new int[shape.length]; // optimization over clone() System.arraycopy(shape, 0, result, 0, shape.length); return result; }
[ "public", "int", "[", "]", "getShape", "(", ")", "{", "int", "[", "]", "result", "=", "new", "int", "[", "shape", ".", "length", "]", ";", "// optimization over clone()", "System", ".", "arraycopy", "(", "shape", ",", "0", ",", "result", ",", "0", ",...
Get the shape: length of Variable in each dimension. A scalar (rank 0) will have an int[0] shape. @return int array whose length is the rank of this Variable and whose values equal the length of that Dimension.
[ "Get", "the", "shape", ":", "length", "of", "Variable", "in", "each", "dimension", ".", "A", "scalar", "(", "rank", "0", ")", "will", "have", "an", "int", "[", "0", "]", "shape", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/Variable.java#L104-L108
test
Get the shape of the node.
Of course, here is the Java code you requested: ```java public int[] getShape() { int[] result = new int[shape.length]; // optimization over clone() System.arraycopy(shape, 0, result, 0, shape.length); return result; } ``` Hope this helps!
Unidata/thredds
opendap/src/main/java/opendap/dap/DDS.java
DDS.getDDSText
public String getDDSText() { StringWriter sw = new StringWriter(); this.print(new PrintWriter(sw)); return sw.toString(); }
java
public String getDDSText() { StringWriter sw = new StringWriter(); this.print(new PrintWriter(sw)); return sw.toString(); }
[ "public", "String", "getDDSText", "(", ")", "{", "StringWriter", "sw", "=", "new", "StringWriter", "(", ")", ";", "this", ".", "print", "(", "new", "PrintWriter", "(", "sw", ")", ")", ";", "return", "sw", ".", "toString", "(", ")", ";", "}" ]
This a wrapper method for <code>DDS.print()</code>. @return The output of <code>DDS.print()</code> as <code>String</code> @see #print(PrintWriter)
[ "This", "a", "wrapper", "method", "for", "<code", ">", "DDS", ".", "print", "()", "<", "/", "code", ">", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DDS.java#L2194-L2199
test
Get the DDF text for this class.
Of course, here is the Java code you requested: ```java public String getDDSText() { StringWriter sw = new StringWriter(); this.print(new PrintWriter(sw)); return sw.toString(); } ``` Hope this helps!
phax/ph-math
ph-math/src/main/java/com/helger/numbercruncher/mathutils/Complex.java
Complex.subtract
public Complex subtract (final Complex z) { return new Complex (m_fReal - z.real (), m_fImaginary - z.imaginary ()); }
java
public Complex subtract (final Complex z) { return new Complex (m_fReal - z.real (), m_fImaginary - z.imaginary ()); }
[ "public", "Complex", "subtract", "(", "final", "Complex", "z", ")", "{", "return", "new", "Complex", "(", "m_fReal", "-", "z", ".", "real", "(", ")", ",", "m_fImaginary", "-", "z", ".", "imaginary", "(", ")", ")", ";", "}" ]
Subtract another complex number from this one. @param z the other complex number @return a new complex number that is the difference
[ "Subtract", "another", "complex", "number", "from", "this", "one", "." ]
9f998870c7e05226e032b1f38c23e7d45ec0169d
https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/mathutils/Complex.java#L103-L106
test
Subtracts another complex number from this number.
Of course, here is the Java code you requested: ```java public Complex subtract (final Complex z) { return new Complex (m_fReal - z.real (), m_fImaginary - z.imaginary ()); } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.kie.eclipse.navigator/src/main/java/org/kie/eclipse/navigator/view/actions/dialogs/AbstractKieRequestDialog.java
AbstractKieRequestDialog.createDialogArea
@Override protected Control createDialogArea(Composite parent) { Composite parentComposite = (Composite)super.createDialogArea(parent); Composite composite = new Composite(parentComposite, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); composite.setLayout(new GridLayout(3,fal...
java
@Override protected Control createDialogArea(Composite parent) { Composite parentComposite = (Composite)super.createDialogArea(parent); Composite composite = new Composite(parentComposite, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); composite.setLayout(new GridLayout(3,fal...
[ "@", "Override", "protected", "Control", "createDialogArea", "(", "Composite", "parent", ")", "{", "Composite", "parentComposite", "=", "(", "Composite", ")", "super", ".", "createDialogArea", "(", "parent", ")", ";", "Composite", "composite", "=", "new", "Compo...
/* (non-Javadoc) @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.kie.eclipse.navigator/src/main/java/org/kie/eclipse/navigator/view/actions/dialogs/AbstractKieRequestDialog.java#L68-L77
test
Create the dialog area.
Of course, here is the Java code you requested: ```java @Override protected Control createDialogArea(Composite parent) { Composite parentComposite = (Composite)super.createDialogArea(parent); Composite composite = new Composite(parentComposite, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL,...
stanfy/enroscar
ui/src/main/java/com/stanfy/enroscar/views/GUIUtils.java
GUIUtils.find
@SuppressWarnings("unchecked") public static <T extends View> T find(final Activity activity, final int id) { final View result = activity.findViewById(id); return (T)result; }
java
@SuppressWarnings("unchecked") public static <T extends View> T find(final Activity activity, final int id) { final View result = activity.findViewById(id); return (T)result; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", "extends", "View", ">", "T", "find", "(", "final", "Activity", "activity", ",", "final", "int", "id", ")", "{", "final", "View", "result", "=", "activity", ".", "findViewById...
Find view by ID. @param activity activity to search in @param id view identifier @param <T> view type @return view instance, null if nothing was found @see Activity#findViewById(int)
[ "Find", "view", "by", "ID", "." ]
0e64f3c309d62e359b55ddcba10e3cc592f5e083
https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/ui/src/main/java/com/stanfy/enroscar/views/GUIUtils.java#L214-L218
test
Find view by id.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T extends View> T find(final Activity activity, final int id) { final View result = activity.findViewById(id); return (T)result; } ``` Hope this helps!
lessthanoptimal/GeoRegression
main/src/georegression/metric/ClosestPoint2D_F64.java
ClosestPoint2D_F64.closestPointT
public static double closestPointT( LineParametric2D_F64 line, double x, double y, double scale ) { double sx = line.slope.x/scale; double sy = line.slope.y/scale; double t = sx * ( x - line.p.x ) + sy * ( y - line.p.y ); t /= sx * sx + sy * sy; return t; }
java
public static double closestPointT( LineParametric2D_F64 line, double x, double y, double scale ) { double sx = line.slope.x/scale; double sy = line.slope.y/scale; double t = sx * ( x - line.p.x ) + sy * ( y - line.p.y ); t /= sx * sx + sy * sy; return t; }
[ "public", "static", "double", "closestPointT", "(", "LineParametric2D_F64", "line", ",", "double", "x", ",", "double", "y", ",", "double", "scale", ")", "{", "double", "sx", "=", "line", ".", "slope", ".", "x", "/", "scale", ";", "double", "sy", "=", "...
<p> Computes the closest point along the line as a function of 't':<br> [x, y] = [x_0, y_0] + t·[slopeX, slopeY] </p> @param line The line along which the closest point is being found. Not modified. @param scale Scale factor. used to avoid numerical issues @param x Point's x-coordinate @param y Point's y-coordinate @r...
[ "<p", ">", "Computes", "the", "closest", "point", "along", "the", "line", "as", "a", "function", "of", "t", ":", "<br", ">", "[", "x", "y", "]", "=", "[", "x_0", "y_0", "]", "+", "t·", "[", "slopeX", "slopeY", "]", "<", "/", "p", ">" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/ClosestPoint2D_F64.java#L160-L168
test
Computes the t - value of the closest point in the line
Of course, here is the Java code you requested: ```java public static double closestPointT( LineParametric2D_F64 line, double x, double y, double scale ) { double sx = line.slope.x/scale; double sy = line.slope.y/scale; double t = sx * ( x - line.p.x ) + sy * ( y - line.p.y ); t /= sx * sx + sy * sy; retur...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/classic/net/SocketNode.java
SocketNode.run
public void run() { try { hardenedLoggingEventInputStream = new HardenedLoggingEventInputStream(new BufferedInputStream(socket.getInputStream())); } catch (Exception e) { logger.error("Could not open ObjectInputStream to " + socket, e); closed = true; } ILoggingEvent event; Logge...
java
public void run() { try { hardenedLoggingEventInputStream = new HardenedLoggingEventInputStream(new BufferedInputStream(socket.getInputStream())); } catch (Exception e) { logger.error("Could not open ObjectInputStream to " + socket, e); closed = true; } ILoggingEvent event; Logge...
[ "public", "void", "run", "(", ")", "{", "try", "{", "hardenedLoggingEventInputStream", "=", "new", "HardenedLoggingEventInputStream", "(", "new", "BufferedInputStream", "(", "socket", ".", "getInputStream", "(", ")", ")", ")", ";", "}", "catch", "(", "Exception"...
}
[ "}" ]
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/classic/net/SocketNode.java#L70-L108
test
This method is run by the server.
Of course, here is the Java code you requested: ```java public void run() { try { hardenedLoggingEventInputStream = new HardenedLoggingEventInputStream(new BufferedInputStream(socket.getInputStream())); } catch (Exception e) { logger.error("Could not open ObjectInputStream to " + socket, e); ...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_1.java
OpenImmo_1_2_1.upgradeEnergiepassElements
protected void upgradeEnergiepassElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass", doc).selectNodes(doc); for (Object item : nodes) { Element parentNode = (...
java
protected void upgradeEnergiepassElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass", doc).selectNodes(doc); for (Object item : nodes) { Element parentNode = (...
[ "protected", "void", "upgradeEnergiepassElements", "(", "Document", "doc", ")", "throws", "JaxenException", "{", "List", "nodes", "=", "XmlUtils", ".", "newXPath", "(", "\"/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass\"", ",", "doc", ")", ".", "s...
Upgrade &lt;energiepass&gt; elements to OpenImmo 1.2.1. <p> Make sure, that a valid value for &lt;art&gt; is used. <p> Remove unsupported &lt;heizwert&gt; element. <p> Replace &lt;energiebedarf&gt;, &lt;skala&gt; with &lt;energieverbrauchkennwert&gt; or &lt;endenergiebedarf&gt; according to the provided &lt;art&gt;. @...
[ "Upgrade", "&lt", ";", "energiepass&gt", ";", "elements", "to", "OpenImmo", "1", ".", "2", ".", "1", ".", "<p", ">", "Make", "sure", "that", "a", "valid", "value", "for", "&lt", ";", "art&gt", ";", "is", "used", ".", "<p", ">", "Remove", "unsupported...
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_1.java#L259-L316
test
Upgrade the energiepass elements.
Of course, here is the Java code you requested: ```java protected void upgradeEnergiepassElements(Document doc) throws JaxenException { List nodes = XmlUtils.newXPath( "/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass", doc).selectNodes(doc); for (...
RestComm/jain-slee
container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/SbbEntityLockFacility.java
SbbEntityLockFacility.onNodeRemovedEvent
@CacheEntryRemoved public void onNodeRemovedEvent(CacheEntryRemovedEvent event) { if(!event.isOriginLocal() && !event.isPre()) { // remote node removal Fqn fqn = ((NodeKey)event.getKey()).getFqn(); if (fqn != null) { if(doInfoLogs) { logger.info("onNodeRemovedEvent( fqn = "+fqn+", size = "+fqn.size...
java
@CacheEntryRemoved public void onNodeRemovedEvent(CacheEntryRemovedEvent event) { if(!event.isOriginLocal() && !event.isPre()) { // remote node removal Fqn fqn = ((NodeKey)event.getKey()).getFqn(); if (fqn != null) { if(doInfoLogs) { logger.info("onNodeRemovedEvent( fqn = "+fqn+", size = "+fqn.size...
[ "@", "CacheEntryRemoved", "public", "void", "onNodeRemovedEvent", "(", "CacheEntryRemovedEvent", "event", ")", "{", "if", "(", "!", "event", ".", "isOriginLocal", "(", ")", "&&", "!", "event", ".", "isPre", "(", ")", ")", "{", "// remote node removal", "Fqn", ...
/* private class DataRemovaClusterListener implements DataRemovalListener { private final Fqn<?> baseFqn = null; @SuppressWarnings("unchecked") public void dataRemoved(Fqn arg0) { final SbbEntityID sbbEntityId = (SbbEntityID) arg0.getLastElement(); if(locks.remove(sbbEntityId) != null) { if(doTraceLogs) { logger.trac...
[ "/", "*", "private", "class", "DataRemovaClusterListener", "implements", "DataRemovalListener", "{" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/SbbEntityLockFacility.java#L134-L187
test
Called when a remote node is removed from the cache.
Of course, here is the Java code you requested: ```java @CacheEntryRemoved public void onNodeRemovedEvent(CacheEntryRemovedEvent event) { if(!event.isOriginLocal() && !event.isPre()) { // remote node removal Fqn fqn = ((NodeKey)event.getKey()).getFqn(); if (fqn != null) { if(doInfoLogs) { logger.i...
deeplearning4j/nd4j
nd4j-common/src/main/java/org/nd4j/util/ReflectionUtils.java
ReflectionUtils.getClass
@SuppressWarnings("unchecked") public static <T> Class<T> getClass(T o) { return (Class<T>) o.getClass(); }
java
@SuppressWarnings("unchecked") public static <T> Class<T> getClass(T o) { return (Class<T>) o.getClass(); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Class", "<", "T", ">", "getClass", "(", "T", "o", ")", "{", "return", "(", "Class", "<", "T", ">", ")", "o", ".", "getClass", "(", ")", ";", "}" ]
Return the correctly-typed {@link Class} of the given object. @param o object whose correctly-typed <code>Class</code> is to be obtained @return the correctly typed <code>Class</code> of the given object.
[ "Return", "the", "correctly", "-", "typed", "{", "@link", "Class", "}", "of", "the", "given", "object", "." ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/util/ReflectionUtils.java#L108-L111
test
Get the class of the object.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T> Class<T> getClass(T o) { return (Class<T>) o.getClass(); } ``` Hope this helps!
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormContainerClient.java
FormContainerClient.lockFormContainer
public Form lockFormContainer( Form formParam, JobView jobViewParam, User userToLockAsParam ) { if(this.serviceTicket != null && formParam != null) { formParam.setServiceTicket(this.serviceTicket); } Long jobViewId = (jobViewParam == null) ? ...
java
public Form lockFormContainer( Form formParam, JobView jobViewParam, User userToLockAsParam ) { if(this.serviceTicket != null && formParam != null) { formParam.setServiceTicket(this.serviceTicket); } Long jobViewId = (jobViewParam == null) ? ...
[ "public", "Form", "lockFormContainer", "(", "Form", "formParam", ",", "JobView", "jobViewParam", ",", "User", "userToLockAsParam", ")", "{", "if", "(", "this", ".", "serviceTicket", "!=", "null", "&&", "formParam", "!=", "null", ")", "{", "formParam", ".", "...
Lock the provided form container for logged in user. If {@code userToLockAsParam} is provided and valid, that user will be used instead. @param formParam The form to lock. @param jobViewParam If retrieved from a view, the lock to view from. @param userToLockAsParam The form will be locked as this user. The logged in u...
[ "Lock", "the", "provided", "form", "container", "for", "logged", "in", "user", ".", "If", "{", "@code", "userToLockAsParam", "}", "is", "provided", "and", "valid", "that", "user", "will", "be", "used", "instead", "." ]
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#L306-L332
test
Method to lock a form container.
Of course, here is the Java code you requested: ```java public Form lockFormContainer( Form formParam, JobView jobViewParam, User userToLockAsParam ) { if(this.serviceTicket != null && formParam != null) { formParam.setServiceTicket(this.serviceTicket); ...
ebourgeois/protobuf-serializer
src/main/java/ca/jeb/protobuf/internal/ProtobufSerializerUtils.java
ProtobufSerializerUtils.getProtobufGetter
public static final String getProtobufGetter(ProtobufAttribute protobufAttribute, Field field) { final String fieldName = field.getName(); final String upperClassName = field.getDeclaringClass().getCanonicalName(); // Look at the cache first Map<String, String> map = CLASS_TO_FIELD_GETTERS_MAP_CACHE.g...
java
public static final String getProtobufGetter(ProtobufAttribute protobufAttribute, Field field) { final String fieldName = field.getName(); final String upperClassName = field.getDeclaringClass().getCanonicalName(); // Look at the cache first Map<String, String> map = CLASS_TO_FIELD_GETTERS_MAP_CACHE.g...
[ "public", "static", "final", "String", "getProtobufGetter", "(", "ProtobufAttribute", "protobufAttribute", ",", "Field", "field", ")", "{", "final", "String", "fieldName", "=", "field", ".", "getName", "(", ")", ";", "final", "String", "upperClassName", "=", "fi...
Retrieve the getter against the Protobuf class; default is to is "get" plus upper case first character of the field name. @param protobufAttribute - {@link ProtobufAttribute} @param field - {@link Field} @return String
[ "Retrieve", "the", "getter", "against", "the", "Protobuf", "class", ";", "default", "is", "to", "is", "get", "plus", "upper", "case", "first", "character", "of", "the", "field", "name", "." ]
c87fe6e5ebe6f0e77bf61f1bb661db5a7a5f9d8e
https://github.com/ebourgeois/protobuf-serializer/blob/c87fe6e5ebe6f0e77bf61f1bb661db5a7a5f9d8e/src/main/java/ca/jeb/protobuf/internal/ProtobufSerializerUtils.java#L241-L275
test
Get the getter for the given field.
Of course, here is the Java code you requested: ```java public static final String getProtobufGetter(ProtobufAttribute protobufAttribute, Field field) { final String fieldName = field.getName(); final String upperClassName = field.getDeclaringClass().getCanonicalName(); // Look at the cache first Map...
Unidata/thredds
legacy/src/main/java/thredds/catalog/InvDatasetScan.java
InvDatasetScan.translatePathToLocation
public String translatePathToLocation( String dsPath ) { if ( dsPath == null ) return null; if ( dsPath.length() > 0 ) if ( dsPath.startsWith( "/" ) ) dsPath = dsPath.substring( 1 ); if ( ! dsPath.startsWith( this.getPath())) return null; // remove the matching part, the rest is...
java
public String translatePathToLocation( String dsPath ) { if ( dsPath == null ) return null; if ( dsPath.length() > 0 ) if ( dsPath.startsWith( "/" ) ) dsPath = dsPath.substring( 1 ); if ( ! dsPath.startsWith( this.getPath())) return null; // remove the matching part, the rest is...
[ "public", "String", "translatePathToLocation", "(", "String", "dsPath", ")", "{", "if", "(", "dsPath", "==", "null", ")", "return", "null", ";", "if", "(", "dsPath", ".", "length", "(", ")", ">", "0", ")", "if", "(", "dsPath", ".", "startsWith", "(", ...
Return the CrawlableDataset path/location that corresponds to the given dataset path. The given dataset path must start with the datasetScan path for this InvDatasetScan, if not, a null is returned. @param dsPath a datasetScan dsPath that @return the CrawlableDataset path that corresponds to the given dataset path or ...
[ "Return", "the", "CrawlableDataset", "path", "/", "location", "that", "corresponds", "to", "the", "given", "dataset", "path", ".", "The", "given", "dataset", "path", "must", "start", "with", "the", "datasetScan", "path", "for", "this", "InvDatasetScan", "if", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/InvDatasetScan.java#L435-L456
test
translatePathToLocation Method.
Of course, here is the Java code you requested: ```java public String translatePathToLocation( String dsPath ) { if ( dsPath == null ) return null; if ( dsPath.length() > 0 ) if ( dsPath.startsWith( "/" ) ) dsPath = dsPath.substring( 1 ); if ( ! dsPath.startsWith( this.getPath())) r...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/TableMetadataDataSource.java
TableMetadataDataSource.create
public void create(TableMetadata metadata) { ContentValues values = new ContentValues(); values.put(TableMetadata.COLUMN_GEOPACKAGE_ID, metadata.getGeoPackageId()); values.put(TableMetadata.COLUMN_TABLE_NAME, metadata.getTableName()); values.put(TableMetadata.COLUMN_LAST_INDEXED, metadat...
java
public void create(TableMetadata metadata) { ContentValues values = new ContentValues(); values.put(TableMetadata.COLUMN_GEOPACKAGE_ID, metadata.getGeoPackageId()); values.put(TableMetadata.COLUMN_TABLE_NAME, metadata.getTableName()); values.put(TableMetadata.COLUMN_LAST_INDEXED, metadat...
[ "public", "void", "create", "(", "TableMetadata", "metadata", ")", "{", "ContentValues", "values", "=", "new", "ContentValues", "(", ")", ";", "values", ".", "put", "(", "TableMetadata", ".", "COLUMN_GEOPACKAGE_ID", ",", "metadata", ".", "getGeoPackageId", "(", ...
Create a new table metadata @param metadata table metadata
[ "Create", "a", "new", "table", "metadata" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/TableMetadataDataSource.java#L44-L59
test
Create the table metadata
Of course, here is the Java code you requested: ```java public void create(TableMetadata metadata) { ContentValues values = new ContentValues(); values.put(TableMetadata.COLUMN_GEOPACKAGE_ID, metadata.getGeoPackageId()); values.put(TableMetadata.COLUMN_TABLE_NAME, metadata.getTableName()); ...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.never
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") public static <T> Observable<T> never() { return RxJavaPlugins.onAssembly((Observable<T>) ObservableNever.INSTANCE); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") public static <T> Observable<T> never() { return RxJavaPlugins.onAssembly((Observable<T>) ObservableNever.INSTANCE); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Observable", "<", "T", ">", "never", "(", ")", "{", "return", "RxJavaPlugins", ...
Returns an Observable that never sends any items or notifications to an {@link Observer}. <p> <img width="640" height="185" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/never.png" alt=""> <p> This ObservableSource is useful primarily for testing purposes. <dl> <dt><b>Scheduler:</b></dt> <dd>{@c...
[ "Returns", "an", "Observable", "that", "never", "sends", "any", "items", "or", "notifications", "to", "an", "{", "@link", "Observer", "}", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "185", "src", "=", "https", ":", "//", "raw", ".", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L3586-L3591
test
Never returns an observable that emits an exception if the source is not a CID .
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) @SuppressWarnings("unchecked") public static <T> Observable<T> never() { return RxJavaPlugins.onAssembly((Observable<T>) ObservableNever.INSTANCE); } ``` Hope this helps!
jcodec/jcodec
src/main/java/net/sourceforge/jaad/aac/ps/PSFilterbank.java
PSFilterbank.channel_filter8
void channel_filter8(int frame_len, float[] filter, float[][] buffer, float[][][] X_hybrid) { int i, n; float[] input_re1 = new float[4], input_re2 = new float[4]; float[] input_im1 = new float[4], input_im2 = new float[4]; float[] x = new float[4]; for(i = 0; i<frame_len; i++) { input_re1[0] = (filter[...
java
void channel_filter8(int frame_len, float[] filter, float[][] buffer, float[][][] X_hybrid) { int i, n; float[] input_re1 = new float[4], input_re2 = new float[4]; float[] input_im1 = new float[4], input_im2 = new float[4]; float[] x = new float[4]; for(i = 0; i<frame_len; i++) { input_re1[0] = (filter[...
[ "void", "channel_filter8", "(", "int", "frame_len", ",", "float", "[", "]", "filter", ",", "float", "[", "]", "[", "]", "buffer", ",", "float", "[", "]", "[", "]", "[", "]", "X_hybrid", ")", "{", "int", "i", ",", "n", ";", "float", "[", "]", "i...
/* complex filter, size 8
[ "/", "*", "complex", "filter", "size", "8" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/net/sourceforge/jaad/aac/ps/PSFilterbank.java#L221-L285
test
This function is used to filter the 8 - dimensional data.
Of course, here is the Java code you requested: ```java void channel_filter8(int frame_len, float[] filter, float[][] buffer, float[][][] X_hybrid) { int i, n; float[] input_re1 = new float[4], input_re2 = new float[4]; float[] input_im1 = new float[4], input_im2 = new float[4]; float[] x = new float[4]; ...
RestComm/jain-slee
container/usage/src/main/java/org/mobicents/slee/container/management/jmx/ServiceUsageMBeanImpl.java
ServiceUsageMBeanImpl.getUsageParameterSets
public synchronized String[] getUsageParameterSets(SbbID sbbId) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, ManagementException { if (sbbId == null) throw new NullPointerException("Sbb ID is null!"); // get the sbb component SbbComponent sbbComponent = sle...
java
public synchronized String[] getUsageParameterSets(SbbID sbbId) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, ManagementException { if (sbbId == null) throw new NullPointerException("Sbb ID is null!"); // get the sbb component SbbComponent sbbComponent = sle...
[ "public", "synchronized", "String", "[", "]", "getUsageParameterSets", "(", "SbbID", "sbbId", ")", "throws", "NullPointerException", ",", "UnrecognizedSbbException", ",", "InvalidArgumentException", ",", "ManagementException", "{", "if", "(", "sbbId", "==", "null", ")...
This method returns a list containing the names of the named SBB usage parameter sets that belong to the SBB specified by the sbbID argument and the Service represented by the ServiceUsageMBean object. @see javax.slee.management.ServiceUsageMBean#getUsageParameterSets(javax.slee.SbbID)
[ "This", "method", "returns", "a", "list", "containing", "the", "names", "of", "the", "named", "SBB", "usage", "parameter", "sets", "that", "belong", "to", "the", "SBB", "specified", "by", "the", "sbbID", "argument", "and", "the", "Service", "represented", "b...
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/usage/src/main/java/org/mobicents/slee/container/management/jmx/ServiceUsageMBeanImpl.java#L454-L491
test
Gets the usage parameter sets for the specified SBB.
Of course, here is the Java code you requested: ```java public synchronized String[] getUsageParameterSets(SbbID sbbId) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, ManagementException { if (sbbId == null) throw new NullPointerException("Sbb ID is null!"); //...
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/FileHelper.java
FileHelper.serializeObjectToFile
public static void serializeObjectToFile(File targetFile, Serializable serializable) { FileOutputStream fileOutputStream = null; ObjectOutputStream objectOutputStream = null; try { fileOutputStream = new FileOutputStream(targetFile); try { objectOutputStre...
java
public static void serializeObjectToFile(File targetFile, Serializable serializable) { FileOutputStream fileOutputStream = null; ObjectOutputStream objectOutputStream = null; try { fileOutputStream = new FileOutputStream(targetFile); try { objectOutputStre...
[ "public", "static", "void", "serializeObjectToFile", "(", "File", "targetFile", ",", "Serializable", "serializable", ")", "{", "FileOutputStream", "fileOutputStream", "=", "null", ";", "ObjectOutputStream", "objectOutputStream", "=", "null", ";", "try", "{", "fileOutp...
将对象写入文件 <br> 2013-9-6 下午1:08:58 @param targetFile @param serializable
[ "将对象写入文件", "<br", ">", "2013", "-", "9", "-", "6", "下午1", ":", "08", ":", "58" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/FileHelper.java#L826-L843
test
Serialize object to a file.
Of course, here is the Java code you requested: ```java public static void serializeObjectToFile(File targetFile, Serializable serializable) { FileOutputStream fileOutputStream = null; ObjectOutputStream objectOutputStream = null; try { fileOutputStream = new FileOutputStream(target...
Unidata/thredds
opendap/src/main/java/opendap/servlet/ascii/asciiSeq.java
asciiSeq.toASCII
public void toASCII(PrintWriter pw, boolean addName, String rootName, boolean newLine) { if (_Debug) System.out.println("asciiSeq.toASCII(" + addName + ",'" + rootName + "') getName(): " + getEncodedName()); //System.out.pri...
java
public void toASCII(PrintWriter pw, boolean addName, String rootName, boolean newLine) { if (_Debug) System.out.println("asciiSeq.toASCII(" + addName + ",'" + rootName + "') getName(): " + getEncodedName()); //System.out.pri...
[ "public", "void", "toASCII", "(", "PrintWriter", "pw", ",", "boolean", "addName", ",", "String", "rootName", ",", "boolean", "newLine", ")", "{", "if", "(", "_Debug", ")", "System", ".", "out", ".", "println", "(", "\"asciiSeq.toASCII(\"", "+", "addName", ...
Returns a string representation of the variables value. This is really foreshadowing functionality for Server types, but as it may come in useful for clients it is added here. Simple types (example: DFloat32) will return a single value. DConstuctor and DVector types will be flattened. DStrings and DURL's will have doub...
[ "Returns", "a", "string", "representation", "of", "the", "variables", "value", ".", "This", "is", "really", "foreshadowing", "functionality", "for", "Server", "types", "but", "as", "it", "may", "come", "in", "useful", "for", "clients", "it", "is", "added", "...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servlet/ascii/asciiSeq.java#L83-L135
test
Write the sequence of data to ASCII.
Of course, here is the Java code you requested: ```java public void toASCII(PrintWriter pw, boolean addName, String rootName, boolean newLine) { if (_Debug) System.out.println("asciiSeq.toASCII(" + addName + ",'" + rootName + "') ge...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/KeyMetadata.java
KeyMetadata.setLongId
public void setLongId(P pojo, Long id) { if (!clazz.isAssignableFrom(pojo.getClass())) throw new IllegalArgumentException("Trying to use metadata for " + clazz.getName() + " to set key of " + pojo.getClass().getName()); this.idMeta.getProperty().set(pojo, id); }
java
public void setLongId(P pojo, Long id) { if (!clazz.isAssignableFrom(pojo.getClass())) throw new IllegalArgumentException("Trying to use metadata for " + clazz.getName() + " to set key of " + pojo.getClass().getName()); this.idMeta.getProperty().set(pojo, id); }
[ "public", "void", "setLongId", "(", "P", "pojo", ",", "Long", "id", ")", "{", "if", "(", "!", "clazz", ".", "isAssignableFrom", "(", "pojo", ".", "getClass", "(", ")", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"Trying to use metadata for \...
Sets the numeric id field
[ "Sets", "the", "numeric", "id", "field" ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/KeyMetadata.java#L254-L259
test
Sets the id of the given POJO.
Of course, here is the Java code you requested: ```java public void setLongId(P pojo, Long id) { if (!clazz.isAssignableFrom(pojo.getClass())) throw new IllegalArgumentException("Trying to use metadata for " + clazz.getName() + " to set key of " + pojo.getClass().getName()); this.idMeta.getProperty().set(pojo,...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/learning/AdamUpdater.java
AdamUpdater.applyUpdater
@Override public void applyUpdater(INDArray gradient, int iteration, int epoch) { if (m == null || v == null) throw new IllegalStateException("Updater has not been initialized with view state"); double beta1 = config.getBeta1(); double beta2 = config.getBeta2(); double l...
java
@Override public void applyUpdater(INDArray gradient, int iteration, int epoch) { if (m == null || v == null) throw new IllegalStateException("Updater has not been initialized with view state"); double beta1 = config.getBeta1(); double beta2 = config.getBeta2(); double l...
[ "@", "Override", "public", "void", "applyUpdater", "(", "INDArray", "gradient", ",", "int", "iteration", ",", "int", "epoch", ")", "{", "if", "(", "m", "==", "null", "||", "v", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"Updater has...
Calculate the update based on the given gradient @param gradient the gradient to get the update for @param iteration @return the gradient
[ "Calculate", "the", "update", "based", "on", "the", "given", "gradient" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/learning/AdamUpdater.java#L74-L99
test
This method is called to apply the update to the image
Of course, here is the Java code you requested: ```java @Override public void applyUpdater(INDArray gradient, int iteration, int epoch) { if (m == null || v == null) throw new IllegalStateException("Updater has not been initialized with view state"); double beta1 = config.getBeta1(); ...
js-lib-com/tiny-container
src/main/java/js/servlet/RequestPreprocessor.java
RequestPreprocessor.startsWith
private static boolean startsWith(String requestPath, String pathComponent) { if (requestPath.charAt(0) != '/') { return false; } int i = 1; for (int j = 0; i < requestPath.length(); ++i, ++j) { if (requestPath.charAt(i) == '/') { return j == pathComponent.length(); } if (j == pathCompo...
java
private static boolean startsWith(String requestPath, String pathComponent) { if (requestPath.charAt(0) != '/') { return false; } int i = 1; for (int j = 0; i < requestPath.length(); ++i, ++j) { if (requestPath.charAt(i) == '/') { return j == pathComponent.length(); } if (j == pathCompo...
[ "private", "static", "boolean", "startsWith", "(", "String", "requestPath", ",", "String", "pathComponent", ")", "{", "if", "(", "requestPath", ".", "charAt", "(", "0", ")", "!=", "'", "'", ")", "{", "return", "false", ";", "}", "int", "i", "=", "1", ...
Test if request path starts with path component. This predicate returns true if first path component from given request path equals requested path component. Comparison is not case sensitive. Request path should start with path separator, otherwise this predicate returns false. @param requestPath request path to test,...
[ "Test", "if", "request", "path", "starts", "with", "path", "component", ".", "This", "predicate", "returns", "true", "if", "first", "path", "component", "from", "given", "request", "path", "equals", "requested", "path", "component", ".", "Comparison", "is", "n...
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/servlet/RequestPreprocessor.java#L224-L241
test
Determines if the requestPath starts with the pathComponent.
Of course, here is the Java code you requested: ```java private static boolean startsWith(String requestPath, String pathComponent) { if (requestPath.charAt(0) != '/') { return false; } int i = 1; for (int j = 0; i < requestPath.length(); ++i, ++j) { if (requestPath.charAt(i) == '/') { return ...
RestComm/jain-slee
container/common/src/main/java/org/mobicents/slee/container/deployment/jboss/DeploymentManagerMBeanImpl.java
DeploymentManagerMBeanImpl.clusterInstall
public void clusterInstall(URL deployableUnitURL) throws DeploymentException { try { doPersistentInstall(deployableUnitURL, farmDeployDir); } catch (Exception e) { throw new DeploymentException(e); } }
java
public void clusterInstall(URL deployableUnitURL) throws DeploymentException { try { doPersistentInstall(deployableUnitURL, farmDeployDir); } catch (Exception e) { throw new DeploymentException(e); } }
[ "public", "void", "clusterInstall", "(", "URL", "deployableUnitURL", ")", "throws", "DeploymentException", "{", "try", "{", "doPersistentInstall", "(", "deployableUnitURL", ",", "farmDeployDir", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "...
/* (non-Javadoc) @see org.mobicents.slee.container.deployment.jboss.DeploymentManagerMBean#clusterInstall(java.net.URL)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/container/deployment/jboss/DeploymentManagerMBeanImpl.java#L100-L107
test
This method is called by the OS to install a single cluster of a single unit.
Of course, here is the Java code you requested: ```java public void clusterInstall(URL deployableUnitURL) throws DeploymentException { try { doPersistentInstall(deployableUnitURL, farmDeployDir); } catch (Exception e) { throw new DeploymentException(e); } } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/ma2/StructureMembers.java
StructureMembers.hideMember
public int hideMember(Member m) { if (m == null) return -1; int index = members.indexOf(m); members.remove(m); if (memberHash != null) memberHash.remove(m.getName()); return index; }
java
public int hideMember(Member m) { if (m == null) return -1; int index = members.indexOf(m); members.remove(m); if (memberHash != null) memberHash.remove(m.getName()); return index; }
[ "public", "int", "hideMember", "(", "Member", "m", ")", "{", "if", "(", "m", "==", "null", ")", "return", "-", "1", ";", "int", "index", "=", "members", ".", "indexOf", "(", "m", ")", ";", "members", ".", "remove", "(", "m", ")", ";", "if", "("...
Remove the given member @param m member @return position that it used to occupy, or -1 if not found
[ "Remove", "the", "given", "member" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/StructureMembers.java#L83-L89
test
Hide a member.
Of course, here is the Java code you requested: ```java public int hideMember(Member m) { if (m == null) return -1; int index = members.indexOf(m); members.remove(m); if (memberHash != null) memberHash.remove(m.getName()); return index; } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/grib/Grib2ReportPanel.java
Grib2ReportPanel.doPdsSummary
private void doPdsSummary(Formatter f, MCollection dcm, boolean eachFile) throws IOException { Counters countersAll = new Counters(); countersAll.add("template"); countersAll.add("timeUnit"); countersAll.add("timeOffset"); countersAll.add("timeIntervalSize"); countersAll.add("levelType"); co...
java
private void doPdsSummary(Formatter f, MCollection dcm, boolean eachFile) throws IOException { Counters countersAll = new Counters(); countersAll.add("template"); countersAll.add("timeUnit"); countersAll.add("timeOffset"); countersAll.add("timeIntervalSize"); countersAll.add("levelType"); co...
[ "private", "void", "doPdsSummary", "(", "Formatter", "f", ",", "MCollection", "dcm", ",", "boolean", "eachFile", ")", "throws", "IOException", "{", "Counters", "countersAll", "=", "new", "Counters", "(", ")", ";", "countersAll", ".", "add", "(", "\"template\""...
/////////////////////////////////////////////////
[ "/////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/grib/Grib2ReportPanel.java#L603-L628
test
Prints the summary of the files in the given MCollection.
Of course, here is the Java code you requested: ```java private void doPdsSummary(Formatter f, MCollection dcm, boolean eachFile) throws IOException { Counters countersAll = new Counters(); countersAll.add("template"); countersAll.add("timeUnit"); countersAll.add("timeOffset"); countersAll.add("tim...
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java
ObjectFactory.createTelDurchw
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "tel_durchw") public JAXBElement<String> createTelDurchw(String value) { return new JAXBElement<String>(_TelDurchw_QNAME, String.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "tel_durchw") public JAXBElement<String> createTelDurchw(String value) { return new JAXBElement<String>(_TelDurchw_QNAME, String.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immoxml.de\"", ",", "name", "=", "\"tel_durchw\"", ")", "public", "JAXBElement", "<", "String", ">", "createTelDurchw", "(", "String", "value", ")", "{", "return", "new", "JAXBElement", "<", "String", "...
Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "String", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L1036-L1039
test
Create an instance of a tel durchw element.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immoxml.de", name = "tel_durchw") public JAXBElement<String> createTelDurchw(String value) { return new JAXBElement<String>(_TelDurchw_QNAME, String.class, null, value); } ``` Hope this helps!
wildfly/wildfly
jsf/subsystem/src/main/java/org/jboss/as/jsf/deployment/JSFModuleIdFactory.java
JSFModuleIdFactory.checkVersionIntegrity
private void checkVersionIntegrity() { activeVersions.addAll(allVersions); for (String version : allVersions) { if (!apiIds.containsKey(version)) { JSFLogger.ROOT_LOGGER.missingJSFModule(version, API_MODULE); activeVersions.remove(version); } ...
java
private void checkVersionIntegrity() { activeVersions.addAll(allVersions); for (String version : allVersions) { if (!apiIds.containsKey(version)) { JSFLogger.ROOT_LOGGER.missingJSFModule(version, API_MODULE); activeVersions.remove(version); } ...
[ "private", "void", "checkVersionIntegrity", "(", ")", "{", "activeVersions", ".", "addAll", "(", "allVersions", ")", ";", "for", "(", "String", "version", ":", "allVersions", ")", "{", "if", "(", "!", "apiIds", ".", "containsKey", "(", "version", ")", ")",...
make sure that each version has api, impl, and injection
[ "make", "sure", "that", "each", "version", "has", "api", "impl", "and", "injection" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jsf/subsystem/src/main/java/org/jboss/as/jsf/deployment/JSFModuleIdFactory.java#L136-L155
test
Check if all versions are present in the JSF file.
Of course, here is the Java code you requested: ```java private void checkVersionIntegrity() { activeVersions.addAll(allVersions); for (String version : allVersions) { if (!apiIds.containsKey(version)) { JSFLogger.ROOT_LOGGER.missingJSFModule(version, API_MODULE); ...
OpenEstate/OpenEstate-IO
Examples/src/main/java/org/openestate/io/examples/CasaItReadingExample.java
CasaItReadingExample.read
protected static void read(InputStream xmlInputStream) throws SAXException, IOException, ParserConfigurationException, JAXBException { LOGGER.info("process example file"); CasaItDocument doc = CasaItUtils.createDocument(xmlInputStream); if (doc == null) { LOGGER.warn("> provided XML ...
java
protected static void read(InputStream xmlInputStream) throws SAXException, IOException, ParserConfigurationException, JAXBException { LOGGER.info("process example file"); CasaItDocument doc = CasaItUtils.createDocument(xmlInputStream); if (doc == null) { LOGGER.warn("> provided XML ...
[ "protected", "static", "void", "read", "(", "InputStream", "xmlInputStream", ")", "throws", "SAXException", ",", "IOException", ",", "ParserConfigurationException", ",", "JAXBException", "{", "LOGGER", ".", "info", "(", "\"process example file\"", ")", ";", "CasaItDoc...
Read an {@link InputStream} into a {@link CasaItDocument} and print some of its content to console. @param xmlInputStream the input stream to read @throws SAXException if the file is not readable by the XML parser @throws IOException if the file is not readable @throws ParserConfigurat...
[ "Read", "an", "{", "@link", "InputStream", "}", "into", "a", "{", "@link", "CasaItDocument", "}", "and", "print", "some", "of", "its", "content", "to", "console", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/CasaItReadingExample.java#L116-L124
test
Read the CasaIt XML file.
Of course, here is the Java code you requested: ```java protected static void read(InputStream xmlInputStream) throws SAXException, IOException, ParserConfigurationException, JAXBException { LOGGER.info("process example file"); CasaItDocument doc = CasaItUtils.createDocument(xmlInputStream); if...
oblac/jodd
jodd-core/src/main/java/jodd/util/PropertiesUtil.java
PropertiesUtil.loadFromString
public static void loadFromString(final Properties p, final String data) throws IOException { try (ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes(StringPool.ISO_8859_1))) { p.load(is); } }
java
public static void loadFromString(final Properties p, final String data) throws IOException { try (ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes(StringPool.ISO_8859_1))) { p.load(is); } }
[ "public", "static", "void", "loadFromString", "(", "final", "Properties", "p", ",", "final", "String", "data", ")", "throws", "IOException", "{", "try", "(", "ByteArrayInputStream", "is", "=", "new", "ByteArrayInputStream", "(", "data", ".", "getBytes", "(", "...
Loads properties from string.
[ "Loads", "properties", "from", "string", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/PropertiesUtil.java#L159-L163
test
Load properties from string.
Of course, here is the Java code you requested: ```java public static void loadFromString(final Properties p, final String data) throws IOException { try (ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes(StringPool.ISO_8859_1))) { p.load(is); } } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/util/ArraysUtil.java
ArraysUtil.values
public static short[] values(Short[] array) { short[] dest = new short[array.length]; for (int i = 0; i < array.length; i++) { Short v = array[i]; if (v != null) { dest[i] = v.shortValue(); } } return dest; }
java
public static short[] values(Short[] array) { short[] dest = new short[array.length]; for (int i = 0; i < array.length; i++) { Short v = array[i]; if (v != null) { dest[i] = v.shortValue(); } } return dest; }
[ "public", "static", "short", "[", "]", "values", "(", "Short", "[", "]", "array", ")", "{", "short", "[", "]", "dest", "=", "new", "short", "[", "array", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "array", ".", ...
Converts to primitive array.
[ "Converts", "to", "primitive", "array", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ArraysUtil.java#L1176-L1185
test
Get the values of the Short array.
Of course, here is the Java code you requested: ```java public static short[] values(Short[] array) { short[] dest = new short[array.length]; for (int i = 0; i < array.length; i++) { Short v = array[i]; if (v != null) { dest[i] = v.shortValue(); } } return dest; } ``` Hope this helps!
buschmais/jqa-commandline-tool
application/src/main/java/com/buschmais/jqassistant/commandline/Main.java
Main.main
public static void main(String[] args) { try { DefaultTaskFactoryImpl taskFactory = new DefaultTaskFactoryImpl(); new Main(taskFactory).run(args); } catch (CliExecutionException e) { String message = getErrorMessage(e); LOGGER.error(message); S...
java
public static void main(String[] args) { try { DefaultTaskFactoryImpl taskFactory = new DefaultTaskFactoryImpl(); new Main(taskFactory).run(args); } catch (CliExecutionException e) { String message = getErrorMessage(e); LOGGER.error(message); S...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "try", "{", "DefaultTaskFactoryImpl", "taskFactory", "=", "new", "DefaultTaskFactoryImpl", "(", ")", ";", "new", "Main", "(", "taskFactory", ")", ".", "run", "(", "args", ")", ...
The main method. @param args The command line arguments. @throws IOException If an error occurs.
[ "The", "main", "method", "." ]
c24de584ef4414fca673a75c16f4a533a188481f
https://github.com/buschmais/jqa-commandline-tool/blob/c24de584ef4414fca673a75c16f4a533a188481f/application/src/main/java/com/buschmais/jqassistant/commandline/Main.java#L47-L56
test
Main method.
Of course, here is the Java code you requested: ```java public static void main(String[] args) { try { DefaultTaskFactoryImpl taskFactory = new DefaultTaskFactoryImpl(); new Main(taskFactory).run(args); } catch (CliExecutionException e) { String message = getErrorMes...
GojaFramework/goja
goja-core/src/main/java/goja/core/libs/Images.java
Images.add
public void add(File dest, File file, int position) { if (dest.exists() && !dest.isDirectory()) { String fn = file.getName().toLowerCase(); int opacityType = fn.endsWith(".png") || fn.endsWith("gif") ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB; ...
java
public void add(File dest, File file, int position) { if (dest.exists() && !dest.isDirectory()) { String fn = file.getName().toLowerCase(); int opacityType = fn.endsWith(".png") || fn.endsWith("gif") ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB; ...
[ "public", "void", "add", "(", "File", "dest", ",", "File", "file", ",", "int", "position", ")", "{", "if", "(", "dest", ".", "exists", "(", ")", "&&", "!", "dest", ".", "isDirectory", "(", ")", ")", "{", "String", "fn", "=", "file", ".", "getName...
将指定的图片加入到当前图片中的指定位置. 即向图片中打水印. @param file 要添加的图片文件。 @param position 要添加的图片在当前图片中的位置. <br /> 其取值范围为1-9之间的整数(默认为9)。分别代表:左上、上中、右上、左中、正中、右中、左下、中下、右下
[ "将指定的图片加入到当前图片中的指定位置", ".", "即向图片中打水印", "." ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/libs/Images.java#L172-L242
test
Add a file to the image store.
Of course, here is the Java code you requested: ```java public void add(File dest, File file, int position) { if (dest.exists() && !dest.isDirectory()) { String fn = file.getName().toLowerCase(); int opacityType = fn.endsWith(".png") || fn.endsWith("gif") ? BufferedI...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib2/table/CfsrLocalTables.java
CfsrLocalTables.getForecastTimeIntervalOffset
@Override public int[] getForecastTimeIntervalOffset(Grib2Record gr) { Grib2Pds pds = gr.getPDS(); if (!pds.isTimeInterval()) { return null; } // LOOK this is hack for CFSR monthly combobulation // see http://rda.ucar.edu/datasets/ds093.2/#docs/time_ranges.html int statType = pds.getOc...
java
@Override public int[] getForecastTimeIntervalOffset(Grib2Record gr) { Grib2Pds pds = gr.getPDS(); if (!pds.isTimeInterval()) { return null; } // LOOK this is hack for CFSR monthly combobulation // see http://rda.ucar.edu/datasets/ds093.2/#docs/time_ranges.html int statType = pds.getOc...
[ "@", "Override", "public", "int", "[", "]", "getForecastTimeIntervalOffset", "(", "Grib2Record", "gr", ")", "{", "Grib2Pds", "pds", "=", "gr", ".", "getPDS", "(", ")", ";", "if", "(", "!", "pds", ".", "isTimeInterval", "(", ")", ")", "{", "return", "nu...
Reference time is the start time of the first forecast, other forecasts at 6-hour intervals. Number in Ave = number of forecast used
[ "Reference", "time", "is", "the", "start", "time", "of", "the", "first", "forecast", "other", "forecasts", "at", "6", "-", "hour", "intervals", ".", "Number", "in", "Ave", "=", "number", "of", "forecast", "used" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib2/table/CfsrLocalTables.java#L78-L116
test
Get the offset of the time interval in the record.
Of course, here is the Java code you requested: ```java @Override public int[] getForecastTimeIntervalOffset(Grib2Record gr) { Grib2Pds pds = gr.getPDS(); if (!pds.isTimeInterval()) { return null; } // LOOK this is hack for CFSR monthly combobulation // see http://rda.ucar.edu/datasets/ds0...
orientechnologies/orientdb
server/src/main/java/com/orientechnologies/orient/server/security/authenticator/ODefaultPasswordAuthenticator.java
ODefaultPasswordAuthenticator.getUser
public OServerUserConfiguration getUser(final String username) { OServerUserConfiguration userCfg = null; synchronized (usersMap) { if (username != null) { String checkName = username; if (!isCaseSensitive()) checkName = username.toLowerCase(Locale.ENGLISH); if (usersM...
java
public OServerUserConfiguration getUser(final String username) { OServerUserConfiguration userCfg = null; synchronized (usersMap) { if (username != null) { String checkName = username; if (!isCaseSensitive()) checkName = username.toLowerCase(Locale.ENGLISH); if (usersM...
[ "public", "OServerUserConfiguration", "getUser", "(", "final", "String", "username", ")", "{", "OServerUserConfiguration", "userCfg", "=", "null", ";", "synchronized", "(", "usersMap", ")", "{", "if", "(", "username", "!=", "null", ")", "{", "String", "checkName...
OSecurityAuthenticator
[ "OSecurityAuthenticator" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/security/authenticator/ODefaultPasswordAuthenticator.java#L147-L164
test
Gets the user configuration for the specified username.
Of course, here is the Java code you requested: ```java public OServerUserConfiguration getUser(final String username) { OServerUserConfiguration userCfg = null; synchronized (usersMap) { if (username != null) { String checkName = username; if (!isCaseSensitive()) checkName = ...
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/configurers/RememberMeConfigurer.java
RememberMeConfigurer.getRememberMeServices
private RememberMeServices getRememberMeServices(H http, String key) throws Exception { if (this.rememberMeServices != null) { if (this.rememberMeServices instanceof LogoutHandler && this.logoutHandler == null) { this.logoutHandler = (LogoutHandler) this.rememberMeServices; } return this.remember...
java
private RememberMeServices getRememberMeServices(H http, String key) throws Exception { if (this.rememberMeServices != null) { if (this.rememberMeServices instanceof LogoutHandler && this.logoutHandler == null) { this.logoutHandler = (LogoutHandler) this.rememberMeServices; } return this.remember...
[ "private", "RememberMeServices", "getRememberMeServices", "(", "H", "http", ",", "String", "key", ")", "throws", "Exception", "{", "if", "(", "this", ".", "rememberMeServices", "!=", "null", ")", "{", "if", "(", "this", ".", "rememberMeServices", "instanceof", ...
Gets the {@link RememberMeServices} or creates the {@link RememberMeServices}. @param http the {@link HttpSecurity} to lookup shared objects @param key the {@link #key(String)} @return the {@link RememberMeServices} to use @throws Exception
[ "Gets", "the", "{" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/RememberMeConfigurer.java#L337-L366
test
Get the RememberMeServices instance.
Of course, here is the Java code you requested: ```java private RememberMeServices getRememberMeServices(H http, String key) throws Exception { if (this.rememberMeServices != null) { if (this.rememberMeServices instanceof LogoutHandler && this.logoutHandler == null) { this.logoutHandler = (LogoutHandl...
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/NetcdfDatasetInfo.java
NetcdfDatasetInfo.writeXML
public String writeXML( ) { XMLOutputter fmt = new XMLOutputter( Format.getPrettyFormat()); return fmt.outputString( makeDocument()); }
java
public String writeXML( ) { XMLOutputter fmt = new XMLOutputter( Format.getPrettyFormat()); return fmt.outputString( makeDocument()); }
[ "public", "String", "writeXML", "(", ")", "{", "XMLOutputter", "fmt", "=", "new", "XMLOutputter", "(", "Format", ".", "getPrettyFormat", "(", ")", ")", ";", "return", "fmt", ".", "outputString", "(", "makeDocument", "(", ")", ")", ";", "}" ]
Write the information as an XML document @return String containing netcdfDatasetInfo XML
[ "Write", "the", "information", "as", "an", "XML", "document" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/NetcdfDatasetInfo.java#L83-L86
test
Write the document to an XML string.
Of course, here is the Java code you requested: ```java public String writeXML( ) { XMLOutputter fmt = new XMLOutputter( Format.getPrettyFormat()); return fmt.outputString( makeDocument()); } ``` Hope this helps!
kocakosm/pitaya
src/org/kocakosm/pitaya/io/Resource.java
Resource.copyTo
public void copyTo(OutputStream out) throws IOException { InputStream in = url.openStream(); try { ByteStreams.copy(in, out); } finally { IO.close(in); } }
java
public void copyTo(OutputStream out) throws IOException { InputStream in = url.openStream(); try { ByteStreams.copy(in, out); } finally { IO.close(in); } }
[ "public", "void", "copyTo", "(", "OutputStream", "out", ")", "throws", "IOException", "{", "InputStream", "in", "=", "url", ".", "openStream", "(", ")", ";", "try", "{", "ByteStreams", ".", "copy", "(", "in", ",", "out", ")", ";", "}", "finally", "{", ...
Copies the content of this resource to the specified stream. @param out the stream to copy to. @throws NullPointerException if {@code out} is {@code null}. @throws IOException if an I/O error occurs during the process.
[ "Copies", "the", "content", "of", "this", "resource", "to", "the", "specified", "stream", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/Resource.java#L110-L118
test
Copy the contents of this URL to the given output stream.
Of course, here is the Java code you requested: ```java public void copyTo(OutputStream out) throws IOException { InputStream in = url.openStream(); try { ByteStreams.copy(in, out); } finally { IO.close(in); } } ``` Hope this helps!
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/record/impl/ODirtyManager.java
ODirtyManager.mergeSet
private static Set<ORecord> mergeSet(Set<ORecord> target, Set<ORecord> source) { if (source != null) { if (target == null) { return source; } else { if (target.size() > source.size()) { target.addAll(source); return target; } else { source.addAll(tar...
java
private static Set<ORecord> mergeSet(Set<ORecord> target, Set<ORecord> source) { if (source != null) { if (target == null) { return source; } else { if (target.size() > source.size()) { target.addAll(source); return target; } else { source.addAll(tar...
[ "private", "static", "Set", "<", "ORecord", ">", "mergeSet", "(", "Set", "<", "ORecord", ">", "target", ",", "Set", "<", "ORecord", ">", "source", ")", "{", "if", "(", "source", "!=", "null", ")", "{", "if", "(", "target", "==", "null", ")", "{", ...
Merge the two set try to use the optimum case @param target @param source @return
[ "Merge", "the", "two", "set", "try", "to", "use", "the", "optimum", "case" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/record/impl/ODirtyManager.java#L109-L125
test
Merge two sets of records.
Of course, here is the Java code you requested: ```java private static Set<ORecord> mergeSet(Set<ORecord> target, Set<ORecord> source) { if (source != null) { if (target == null) { return source; } else { if (target.size() > source.size()) { target.addAll(source); re...
passy/Android-DirectoryChooser
library/src/main/java/net/rdrei/android/dirchooser/DirectoryChooserActivity.java
DirectoryChooserActivity.setupActionBar
void setupActionBar() { // there might not be an ActionBar, for example when started in Theme.Holo.Dialog.NoActionBar theme @SuppressLint("AppCompatMethod") final ActionBar actionBar = getActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } }
java
void setupActionBar() { // there might not be an ActionBar, for example when started in Theme.Holo.Dialog.NoActionBar theme @SuppressLint("AppCompatMethod") final ActionBar actionBar = getActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } }
[ "void", "setupActionBar", "(", ")", "{", "// there might not be an ActionBar, for example when started in Theme.Holo.Dialog.NoActionBar theme", "@", "SuppressLint", "(", "\"AppCompatMethod\"", ")", "final", "ActionBar", "actionBar", "=", "getActionBar", "(", ")", ";", "if", "...
/* package
[ "/", "*", "package" ]
ee5b7f1b4cf01598b8719fcdf8ebd066418c48f4
https://github.com/passy/Android-DirectoryChooser/blob/ee5b7f1b4cf01598b8719fcdf8ebd066418c48f4/library/src/main/java/net/rdrei/android/dirchooser/DirectoryChooserActivity.java#L45-L51
test
Setup the action bar.
Of course, here is the Java code you requested: ```java void setupActionBar() { // there might not be an ActionBar, for example when started in Theme.Holo.Dialog.NoActionBar theme @SuppressLint("AppCompatMethod") final ActionBar actionBar = getActionBar(); if (actionBar != null) { a...
NanoHttpd/nanohttpd
webserver/src/main/java/org/nanohttpd/webserver/SimpleWebServer.java
SimpleWebServer.main
public static void main(String[] args) { // Defaults int port = 8080; String host = null; // bind to all interfaces by default List<File> rootDirs = new ArrayList<File>(); boolean quiet = false; String cors = null; Map<String, String> options = new HashMap<String...
java
public static void main(String[] args) { // Defaults int port = 8080; String host = null; // bind to all interfaces by default List<File> rootDirs = new ArrayList<File>(); boolean quiet = false; String cors = null; Map<String, String> options = new HashMap<String...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "// Defaults", "int", "port", "=", "8080", ";", "String", "host", "=", "null", ";", "// bind to all interfaces by default", "List", "<", "File", ">", "rootDirs", "=", "new", "Ar...
Starts as a standalone file server and waits for Enter.
[ "Starts", "as", "a", "standalone", "file", "server", "and", "waits", "for", "Enter", "." ]
b04a342a4bcd0ff44be65138acffc73a29381c72
https://github.com/NanoHttpd/nanohttpd/blob/b04a342a4bcd0ff44be65138acffc73a29381c72/webserver/src/main/java/org/nanohttpd/webserver/SimpleWebServer.java#L103-L177
test
Main method for the SimpleWebServer.
Of course, here is the Java code you requested: ```java public static void main(String[] args) { // Defaults int port = 8080; String host = null; // bind to all interfaces by default List<File> rootDirs = new ArrayList<File>(); boolean quiet = false; String cors = null;...
RestComm/jain-slee
container/common/src/main/java/org/mobicents/slee/runtime/facilities/TracerImpl.java
TracerImpl.trace
public void trace(TraceLevel traceLevel, String message, Throwable t) throws NullPointerException, IllegalArgumentException, FacilityException { sendNotification(traceLevel, message, t); logger.log(tracerToLog4JLevel(traceLevel), message,t); }
java
public void trace(TraceLevel traceLevel, String message, Throwable t) throws NullPointerException, IllegalArgumentException, FacilityException { sendNotification(traceLevel, message, t); logger.log(tracerToLog4JLevel(traceLevel), message,t); }
[ "public", "void", "trace", "(", "TraceLevel", "traceLevel", ",", "String", "message", ",", "Throwable", "t", ")", "throws", "NullPointerException", ",", "IllegalArgumentException", ",", "FacilityException", "{", "sendNotification", "(", "traceLevel", ",", "message", ...
/* (non-Javadoc) @see javax.slee.facilities.Tracer#trace(javax.slee.facilities.TraceLevel, java.lang.String, java.lang.Throwable)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/runtime/facilities/TracerImpl.java#L427-L433
test
This method logs a message and throwable with the specified trace level.
Of course, here is the Java code you requested: ```java public void trace(TraceLevel traceLevel, String message, Throwable t) throws NullPointerException, IllegalArgumentException, FacilityException { sendNotification(traceLevel, message, t); logger.log(tracerToLog4JLevel(traceLevel), message,t); }...
lessthanoptimal/GeoRegression
main/src/georegression/metric/Distance2D_F64.java
Distance2D_F64.distance
public static double distance( LineParametric2D_F64 line, Point2D_F64 p ) { return Math.sqrt(distanceSq(line, p)); }
java
public static double distance( LineParametric2D_F64 line, Point2D_F64 p ) { return Math.sqrt(distanceSq(line, p)); }
[ "public", "static", "double", "distance", "(", "LineParametric2D_F64", "line", ",", "Point2D_F64", "p", ")", "{", "return", "Math", ".", "sqrt", "(", "distanceSq", "(", "line", ",", "p", ")", ")", ";", "}" ]
<p> Returns the Euclidean distance of the closest point on the line from a point. </p> @param line A line segment. Not modified. @param p The point. Not modified. @return Distance the closest point on the line is away from the point.
[ "<p", ">", "Returns", "the", "Euclidean", "distance", "of", "the", "closest", "point", "on", "the", "line", "from", "a", "point", ".", "<", "/", "p", ">" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/Distance2D_F64.java#L51-L53
test
Computes the Euclidean distance between two points.
Of course, here is the Java code you requested: ```java public static double distance( LineParametric2D_F64 line, Point2D_F64 p ) { return Math.sqrt(distanceSq(line, p)); } ``` Hope this helps!
lessthanoptimal/GeoRegression
main/src/georegression/geometry/UtilPlane3D_F64.java
UtilPlane3D_F64.planeToWorld
public static Se3_F64 planeToWorld( PlaneGeneral3D_F64 plane , Se3_F64 planeToWorld ) { if( planeToWorld == null ) planeToWorld = new Se3_F64(); Vector3D_F64 axisZ = new Vector3D_F64(plane.A,plane.B,plane.C); axisZ.normalize(); Vector3D_F64 axisX = new Vector3D_F64(); Vector3D_F64 axisY = new Vector3D_F6...
java
public static Se3_F64 planeToWorld( PlaneGeneral3D_F64 plane , Se3_F64 planeToWorld ) { if( planeToWorld == null ) planeToWorld = new Se3_F64(); Vector3D_F64 axisZ = new Vector3D_F64(plane.A,plane.B,plane.C); axisZ.normalize(); Vector3D_F64 axisX = new Vector3D_F64(); Vector3D_F64 axisY = new Vector3D_F6...
[ "public", "static", "Se3_F64", "planeToWorld", "(", "PlaneGeneral3D_F64", "plane", ",", "Se3_F64", "planeToWorld", ")", "{", "if", "(", "planeToWorld", "==", "null", ")", "planeToWorld", "=", "new", "Se3_F64", "(", ")", ";", "Vector3D_F64", "axisZ", "=", "new"...
Creates a transform from the plane's reference frame into world's reference frame. The z-axis is set to the plane's normal and the x-axis and y-axis are arbitrarily choosen. Points which lie along the plane will lie along its x-y plane. @param plane Plane @param planeToWorld (Optional) storage for the planeToWorld t...
[ "Creates", "a", "transform", "from", "the", "plane", "s", "reference", "frame", "into", "world", "s", "reference", "frame", ".", "The", "z", "-", "axis", "is", "set", "to", "the", "plane", "s", "normal", "and", "the", "x", "-", "axis", "and", "y", "-...
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPlane3D_F64.java#L281-L293
test
Converts a plane in world space into a plane in world space.
Of course, here is the Java code you requested: ```java public static Se3_F64 planeToWorld( PlaneGeneral3D_F64 plane , Se3_F64 planeToWorld ) { if( planeToWorld == null ) planeToWorld = new Se3_F64(); Vector3D_F64 axisZ = new Vector3D_F64(plane.A,plane.B,plane.C); axisZ.normalize(); Vector3D_F64 axisX = n...
liveontologies/elk-reasoner
elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/Reasoner.java
Reasoner.getSuperClassesQuietly
public synchronized Set<? extends Node<ElkClass>> getSuperClassesQuietly( ElkClassExpression classExpression, boolean direct) throws ElkException { try { return getSuperClasses(classExpression, direct); } catch (final ElkInconsistentOntologyException e) { // All classes are equivalent to each other, so ...
java
public synchronized Set<? extends Node<ElkClass>> getSuperClassesQuietly( ElkClassExpression classExpression, boolean direct) throws ElkException { try { return getSuperClasses(classExpression, direct); } catch (final ElkInconsistentOntologyException e) { // All classes are equivalent to each other, so ...
[ "public", "synchronized", "Set", "<", "?", "extends", "Node", "<", "ElkClass", ">", ">", "getSuperClassesQuietly", "(", "ElkClassExpression", "classExpression", ",", "boolean", "direct", ")", "throws", "ElkException", "{", "try", "{", "return", "getSuperClasses", ...
Return the (direct or indirect) superclasses of the given {@link ElkClassExpression} as specified by the parameter. The method returns a set of {@link Node}s, each of which representing an equivalent class of superclasses. Calling of this method may trigger the computation of the taxonomy, if it has not been done yet. ...
[ "Return", "the", "(", "direct", "or", "indirect", ")", "superclasses", "of", "the", "given", "{", "@link", "ElkClassExpression", "}", "as", "specified", "by", "the", "parameter", ".", "The", "method", "returns", "a", "set", "of", "{", "@link", "Node", "}",...
cfbe5279a57e0433d45c1676c7658ddb6e29b9eb
https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/Reasoner.java#L571-L583
test
Gets the super classes of the given class expression ignoring the exceptions.
Of course, here is the Java code you requested: ```java public synchronized Set<? extends Node<ElkClass>> getSuperClassesQuietly( ElkClassExpression classExpression, boolean direct) throws ElkException { try { return getSuperClasses(classExpression, direct); } catch (final ElkInconsistentOntologyException...
AlejandroRivera/embedded-rabbitmq
src/main/java/io/arivera/oss/embedded/rabbitmq/apache/commons/lang3/StopWatch.java
StopWatch.stop
public void stop() { if (this.runningState != State.RUNNING && this.runningState != State.SUSPENDED) { throw new IllegalStateException("Stopwatch is not running. "); } if (this.runningState == State.RUNNING) { this.stopTime = System.nanoTime(); } this.runningState = State.STOPPED; }
java
public void stop() { if (this.runningState != State.RUNNING && this.runningState != State.SUSPENDED) { throw new IllegalStateException("Stopwatch is not running. "); } if (this.runningState == State.RUNNING) { this.stopTime = System.nanoTime(); } this.runningState = State.STOPPED; }
[ "public", "void", "stop", "(", ")", "{", "if", "(", "this", ".", "runningState", "!=", "State", ".", "RUNNING", "&&", "this", ".", "runningState", "!=", "State", ".", "SUSPENDED", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Stopwatch is not ru...
<p> Stop the stopwatch. </p> <p> This method ends a new timing session, allowing the time to be retrieved. </p> @throws IllegalStateException if the StopWatch is not running.
[ "<p", ">", "Stop", "the", "stopwatch", ".", "<", "/", "p", ">" ]
b9dc6e0a1b7eabf16bf5a573d0d6bf4d536f0a46
https://github.com/AlejandroRivera/embedded-rabbitmq/blob/b9dc6e0a1b7eabf16bf5a573d0d6bf4d536f0a46/src/main/java/io/arivera/oss/embedded/rabbitmq/apache/commons/lang3/StopWatch.java#L217-L225
test
Stop the stopwatch.
Of course, here is the Java code you requested: ```java public void stop() { if (this.runningState != State.RUNNING && this.runningState != State.SUSPENDED) { throw new IllegalStateException("Stopwatch is not running. "); } if (this.runningState == State.RUNNING) { this.stopTime = System.nanoTi...
RestComm/jain-slee
container/services/src/main/java/org/mobicents/slee/container/deployment/ConcreteSbbLocalObjectGenerator.java
ConcreteSbbLocalObjectGenerator.generateSbbLocalObjectConcreteClass
public Class generateSbbLocalObjectConcreteClass() { //Generates the implements link if (logger.isTraceEnabled()) { logger.trace("generateSbbLocalObjectConcreteClass: sbbLocalObjectInterface = " + sbbLocalObjectName + " deployPath = " ...
java
public Class generateSbbLocalObjectConcreteClass() { //Generates the implements link if (logger.isTraceEnabled()) { logger.trace("generateSbbLocalObjectConcreteClass: sbbLocalObjectInterface = " + sbbLocalObjectName + " deployPath = " ...
[ "public", "Class", "generateSbbLocalObjectConcreteClass", "(", ")", "{", "//Generates the implements link", "if", "(", "logger", ".", "isTraceEnabled", "(", ")", ")", "{", "logger", ".", "trace", "(", "\"generateSbbLocalObjectConcreteClass: sbbLocalObjectInterface = \"", "+...
Generate the Sbb Local Object Class @param sbbLocalObjectName the name of the Sbb Local Object @return the concrete Sbb Local Object class implementing the Sbb Local Object
[ "Generate", "the", "Sbb", "Local", "Object", "Class" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/container/deployment/ConcreteSbbLocalObjectGenerator.java#L98-L181
test
Generates the SbbLocalObject concrete class.
Of course, here is the Java code you requested: ```java public Class generateSbbLocalObjectConcreteClass() { //Generates the implements link if (logger.isTraceEnabled()) { logger.trace("generateSbbLocalObjectConcreteClass: sbbLocalObjectInterface = " + sbbLocalOb...
ReactiveX/RxJava
src/main/java/io/reactivex/disposables/Disposables.java
Disposables.fromAction
@NonNull public static Disposable fromAction(@NonNull Action run) { ObjectHelper.requireNonNull(run, "run is null"); return new ActionDisposable(run); }
java
@NonNull public static Disposable fromAction(@NonNull Action run) { ObjectHelper.requireNonNull(run, "run is null"); return new ActionDisposable(run); }
[ "@", "NonNull", "public", "static", "Disposable", "fromAction", "(", "@", "NonNull", "Action", "run", ")", "{", "ObjectHelper", ".", "requireNonNull", "(", "run", ",", "\"run is null\"", ")", ";", "return", "new", "ActionDisposable", "(", "run", ")", ";", "}...
Construct a Disposable by wrapping a Action that is executed exactly once when the Disposable is disposed. @param run the Action to wrap @return the new Disposable instance
[ "Construct", "a", "Disposable", "by", "wrapping", "a", "Action", "that", "is", "executed", "exactly", "once", "when", "the", "Disposable", "is", "disposed", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/disposables/Disposables.java#L53-L57
test
Creates a Disposable from an Action.
Of course, here is the Java code you requested: ```java @NonNull public static Disposable fromAction(@NonNull Action run) { ObjectHelper.requireNonNull(run, "run is null"); return new ActionDisposable(run); } ``` Hope this helps!
sialcasa/mvvmFX
mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/mapping/ModelWrapper.java
ModelWrapper.field
public <K, V> MapProperty<K, V> field(MapGetter<M, K, V> getter, MapSetter<M, K, V> setter) { return add(new BeanMapPropertyField<>(this::propertyWasChanged, getter, (m, map) -> setter.accept(m, FXCollections.observableMap(map)), SimpleMapProperty::new)); }
java
public <K, V> MapProperty<K, V> field(MapGetter<M, K, V> getter, MapSetter<M, K, V> setter) { return add(new BeanMapPropertyField<>(this::propertyWasChanged, getter, (m, map) -> setter.accept(m, FXCollections.observableMap(map)), SimpleMapProperty::new)); }
[ "public", "<", "K", ",", "V", ">", "MapProperty", "<", "K", ",", "V", ">", "field", "(", "MapGetter", "<", "M", ",", "K", ",", "V", ">", "getter", ",", "MapSetter", "<", "M", ",", "K", ",", "V", ">", "setter", ")", "{", "return", "add", "(", ...
/* Field type map
[ "/", "*", "Field", "type", "map" ]
240566a358a8e01c94c0bbb99228140a69690d02
https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/mapping/ModelWrapper.java#L1568-L1571
test
Adds a field to this map property.
Of course, here is the Java code you requested: ```java public <K, V> MapProperty<K, V> field(MapGetter<M, K, V> getter, MapSetter<M, K, V> setter) { return add(new BeanMapPropertyField<>(this::propertyWasChanged, getter, (m, map) -> setter.accept(m, FXCollections.observableMap(map)), SimpleMapProperty::new)); ...
abmargb/jamppa
src/main/java/org/jamppa/component/utils/XMPPUtils.java
XMPPUtils.errorRSM
public static IQ errorRSM(IQ iq, Logger logger) { String rsmMessage = "RSM: Page Not Found"; logger.error(rsmMessage + " " + iq); return XMPPUtils.createErrorResponse(iq, rsmMessage, Condition.item_not_found, Type.cancel); }
java
public static IQ errorRSM(IQ iq, Logger logger) { String rsmMessage = "RSM: Page Not Found"; logger.error(rsmMessage + " " + iq); return XMPPUtils.createErrorResponse(iq, rsmMessage, Condition.item_not_found, Type.cancel); }
[ "public", "static", "IQ", "errorRSM", "(", "IQ", "iq", ",", "Logger", "logger", ")", "{", "String", "rsmMessage", "=", "\"RSM: Page Not Found\"", ";", "logger", ".", "error", "(", "rsmMessage", "+", "\" \"", "+", "iq", ")", ";", "return", "XMPPUtils", ".",...
Logs the RSM page not found error and returns an IQ error response @param iq @param errorMessage @param logger @return
[ "Logs", "the", "RSM", "page", "not", "found", "error", "and", "returns", "an", "IQ", "error", "response" ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jamppa/component/utils/XMPPUtils.java#L73-L78
test
Create an error response for an RSM page not found condition.
Of course, here is the Java code you requested: ```java public static IQ errorRSM(IQ iq, Logger logger) { String rsmMessage = "RSM: Page Not Found"; logger.error(rsmMessage + " " + iq); return XMPPUtils.createErrorResponse(iq, rsmMessage, Condition.item_not_found, Type.cancel); ...
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/effects/CharacterEffect.java
CharacterEffect.applyToSelection
public void applyToSelection(RTEditText editor, V value) { Selection selection = getSelection(editor); // SPAN_INCLUSIVE_INCLUSIVE is default for empty spans int flags = selection.isEmpty() ? Spanned.SPAN_INCLUSIVE_INCLUSIVE : Spanned.SPAN_EXCLUSIVE_INCLUSIVE; Spannable str = editor.get...
java
public void applyToSelection(RTEditText editor, V value) { Selection selection = getSelection(editor); // SPAN_INCLUSIVE_INCLUSIVE is default for empty spans int flags = selection.isEmpty() ? Spanned.SPAN_INCLUSIVE_INCLUSIVE : Spanned.SPAN_EXCLUSIVE_INCLUSIVE; Spannable str = editor.get...
[ "public", "void", "applyToSelection", "(", "RTEditText", "editor", ",", "V", "value", ")", "{", "Selection", "selection", "=", "getSelection", "(", "editor", ")", ";", "// SPAN_INCLUSIVE_INCLUSIVE is default for empty spans", "int", "flags", "=", "selection", ".", "...
Apply this effect to the selection. If value is Null then the effect will be removed from the current selection. @param editor The editor to apply the effect to (current selection) @param value The value to apply (depends on the Effect)
[ "Apply", "this", "effect", "to", "the", "selection", ".", "If", "value", "is", "Null", "then", "the", "effect", "will", "be", "removed", "from", "the", "current", "selection", "." ]
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/effects/CharacterEffect.java#L48-L86
test
Apply the selection to the text editor.
Of course, here is the Java code you requested: ```java public void applyToSelection(RTEditText editor, V value) { Selection selection = getSelection(editor); // SPAN_INCLUSIVE_INCLUSIVE is default for empty spans int flags = selection.isEmpty() ? Spanned.SPAN_INCLUSIVE_INCLUSIVE : Spanned.SPAN...
basis-technology-corp/tcl-regex-java
src/main/java/com/basistech/tclre/Nfa.java
Nfa.combine
int combine(Arc con, Arc a) throws RegexException { //# define CA(ct,at) (((ct)<<CHAR_BIT) | (at)) //CA(con->type, a->type)) { switch ((con.type << 8) | a.type) { case '^' << 8 | Compiler.PLAIN: /* newlines are handled separately */ case '$' << 8 | Compiler.PLAIN: ...
java
int combine(Arc con, Arc a) throws RegexException { //# define CA(ct,at) (((ct)<<CHAR_BIT) | (at)) //CA(con->type, a->type)) { switch ((con.type << 8) | a.type) { case '^' << 8 | Compiler.PLAIN: /* newlines are handled separately */ case '$' << 8 | Compiler.PLAIN: ...
[ "int", "combine", "(", "Arc", "con", ",", "Arc", "a", ")", "throws", "RegexException", "{", "//# define CA(ct,at) (((ct)<<CHAR_BIT) | (at))", "//CA(con->type, a->type)) {", "switch", "(", "(", "con", ".", "type", "<<", "8", ")", "|", "a", ".", "type", ")", ...
combine - constraint lands on an arc, what happens? @return result
[ "combine", "-", "constraint", "lands", "on", "an", "arc", "what", "happens?" ]
de0d5eaccf9a61b694cb8793f234cc229c395b43
https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Nfa.java#L787-L836
test
Combine two Arcs.
Of course, here is the Java code you requested: ```java int combine(Arc con, Arc a) throws RegexException { //# define CA(ct,at) (((ct)<<CHAR_BIT) | (at)) //CA(con->type, a->type)) { switch ((con.type << 8) | a.type) { case '^' << 8 | Compiler.PLAIN: /* newlines are handled se...
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/core/write/objectmapper/HollowObjectMapper.java
HollowObjectMapper.initializeTypeState
public void initializeTypeState(Class<?> clazz) { Objects.requireNonNull(clazz); getTypeMapper(clazz, null, null); }
java
public void initializeTypeState(Class<?> clazz) { Objects.requireNonNull(clazz); getTypeMapper(clazz, null, null); }
[ "public", "void", "initializeTypeState", "(", "Class", "<", "?", ">", "clazz", ")", "{", "Objects", ".", "requireNonNull", "(", "clazz", ")", ";", "getTypeMapper", "(", "clazz", ",", "null", ",", "null", ")", ";", "}" ]
Initializes the schema for the specified type in the data model. <p> The schema will be derived from the field and type names in <code>clazz</code> and added to the state engine's data model; schemas of types referenced from <code>clazz</code> will also be added. This can be used to add a type's schema to the state eng...
[ "Initializes", "the", "schema", "for", "the", "specified", "type", "in", "the", "data", "model", ".", "<p", ">", "The", "schema", "will", "be", "derived", "from", "the", "field", "and", "type", "names", "in", "<code", ">", "clazz<", "/", "code", ">", "...
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/write/objectmapper/HollowObjectMapper.java#L120-L123
test
Initialize the type state for a class.
Of course, here is the Java code you requested: ```java public void initializeTypeState(Class<?> clazz) { Objects.requireNonNull(clazz); getTypeMapper(clazz, null, null); } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/Broadcast.java
Broadcast.amax
public static INDArray amax(INDArray x, INDArray y, INDArray z, int... dimensions) { if(dimensions == null) { Preconditions.checkArgument(Arrays.equals(x.shape(),y.shape()),getFormattedShapeErrorMessageXy(x,y)); Preconditions.checkArgument(Arrays.equals(x.shape(),z.shape()),getFormattedS...
java
public static INDArray amax(INDArray x, INDArray y, INDArray z, int... dimensions) { if(dimensions == null) { Preconditions.checkArgument(Arrays.equals(x.shape(),y.shape()),getFormattedShapeErrorMessageXy(x,y)); Preconditions.checkArgument(Arrays.equals(x.shape(),z.shape()),getFormattedS...
[ "public", "static", "INDArray", "amax", "(", "INDArray", "x", ",", "INDArray", "y", ",", "INDArray", "z", ",", "int", "...", "dimensions", ")", "{", "if", "(", "dimensions", "==", "null", ")", "{", "Preconditions", ".", "checkArgument", "(", "Arrays", "....
Broadcast absolute max op. See: {@link BroadcastAMax}
[ "Broadcast", "absolute", "max", "op", ".", "See", ":", "{" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/Broadcast.java#L236-L244
test
Compute the AMAX operation
Of course, here is the Java code you requested: ```java public static INDArray amax(INDArray x, INDArray y, INDArray z, int... dimensions) { if(dimensions == null) { Preconditions.checkArgument(Arrays.equals(x.shape(),y.shape()),getFormattedShapeErrorMessageXy(x,y)); Preconditions.check...
3pillarlabs/spring-integration-aws
spring-integration-aws/src/main/java/org/springframework/integration/aws/sns/config/SnsParserUtils.java
SnsParserUtils.getSnsExecutorBuilder
public static BeanDefinitionBuilder getSnsExecutorBuilder( final Element element, final ParserContext parserContext) { Assert.notNull(element, "The provided element must not be null."); Assert.notNull(parserContext, "The provided parserContext must not be null."); final BeanDefinitionBuilder snsExecutorB...
java
public static BeanDefinitionBuilder getSnsExecutorBuilder( final Element element, final ParserContext parserContext) { Assert.notNull(element, "The provided element must not be null."); Assert.notNull(parserContext, "The provided parserContext must not be null."); final BeanDefinitionBuilder snsExecutorB...
[ "public", "static", "BeanDefinitionBuilder", "getSnsExecutorBuilder", "(", "final", "Element", "element", ",", "final", "ParserContext", "parserContext", ")", "{", "Assert", ".", "notNull", "(", "element", ",", "\"The provided element must not be null.\"", ")", ";", "As...
Create a new {@link BeanDefinitionBuilder} for the class {@link SnsExecutor}. Initialize the wrapped {@link SnsExecutor} with common properties. @param element Must not be null @param parserContext Must not be null @return The BeanDefinitionBuilder for the SnsExecutor
[ "Create", "a", "new", "{", "@link", "BeanDefinitionBuilder", "}", "for", "the", "class", "{", "@link", "SnsExecutor", "}", ".", "Initialize", "the", "wrapped", "{", "@link", "SnsExecutor", "}", "with", "common", "properties", "." ]
6d2e8c63cc0cd5b666356a696e80674952302495
https://github.com/3pillarlabs/spring-integration-aws/blob/6d2e8c63cc0cd5b666356a696e80674952302495/spring-integration-aws/src/main/java/org/springframework/integration/aws/sns/config/SnsParserUtils.java#L54-L87
test
Gets the snsExecutor builder.
Of course, here is the Java code you requested: ```java public static BeanDefinitionBuilder getSnsExecutorBuilder( final Element element, final ParserContext parserContext) { Assert.notNull(element, "The provided element must not be null."); Assert.notNull(parserContext, "The provided parserContext must no...
OpenEstate/OpenEstate-IO
Examples/src/main/java/org/openestate/io/examples/OpenImmoWritingExample.java
OpenImmoWritingExample.createAnbieter
protected static Anbieter createAnbieter() { // create an example agency Anbieter anbieter = FACTORY.createAnbieter(); anbieter.setAnbieternr("123456"); anbieter.setFirma("Agency Name"); anbieter.setOpenimmoAnid("123456"); // add some real estates to the agency a...
java
protected static Anbieter createAnbieter() { // create an example agency Anbieter anbieter = FACTORY.createAnbieter(); anbieter.setAnbieternr("123456"); anbieter.setFirma("Agency Name"); anbieter.setOpenimmoAnid("123456"); // add some real estates to the agency a...
[ "protected", "static", "Anbieter", "createAnbieter", "(", ")", "{", "// create an example agency", "Anbieter", "anbieter", "=", "FACTORY", ".", "createAnbieter", "(", ")", ";", "anbieter", ".", "setAnbieternr", "(", "\"123456\"", ")", ";", "anbieter", ".", "setFir...
Create an {@link Anbieter} with some example data. @return created example object
[ "Create", "an", "{", "@link", "Anbieter", "}", "with", "some", "example", "data", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/OpenImmoWritingExample.java#L122-L134
test
Create an Anbieter object.
Of course, here is the Java code you requested: ```java protected static Anbieter createAnbieter() { // create an example agency Anbieter anbieter = FACTORY.createAnbieter(); anbieter.setAnbieternr("123456"); anbieter.setFirma("Agency Name"); anbieter.setOpenimmoAnid("123456"); ...
wildfly/wildfly
webservices/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java
ASHelper.getEndpointName
public static String getEndpointName(final ServletMetaData servletMD) { final String endpointName = servletMD.getName(); return endpointName != null ? endpointName.trim() : null; }
java
public static String getEndpointName(final ServletMetaData servletMD) { final String endpointName = servletMD.getName(); return endpointName != null ? endpointName.trim() : null; }
[ "public", "static", "String", "getEndpointName", "(", "final", "ServletMetaData", "servletMD", ")", "{", "final", "String", "endpointName", "=", "servletMD", ".", "getName", "(", ")", ";", "return", "endpointName", "!=", "null", "?", "endpointName", ".", "trim",...
Returns endpoint name. @param servletMD servlet meta data @return endpoint name
[ "Returns", "endpoint", "name", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/util/ASHelper.java#L113-L116
test
Gets the endpoint name.
Of course, here is the Java code you requested: ```java public static String getEndpointName(final ServletMetaData servletMD) { final String endpointName = servletMD.getName(); return endpointName != null ? endpointName.trim() : null; } ``` Hope this helps!
js-lib-com/tiny-container
src/main/java/js/container/LoggerInstanceProcessor.java
LoggerInstanceProcessor.postProcessInstance
@Override public void postProcessInstance(ManagedClassSPI managedClass, Object instance) { if (!managedClass.getInstanceScope().equals(InstanceScope.APPLICATION)) { return; } if (!managedClass.getInstanceType().equals(InstanceType.PROXY)) { return; } Class<?>[] interfaceClasses = managedClass...
java
@Override public void postProcessInstance(ManagedClassSPI managedClass, Object instance) { if (!managedClass.getInstanceScope().equals(InstanceScope.APPLICATION)) { return; } if (!managedClass.getInstanceType().equals(InstanceType.PROXY)) { return; } Class<?>[] interfaceClasses = managedClass...
[ "@", "Override", "public", "void", "postProcessInstance", "(", "ManagedClassSPI", "managedClass", ",", "Object", "instance", ")", "{", "if", "(", "!", "managedClass", ".", "getInstanceScope", "(", ")", ".", "equals", "(", "InstanceScope", ".", "APPLICATION", ")"...
Dump managed instance of {@link InstanceType#PROXY} type and with {@link InstanceScope#APPLICATION} scope to container logger. For managed instance of other scope / type combinations this method does nothing. @param managedClass managed class, @param instance instance of managed class.
[ "Dump", "managed", "instance", "of", "{", "@link", "InstanceType#PROXY", "}", "type", "and", "with", "{", "@link", "InstanceScope#APPLICATION", "}", "scope", "to", "container", "logger", ".", "For", "managed", "instance", "of", "other", "scope", "/", "type", "...
ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e
https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/container/LoggerInstanceProcessor.java#L27-L50
test
Override this method to add more information to the container proxy.
Of course, here is the Java code you requested: ```java @Override public void postProcessInstance(ManagedClassSPI managedClass, Object instance) { if (!managedClass.getInstanceScope().equals(InstanceScope.APPLICATION)) { return; } if (!managedClass.getInstanceType().equals(InstanceType.PROXY)) { ret...
Unidata/thredds
cdm/src/main/java/ucar/nc2/ft/point/standard/plug/CFpointObs.java
CFpointObs.makeStationTable
private TableConfig makeStationTable(NetcdfDataset ds, FeatureType ftype, EncodingInfo info, Formatter errlog) throws IOException { Variable lat = CoordSysEvaluator.findCoordByType(ds, AxisType.Lat); Variable lon = CoordSysEvaluator.findCoordByType(ds, AxisType.Lon); if (lat == null || lon == null) { ...
java
private TableConfig makeStationTable(NetcdfDataset ds, FeatureType ftype, EncodingInfo info, Formatter errlog) throws IOException { Variable lat = CoordSysEvaluator.findCoordByType(ds, AxisType.Lat); Variable lon = CoordSysEvaluator.findCoordByType(ds, AxisType.Lon); if (lat == null || lon == null) { ...
[ "private", "TableConfig", "makeStationTable", "(", "NetcdfDataset", "ds", ",", "FeatureType", "ftype", ",", "EncodingInfo", "info", ",", "Formatter", "errlog", ")", "throws", "IOException", "{", "Variable", "lat", "=", "CoordSysEvaluator", ".", "findCoordByType", "(...
for station and stationProfile, not flat
[ "for", "station", "and", "stationProfile", "not", "flat" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/plug/CFpointObs.java#L1176-L1236
test
Make a station table
Of course, here is the Java code you requested: ```java private TableConfig makeStationTable(NetcdfDataset ds, FeatureType ftype, EncodingInfo info, Formatter errlog) throws IOException { Variable lat = CoordSysEvaluator.findCoordByType(ds, AxisType.Lat); Variable lon = CoordSysEvaluator.findCoordByType(ds, ...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createLagerflaeche
@XmlElementDecl(namespace = "", name = "lagerflaeche") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createLagerflaeche(BigDecimal value) { return new JAXBElement<BigDecimal>(_Lagerflaeche_QNAME, BigDecimal.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "lagerflaeche") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createLagerflaeche(BigDecimal value) { return new JAXBElement<BigDecimal>(_Lagerflaeche_QNAME, BigDecimal.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"lagerflaeche\"", ")", "@", "XmlJavaTypeAdapter", "(", "Adapter2", ".", "class", ")", "public", "JAXBElement", "<", "BigDecimal", ">", "createLagerflaeche", "(", "BigDecimal", "value", ")"...
Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "BigDecimal", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2112-L2116
test
Create an instance of a lagerflaeche JAXBElement.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "lagerflaeche") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createLagerflaeche(BigDecimal value) { return new JAXBElement<BigDecimal>(_Lagerflaeche_QNAME, BigDecimal.class, null, value...
oblac/jodd
jodd-http/src/main/java/jodd/http/Buffer.java
Buffer.append
public Buffer append(final String string) { ensureLast(); try { byte[] bytes = string.getBytes(StringPool.ISO_8859_1); last.append(bytes); size += bytes.length; } catch (UnsupportedEncodingException ignore) { } return this; }
java
public Buffer append(final String string) { ensureLast(); try { byte[] bytes = string.getBytes(StringPool.ISO_8859_1); last.append(bytes); size += bytes.length; } catch (UnsupportedEncodingException ignore) { } return this; }
[ "public", "Buffer", "append", "(", "final", "String", "string", ")", "{", "ensureLast", "(", ")", ";", "try", "{", "byte", "[", "]", "bytes", "=", "string", ".", "getBytes", "(", "StringPool", ".", "ISO_8859_1", ")", ";", "last", ".", "append", "(", ...
Appends string content to buffer.
[ "Appends", "string", "content", "to", "buffer", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/Buffer.java#L54-L67
test
Append a string to the end of the buffer.
Of course, here is the Java code you requested: ```java public Buffer append(final String string) { ensureLast(); try { byte[] bytes = string.getBytes(StringPool.ISO_8859_1); last.append(bytes); size += bytes.length; } catch (UnsupportedEncodingException ignore) { } return this; } ``` Hope thi...
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/core/index/HollowHashIndexBuilder.java
HollowHashIndexBuilder.calculateDedupedSizesAndTotalNumberOfSelectBuckets
private long calculateDedupedSizesAndTotalNumberOfSelectBuckets(MultiLinkedElementArray elementArray, GrowingSegmentedLongArray matchIndexHashAndSizeArray) { long totalBuckets = 0; long maxSize = 0; int[] selectArray = new int[8]; for(int i=0;i<elementArray.numLists();i++) { ...
java
private long calculateDedupedSizesAndTotalNumberOfSelectBuckets(MultiLinkedElementArray elementArray, GrowingSegmentedLongArray matchIndexHashAndSizeArray) { long totalBuckets = 0; long maxSize = 0; int[] selectArray = new int[8]; for(int i=0;i<elementArray.numLists();i++) { ...
[ "private", "long", "calculateDedupedSizesAndTotalNumberOfSelectBuckets", "(", "MultiLinkedElementArray", "elementArray", ",", "GrowingSegmentedLongArray", "matchIndexHashAndSizeArray", ")", "{", "long", "totalBuckets", "=", "0", ";", "long", "maxSize", "=", "0", ";", "int",...
Called after initial pass. Returns the sum total number of select buckets in the low 7 bytes, and the bits required for the max set size in the high 1 byte.
[ "Called", "after", "initial", "pass", ".", "Returns", "the", "sum", "total", "number", "of", "select", "buckets", "in", "the", "low", "7", "bytes", "and", "the", "bits", "required", "for", "the", "max", "set", "size", "in", "the", "high", "1", "byte", ...
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/index/HollowHashIndexBuilder.java#L295-L341
test
Calculate the deduplicated sizes and total number of select buckets.
Of course, here is the Java code you requested: ```java private long calculateDedupedSizesAndTotalNumberOfSelectBuckets(MultiLinkedElementArray elementArray, GrowingSegmentedLongArray matchIndexHashAndSizeArray) { long totalBuckets = 0; long maxSize = 0; int[] selectArray = new int[8]; ...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java
GeometryMetadataDataSource.count
public int count(String geoPackage, String tableName, GeometryEnvelope envelope) { return count(getGeoPackageId(geoPackage), tableName, envelope); }
java
public int count(String geoPackage, String tableName, GeometryEnvelope envelope) { return count(getGeoPackageId(geoPackage), tableName, envelope); }
[ "public", "int", "count", "(", "String", "geoPackage", ",", "String", "tableName", ",", "GeometryEnvelope", "envelope", ")", "{", "return", "count", "(", "getGeoPackageId", "(", "geoPackage", ")", ",", "tableName", ",", "envelope", ")", ";", "}" ]
Query for all table geometry metadata count matching the envelope @param geoPackage GeoPackage name @param tableName table name @param envelope geometry envelope @return count @since 1.1.0
[ "Query", "for", "all", "table", "geometry", "metadata", "count", "matching", "the", "envelope" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java#L535-L537
test
Count the number of records in the Geometry Geometry
Of course, here is the Java code you requested: ```java public int count(String geoPackage, String tableName, GeometryEnvelope envelope) { return count(getGeoPackageId(geoPackage), tableName, envelope); } ``` Hope this helps!
RestComm/jain-slee
container/usage/src/main/java/org/mobicents/slee/container/management/jmx/ServiceUsageMBeanImpl.java
ServiceUsageMBeanImpl.getSbbUsageMBean
public ObjectName getSbbUsageMBean(SbbID sbbId, String name) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, UnrecognizedUsageParameterSetNameException, ManagementException { if (name == null) throw new NullPointerException("Sbb usage param set is null"); if (name....
java
public ObjectName getSbbUsageMBean(SbbID sbbId, String name) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, UnrecognizedUsageParameterSetNameException, ManagementException { if (name == null) throw new NullPointerException("Sbb usage param set is null"); if (name....
[ "public", "ObjectName", "getSbbUsageMBean", "(", "SbbID", "sbbId", ",", "String", "name", ")", "throws", "NullPointerException", ",", "UnrecognizedSbbException", ",", "InvalidArgumentException", ",", "UnrecognizedUsageParameterSetNameException", ",", "ManagementException", "{...
/* (non-Javadoc) @see javax.slee.management.ServiceUsageMBean#getSbbUsageMBean(javax.slee.SbbID, java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/usage/src/main/java/org/mobicents/slee/container/management/jmx/ServiceUsageMBeanImpl.java#L515-L528
test
Returns the ObjectName of the SbbUsageMBean with the given name.
Of course, here is the Java code you requested: ```java public ObjectName getSbbUsageMBean(SbbID sbbId, String name) throws NullPointerException, UnrecognizedSbbException, InvalidArgumentException, UnrecognizedUsageParameterSetNameException, ManagementException { if (name == null) throw new NullPoin...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.concatMapCompletableDelayError
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Completable concatMapCompletableDelayError(Function<? super T, ? extends CompletableSource> mapper, boolean tillTheEnd, int prefetch) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefe...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Completable concatMapCompletableDelayError(Function<? super T, ? extends CompletableSource> mapper, boolean tillTheEnd, int prefetch) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(prefe...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Completable", "concatMapCompletableDelayError", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "CompletableSource", ">", "mapper", ",", ...
Maps the upstream items into {@link CompletableSource}s and subscribes to them one after the other terminates, optionally delaying all errors till both this {@code Observable} and all inner {@code CompletableSource}s terminate. <p> <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/r...
[ "Maps", "the", "upstream", "items", "into", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L6793-L6799
test
Creates an Completable that completes when the source CompletableSource completes with the result of applying the provided function to each element of the source CompletableSource.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Completable concatMapCompletableDelayError(Function<? super T, ? extends CompletableSource> mapper, boolean tillTheEnd, int prefetch) { ObjectHelper.requireNonNull(mapper, "ma...
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/retrieval/SearchResult.java
SearchResult.setCandidateAnswers
public void setCandidateAnswers(FSArray v) { if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_candidateAnswers == null) jcasType.jcas.throwFeatMissing("candidateAnswers", "edu.cmu.lti.oaqa.type.retrieval.SearchResult"); jcasType.ll_cas.ll_setRefValue(addr, ((SearchResult_Type)jcasT...
java
public void setCandidateAnswers(FSArray v) { if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_candidateAnswers == null) jcasType.jcas.throwFeatMissing("candidateAnswers", "edu.cmu.lti.oaqa.type.retrieval.SearchResult"); jcasType.ll_cas.ll_setRefValue(addr, ((SearchResult_Type)jcasT...
[ "public", "void", "setCandidateAnswers", "(", "FSArray", "v", ")", "{", "if", "(", "SearchResult_Type", ".", "featOkTst", "&&", "(", "(", "SearchResult_Type", ")", "jcasType", ")", ".", "casFeat_candidateAnswers", "==", "null", ")", "jcasType", ".", "jcas", "....
setter for candidateAnswers - sets CandidateAnswerVariants generated from this SearchResult. @generated @param v value to set into the feature
[ "setter", "for", "candidateAnswers", "-", "sets", "CandidateAnswerVariants", "generated", "from", "this", "SearchResult", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/retrieval/SearchResult.java#L217-L220
test
setter for candidateAnswers - sets
Of course, here is the Java code you requested: ```java public void setCandidateAnswers(FSArray v) { if (SearchResult_Type.featOkTst && ((SearchResult_Type)jcasType).casFeat_candidateAnswers == null) jcasType.jcas.throwFeatMissing("candidateAnswers", "edu.cmu.lti.oaqa.type.retrieval.SearchResult"); jcasT...
apache/parquet-mr
parquet-pig/src/main/java/org/apache/parquet/pig/ParquetStorer.java
ParquetStorer.getOutputFormat
@Override public OutputFormat<Void, Tuple> getOutputFormat() throws IOException { Schema pigSchema = getSchema(); return new ParquetOutputFormat<Tuple>(new TupleWriteSupport(pigSchema)); }
java
@Override public OutputFormat<Void, Tuple> getOutputFormat() throws IOException { Schema pigSchema = getSchema(); return new ParquetOutputFormat<Tuple>(new TupleWriteSupport(pigSchema)); }
[ "@", "Override", "public", "OutputFormat", "<", "Void", ",", "Tuple", ">", "getOutputFormat", "(", ")", "throws", "IOException", "{", "Schema", "pigSchema", "=", "getSchema", "(", ")", ";", "return", "new", "ParquetOutputFormat", "<", "Tuple", ">", "(", "new...
{@inheritDoc}
[ "{" ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-pig/src/main/java/org/apache/parquet/pig/ParquetStorer.java#L100-L104
test
Override to provide a output format for the CID .
Of course, here is the Java code you requested: ```java @Override public OutputFormat<Void, Tuple> getOutputFormat() throws IOException { Schema pigSchema = getSchema(); return new ParquetOutputFormat<Tuple>(new TupleWriteSupport(pigSchema)); } ``` Hope this helps!
cologneintelligence/FitGoodies
fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/file/FileSystemDirectoryHelper.java
FileSystemDirectoryHelper.abs2rel
public String abs2rel(final String basePath, final String absPath) { if (!isAbsolutePath(absPath)) { return absPath; } if (isWindowsDrive(absPath) && isWindowsDrive(basePath) && absPath.charAt(0) != basePath.charAt(0)) { return absPath; } StringBuilder result = new StringBuilder(); String[] basePart...
java
public String abs2rel(final String basePath, final String absPath) { if (!isAbsolutePath(absPath)) { return absPath; } if (isWindowsDrive(absPath) && isWindowsDrive(basePath) && absPath.charAt(0) != basePath.charAt(0)) { return absPath; } StringBuilder result = new StringBuilder(); String[] basePart...
[ "public", "String", "abs2rel", "(", "final", "String", "basePath", ",", "final", "String", "absPath", ")", "{", "if", "(", "!", "isAbsolutePath", "(", "absPath", ")", ")", "{", "return", "absPath", ";", "}", "if", "(", "isWindowsDrive", "(", "absPath", "...
Converts an absolute path into a relative one. @param basePath path to start from @param absPath path to convert @return {@code absPath} as a relative path starting from {@code basePath}
[ "Converts", "an", "absolute", "path", "into", "a", "relative", "one", "." ]
834e42d1f41b4b9226060b1e83a80cc69ea88c7b
https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/file/FileSystemDirectoryHelper.java#L142-L178
test
Converts absolute path to relative path.
Of course, here is the Java code you requested: ```java public String abs2rel(final String basePath, final String absPath) { if (!isAbsolutePath(absPath)) { return absPath; } if (isWindowsDrive(absPath) && isWindowsDrive(basePath) && absPath.charAt(0) != basePath.charAt(0)) { return absPath; } String...
boonproject/boon
slumberdb/slumberdb-service-client/src/main/java/org/boon/slumberdb/service/client/DataStoreSimpleHttpClient.java
DataStoreSimpleHttpClient.handleMessageFromServer
private void handleMessageFromServer(String textResponse) { if (verbose) { puts("RESPONSE", url, ProtocolConstants.prettyPrintMessage(textResponse)); puts("RESPONSE", url); puts(ProtocolConstants.prettyPrintMessageWithLinesTabs(textResponse)); } if (textRes...
java
private void handleMessageFromServer(String textResponse) { if (verbose) { puts("RESPONSE", url, ProtocolConstants.prettyPrintMessage(textResponse)); puts("RESPONSE", url); puts(ProtocolConstants.prettyPrintMessageWithLinesTabs(textResponse)); } if (textRes...
[ "private", "void", "handleMessageFromServer", "(", "String", "textResponse", ")", "{", "if", "(", "verbose", ")", "{", "puts", "(", "\"RESPONSE\"", ",", "url", ",", "ProtocolConstants", ".", "prettyPrintMessage", "(", "textResponse", ")", ")", ";", "puts", "("...
RESPONSES FROM SERVER. @param textResponse
[ "RESPONSES", "FROM", "SERVER", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/slumberdb/slumberdb-service-client/src/main/java/org/boon/slumberdb/service/client/DataStoreSimpleHttpClient.java#L54-L80
test
Handle a message from the server.
Of course, here is the Java code you requested: ```java private void handleMessageFromServer(String textResponse) { if (verbose) { puts("RESPONSE", url, ProtocolConstants.prettyPrintMessage(textResponse)); puts("RESPONSE", url); puts(ProtocolConstants.prettyPrintMessageWith...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/TldScanner.java
TldScanner.scanTlds
private void scanTlds() throws JasperException { mappings = new HashMap<String, String[]>(); // Make a local copy of the system jar cache jarTldCacheLocal.putAll(jarTldCache); try { processWebDotXml(); scanJars(); processTldsInFileSystem("/WEB-INF/...
java
private void scanTlds() throws JasperException { mappings = new HashMap<String, String[]>(); // Make a local copy of the system jar cache jarTldCacheLocal.putAll(jarTldCache); try { processWebDotXml(); scanJars(); processTldsInFileSystem("/WEB-INF/...
[ "private", "void", "scanTlds", "(", ")", "throws", "JasperException", "{", "mappings", "=", "new", "HashMap", "<", "String", ",", "String", "[", "]", ">", "(", ")", ";", "// Make a local copy of the system jar cache ", "jarTldCacheLocal", ".", "putAll", "(", "ja...
Scan the all the tlds accessible in the web app. For performance reasons, this is done in two stages. At servlet initialization time, we only scan the jar files for listeners. The container passes a list of system jar files that are known to contain tlds with listeners. The rest of the jar files will be scanned when...
[ "Scan", "the", "all", "the", "tlds", "accessible", "in", "the", "web", "app", ".", "For", "performance", "reasons", "this", "is", "done", "in", "two", "stages", ".", "At", "servlet", "initialization", "time", "we", "only", "scan", "the", "jar", "files", ...
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/TldScanner.java#L340-L358
test
Scan the TLDs in the classpath.
Of course, here is the Java code you requested: ```java private void scanTlds() throws JasperException { mappings = new HashMap<String, String[]>(); // Make a local copy of the system jar cache jarTldCacheLocal.putAll(jarTldCache); try { processWebDotXml(); s...
blademainer/common_utils
common_helper/src/main/java/com/xiongyingqi/util/AnnotationHelper.java
AnnotationHelper.readAnnotationValueOnField
public static <T extends Annotation> T readAnnotationValueOnField(Field field, Class<T> annotationClass) { if (field.isAnnotationPresent(annotationClass)) { T t = field.getAnnotation(annotationClass); return t; } else { Method method = EntityHelper.findGetMethod(field...
java
public static <T extends Annotation> T readAnnotationValueOnField(Field field, Class<T> annotationClass) { if (field.isAnnotationPresent(annotationClass)) { T t = field.getAnnotation(annotationClass); return t; } else { Method method = EntityHelper.findGetMethod(field...
[ "public", "static", "<", "T", "extends", "Annotation", ">", "T", "readAnnotationValueOnField", "(", "Field", "field", ",", "Class", "<", "T", ">", "annotationClass", ")", "{", "if", "(", "field", ".", "isAnnotationPresent", "(", "annotationClass", ")", ")", ...
读取field的注解值(包括get、set方法) @param field @param annotationClass @param <T> @return
[ "读取field的注解值(包括get、set方法)" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/AnnotationHelper.java#L42-L54
test
Read an annotation value on a field.
Of course, here is the Java code you requested: ```java public static <T extends Annotation> T readAnnotationValueOnField(Field field, Class<T> annotationClass) { if (field.isAnnotationPresent(annotationClass)) { T t = field.getAnnotation(annotationClass); return t; } else { ...
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/collections/ArrayStack.java
ArrayStack.push
public T push(T element) { int i; Object[] els; if ((i = size++) >= (els = elements).length) { System.arraycopy(els, 0, els = elements = new Object[i << 1], 0, i); } els[i] = element; return element; }
java
public T push(T element) { int i; Object[] els; if ((i = size++) >= (els = elements).length) { System.arraycopy(els, 0, els = elements = new Object[i << 1], 0, i); } els[i] = element; return element; }
[ "public", "T", "push", "(", "T", "element", ")", "{", "int", "i", ";", "Object", "[", "]", "els", ";", "if", "(", "(", "i", "=", "size", "++", ")", ">=", "(", "els", "=", "elements", ")", ".", "length", ")", "{", "System", ".", "arraycopy", "...
Pushes an item onto the top of this stack. @param element - the element to be pushed onto this stack @return the item argument
[ "Pushes", "an", "item", "onto", "the", "top", "of", "this", "stack", "." ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/collections/ArrayStack.java#L70-L78
test
Push an element onto the stack.
Of course, here is the Java code you requested: ```java public T push(T element) { int i; Object[] els; if ((i = size++) >= (els = elements).length) { System.arraycopy(els, 0, els = elements = new Object[i << 1], 0, i); } els[i] = element; return element; ...
Unidata/thredds
cdm/src/main/java/thredds/client/catalog/builder/CatalogBuilder.java
CatalogBuilder.readSource
protected ThreddsMetadata.Source readSource(Element elem) { if (elem == null) { return null; } ThreddsMetadata.Vocab name = readControlledVocabulary(elem.getChild("name", Catalog.defNS)); Element contact = elem.getChild("contact", Catalog.defNS); if (contact == null) { errlog.format(" **...
java
protected ThreddsMetadata.Source readSource(Element elem) { if (elem == null) { return null; } ThreddsMetadata.Vocab name = readControlledVocabulary(elem.getChild("name", Catalog.defNS)); Element contact = elem.getChild("contact", Catalog.defNS); if (contact == null) { errlog.format(" **...
[ "protected", "ThreddsMetadata", ".", "Source", "readSource", "(", "Element", "elem", ")", "{", "if", "(", "elem", "==", "null", ")", "{", "return", "null", ";", "}", "ThreddsMetadata", ".", "Vocab", "name", "=", "readControlledVocabulary", "(", "elem", ".", ...
/* <xsd:complexType name="sourceType"> <xsd:sequence> <xsd:element name="name" type="controlledVocabulary"/> <xsd:element name="contact"> <xsd:complexType> <xsd:attribute name="email" type="xsd:string" use="required"/> <xsd:attribute name="url" type="xsd:anyURI"/> </xsd:complexType> </xsd:element> </xsd:sequence> </x...
[ "/", "*", "<xsd", ":", "complexType", "name", "=", "sourceType", ">", "<xsd", ":", "sequence", ">", "<xsd", ":", "element", "name", "=", "name", "type", "=", "controlledVocabulary", "/", ">" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/client/catalog/builder/CatalogBuilder.java#L1064-L1076
test
Read a source element.
Of course, here is the Java code you requested: ```java protected ThreddsMetadata.Source readSource(Element elem) { if (elem == null) { return null; } ThreddsMetadata.Vocab name = readControlledVocabulary(elem.getChild("name", Catalog.defNS)); Element contact = elem.getChild("contact", Catalog.de...
Unidata/thredds
cdm/src/main/java/ucar/unidata/io/BeLeDataInputStream.java
BeLeDataInputStream.readLELong
public long readLELong() throws IOException { readFully(w, 0, 8); return (long) (w[7] & 0xff) << 56 | (long) (w[6] & 0xff) << 48 | (long) (w[5] & 0xff) << 40 | (long) (w[4] & 0xff) << 32 | (long) (w[3] & 0xff) << 24 | ...
java
public long readLELong() throws IOException { readFully(w, 0, 8); return (long) (w[7] & 0xff) << 56 | (long) (w[6] & 0xff) << 48 | (long) (w[5] & 0xff) << 40 | (long) (w[4] & 0xff) << 32 | (long) (w[3] & 0xff) << 24 | ...
[ "public", "long", "readLELong", "(", ")", "throws", "IOException", "{", "readFully", "(", "w", ",", "0", ",", "8", ")", ";", "return", "(", "long", ")", "(", "w", "[", "7", "]", "&", "0xff", ")", "<<", "56", "|", "(", "long", ")", "(", "w", "...
read a long in little endian format @return long from next 8 bytes in stream, littleEndian order
[ "read", "a", "long", "in", "little", "endian", "format" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/io/BeLeDataInputStream.java#L111-L122
test
read le long.
Of course, here is the Java code you requested: ```java public long readLELong() throws IOException { readFully(w, 0, 8); return (long) (w[7] & 0xff) << 56 | (long) (w[6] & 0xff) << 48 | (long) (w[5] & 0xff) << 40 | (long) (w[4] & 0xff) <<...
blademainer/common_utils
commons-file/src/main/java/com/xiongyingqi/util/FileEncode.java
FileEncode.getEncodeByUtil
public static synchronized String getEncodeByUtil(File file) { CodepageDetectorProxy detector = CodepageDetectorProxy.getInstance(); detector.add(new ParsingDetector(false)); detector.add(JChardetFacade.getInstance());// 用到antlr.jar、chardet.jar // ASCIIDetector用于ASCII编码测定 detec...
java
public static synchronized String getEncodeByUtil(File file) { CodepageDetectorProxy detector = CodepageDetectorProxy.getInstance(); detector.add(new ParsingDetector(false)); detector.add(JChardetFacade.getInstance());// 用到antlr.jar、chardet.jar // ASCIIDetector用于ASCII编码测定 detec...
[ "public", "static", "synchronized", "String", "getEncodeByUtil", "(", "File", "file", ")", "{", "CodepageDetectorProxy", "detector", "=", "CodepageDetectorProxy", ".", "getInstance", "(", ")", ";", "detector", ".", "add", "(", "new", "ParsingDetector", "(", "false...
使用工具获取文件的编码方式 @param file @return
[ "使用工具获取文件的编码方式" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/commons-file/src/main/java/com/xiongyingqi/util/FileEncode.java#L22-L42
test
Get the encoding by the Util class.
Of course, here is the Java code you requested: ```java public static synchronized String getEncodeByUtil(File file) { CodepageDetectorProxy detector = CodepageDetectorProxy.getInstance(); detector.add(new ParsingDetector(false)); detector.add(JChardetFacade.getInstance());// 用到antlr.jar、char...
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java
src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java
StdDraw.square
public static void square(double x, double y, double halfLength) { if (!(halfLength >= 0)) throw new IllegalArgumentException("half length must be nonnegative"); double xs = scaleX(x); double ys = scaleY(y); double ws = factorX(2 * halfLength); double hs = factorY(2 * halfLength); if (ws...
java
public static void square(double x, double y, double halfLength) { if (!(halfLength >= 0)) throw new IllegalArgumentException("half length must be nonnegative"); double xs = scaleX(x); double ys = scaleY(y); double ws = factorX(2 * halfLength); double hs = factorY(2 * halfLength); if (ws...
[ "public", "static", "void", "square", "(", "double", "x", ",", "double", "y", ",", "double", "halfLength", ")", "{", "if", "(", "!", "(", "halfLength", ">=", "0", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"half length must be nonnegative\"",...
Draws a square of side length 2r, centered at (<em>x</em>, <em>y</em>). @param x the <em>x</em>-coordinate of the center of the square @param y the <em>y</em>-coordinate of the center of the square @param halfLength one half the length of any side of the square @throws IllegalArgumentException if {@code halfLength}...
[ "Draws", "a", "square", "of", "side", "length", "2r", "centered", "at", "(", "<em", ">", "x<", "/", "em", ">", "<em", ">", "y<", "/", "em", ">", ")", "." ]
516fee15e537ecdb3f4dcbe3695c5cfde7e930da
https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java#L476-L489
test
Square the image using the Cosine algorithm.
Of course, here is the Java code you requested: ```java public static void square(double x, double y, double halfLength) { if (!(halfLength >= 0)) throw new IllegalArgumentException("half length must be nonnegative"); double xs = scaleX(x); double ys = scaleY(y); double ws = factorX(2 * halfLen...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasSrot
public static void cublasSrot(int n, Pointer x, int incx, Pointer y, int incy, float sc, float ss) { cublasSrotNative(n, x, incx, y, incy, sc, ss); checkResultBLAS(); }
java
public static void cublasSrot(int n, Pointer x, int incx, Pointer y, int incy, float sc, float ss) { cublasSrotNative(n, x, incx, y, incy, sc, ss); checkResultBLAS(); }
[ "public", "static", "void", "cublasSrot", "(", "int", "n", ",", "Pointer", "x", ",", "int", "incx", ",", "Pointer", "y", ",", "int", "incy", ",", "float", "sc", ",", "float", "ss", ")", "{", "cublasSrotNative", "(", "n", ",", "x", ",", "incx", ",",...
<pre> void cublasSrot (int n, float *x, int incx, float *y, int incy, float sc, float ss) multiplies a 2x2 matrix ( sc ss) with the 2xn matrix ( transpose(x) ) (-ss sc) ( transpose(y) ) The elements of x are in x[lx + i * incx], i = 0 ... n - 1, where lx = 1 if incx >= 0, else lx = 1 + (1 - n) * i...
[ "<pre", ">", "void", "cublasSrot", "(", "int", "n", "float", "*", "x", "int", "incx", "float", "*", "y", "int", "incy", "float", "sc", "float", "ss", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L1465-L1469
test
CublasSrot for symmetric matrix
Of course, here is the Java code you requested: ```java public static void cublasSrot(int n, Pointer x, int incx, Pointer y, int incy, float sc, float ss) { cublasSrotNative(n, x, incx, y, incy, sc, ss); checkResultBLAS(); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createHoechstgebotZeigen
@XmlElementDecl(namespace = "", name = "hoechstgebot_zeigen") public JAXBElement<Boolean> createHoechstgebotZeigen(Boolean value) { return new JAXBElement<Boolean>(_HoechstgebotZeigen_QNAME, Boolean.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "hoechstgebot_zeigen") public JAXBElement<Boolean> createHoechstgebotZeigen(Boolean value) { return new JAXBElement<Boolean>(_HoechstgebotZeigen_QNAME, Boolean.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"hoechstgebot_zeigen\"", ")", "public", "JAXBElement", "<", "Boolean", ">", "createHoechstgebotZeigen", "(", "Boolean", "value", ")", "{", "return", "new", "JAXBElement", "<", "Boolean", "...
Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Boolean", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2567-L2570
test
Create an instance of a Hoechstgebot_zeigen JAXBElement.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "hoechstgebot_zeigen") public JAXBElement<Boolean> createHoechstgebotZeigen(Boolean value) { return new JAXBElement<Boolean>(_HoechstgebotZeigen_QNAME, Boolean.class, null, value); } ``` Hope this helps!
Unidata/thredds
dap4/d4servlet/src/main/java/dap4/servlet/SerialWriter.java
SerialWriter.writeAtomicArray
public void writeAtomicArray(DapType daptype, Object values) throws IOException { assert values != null && values.getClass().isArray(); ByteBuffer buf = SerialWriter.encodeArray(daptype, values, this.order); byte[] bytes = buf.array(); int len = buf.position(); ...
java
public void writeAtomicArray(DapType daptype, Object values) throws IOException { assert values != null && values.getClass().isArray(); ByteBuffer buf = SerialWriter.encodeArray(daptype, values, this.order); byte[] bytes = buf.array(); int len = buf.position(); ...
[ "public", "void", "writeAtomicArray", "(", "DapType", "daptype", ",", "Object", "values", ")", "throws", "IOException", "{", "assert", "values", "!=", "null", "&&", "values", ".", "getClass", "(", ")", ".", "isArray", "(", ")", ";", "ByteBuffer", "buf", "=...
Write out an array of atomic values @param daptype type of the values @param values the array of values @throws IOException
[ "Write", "out", "an", "array", "of", "atomic", "values" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4servlet/src/main/java/dap4/servlet/SerialWriter.java#L295-L312
test
Write an atomic array of objects to the output stream.
Of course, here is the Java code you requested: ```java public void writeAtomicArray(DapType daptype, Object values) throws IOException { assert values != null && values.getClass().isArray(); ByteBuffer buf = SerialWriter.encodeArray(daptype, values, this.order); byte[] byte...
flow/noise
src/main/java/com/flowpowered/noise/model/Sphere.java
Sphere.getValue
public double getValue(double lat, double lon) { if (module == null) { throw new NoModuleException(); } double[] vec = Utils.latLonToXYZ(lat, lon); return module.getValue(vec[0], vec[1], vec[2]); }
java
public double getValue(double lat, double lon) { if (module == null) { throw new NoModuleException(); } double[] vec = Utils.latLonToXYZ(lat, lon); return module.getValue(vec[0], vec[1], vec[2]); }
[ "public", "double", "getValue", "(", "double", "lat", ",", "double", "lon", ")", "{", "if", "(", "module", "==", "null", ")", "{", "throw", "new", "NoModuleException", "(", ")", ";", "}", "double", "[", "]", "vec", "=", "Utils", ".", "latLonToXYZ", "...
Returns the output value from the noise module given the (latitude, longitude) coordinates of the specified input value located on the surface of the sphere. @param lat The latitude of the input value, in degrees. @param lon The longitude of the input value, in degrees. @return The output value from the noise module.
[ "Returns", "the", "output", "value", "from", "the", "noise", "module", "given", "the", "(", "latitude", "longitude", ")", "coordinates", "of", "the", "specified", "input", "value", "located", "on", "the", "surface", "of", "the", "sphere", "." ]
fe880dbbb09731ade59d9b4c0da6720b70f17509
https://github.com/flow/noise/blob/fe880dbbb09731ade59d9b4c0da6720b70f17509/src/main/java/com/flowpowered/noise/model/Sphere.java#L79-L85
test
Gets the value of the tca from the given lat lon.
Of course, here is the Java code you requested: ```java public double getValue(double lat, double lon) { if (module == null) { throw new NoModuleException(); } double[] vec = Utils.latLonToXYZ(lat, lon); return module.getValue(vec[0], vec[1], vec[2]); } ``` Hope this he...
basis-technology-corp/tcl-regex-java
src/main/java/com/basistech/tclre/Compiler.java
Compiler.parseqatom
private void parseqatom(int stopper, int type, State lp, State rp, Subre top) throws RegexException { State s; /* temporaries for new states */ State s2; int m; int n; Subre atom; /* atom's subtree */ Subre t; boolean cap; /* capturing parens? */ in...
java
private void parseqatom(int stopper, int type, State lp, State rp, Subre top) throws RegexException { State s; /* temporaries for new states */ State s2; int m; int n; Subre atom; /* atom's subtree */ Subre t; boolean cap; /* capturing parens? */ in...
[ "private", "void", "parseqatom", "(", "int", "stopper", ",", "int", "type", ",", "State", "lp", ",", "State", "rp", ",", "Subre", "top", ")", "throws", "RegexException", "{", "State", "s", ";", "/* temporaries for new states */", "State", "s2", ";", "int", ...
CHECKSTYLE:OFF
[ "CHECKSTYLE", ":", "OFF" ]
de0d5eaccf9a61b694cb8793f234cc229c395b43
https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Compiler.java#L640-L1046
test
Parse a QUANTIFIER.
Of course, here is the Java code you requested: ```java private void parseqatom(int stopper, int type, State lp, State rp, Subre top) throws RegexException { State s; /* temporaries for new states */ State s2; int m; int n; Subre atom; /* atom's subtree */ Subre t; ...
eiichiro/bootleg
src/main/java/org/eiichiro/bootleg/Routing.java
Routing.add
public void add(Verb verb, String pattern, Class<?> endpoint, String method) { Preconditions.checkArgument(pattern != null, "Parameter 'pattern' must not be [" + pattern + "]"); Preconditions.checkArgument(pattern.startsWith("/"), "Parameter 'pattern' must start with [/]"); Preconditions.checkArgument(e...
java
public void add(Verb verb, String pattern, Class<?> endpoint, String method) { Preconditions.checkArgument(pattern != null, "Parameter 'pattern' must not be [" + pattern + "]"); Preconditions.checkArgument(pattern.startsWith("/"), "Parameter 'pattern' must start with [/]"); Preconditions.checkArgument(e...
[ "public", "void", "add", "(", "Verb", "verb", ",", "String", "pattern", ",", "Class", "<", "?", ">", "endpoint", ",", "String", "method", ")", "{", "Preconditions", ".", "checkArgument", "(", "pattern", "!=", "null", ",", "\"Parameter 'pattern' must not be [\"...
Adds URL routing pattern. The routing pattern can be specified as URI template format and the path variables can be passed to Web endpoint method like this: <pre> {@code @Override} public void routing(Routing routing) { routing.add("/user/{id}/*", User.class, "handle"); } </pre> <pre> {@code} public class User { // '/...
[ "Adds", "URL", "routing", "pattern", ".", "The", "routing", "pattern", "can", "be", "specified", "as", "URI", "template", "format", "and", "the", "path", "variables", "can", "be", "passed", "to", "Web", "endpoint", "method", "like", "this", ":", "<pre", ">...
b98a108500597cb6185056be2eef7de5ba1963d2
https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/Routing.java#L106-L143
test
Adds a verb to the list of routes.
Of course, here is the Java code you requested: ```java public void add(Verb verb, String pattern, Class<?> endpoint, String method) { Preconditions.checkArgument(pattern != null, "Parameter 'pattern' must not be [" + pattern + "]"); Preconditions.checkArgument(pattern.startsWith("/"), "Parameter 'patter...
orientechnologies/orientdb
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponseWrapper.java
OHttpResponseWrapper.writeHeaders
public OHttpResponseWrapper writeHeaders(final String iContentType, final boolean iKeepAlive) throws IOException { response.writeHeaders(iContentType, iKeepAlive); return this; }
java
public OHttpResponseWrapper writeHeaders(final String iContentType, final boolean iKeepAlive) throws IOException { response.writeHeaders(iContentType, iKeepAlive); return this; }
[ "public", "OHttpResponseWrapper", "writeHeaders", "(", "final", "String", "iContentType", ",", "final", "boolean", "iKeepAlive", ")", "throws", "IOException", "{", "response", ".", "writeHeaders", "(", "iContentType", ",", "iKeepAlive", ")", ";", "return", "this", ...
Sets the response's headers specifying when using the keep-alive or not. @param iContentType Response's content type @param iKeepAlive Use the keep-alive of the connection @return The object itself for fluent chained calls
[ "Sets", "the", "response", "s", "headers", "specifying", "when", "using", "the", "keep", "-", "alive", "or", "not", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponseWrapper.java#L140-L143
test
Write the headers of the response.
Of course, here is the Java code you requested: ```java public OHttpResponseWrapper writeHeaders(final String iContentType, final boolean iKeepAlive) throws IOException { response.writeHeaders(iContentType, iKeepAlive); return this; } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/dataset/DatasetUrl.java
DatasetUrl.searchFragment
static private ServiceType searchFragment(String fragment) { if (fragment.length() == 0) return null; Map<String, String> map = parseFragment(fragment); if (map == null) return null; String protocol = map.get("protocol"); if(protocol == null) { for(String p: FRAGPROTOCOLS) { if(m...
java
static private ServiceType searchFragment(String fragment) { if (fragment.length() == 0) return null; Map<String, String> map = parseFragment(fragment); if (map == null) return null; String protocol = map.get("protocol"); if(protocol == null) { for(String p: FRAGPROTOCOLS) { if(m...
[ "static", "private", "ServiceType", "searchFragment", "(", "String", "fragment", ")", "{", "if", "(", "fragment", ".", "length", "(", ")", "==", "0", ")", "return", "null", ";", "Map", "<", "String", ",", "String", ">", "map", "=", "parseFragment", "(", ...
Given a location, find markers indicated which protocol to use LOOK what use case is this handling ? @param fragment the fragment is to be examined @return The discovered ServiceType, or null
[ "Given", "a", "location", "find", "markers", "indicated", "which", "protocol", "to", "use", "LOOK", "what", "use", "case", "is", "this", "handling", "?" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/DatasetUrl.java#L194-L218
test
Search for the protocol in the fragment.
Of course, here is the Java code you requested: ```java static private ServiceType searchFragment(String fragment) { if (fragment.length() == 0) return null; Map<String, String> map = parseFragment(fragment); if (map == null) return null; String protocol = map.get("protocol"); if(protocol == ...
basis-technology-corp/tcl-regex-java
src/main/java/com/basistech/tclre/ColorMap.java
ColorMap.pseudocolor
short pseudocolor() { short co = newcolor(); ColorDesc cd = colorDescs.get(co); cd.setNChars(1); cd.markPseudo(); return co; }
java
short pseudocolor() { short co = newcolor(); ColorDesc cd = colorDescs.get(co); cd.setNChars(1); cd.markPseudo(); return co; }
[ "short", "pseudocolor", "(", ")", "{", "short", "co", "=", "newcolor", "(", ")", ";", "ColorDesc", "cd", "=", "colorDescs", ".", "get", "(", "co", ")", ";", "cd", ".", "setNChars", "(", "1", ")", ";", "cd", ".", "markPseudo", "(", ")", ";", "retu...
pseudocolor - allocate a false color to be managed by other means. @return a color, otherwise unused.
[ "pseudocolor", "-", "allocate", "a", "false", "color", "to", "be", "managed", "by", "other", "means", "." ]
de0d5eaccf9a61b694cb8793f234cc229c395b43
https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/ColorMap.java#L151-L157
test
Get a pseudo - color color.
Of course, here is the Java code you requested: ```java short pseudocolor() { short co = newcolor(); ColorDesc cd = colorDescs.get(co); cd.setNChars(1); cd.markPseudo(); return co; } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/table/ColumnWidthsResizer.java
ColumnWidthsResizer.tableChanged
@Override public void tableChanged(final TableModelEvent e) { if (e.getFirstRow() == TableModelEvent.HEADER_ROW) { return; // Do not respond to changes in the number of columns here, only row and data changes. } // ColumnWidthsResizer requires that the internal Swing TableModelList...
java
@Override public void tableChanged(final TableModelEvent e) { if (e.getFirstRow() == TableModelEvent.HEADER_ROW) { return; // Do not respond to changes in the number of columns here, only row and data changes. } // ColumnWidthsResizer requires that the internal Swing TableModelList...
[ "@", "Override", "public", "void", "tableChanged", "(", "final", "TableModelEvent", "e", ")", "{", "if", "(", "e", ".", "getFirstRow", "(", ")", "==", "TableModelEvent", ".", "HEADER_ROW", ")", "{", "return", ";", "// Do not respond to changes in the number of col...
////////////////////////////////////////////// TableModelListener ////////////////////////////////////////////////
[ "//////////////////////////////////////////////", "TableModelListener", "////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/table/ColumnWidthsResizer.java#L52-L75
test
The TableModelListener method is called when the table is changed.
Of course, here is the Java code you requested: ```java @Override public void tableChanged(final TableModelEvent e) { if (e.getFirstRow() == TableModelEvent.HEADER_ROW) { return; // Do not respond to changes in the number of columns here, only row and data changes. } // ColumnWidt...
sialcasa/mvvmFX
mvvmfx-validation/src/main/java/de/saxsys/mvvmfx/utils/validation/CompositeValidationStatus.java
CompositeValidationStatus.addMessage
void addMessage(Validator validator, List<? extends ValidationMessage> messages) { if(messages.isEmpty()) { return; } final int validatorHash = System.identityHashCode(validator); if(!validatorToMessagesMap.containsKey(validatorHash)){ validatorToMessagesMap.put(validatorHash, new ArrayList<>()); } ...
java
void addMessage(Validator validator, List<? extends ValidationMessage> messages) { if(messages.isEmpty()) { return; } final int validatorHash = System.identityHashCode(validator); if(!validatorToMessagesMap.containsKey(validatorHash)){ validatorToMessagesMap.put(validatorHash, new ArrayList<>()); } ...
[ "void", "addMessage", "(", "Validator", "validator", ",", "List", "<", "?", "extends", "ValidationMessage", ">", "messages", ")", "{", "if", "(", "messages", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "final", "int", "validatorHash", "=", "S...
Add a list of validation messages for the specified validator.
[ "Add", "a", "list", "of", "validation", "messages", "for", "the", "specified", "validator", "." ]
240566a358a8e01c94c0bbb99228140a69690d02
https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx-validation/src/main/java/de/saxsys/mvvmfx/utils/validation/CompositeValidationStatus.java#L88-L110
test
Add a validation message to the validator.
Of course, here is the Java code you requested: ```java void addMessage(Validator validator, List<? extends ValidationMessage> messages) { if(messages.isEmpty()) { return; } final int validatorHash = System.identityHashCode(validator); if(!validatorToMessagesMap.containsKey(validatorHash)){ validatorT...
oblac/jodd
jodd-core/src/main/java/jodd/io/ZipUtil.java
ZipUtil.ungzip
public static File ungzip(final File file) throws IOException { String outFileName = FileNameUtil.removeExtension(file.getAbsolutePath()); File out = new File(outFileName); out.createNewFile(); FileOutputStream fos = new FileOutputStream(out); GZIPInputStream gzis = new GZIPInputStream(new FileInputStream(fi...
java
public static File ungzip(final File file) throws IOException { String outFileName = FileNameUtil.removeExtension(file.getAbsolutePath()); File out = new File(outFileName); out.createNewFile(); FileOutputStream fos = new FileOutputStream(out); GZIPInputStream gzis = new GZIPInputStream(new FileInputStream(fi...
[ "public", "static", "File", "ungzip", "(", "final", "File", "file", ")", "throws", "IOException", "{", "String", "outFileName", "=", "FileNameUtil", ".", "removeExtension", "(", "file", ".", "getAbsolutePath", "(", ")", ")", ";", "File", "out", "=", "new", ...
Decompress gzip archive.
[ "Decompress", "gzip", "archive", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/ZipUtil.java#L141-L156
test
Ungzip a file.
Of course, here is the Java code you requested: ```java public static File ungzip(final File file) throws IOException { String outFileName = FileNameUtil.removeExtension(file.getAbsolutePath()); File out = new File(outFileName); out.createNewFile(); FileOutputStream fos = new FileOutputStream(out); GZIPInpu...