repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java | CheckClassAdapter.checkChar | private static int checkChar(final char c, final String signature, int pos) {
"""
Checks a single character.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part.
"""
... | java | private static int checkChar(final char c, final String signature, int pos) {
if (getChar(signature, pos) == c) {
return pos + 1;
}
throw new IllegalArgumentException(signature + ": '" + c
+ "' expected at index " + pos);
} | [
"private",
"static",
"int",
"checkChar",
"(",
"final",
"char",
"c",
",",
"final",
"String",
"signature",
",",
"int",
"pos",
")",
"{",
"if",
"(",
"getChar",
"(",
"signature",
",",
"pos",
")",
"==",
"c",
")",
"{",
"return",
"pos",
"+",
"1",
";",
"}",... | Checks a single character.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part. | [
"Checks",
"a",
"single",
"character",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L988-L994 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6ravariables.java | nd6ravariables.get | public static nd6ravariables get(nitro_service service, Long vlan) throws Exception {
"""
Use this API to fetch nd6ravariables resource of given name .
"""
nd6ravariables obj = new nd6ravariables();
obj.set_vlan(vlan);
nd6ravariables response = (nd6ravariables) obj.get_resource(service);
return respons... | java | public static nd6ravariables get(nitro_service service, Long vlan) throws Exception{
nd6ravariables obj = new nd6ravariables();
obj.set_vlan(vlan);
nd6ravariables response = (nd6ravariables) obj.get_resource(service);
return response;
} | [
"public",
"static",
"nd6ravariables",
"get",
"(",
"nitro_service",
"service",
",",
"Long",
"vlan",
")",
"throws",
"Exception",
"{",
"nd6ravariables",
"obj",
"=",
"new",
"nd6ravariables",
"(",
")",
";",
"obj",
".",
"set_vlan",
"(",
"vlan",
")",
";",
"nd6ravar... | Use this API to fetch nd6ravariables resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"nd6ravariables",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/nd6ravariables.java#L549-L554 |
aws/aws-sdk-java | aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/ClusterParameterGroupStatus.java | ClusterParameterGroupStatus.getClusterParameterStatusList | public java.util.List<ClusterParameterStatus> getClusterParameterStatusList() {
"""
<p>
The list of parameter statuses.
</p>
<p>
For more information about parameters and parameter groups, go to <a
href="https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html">Amazon Redshift
Para... | java | public java.util.List<ClusterParameterStatus> getClusterParameterStatusList() {
if (clusterParameterStatusList == null) {
clusterParameterStatusList = new com.amazonaws.internal.SdkInternalList<ClusterParameterStatus>();
}
return clusterParameterStatusList;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"ClusterParameterStatus",
">",
"getClusterParameterStatusList",
"(",
")",
"{",
"if",
"(",
"clusterParameterStatusList",
"==",
"null",
")",
"{",
"clusterParameterStatusList",
"=",
"new",
"com",
".",
"amazonaws",
".",... | <p>
The list of parameter statuses.
</p>
<p>
For more information about parameters and parameter groups, go to <a
href="https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html">Amazon Redshift
Parameter Groups</a> in the <i>Amazon Redshift Cluster Management Guide</i>.
</p>
@return The list... | [
"<p",
">",
"The",
"list",
"of",
"parameter",
"statuses",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
"more",
"information",
"about",
"parameters",
"and",
"parameter",
"groups",
"go",
"to",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"aws",
"."... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/ClusterParameterGroupStatus.java#L150-L155 |
fabric8io/ipaas-quickstarts | archetype-builder/src/main/java/io/fabric8/tooling/archetype/ArchetypeUtils.java | ArchetypeUtils.relativePath | public String relativePath(File base, File nested) throws IOException {
"""
Returns relative path (without leading '/') if <code>nested</code> is inside <code>base</code>.
Returns <code>nested</code> (as absolute path) otherwise.
@param base
@param nested
@return
@throws IOException
"""
String b... | java | public String relativePath(File base, File nested) throws IOException {
String basePath = base.getCanonicalPath();
String nestedPath = nested.getCanonicalPath();
if (nestedPath.equals(basePath)) {
return "";
} else if (nestedPath.startsWith(basePath)) {
return nes... | [
"public",
"String",
"relativePath",
"(",
"File",
"base",
",",
"File",
"nested",
")",
"throws",
"IOException",
"{",
"String",
"basePath",
"=",
"base",
".",
"getCanonicalPath",
"(",
")",
";",
"String",
"nestedPath",
"=",
"nested",
".",
"getCanonicalPath",
"(",
... | Returns relative path (without leading '/') if <code>nested</code> is inside <code>base</code>.
Returns <code>nested</code> (as absolute path) otherwise.
@param base
@param nested
@return
@throws IOException | [
"Returns",
"relative",
"path",
"(",
"without",
"leading",
"/",
")",
"if",
"<code",
">",
"nested<",
"/",
"code",
">",
"is",
"inside",
"<code",
">",
"base<",
"/",
"code",
">",
".",
"Returns",
"<code",
">",
"nested<",
"/",
"code",
">",
"(",
"as",
"absol... | train | https://github.com/fabric8io/ipaas-quickstarts/blob/cf9a9aa09204a82ac996304ab8c96791f7e5db22/archetype-builder/src/main/java/io/fabric8/tooling/archetype/ArchetypeUtils.java#L87-L97 |
openskynetwork/java-adsb | src/main/java/org/opensky/libadsb/PositionDecoder.java | PositionDecoder.decodePosition | public Position decodePosition(double time, SurfacePositionV0Msg msg) {
"""
Shortcut for using the last known position for reference; no reasonableness check on distance to receiver
@param time time of applicability/reception of position report (seconds)
@param msg surface position message
@return WGS84 coordin... | java | public Position decodePosition(double time, SurfacePositionV0Msg msg) {
if (last_pos == null)
return null;
return decodePosition(time, msg, last_pos);
} | [
"public",
"Position",
"decodePosition",
"(",
"double",
"time",
",",
"SurfacePositionV0Msg",
"msg",
")",
"{",
"if",
"(",
"last_pos",
"==",
"null",
")",
"return",
"null",
";",
"return",
"decodePosition",
"(",
"time",
",",
"msg",
",",
"last_pos",
")",
";",
"}... | Shortcut for using the last known position for reference; no reasonableness check on distance to receiver
@param time time of applicability/reception of position report (seconds)
@param msg surface position message
@return WGS84 coordinates with latitude and longitude in dec degrees, and altitude in meters. altitude mi... | [
"Shortcut",
"for",
"using",
"the",
"last",
"known",
"position",
"for",
"reference",
";",
"no",
"reasonableness",
"check",
"on",
"distance",
"to",
"receiver"
] | train | https://github.com/openskynetwork/java-adsb/blob/01d497d3e74ad10063ab443ab583e9c8653a8b8d/src/main/java/org/opensky/libadsb/PositionDecoder.java#L447-L452 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java | Tile.getBoundaryAbsolute | public static Rectangle getBoundaryAbsolute(Tile upperLeft, Tile lowerRight) {
"""
Extend of the area defined by the two tiles in absolute coordinates.
@param upperLeft tile in upper left corner of area.
@param lowerRight tile in lower right corner of area.
@return rectangle with the absolute coordinates.
... | java | public static Rectangle getBoundaryAbsolute(Tile upperLeft, Tile lowerRight) {
return new Rectangle(upperLeft.getOrigin().x, upperLeft.getOrigin().y, lowerRight.getOrigin().x + upperLeft.tileSize, lowerRight.getOrigin().y + upperLeft.tileSize);
} | [
"public",
"static",
"Rectangle",
"getBoundaryAbsolute",
"(",
"Tile",
"upperLeft",
",",
"Tile",
"lowerRight",
")",
"{",
"return",
"new",
"Rectangle",
"(",
"upperLeft",
".",
"getOrigin",
"(",
")",
".",
"x",
",",
"upperLeft",
".",
"getOrigin",
"(",
")",
".",
... | Extend of the area defined by the two tiles in absolute coordinates.
@param upperLeft tile in upper left corner of area.
@param lowerRight tile in lower right corner of area.
@return rectangle with the absolute coordinates. | [
"Extend",
"of",
"the",
"area",
"defined",
"by",
"the",
"two",
"tiles",
"in",
"absolute",
"coordinates",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/model/Tile.java#L51-L53 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomMetadataWriter.java | AtomMetadataWriter.writeFeedId | void writeFeedId(Object entity, NavigationProperty property) throws XMLStreamException, ODataEdmException {
"""
Write an {@code <id>} element when the parent element is a {@code <feed>} element.
@param entity The enclosing entity for which the feed is getting generated.
@param property The property that will... | java | void writeFeedId(Object entity, NavigationProperty property) throws XMLStreamException, ODataEdmException {
xmlWriter.writeStartElement(ATOM_ID);
if (entity != null) {
xmlWriter.writeCharacters(String.format("%s/%s/%s", oDataUri.serviceRoot(),
getEntityWithKey(entity), ... | [
"void",
"writeFeedId",
"(",
"Object",
"entity",
",",
"NavigationProperty",
"property",
")",
"throws",
"XMLStreamException",
",",
"ODataEdmException",
"{",
"xmlWriter",
".",
"writeStartElement",
"(",
"ATOM_ID",
")",
";",
"if",
"(",
"entity",
"!=",
"null",
")",
"{... | Write an {@code <id>} element when the parent element is a {@code <feed>} element.
@param entity The enclosing entity for which the feed is getting generated.
@param property The property that will be expanded in the feed.
@throws XMLStreamException If unable to write to stream
@throws ODataEdmException If unable t... | [
"Write",
"an",
"{",
"@code",
"<id",
">",
"}",
"element",
"when",
"the",
"parent",
"element",
"is",
"a",
"{",
"@code",
"<feed",
">",
"}",
"element",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/atom/writer/AtomMetadataWriter.java#L203-L221 |
TheBlackChamber/commons-encryption | src/main/java/net/theblackchamber/crypto/implementations/SecureProperties.java | SecureProperties.attemptDecryption | private String attemptDecryption(String key, String property) {
"""
Utility method which will determine if a requested property needs to be
decrypted. If property key ends in -encrypted and the encryption provider
is configured this method will return the decrypted property value. If
the key does not include -e... | java | private String attemptDecryption(String key, String property) {
try {
if (StringUtils.endsWithIgnoreCase(key, ENCRYPTED_SUFFIX)) {
if (encryptionProvider == null)
throw new RuntimeCryptoException(
"No encryption provider configured");
return encryptionProvider.decrypt(property);
} else {
... | [
"private",
"String",
"attemptDecryption",
"(",
"String",
"key",
",",
"String",
"property",
")",
"{",
"try",
"{",
"if",
"(",
"StringUtils",
".",
"endsWithIgnoreCase",
"(",
"key",
",",
"ENCRYPTED_SUFFIX",
")",
")",
"{",
"if",
"(",
"encryptionProvider",
"==",
"... | Utility method which will determine if a requested property needs to be
decrypted. If property key ends in -encrypted and the encryption provider
is configured this method will return the decrypted property value. If
the key does not include -encrypted then the property value will be
returned.
@param key
@param proper... | [
"Utility",
"method",
"which",
"will",
"determine",
"if",
"a",
"requested",
"property",
"needs",
"to",
"be",
"decrypted",
".",
"If",
"property",
"key",
"ends",
"in",
"-",
"encrypted",
"and",
"the",
"encryption",
"provider",
"is",
"configured",
"this",
"method",... | train | https://github.com/TheBlackChamber/commons-encryption/blob/0cbbf7c07ae3c133cc82b6dde7ab7af91ddf64d0/src/main/java/net/theblackchamber/crypto/implementations/SecureProperties.java#L555-L570 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigRational.java | BigRational.valueOf | public static BigRational valueOf(BigInteger value) {
"""
Creates a rational number of the specified {@link BigInteger} value.
@param value the {@link BigInteger} value
@return the rational number
"""
if (value.compareTo(BigInteger.ZERO) == 0) {
return ZERO;
}
if (value.compareTo(BigInteger.ON... | java | public static BigRational valueOf(BigInteger value) {
if (value.compareTo(BigInteger.ZERO) == 0) {
return ZERO;
}
if (value.compareTo(BigInteger.ONE) == 0) {
return ONE;
}
return valueOf(value, BigInteger.ONE);
} | [
"public",
"static",
"BigRational",
"valueOf",
"(",
"BigInteger",
"value",
")",
"{",
"if",
"(",
"value",
".",
"compareTo",
"(",
"BigInteger",
".",
"ZERO",
")",
"==",
"0",
")",
"{",
"return",
"ZERO",
";",
"}",
"if",
"(",
"value",
".",
"compareTo",
"(",
... | Creates a rational number of the specified {@link BigInteger} value.
@param value the {@link BigInteger} value
@return the rational number | [
"Creates",
"a",
"rational",
"number",
"of",
"the",
"specified",
"{",
"@link",
"BigInteger",
"}",
"value",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigRational.java#L872-L880 |
phax/ph-oton | ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java | HCHelper.iterateChildrenNoCopy | public static void iterateChildrenNoCopy (@Nonnull final IHCNode aNode, @Nonnull final IHCIteratorCallback aCallback) {
"""
Recursively iterate all child nodes of the passed node.
@param aNode
The node who's children should be iterated.
@param aCallback
The callback to be invoked on every child
"""
V... | java | public static void iterateChildrenNoCopy (@Nonnull final IHCNode aNode, @Nonnull final IHCIteratorCallback aCallback)
{
ValueEnforcer.notNull (aNode, "node");
ValueEnforcer.notNull (aCallback, "callback");
_recursiveIterateTreeBreakableNoCopy (aNode, aCallback);
} | [
"public",
"static",
"void",
"iterateChildrenNoCopy",
"(",
"@",
"Nonnull",
"final",
"IHCNode",
"aNode",
",",
"@",
"Nonnull",
"final",
"IHCIteratorCallback",
"aCallback",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aNode",
",",
"\"node\"",
")",
";",
"ValueEnf... | Recursively iterate all child nodes of the passed node.
@param aNode
The node who's children should be iterated.
@param aCallback
The callback to be invoked on every child | [
"Recursively",
"iterate",
"all",
"child",
"nodes",
"of",
"the",
"passed",
"node",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/HCHelper.java#L154-L160 |
twitter/hraven | hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java | JobHistoryFileParserHadoop2.iterateAndPreparePuts | private void iterateAndPreparePuts(JSONObject eventDetails, Put p, Hadoop2RecordType recType)
throws JSONException {
"""
iterate over the event details and prepare puts
@throws JSONException
"""
Iterator<?> keys = eventDetails.keys();
while (keys.hasNext()) {
String key = (String) keys.nex... | java | private void iterateAndPreparePuts(JSONObject eventDetails, Put p, Hadoop2RecordType recType)
throws JSONException {
Iterator<?> keys = eventDetails.keys();
while (keys.hasNext()) {
String key = (String) keys.next();
processAllTypes(p, recType, eventDetails, key);
}
} | [
"private",
"void",
"iterateAndPreparePuts",
"(",
"JSONObject",
"eventDetails",
",",
"Put",
"p",
",",
"Hadoop2RecordType",
"recType",
")",
"throws",
"JSONException",
"{",
"Iterator",
"<",
"?",
">",
"keys",
"=",
"eventDetails",
".",
"keys",
"(",
")",
";",
"while... | iterate over the event details and prepare puts
@throws JSONException | [
"iterate",
"over",
"the",
"event",
"details",
"and",
"prepare",
"puts"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserHadoop2.java#L488-L495 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/engine/AbstractExceptionAwareLogic.java | AbstractExceptionAwareLogic.handleException | protected R handleException(final Exception e, final HttpActionAdapter<R, C> httpActionAdapter, final C context) {
"""
Handle exceptions.
@param e the thrown exception
@param httpActionAdapter the HTTP action adapter
@param context the web context
@return the final HTTP result
"""
if (httpActionA... | java | protected R handleException(final Exception e, final HttpActionAdapter<R, C> httpActionAdapter, final C context) {
if (httpActionAdapter == null || context == null) {
throw runtimeException(e);
} else if (e instanceof HttpAction) {
final HttpAction action = (HttpAction) e;
... | [
"protected",
"R",
"handleException",
"(",
"final",
"Exception",
"e",
",",
"final",
"HttpActionAdapter",
"<",
"R",
",",
"C",
">",
"httpActionAdapter",
",",
"final",
"C",
"context",
")",
"{",
"if",
"(",
"httpActionAdapter",
"==",
"null",
"||",
"context",
"==",... | Handle exceptions.
@param e the thrown exception
@param httpActionAdapter the HTTP action adapter
@param context the web context
@return the final HTTP result | [
"Handle",
"exceptions",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/engine/AbstractExceptionAwareLogic.java#L37-L52 |
kuali/ojb-1.0.4 | src/tools/org/apache/ojb/tools/mapping/reversedb2/propertyEditors/EditableTreeNodeWithProperties.java | EditableTreeNodeWithProperties.removePropertyChangeListener | public void removePropertyChangeListener (String propertyName, java.beans.PropertyChangeListener listener) {
"""
Remove a PropertyChangeListener for a specific property from this node.
This functionality has. Please note that the listener this does not remove
a listener that has been added without specifying the... | java | public void removePropertyChangeListener (String propertyName, java.beans.PropertyChangeListener listener)
{
this.propertyChangeDelegate.removePropertyChangeListener(propertyName, listener);
} | [
"public",
"void",
"removePropertyChangeListener",
"(",
"String",
"propertyName",
",",
"java",
".",
"beans",
".",
"PropertyChangeListener",
"listener",
")",
"{",
"this",
".",
"propertyChangeDelegate",
".",
"removePropertyChangeListener",
"(",
"propertyName",
",",
"listen... | Remove a PropertyChangeListener for a specific property from this node.
This functionality has. Please note that the listener this does not remove
a listener that has been added without specifying the property it is
interested in. | [
"Remove",
"a",
"PropertyChangeListener",
"for",
"a",
"specific",
"property",
"from",
"this",
"node",
".",
"This",
"functionality",
"has",
".",
"Please",
"note",
"that",
"the",
"listener",
"this",
"does",
"not",
"remove",
"a",
"listener",
"that",
"has",
"been",... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/tools/org/apache/ojb/tools/mapping/reversedb2/propertyEditors/EditableTreeNodeWithProperties.java#L84-L87 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/KeyFieldHelper.java | KeyFieldHelper.setKeyFieldSpec | public void setKeyFieldSpec(int start, int end) {
"""
Required for backcompatibility with num.key.fields.for.partition in
{@link KeyFieldBasedPartitioner}
"""
if (end >= start) {
KeyDescription k = new KeyDescription();
k.beginFieldIdx = start;
k.endFieldIdx = end;
keySpecSeen = tr... | java | public void setKeyFieldSpec(int start, int end) {
if (end >= start) {
KeyDescription k = new KeyDescription();
k.beginFieldIdx = start;
k.endFieldIdx = end;
keySpecSeen = true;
allKeySpecs.add(k);
}
} | [
"public",
"void",
"setKeyFieldSpec",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"end",
">=",
"start",
")",
"{",
"KeyDescription",
"k",
"=",
"new",
"KeyDescription",
"(",
")",
";",
"k",
".",
"beginFieldIdx",
"=",
"start",
";",
"k",
"... | Required for backcompatibility with num.key.fields.for.partition in
{@link KeyFieldBasedPartitioner} | [
"Required",
"for",
"backcompatibility",
"with",
"num",
".",
"key",
".",
"fields",
".",
"for",
".",
"partition",
"in",
"{"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/KeyFieldHelper.java#L75-L83 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINKHDBSCANLinearMemory.java | SLINKHDBSCANLinearMemory.step1 | private void step1(DBIDRef id, WritableDBIDDataStore pi, WritableDoubleDataStore lambda) {
"""
First step: Initialize P(id) = id, L(id) = infinity.
@param id the id of the object to be inserted into the pointer
representation
@param pi Pi data store
@param lambda Lambda data store
"""
// P(n+1) = n+1... | java | private void step1(DBIDRef id, WritableDBIDDataStore pi, WritableDoubleDataStore lambda) {
// P(n+1) = n+1:
pi.put(id, id);
// L(n+1) = infinity
// Initialized already.
// lambda.putDouble(id, Double.POSITIVE_INFINITY);
} | [
"private",
"void",
"step1",
"(",
"DBIDRef",
"id",
",",
"WritableDBIDDataStore",
"pi",
",",
"WritableDoubleDataStore",
"lambda",
")",
"{",
"// P(n+1) = n+1:",
"pi",
".",
"put",
"(",
"id",
",",
"id",
")",
";",
"// L(n+1) = infinity",
"// Initialized already.",
"// l... | First step: Initialize P(id) = id, L(id) = infinity.
@param id the id of the object to be inserted into the pointer
representation
@param pi Pi data store
@param lambda Lambda data store | [
"First",
"step",
":",
"Initialize",
"P",
"(",
"id",
")",
"=",
"id",
"L",
"(",
"id",
")",
"=",
"infinity",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINKHDBSCANLinearMemory.java#L138-L144 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/GraphicsUtil.java | GraphicsUtil.createGraphics | public static Graphics2D createGraphics(BufferedImage image, Color color) {
"""
创建{@link Graphics2D}
@param image {@link BufferedImage}
@param color {@link Color}背景颜色以及当前画笔颜色
@return {@link Graphics2D}
@since 4.5.2
"""
final Graphics2D g = image.createGraphics();
// 填充背景
g.setColor(color);
g.... | java | public static Graphics2D createGraphics(BufferedImage image, Color color) {
final Graphics2D g = image.createGraphics();
// 填充背景
g.setColor(color);
g.fillRect(0, 0, image.getWidth(), image.getHeight());
return g;
} | [
"public",
"static",
"Graphics2D",
"createGraphics",
"(",
"BufferedImage",
"image",
",",
"Color",
"color",
")",
"{",
"final",
"Graphics2D",
"g",
"=",
"image",
".",
"createGraphics",
"(",
")",
";",
"// 填充背景\r",
"g",
".",
"setColor",
"(",
"color",
")",
";",
"... | 创建{@link Graphics2D}
@param image {@link BufferedImage}
@param color {@link Color}背景颜色以及当前画笔颜色
@return {@link Graphics2D}
@since 4.5.2 | [
"创建",
"{",
"@link",
"Graphics2D",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/GraphicsUtil.java#L25-L32 |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java | GenericCollectionTypeResolver.getMapValueFieldType | public static Class<?> getMapValueFieldType(Field mapField, int nestingLevel) {
"""
Determine the generic value type of the given Map field.
@param mapField the map field to introspect
@param nestingLevel the nesting level of the target type
(typically 1; e.g. in case of a List of Lists, 1 would indicate the
n... | java | public static Class<?> getMapValueFieldType(Field mapField, int nestingLevel) {
return getGenericFieldType(mapField, Map.class, 1, null, nestingLevel);
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getMapValueFieldType",
"(",
"Field",
"mapField",
",",
"int",
"nestingLevel",
")",
"{",
"return",
"getGenericFieldType",
"(",
"mapField",
",",
"Map",
".",
"class",
",",
"1",
",",
"null",
",",
"nestingLevel",
")",
... | Determine the generic value type of the given Map field.
@param mapField the map field to introspect
@param nestingLevel the nesting level of the target type
(typically 1; e.g. in case of a List of Lists, 1 would indicate the
nested List, whereas 2 would indicate the element of the nested List)
@return the generic type... | [
"Determine",
"the",
"generic",
"value",
"type",
"of",
"the",
"given",
"Map",
"field",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java#L160-L162 |
OpenTSDB/opentsdb | src/tools/UidManager.java | UidManager.lookupName | private static int lookupName(final HBaseClient client,
final byte[] table,
final short idwidth,
final String name,
final String kind) {
"""
Looks up a name and finds the corresponding UI... | java | private static int lookupName(final HBaseClient client,
final byte[] table,
final short idwidth,
final String name,
final String kind) {
if (kind != null) {
return extactLookupName(c... | [
"private",
"static",
"int",
"lookupName",
"(",
"final",
"HBaseClient",
"client",
",",
"final",
"byte",
"[",
"]",
"table",
",",
"final",
"short",
"idwidth",
",",
"final",
"String",
"name",
",",
"final",
"String",
"kind",
")",
"{",
"if",
"(",
"kind",
"!=",... | Looks up a name and finds the corresponding UID(s), if any.
@param client The HBase client to use.
@param table The name of the HBase table to use.
@param idwidth Number of bytes on which the UIDs should be.
@param name The name to look for.
@param kind The 'kind' of the ID (can be {@code null}).
@return The exit statu... | [
"Looks",
"up",
"a",
"name",
"and",
"finds",
"the",
"corresponding",
"UID",
"(",
"s",
")",
"if",
"any",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/UidManager.java#L938-L948 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsDefaultPageEditor.java | CmsDefaultPageEditor.buildSelectElementName | public String buildSelectElementName(String attributes) {
"""
Builds the html String for the element name selector.<p>
@param attributes optional attributes for the <select> tag
@return the html for the element name selectbox
"""
// get the active page elements
List<CmsDialogElement>... | java | public String buildSelectElementName(String attributes) {
// get the active page elements
List<CmsDialogElement> elementList = getElementList();
int counter = 0;
int currentIndex = -1;
List<String> options = new ArrayList<String>(elementList.size());
List<String> values... | [
"public",
"String",
"buildSelectElementName",
"(",
"String",
"attributes",
")",
"{",
"// get the active page elements",
"List",
"<",
"CmsDialogElement",
">",
"elementList",
"=",
"getElementList",
"(",
")",
";",
"int",
"counter",
"=",
"0",
";",
"int",
"currentIndex",... | Builds the html String for the element name selector.<p>
@param attributes optional attributes for the <select> tag
@return the html for the element name selectbox | [
"Builds",
"the",
"html",
"String",
"for",
"the",
"element",
"name",
"selector",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsDefaultPageEditor.java#L329-L359 |
baratine/baratine | core/src/main/java/com/caucho/v5/util/FreeList.java | FreeList.allocate | public final T allocate() {
"""
Try to get an object from the free list. Returns null if the free list
is empty.
@return the new object or null.
"""
AtomicInteger topRef = _top;
while (true) {
final int top = topRef.get();
if (top <= 0) {
return null;
}
else i... | java | public final T allocate()
{
AtomicInteger topRef = _top;
while (true) {
final int top = topRef.get();
if (top <= 0) {
return null;
}
else if (topRef.compareAndSet(top, top - 1)) {
T value = _freeStack.getAndSet(top - 1, null);
if (value != null) {... | [
"public",
"final",
"T",
"allocate",
"(",
")",
"{",
"AtomicInteger",
"topRef",
"=",
"_top",
";",
"while",
"(",
"true",
")",
"{",
"final",
"int",
"top",
"=",
"topRef",
".",
"get",
"(",
")",
";",
"if",
"(",
"top",
"<=",
"0",
")",
"{",
"return",
"nul... | Try to get an object from the free list. Returns null if the free list
is empty.
@return the new object or null. | [
"Try",
"to",
"get",
"an",
"object",
"from",
"the",
"free",
"list",
".",
"Returns",
"null",
"if",
"the",
"free",
"list",
"is",
"empty",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/FreeList.java#L69-L87 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/writer/http/SalesforceRestWriter.java | SalesforceRestWriter.onConnect | @Override
public void onConnect(URI serverHost) throws IOException {
"""
Retrieve access token, if needed, retrieve instance url, and set server host URL
{@inheritDoc}
@see org.apache.gobblin.writer.http.HttpWriter#onConnect(org.apache.http.HttpHost)
"""
if (!StringUtils.isEmpty(accessToken)) {
r... | java | @Override
public void onConnect(URI serverHost) throws IOException {
if (!StringUtils.isEmpty(accessToken)) {
return; //No need to be called if accessToken is active.
}
try {
getLog().info("Getting Oauth2 access token.");
OAuthClientRequest request = OAuthClientRequest.tokenLocation(ser... | [
"@",
"Override",
"public",
"void",
"onConnect",
"(",
"URI",
"serverHost",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"accessToken",
")",
")",
"{",
"return",
";",
"//No need to be called if accessToken is active.",
"}",
... | Retrieve access token, if needed, retrieve instance url, and set server host URL
{@inheritDoc}
@see org.apache.gobblin.writer.http.HttpWriter#onConnect(org.apache.http.HttpHost) | [
"Retrieve",
"access",
"token",
"if",
"needed",
"retrieve",
"instance",
"url",
"and",
"set",
"server",
"host",
"URL",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/writer/http/SalesforceRestWriter.java#L126-L152 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.splitEachLine | public static <T> T splitEachLine(Reader self, Pattern pattern, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException {
"""
Iterates through the given reader line by line, splitting each line using
the given regex separator Pattern. For each line, the given closure i... | java | public static <T> T splitEachLine(Reader self, Pattern pattern, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException {
BufferedReader br;
T result = null;
if (self instanceof BufferedReader)
br = (BufferedReader) self;
else
... | [
"public",
"static",
"<",
"T",
">",
"T",
"splitEachLine",
"(",
"Reader",
"self",
",",
"Pattern",
"pattern",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"\"List<String>\"",
")",
"Closure",
"<",
"T",
">",
"... | Iterates through the given reader line by line, splitting each line using
the given regex separator Pattern. For each line, the given closure is called with
a single parameter being the list of strings computed by splitting the line
around matches of the given regular expression. The Reader is closed afterwards.
<p>
H... | [
"Iterates",
"through",
"the",
"given",
"reader",
"line",
"by",
"line",
"splitting",
"each",
"line",
"using",
"the",
"given",
"regex",
"separator",
"Pattern",
".",
"For",
"each",
"line",
"the",
"given",
"closure",
"is",
"called",
"with",
"a",
"single",
"param... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L557-L584 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/manager/HBCIKernel.java | HBCIKernel.rawDoIt | public HBCIMsgStatus rawDoIt(Message message, boolean signit, boolean cryptit) {
"""
/* Processes the current message (mid-level API).
This method creates the message specified earlier by the methods rawNewJob() and
rawSet(), signs and encrypts it using the values of @p inst, @p user, @p signit
and @p crypit... | java | public HBCIMsgStatus rawDoIt(Message message, boolean signit, boolean cryptit) {
HBCIMsgStatus msgStatus = new HBCIMsgStatus();
try {
message.complete();
log.debug("generating raw message " + message.getName());
passport.getCallback().status(HBCICallback.STATUS_MSG_... | [
"public",
"HBCIMsgStatus",
"rawDoIt",
"(",
"Message",
"message",
",",
"boolean",
"signit",
",",
"boolean",
"cryptit",
")",
"{",
"HBCIMsgStatus",
"msgStatus",
"=",
"new",
"HBCIMsgStatus",
"(",
")",
";",
"try",
"{",
"message",
".",
"complete",
"(",
")",
";",
... | /* Processes the current message (mid-level API).
This method creates the message specified earlier by the methods rawNewJob() and
rawSet(), signs and encrypts it using the values of @p inst, @p user, @p signit
and @p crypit and sends it to server.
After that it waits for the response, decrypts it, checks the signat... | [
"/",
"*",
"Processes",
"the",
"current",
"message",
"(",
"mid",
"-",
"level",
"API",
")",
"."
] | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/manager/HBCIKernel.java#L78-L124 |
structr/structr | structr-core/src/main/java/org/structr/schema/action/Function.java | Function.assertArrayHasMinLengthAndAllElementsNotNull | protected void assertArrayHasMinLengthAndAllElementsNotNull(final Object[] array, final Integer minLength) throws ArgumentCountException, ArgumentNullException {
"""
Test if the given object array has a minimum length and all its elements are not null.
@param array
@param minLength
@throws IllegalArgumentExce... | java | protected void assertArrayHasMinLengthAndAllElementsNotNull(final Object[] array, final Integer minLength) throws ArgumentCountException, ArgumentNullException {
if (array.length < minLength) {
throw ArgumentCountException.tooFew(array.length, minLength);
}
for (final Object element : array) {
if (eleme... | [
"protected",
"void",
"assertArrayHasMinLengthAndAllElementsNotNull",
"(",
"final",
"Object",
"[",
"]",
"array",
",",
"final",
"Integer",
"minLength",
")",
"throws",
"ArgumentCountException",
",",
"ArgumentNullException",
"{",
"if",
"(",
"array",
".",
"length",
"<",
... | Test if the given object array has a minimum length and all its elements are not null.
@param array
@param minLength
@throws IllegalArgumentException in case of wrong number of parameters | [
"Test",
"if",
"the",
"given",
"object",
"array",
"has",
"a",
"minimum",
"length",
"and",
"all",
"its",
"elements",
"are",
"not",
"null",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/action/Function.java#L124-L136 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AuthResourcesV2.java | AuthResourcesV2.login | @POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Description("Authenticates a user and returns access and refresh tokens.")
@Path("/login")
public Response login(@Context HttpServletRequest req, final CredentialsDto creds) {
"""
Authenticates a user and return ... | java | @POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Description("Authenticates a user and returns access and refresh tokens.")
@Path("/login")
public Response login(@Context HttpServletRequest req, final CredentialsDto creds) {
try {
PrincipalUser u... | [
"@",
"POST",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Description",
"(",
"\"Authenticates a user and returns access and refresh tokens.\"",
")",
"@",
"Path",
"(",
"\"/login\... | Authenticates a user and return JsonWebTokens (AccessToken and RefreshToken).
@param req The HTTP request.
@param creds The credentials with which to authenticate.
@return The tokens (access and refresh) or Exception if authentication fails.
@throws WebApplicationException If the user is not authenticated... | [
"Authenticates",
"a",
"user",
"and",
"return",
"JsonWebTokens",
"(",
"AccessToken",
"and",
"RefreshToken",
")",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AuthResourcesV2.java#L80-L99 |
sarxos/v4l4j | src/main/java/au/edu/jcu/v4l4j/VideoDevice.java | VideoDevice.getRawFrameGrabber | public RawFrameGrabber getRawFrameGrabber(int w, int h, int input, int std)
throws V4L4JException {
"""
This method returns a {@link RawFrameGrabber} associated with this
video device. Captured frames will be handed out in the same format as
received from the driver. The chosen format is the one returned by
... | java | public RawFrameGrabber getRawFrameGrabber(int w, int h, int input, int std)
throws V4L4JException{
if(deviceInfo==null)
throw new ImageFormatException("No DeviceInfo could be obtained. "
+"The device is probably used by another application");
return getRawFrameGrabber(w, h, input, std,
deviceInfo.g... | [
"public",
"RawFrameGrabber",
"getRawFrameGrabber",
"(",
"int",
"w",
",",
"int",
"h",
",",
"int",
"input",
",",
"int",
"std",
")",
"throws",
"V4L4JException",
"{",
"if",
"(",
"deviceInfo",
"==",
"null",
")",
"throw",
"new",
"ImageFormatException",
"(",
"\"No ... | This method returns a {@link RawFrameGrabber} associated with this
video device. Captured frames will be handed out in the same format as
received from the driver. The chosen format is the one returned by
<code>getDeviceInfo().getFormatList().getNativeFormats().get(0)</code>. The
{@link RawFrameGrabber} must be release... | [
"This",
"method",
"returns",
"a",
"{"
] | train | https://github.com/sarxos/v4l4j/blob/4fc0eec2c3a1a4260593f6ac03b7a8013e3804c9/src/main/java/au/edu/jcu/v4l4j/VideoDevice.java#L1397-L1404 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.email_pro_email_GET | public OvhXdslEmailPro email_pro_email_GET(String email) throws IOException {
"""
Get this object properties
REST: GET /xdsl/email/pro/{email}
@param email [required] The email address if the XDSL Email Pro
"""
String qPath = "/xdsl/email/pro/{email}";
StringBuilder sb = path(qPath, email);
String re... | java | public OvhXdslEmailPro email_pro_email_GET(String email) throws IOException {
String qPath = "/xdsl/email/pro/{email}";
StringBuilder sb = path(qPath, email);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhXdslEmailPro.class);
} | [
"public",
"OvhXdslEmailPro",
"email_pro_email_GET",
"(",
"String",
"email",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/email/pro/{email}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"email",
")",
";",
"String",
"resp",
... | Get this object properties
REST: GET /xdsl/email/pro/{email}
@param email [required] The email address if the XDSL Email Pro | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1910-L1915 |
demidenko05/beigesoft-accounting | src/main/java/org/beigesoft/accounting/service/SrvBalanceStd.java | SrvBalanceStd.recalculateAllIfNeed | @Override
public final synchronized void recalculateAllIfNeed(
final Map<String, Object> pAddParam, final Date pDateFor) throws Exception {
"""
<p>Recalculate if need for all balances for all dates less
or equals pDateFor, this method is always invoked by report ledger.</p>
@param pAddParam additional para... | java | @Override
public final synchronized void recalculateAllIfNeed(
final Map<String, Object> pAddParam, final Date pDateFor) throws Exception {
//must be before evalDateBalanceStoreStart!!!
evalBalanceStorePeriod(pAddParam);
evalDateBalanceStoreStart(pAddParam);
Date datePeriodStartFor = evalDatePerio... | [
"@",
"Override",
"public",
"final",
"synchronized",
"void",
"recalculateAllIfNeed",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pAddParam",
",",
"final",
"Date",
"pDateFor",
")",
"throws",
"Exception",
"{",
"//must be before evalDateBalanceStoreStart!!!",... | <p>Recalculate if need for all balances for all dates less
or equals pDateFor, this method is always invoked by report ledger.</p>
@param pAddParam additional param
@param pDateFor date for
@throws Exception - an exception | [
"<p",
">",
"Recalculate",
"if",
"need",
"for",
"all",
"balances",
"for",
"all",
"dates",
"less",
"or",
"equals",
"pDateFor",
"this",
"method",
"is",
"always",
"invoked",
"by",
"report",
"ledger",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-accounting/blob/e6f423949008218ddd05953b078f1ea8805095c1/src/main/java/org/beigesoft/accounting/service/SrvBalanceStd.java#L236-L279 |
alkacon/opencms-core | src/org/opencms/xml/page/CmsXmlPage.java | CmsXmlPage.isEnabled | @Override
public boolean isEnabled(String name, Locale locale) {
"""
Checks if the element of a page object is enabled.<p>
@param name the name of the element
@param locale the locale of the element
@return true if the element exists and is not disabled
"""
CmsXmlHtmlValue value = (CmsXmlHtml... | java | @Override
public boolean isEnabled(String name, Locale locale) {
CmsXmlHtmlValue value = (CmsXmlHtmlValue)getValue(name, locale);
if (value != null) {
Element element = value.getElement();
Attribute enabled = element.attribute(ATTRIBUTE_ENABLED);
return ((enable... | [
"@",
"Override",
"public",
"boolean",
"isEnabled",
"(",
"String",
"name",
",",
"Locale",
"locale",
")",
"{",
"CmsXmlHtmlValue",
"value",
"=",
"(",
"CmsXmlHtmlValue",
")",
"getValue",
"(",
"name",
",",
"locale",
")",
";",
"if",
"(",
"value",
"!=",
"null",
... | Checks if the element of a page object is enabled.<p>
@param name the name of the element
@param locale the locale of the element
@return true if the element exists and is not disabled | [
"Checks",
"if",
"the",
"element",
"of",
"a",
"page",
"object",
"is",
"enabled",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/page/CmsXmlPage.java#L330-L342 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java | TableFormBuilder.addBinding | public JComponent[] addBinding(Binding binding, String attributes, String labelAttributes) {
"""
adds a field binding to the form. This method does not use the default label attributes which may have been set
through {@link #setLabelAttributes(String)}
@param binding
the binding of the field
@param attribute... | java | public JComponent[] addBinding(Binding binding, String attributes, String labelAttributes) {
return addBinding(binding, binding.getControl(), attributes, labelAttributes);
} | [
"public",
"JComponent",
"[",
"]",
"addBinding",
"(",
"Binding",
"binding",
",",
"String",
"attributes",
",",
"String",
"labelAttributes",
")",
"{",
"return",
"addBinding",
"(",
"binding",
",",
"binding",
".",
"getControl",
"(",
")",
",",
"attributes",
",",
"... | adds a field binding to the form. This method does not use the default label attributes which may have been set
through {@link #setLabelAttributes(String)}
@param binding
the binding of the field
@param attributes
optional layout attributes for the label. If null no layout attributes will be applied to the label.
See ... | [
"adds",
"a",
"field",
"binding",
"to",
"the",
"form",
".",
"This",
"method",
"does",
"not",
"use",
"the",
"default",
"label",
"attributes",
"which",
"may",
"have",
"been",
"set",
"through",
"{",
"@link",
"#setLabelAttributes",
"(",
"String",
")",
"}"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java#L394-L396 |
callstats-io/callstats.java | callstats-java-sample-maven/sample.sdk/src/main/java/io/callstats/sample/sdk/LocalTokenGenerator.java | LocalTokenGenerator.readEcPrivateKey | private PrivateKey readEcPrivateKey(String fileName) throws InvalidKeySpecException, NoSuchAlgorithmException, IOException, NoSuchProviderException {
"""
Reads JWK into PrivateKEy instance
@param fileName Path to the JWK file
@return java.security.PrivateKey instance of JWK
@throws InvalidKeySpecException
@thr... | java | private PrivateKey readEcPrivateKey(String fileName) throws InvalidKeySpecException, NoSuchAlgorithmException, IOException, NoSuchProviderException
{
StringBuilder sb = new StringBuilder();
BufferedReader br = new BufferedReader(new FileReader(fileName));
try {
char[] cbuf = new char[1024];
... | [
"private",
"PrivateKey",
"readEcPrivateKey",
"(",
"String",
"fileName",
")",
"throws",
"InvalidKeySpecException",
",",
"NoSuchAlgorithmException",
",",
"IOException",
",",
"NoSuchProviderException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",... | Reads JWK into PrivateKEy instance
@param fileName Path to the JWK file
@return java.security.PrivateKey instance of JWK
@throws InvalidKeySpecException
@throws NoSuchAlgorithmException
@throws IOException
@throws NoSuchProviderException | [
"Reads",
"JWK",
"into",
"PrivateKEy",
"instance"
] | train | https://github.com/callstats-io/callstats.java/blob/04ec34f1490b75952ed90da706d59e311e2b44f1/callstats-java-sample-maven/sample.sdk/src/main/java/io/callstats/sample/sdk/LocalTokenGenerator.java#L182-L213 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/stream/BigDecimalStream.java | BigDecimalStream.range | public static Stream<BigDecimal> range(BigDecimal startInclusive, BigDecimal endExclusive, BigDecimal step, MathContext mathContext) {
"""
Returns a sequential ordered {@code Stream<BigDecimal>} from {@code startInclusive}
(inclusive) to {@code endExclusive} (exclusive) by an incremental {@code step}.
<p>An eq... | java | public static Stream<BigDecimal> range(BigDecimal startInclusive, BigDecimal endExclusive, BigDecimal step, MathContext mathContext) {
if (step.signum() == 0) {
throw new IllegalArgumentException("invalid step: 0");
}
if (endExclusive.subtract(startInclusive).signum() != step.signum()) {
retur... | [
"public",
"static",
"Stream",
"<",
"BigDecimal",
">",
"range",
"(",
"BigDecimal",
"startInclusive",
",",
"BigDecimal",
"endExclusive",
",",
"BigDecimal",
"step",
",",
"MathContext",
"mathContext",
")",
"{",
"if",
"(",
"step",
".",
"signum",
"(",
")",
"==",
"... | Returns a sequential ordered {@code Stream<BigDecimal>} from {@code startInclusive}
(inclusive) to {@code endExclusive} (exclusive) by an incremental {@code step}.
<p>An equivalent sequence of increasing values can be produced
sequentially using a {@code for} loop as follows:
<pre>for (BigDecimal i = startInclusive; i... | [
"Returns",
"a",
"sequential",
"ordered",
"{",
"@code",
"Stream<BigDecimal",
">",
"}",
"from",
"{",
"@code",
"startInclusive",
"}",
"(",
"inclusive",
")",
"to",
"{",
"@code",
"endExclusive",
"}",
"(",
"exclusive",
")",
"by",
"an",
"incremental",
"{",
"@code",... | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/stream/BigDecimalStream.java#L35-L43 |
nguyenq/tess4j | src/main/java/com/recognition/software/jdeskew/ImageUtil.java | ImageUtil.isBlack | public static boolean isBlack(BufferedImage image, int x, int y, int luminanceCutOff) {
"""
Whether the pixel is black.
@param image source image
@param x
@param y
@param luminanceCutOff
@return
"""
int pixelRGBValue;
int r;
int g;
int b;
double luminance = 0... | java | public static boolean isBlack(BufferedImage image, int x, int y, int luminanceCutOff) {
int pixelRGBValue;
int r;
int g;
int b;
double luminance = 0.0;
// return white on areas outside of image boundaries
if (x < 0 || y < 0 || x > image.getWidth() || y > ... | [
"public",
"static",
"boolean",
"isBlack",
"(",
"BufferedImage",
"image",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"luminanceCutOff",
")",
"{",
"int",
"pixelRGBValue",
";",
"int",
"r",
";",
"int",
"g",
";",
"int",
"b",
";",
"double",
"luminance",
"... | Whether the pixel is black.
@param image source image
@param x
@param y
@param luminanceCutOff
@return | [
"Whether",
"the",
"pixel",
"is",
"black",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/com/recognition/software/jdeskew/ImageUtil.java#L49-L72 |
foundation-runtime/service-directory | 1.1/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/HttpUtils.java | HttpUtils.putJson | public static HttpResponse putJson(String urlStr, String body) throws IOException {
"""
Invoke REST Service using PUT method.
@param urlStr
the REST Service URL String.
@param body
the Http Body String.
@return the HttpResponse.
@throws IOException
"""
Map<String, String> headers = new HashMap<... | java | public static HttpResponse putJson(String urlStr, String body) throws IOException {
Map<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/json");
return put(urlStr, body, headers);
} | [
"public",
"static",
"HttpResponse",
"putJson",
"(",
"String",
"urlStr",
",",
"String",
"body",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";"... | Invoke REST Service using PUT method.
@param urlStr
the REST Service URL String.
@param body
the Http Body String.
@return the HttpResponse.
@throws IOException | [
"Invoke",
"REST",
"Service",
"using",
"PUT",
"method",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.1/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/HttpUtils.java#L93-L97 |
datasift/datasift-java | src/main/java/com/datasift/client/managedsource/sources/FacebookPage.java | FacebookPage.addPage | public FacebookPage addPage(String id, String url, String title) {
"""
/*
Adds information about a single facebook page
@param id the id of the facebook page
@param url the facebook page's URL
@param title the page's title
@return this
"""
ResourceParams parameterSet = newResourceParams();
... | java | public FacebookPage addPage(String id, String url, String title) {
ResourceParams parameterSet = newResourceParams();
parameterSet.set("id", id);
parameterSet.set("url", url);
parameterSet.set("title", title);
return this;
} | [
"public",
"FacebookPage",
"addPage",
"(",
"String",
"id",
",",
"String",
"url",
",",
"String",
"title",
")",
"{",
"ResourceParams",
"parameterSet",
"=",
"newResourceParams",
"(",
")",
";",
"parameterSet",
".",
"set",
"(",
"\"id\"",
",",
"id",
")",
";",
"pa... | /*
Adds information about a single facebook page
@param id the id of the facebook page
@param url the facebook page's URL
@param title the page's title
@return this | [
"/",
"*",
"Adds",
"information",
"about",
"a",
"single",
"facebook",
"page"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/managedsource/sources/FacebookPage.java#L71-L77 |
tweea/matrixjavalib-main-common | src/main/java/net/matrix/lang/Reflections.java | Reflections.invokeMethod | public static <T> T invokeMethod(final Object target, final String name, final Class<?>[] parameterTypes, final Object[] parameterValues) {
"""
直接调用对象方法,无视 private/protected 修饰符。
用于一次性调用的情况,否则应使用 getAccessibleMethod() 函数获得 Method 后反复调用。
同时匹配方法名 + 参数类型。
@param target
目标对象
@param name
方法名
@param parameterTy... | java | public static <T> T invokeMethod(final Object target, final String name, final Class<?>[] parameterTypes, final Object[] parameterValues) {
Method method = getAccessibleMethod(target, name, parameterTypes);
if (method == null) {
throw new IllegalArgumentException("Could not find method [" + name + "] on targe... | [
"public",
"static",
"<",
"T",
">",
"T",
"invokeMethod",
"(",
"final",
"Object",
"target",
",",
"final",
"String",
"name",
",",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
",",
"final",
"Object",
"[",
"]",
"parameterValues",
")",
"{",
"... | 直接调用对象方法,无视 private/protected 修饰符。
用于一次性调用的情况,否则应使用 getAccessibleMethod() 函数获得 Method 后反复调用。
同时匹配方法名 + 参数类型。
@param target
目标对象
@param name
方法名
@param parameterTypes
参数类型
@param parameterValues
参数值
@param <T>
期待的返回值类型
@return 返回值 | [
"直接调用对象方法,无视",
"private",
"/",
"protected",
"修饰符。",
"用于一次性调用的情况,否则应使用",
"getAccessibleMethod",
"()",
"函数获得",
"Method",
"后反复调用。",
"同时匹配方法名",
"+",
"参数类型。"
] | train | https://github.com/tweea/matrixjavalib-main-common/blob/ac8f98322a422e3ef76c3e12d47b98268cec7006/src/main/java/net/matrix/lang/Reflections.java#L145-L156 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/loader/BindingXmlLoader.java | BindingXmlLoader.loadDocument | private static Document loadDocument(URL location) throws IOException, ParserConfigurationException, SAXException {
"""
Helper method to load a DOM Document from the given configuration URL
@param location The configuration URL
@return A W3C DOM Document
@throws IOException If the configuration cannot be read
... | java | private static Document loadDocument(URL location) throws IOException, ParserConfigurationException, SAXException {
InputStream inputStream = null;
if (location != null) {
URLConnection urlConnection = location.openConnection();
urlConnection.setUseCaches(false);
... | [
"private",
"static",
"Document",
"loadDocument",
"(",
"URL",
"location",
")",
"throws",
"IOException",
",",
"ParserConfigurationException",
",",
"SAXException",
"{",
"InputStream",
"inputStream",
"=",
"null",
";",
"if",
"(",
"location",
"!=",
"null",
")",
"{",
"... | Helper method to load a DOM Document from the given configuration URL
@param location The configuration URL
@return A W3C DOM Document
@throws IOException If the configuration cannot be read
@throws ParserConfigurationException If the DOM Parser cannot be initialised
@throws SAXException If the configuraiton cannot be ... | [
"Helper",
"method",
"to",
"load",
"a",
"DOM",
"Document",
"from",
"the",
"given",
"configuration",
"URL"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/loader/BindingXmlLoader.java#L87-L118 |
devnied/Bit-lib4j | src/main/java/fr/devnied/bitlib/BitUtils.java | BitUtils.setNextString | public void setNextString(final String pValue, final int pLength, final boolean pPaddedBefore) {
"""
Method to write a String
@param pValue
the string to write
@param pLength
the string length
@param pPaddedBefore
indicate if the string is padded before or after
"""
setNextByte(pValue.getBytes(Chars... | java | public void setNextString(final String pValue, final int pLength, final boolean pPaddedBefore) {
setNextByte(pValue.getBytes(Charset.defaultCharset()), pLength, pPaddedBefore);
} | [
"public",
"void",
"setNextString",
"(",
"final",
"String",
"pValue",
",",
"final",
"int",
"pLength",
",",
"final",
"boolean",
"pPaddedBefore",
")",
"{",
"setNextByte",
"(",
"pValue",
".",
"getBytes",
"(",
"Charset",
".",
"defaultCharset",
"(",
")",
")",
",",... | Method to write a String
@param pValue
the string to write
@param pLength
the string length
@param pPaddedBefore
indicate if the string is padded before or after | [
"Method",
"to",
"write",
"a",
"String"
] | train | https://github.com/devnied/Bit-lib4j/blob/bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0/src/main/java/fr/devnied/bitlib/BitUtils.java#L661-L663 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/aggregate/MiniBatchGlobalGroupAggFunction.java | MiniBatchGlobalGroupAggFunction.addInput | @Override
public BaseRow addInput(@Nullable BaseRow previousAcc, BaseRow input) throws Exception {
"""
The {@code previousAcc} is accumulator, but input is a row in <key, accumulator> schema,
the specific generated {@link #localAgg} will project the {@code input} to accumulator
in merge method.
"""
... | java | @Override
public BaseRow addInput(@Nullable BaseRow previousAcc, BaseRow input) throws Exception {
BaseRow currentAcc;
if (previousAcc == null) {
currentAcc = localAgg.createAccumulators();
} else {
currentAcc = previousAcc;
}
localAgg.setAccumulators(currentAcc);
localAgg.merge(input);
return loc... | [
"@",
"Override",
"public",
"BaseRow",
"addInput",
"(",
"@",
"Nullable",
"BaseRow",
"previousAcc",
",",
"BaseRow",
"input",
")",
"throws",
"Exception",
"{",
"BaseRow",
"currentAcc",
";",
"if",
"(",
"previousAcc",
"==",
"null",
")",
"{",
"currentAcc",
"=",
"lo... | The {@code previousAcc} is accumulator, but input is a row in <key, accumulator> schema,
the specific generated {@link #localAgg} will project the {@code input} to accumulator
in merge method. | [
"The",
"{"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/aggregate/MiniBatchGlobalGroupAggFunction.java#L149-L161 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.populateFaultInCDC | private void populateFaultInCDC(CDCQueryResult cdcQueryResult, QueryResult queryResult) {
"""
Method to populate the fault in CDCQueryResult if any
@param cdcQueryResult the CDCQueryResult
@param queryResult the QueryResult
"""
if (queryResult != null) {
Fault fault = queryResult.getFau... | java | private void populateFaultInCDC(CDCQueryResult cdcQueryResult, QueryResult queryResult) {
if (queryResult != null) {
Fault fault = queryResult.getFault();
if (fault != null) {
cdcQueryResult.setFalut(fault);
}
}
} | [
"private",
"void",
"populateFaultInCDC",
"(",
"CDCQueryResult",
"cdcQueryResult",
",",
"QueryResult",
"queryResult",
")",
"{",
"if",
"(",
"queryResult",
"!=",
"null",
")",
"{",
"Fault",
"fault",
"=",
"queryResult",
".",
"getFault",
"(",
")",
";",
"if",
"(",
... | Method to populate the fault in CDCQueryResult if any
@param cdcQueryResult the CDCQueryResult
@param queryResult the QueryResult | [
"Method",
"to",
"populate",
"the",
"fault",
"in",
"CDCQueryResult",
"if",
"any"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L1716-L1723 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.addServerMapping | public ServerRedirect addServerMapping(String sourceHost, String destinationHost, String hostHeader) {
"""
Add a new server mapping to current profile
@param sourceHost source hostname
@param destinationHost destination hostname
@param hostHeader host header
@return ServerRedirect
"""
JSONObject ... | java | public ServerRedirect addServerMapping(String sourceHost, String destinationHost, String hostHeader) {
JSONObject response = null;
ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
params.add(new BasicNameValuePair("srcUrl", sourceHost));
params.add(new BasicNa... | [
"public",
"ServerRedirect",
"addServerMapping",
"(",
"String",
"sourceHost",
",",
"String",
"destinationHost",
",",
"String",
"hostHeader",
")",
"{",
"JSONObject",
"response",
"=",
"null",
";",
"ArrayList",
"<",
"BasicNameValuePair",
">",
"params",
"=",
"new",
"Ar... | Add a new server mapping to current profile
@param sourceHost source hostname
@param destinationHost destination hostname
@param hostHeader host header
@return ServerRedirect | [
"Add",
"a",
"new",
"server",
"mapping",
"to",
"current",
"profile"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1011-L1031 |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.writeFileToTempDirectory | public static File writeFileToTempDirectory(final byte[] data, final String fileName) {
"""
Write file to temp directory.
@param data the data
@param fileName the file name
@return the file
"""
try {
File file = createTempDirectory();
File out = new File(file, fileName);
out.deleteOnExi... | java | public static File writeFileToTempDirectory(final byte[] data, final String fileName) {
try {
File file = createTempDirectory();
File out = new File(file, fileName);
out.deleteOnExit();
file.deleteOnExit();
return writeDataToFile(data, out);
} catch (IOException e) {
JKExceptionUtil.handle... | [
"public",
"static",
"File",
"writeFileToTempDirectory",
"(",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"String",
"fileName",
")",
"{",
"try",
"{",
"File",
"file",
"=",
"createTempDirectory",
"(",
")",
";",
"File",
"out",
"=",
"new",
"File",
"(",
"... | Write file to temp directory.
@param data the data
@param fileName the file name
@return the file | [
"Write",
"file",
"to",
"temp",
"directory",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L422-L433 |
ontop/ontop | mapping/sql/r2rml/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/R2RMLParser.java | R2RMLParser.getTermTypeAtom | private ImmutableFunctionalTerm getTermTypeAtom(String string, Object type, String joinCond) {
"""
get a typed atom of a specific type
@param type
- iri, blanknode or literal
@param string
- the atom as string
@return the contructed Function atom
"""
if (type.equals(R2RMLVocabulary.iri)) {
return... | java | private ImmutableFunctionalTerm getTermTypeAtom(String string, Object type, String joinCond) {
if (type.equals(R2RMLVocabulary.iri)) {
return getURIFunction(string, joinCond);
} else if (type.equals(R2RMLVocabulary.blankNode)) {
return getTypedFunction(string, 2, joinCond);
} else if (type.equals(R2RML... | [
"private",
"ImmutableFunctionalTerm",
"getTermTypeAtom",
"(",
"String",
"string",
",",
"Object",
"type",
",",
"String",
"joinCond",
")",
"{",
"if",
"(",
"type",
".",
"equals",
"(",
"R2RMLVocabulary",
".",
"iri",
")",
")",
"{",
"return",
"getURIFunction",
"(",
... | get a typed atom of a specific type
@param type
- iri, blanknode or literal
@param string
- the atom as string
@return the contructed Function atom | [
"get",
"a",
"typed",
"atom",
"of",
"a",
"specific",
"type"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/r2rml/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/R2RMLParser.java#L409-L424 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/util/IOHelper.java | IOHelper.httpPost | @SuppressWarnings("resource")
public static InputStream httpPost(final String httpurl, final String data, final Map<String, String>... requestProperties) throws IOException {
"""
Simple http post implementation. Supports HTTP Basic authentication via request properties.
You may want to use {@link #createBasic... | java | @SuppressWarnings("resource")
public static InputStream httpPost(final String httpurl, final String data, final Map<String, String>... requestProperties) throws IOException {
byte[] bytes = data.getBytes("utf-8");
java.net.URL url = new java.net.URL(httpurl);
HttpURLConnection connection = (... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"public",
"static",
"InputStream",
"httpPost",
"(",
"final",
"String",
"httpurl",
",",
"final",
"String",
"data",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"...",
"requestProperties",
")",
"throw... | Simple http post implementation. Supports HTTP Basic authentication via request properties.
You may want to use {@link #createBasicAuthenticationProperty} to add authentication.
@param httpurl
target url
@param data
String with content to post
@param requestProperties
optional http header fields (key->value)
@retur... | [
"Simple",
"http",
"post",
"implementation",
".",
"Supports",
"HTTP",
"Basic",
"authentication",
"via",
"request",
"properties",
".",
"You",
"may",
"want",
"to",
"use",
"{",
"@link",
"#createBasicAuthenticationProperty",
"}",
"to",
"add",
"authentication",
"."
] | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/util/IOHelper.java#L118-L135 |
ontop/ontop | mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/RAExpression.java | RAExpression.joinUsing | public static RAExpression joinUsing(RAExpression re1, RAExpression re2,
ImmutableSet<QuotedID> using, TermFactory termFactory) throws IllegalJoinException {
"""
JOIN USING
@param re1 a {@link RAExpression}
@param re2 a {@link RAExpression}
@param using a {@link Immuta... | java | public static RAExpression joinUsing(RAExpression re1, RAExpression re2,
ImmutableSet<QuotedID> using, TermFactory termFactory) throws IllegalJoinException {
RAExpressionAttributes attributes =
RAExpressionAttributes.joinUsing(re1.attributes, re2.attribu... | [
"public",
"static",
"RAExpression",
"joinUsing",
"(",
"RAExpression",
"re1",
",",
"RAExpression",
"re2",
",",
"ImmutableSet",
"<",
"QuotedID",
">",
"using",
",",
"TermFactory",
"termFactory",
")",
"throws",
"IllegalJoinException",
"{",
"RAExpressionAttributes",
"attri... | JOIN USING
@param re1 a {@link RAExpression}
@param re2 a {@link RAExpression}
@param using a {@link ImmutableSet}<{@link QuotedID}>
@return a {@link RAExpression}
@throws IllegalJoinException if the same alias occurs in both arguments
or one of the `using' attributes is ambiguous or absent | [
"JOIN",
"USING"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/parser/impl/RAExpression.java#L130-L140 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java | ContinuousDistributions.multinomialGaussianSample | public static double[] multinomialGaussianSample(double[] mean, double[][] covariance) {
"""
Samples from Multinomial Normal Distribution.
@param mean
@param covariance
@return A multinomialGaussianSample from the Multinomial Normal Distribution
"""
MultivariateNormalDistribution gaus... | java | public static double[] multinomialGaussianSample(double[] mean, double[][] covariance) {
MultivariateNormalDistribution gaussian = new
MultivariateNormalDistribution(mean, covariance);
gaussian.reseedRandomGenerator(RandomGenerator.getThreadLocalRandom().nextLong());
return gaussian... | [
"public",
"static",
"double",
"[",
"]",
"multinomialGaussianSample",
"(",
"double",
"[",
"]",
"mean",
",",
"double",
"[",
"]",
"[",
"]",
"covariance",
")",
"{",
"MultivariateNormalDistribution",
"gaussian",
"=",
"new",
"MultivariateNormalDistribution",
"(",
"mean"... | Samples from Multinomial Normal Distribution.
@param mean
@param covariance
@return A multinomialGaussianSample from the Multinomial Normal Distribution | [
"Samples",
"from",
"Multinomial",
"Normal",
"Distribution",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java#L643-L648 |
mapsforge/mapsforge | mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/group/ChildMarker.java | ChildMarker.init | public void init(int index, Bitmap bitmap, int horizontalOffset, int verticalOffset) {
"""
Set group marker parameter. To know index and calculate position on spiral.
@param index the index of this child marker.
@param bitmap the bitmap of the group marker.
@param horizontalOffset the hor... | java | public void init(int index, Bitmap bitmap, int horizontalOffset, int verticalOffset) {
this.index = index;
this.groupBitmapHalfHeight = bitmap.getHeight() / 2;
this.groupBitmapHalfWidth = bitmap.getWidth() / 2;
this.groupHOffset = horizontalOffset;
this.groupVOffset = verticalOf... | [
"public",
"void",
"init",
"(",
"int",
"index",
",",
"Bitmap",
"bitmap",
",",
"int",
"horizontalOffset",
",",
"int",
"verticalOffset",
")",
"{",
"this",
".",
"index",
"=",
"index",
";",
"this",
".",
"groupBitmapHalfHeight",
"=",
"bitmap",
".",
"getHeight",
... | Set group marker parameter. To know index and calculate position on spiral.
@param index the index of this child marker.
@param bitmap the bitmap of the group marker.
@param horizontalOffset the horizontal offset of the group marker.
@param verticalOffset the vertical offset of the group marker. | [
"Set",
"group",
"marker",
"parameter",
".",
"To",
"know",
"index",
"and",
"calculate",
"position",
"on",
"spiral",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/group/ChildMarker.java#L125-L132 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/basic/service_binding.java | service_binding.get | public static service_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch service_binding resource of given name .
"""
service_binding obj = new service_binding();
obj.set_name(name);
service_binding response = (service_binding) obj.get_resource(service);
return... | java | public static service_binding get(nitro_service service, String name) throws Exception{
service_binding obj = new service_binding();
obj.set_name(name);
service_binding response = (service_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"service_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"service_binding",
"obj",
"=",
"new",
"service_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"ser... | Use this API to fetch service_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"service_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/basic/service_binding.java#L125-L130 |
oboehm/jfachwert | src/main/java/de/jfachwert/pruefung/NumberValidator.java | NumberValidator.verifyNumber | public Number verifyNumber(Number number) {
"""
Verifiziert die uebergebene Nummer, ob sie eine gueltige Nummer und
nicht unendlich oder 'NaN' ist. Falls die Nummer unendlich oder 'NaN'
ist, wird eine {@link ArithmeticException} geworfen.
@param number zu pruefende Nummer
@return die Nummer selbst zur Weiter... | java | public Number verifyNumber(Number number) {
if ((number instanceof Double) || (number instanceof Float)) {
double dValue = number.doubleValue();
if (Double.isNaN(dValue) || Double.isInfinite(dValue)) {
throw new LocalizedArithmeticException(dValue, NUMBER);
}
... | [
"public",
"Number",
"verifyNumber",
"(",
"Number",
"number",
")",
"{",
"if",
"(",
"(",
"number",
"instanceof",
"Double",
")",
"||",
"(",
"number",
"instanceof",
"Float",
")",
")",
"{",
"double",
"dValue",
"=",
"number",
".",
"doubleValue",
"(",
")",
";",... | Verifiziert die uebergebene Nummer, ob sie eine gueltige Nummer und
nicht unendlich oder 'NaN' ist. Falls die Nummer unendlich oder 'NaN'
ist, wird eine {@link ArithmeticException} geworfen.
@param number zu pruefende Nummer
@return die Nummer selbst zur Weiterverarbeitung | [
"Verifiziert",
"die",
"uebergebene",
"Nummer",
"ob",
"sie",
"eine",
"gueltige",
"Nummer",
"und",
"nicht",
"unendlich",
"oder",
"NaN",
"ist",
".",
"Falls",
"die",
"Nummer",
"unendlich",
"oder",
"NaN",
"ist",
"wird",
"eine",
"{",
"@link",
"ArithmeticException",
... | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/pruefung/NumberValidator.java#L130-L138 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.forceLoadTile | public boolean forceLoadTile(final OnlineTileSourceBase tileSource, final long pMapTileIndex) {
"""
Actual tile download, regardless of the tile being already present in the cache
@return true if success, false if error
@since 5.6.5
"""
try {
final Drawable drawable = mTileDownloader.do... | java | public boolean forceLoadTile(final OnlineTileSourceBase tileSource, final long pMapTileIndex) {
try {
final Drawable drawable = mTileDownloader.downloadTile(pMapTileIndex, mTileWriter, tileSource);
return drawable != null;
} catch (CantContinueException e) {
return fa... | [
"public",
"boolean",
"forceLoadTile",
"(",
"final",
"OnlineTileSourceBase",
"tileSource",
",",
"final",
"long",
"pMapTileIndex",
")",
"{",
"try",
"{",
"final",
"Drawable",
"drawable",
"=",
"mTileDownloader",
".",
"downloadTile",
"(",
"pMapTileIndex",
",",
"mTileWrit... | Actual tile download, regardless of the tile being already present in the cache
@return true if success, false if error
@since 5.6.5 | [
"Actual",
"tile",
"download",
"regardless",
"of",
"the",
"tile",
"being",
"already",
"present",
"in",
"the",
"cache"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L166-L173 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockStore.java | UnderFileSystemBlockStore.releaseAccess | public void releaseAccess(long sessionId, long blockId) {
"""
Releases the access token of this block by removing this (sessionId, blockId) pair from the
store.
@param sessionId the session ID
@param blockId the block ID
"""
try (LockResource lr = new LockResource(mLock)) {
Key key = new Key(ses... | java | public void releaseAccess(long sessionId, long blockId) {
try (LockResource lr = new LockResource(mLock)) {
Key key = new Key(sessionId, blockId);
if (!mBlocks.containsKey(key)) {
LOG.warn("Key (block ID: {}, session ID {}) is not found when releasing the UFS block.",
blockId, sessio... | [
"public",
"void",
"releaseAccess",
"(",
"long",
"sessionId",
",",
"long",
"blockId",
")",
"{",
"try",
"(",
"LockResource",
"lr",
"=",
"new",
"LockResource",
"(",
"mLock",
")",
")",
"{",
"Key",
"key",
"=",
"new",
"Key",
"(",
"sessionId",
",",
"blockId",
... | Releases the access token of this block by removing this (sessionId, blockId) pair from the
store.
@param sessionId the session ID
@param blockId the block ID | [
"Releases",
"the",
"access",
"token",
"of",
"this",
"block",
"by",
"removing",
"this",
"(",
"sessionId",
"blockId",
")",
"pair",
"from",
"the",
"store",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/UnderFileSystemBlockStore.java#L165-L188 |
landawn/AbacusUtil | src/com/landawn/abacus/hash/FarmHashFingerprint64.java | FarmHashFingerprint64.hashLength65Plus | private static long hashLength65Plus(byte[] bytes, int offset, int length) {
"""
/*
Compute an 8-byte hash of a byte array of length greater than 64 bytes.
"""
final int seed = 81;
// For strings over 64 bytes we loop. Internal state consists of 56 bytes: v, w, x, y, and z.
long x = se... | java | private static long hashLength65Plus(byte[] bytes, int offset, int length) {
final int seed = 81;
// For strings over 64 bytes we loop. Internal state consists of 56 bytes: v, w, x, y, and z.
long x = seed;
// @SuppressWarnings("ConstantOverflow")
long y = seed * K1 + 113;
... | [
"private",
"static",
"long",
"hashLength65Plus",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"final",
"int",
"seed",
"=",
"81",
";",
"// For strings over 64 bytes we loop. Internal state consists of 56 bytes: v, w, x, y, and z."... | /*
Compute an 8-byte hash of a byte array of length greater than 64 bytes. | [
"/",
"*",
"Compute",
"an",
"8",
"-",
"byte",
"hash",
"of",
"a",
"byte",
"array",
"of",
"length",
"greater",
"than",
"64",
"bytes",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/hash/FarmHashFingerprint64.java#L165-L205 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java | DirectoryServiceClient.setUser | public void setUser(String userName, String password) {
"""
Set the user for the DirectoryServiceClient.
It will ask the DirectoryConnection to do authentication again.
@param userName
the user name.
@param password
the password.
"""
if(userName != null && ! userName.isEmpty()){
co... | java | public void setUser(String userName, String password){
if(userName != null && ! userName.isEmpty()){
connection.setDirectoryUser(userName, password);
}
} | [
"public",
"void",
"setUser",
"(",
"String",
"userName",
",",
"String",
"password",
")",
"{",
"if",
"(",
"userName",
"!=",
"null",
"&&",
"!",
"userName",
".",
"isEmpty",
"(",
")",
")",
"{",
"connection",
".",
"setDirectoryUser",
"(",
"userName",
",",
"pas... | Set the user for the DirectoryServiceClient.
It will ask the DirectoryConnection to do authentication again.
@param userName
the user name.
@param password
the password. | [
"Set",
"the",
"user",
"for",
"the",
"DirectoryServiceClient",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L198-L202 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.encodeString | public static ByteBuf encodeString(ByteBufAllocator alloc, CharBuffer src, Charset charset, int extraCapacity) {
"""
Encode the given {@link CharBuffer} using the given {@link Charset} into a new {@link ByteBuf} which
is allocated via the {@link ByteBufAllocator}.
@param alloc The {@link ByteBufAllocator} to a... | java | public static ByteBuf encodeString(ByteBufAllocator alloc, CharBuffer src, Charset charset, int extraCapacity) {
return encodeString0(alloc, false, src, charset, extraCapacity);
} | [
"public",
"static",
"ByteBuf",
"encodeString",
"(",
"ByteBufAllocator",
"alloc",
",",
"CharBuffer",
"src",
",",
"Charset",
"charset",
",",
"int",
"extraCapacity",
")",
"{",
"return",
"encodeString0",
"(",
"alloc",
",",
"false",
",",
"src",
",",
"charset",
",",... | Encode the given {@link CharBuffer} using the given {@link Charset} into a new {@link ByteBuf} which
is allocated via the {@link ByteBufAllocator}.
@param alloc The {@link ByteBufAllocator} to allocate {@link ByteBuf}.
@param src The {@link CharBuffer} to encode.
@param charset The specified {@link Charset}.
@param ex... | [
"Encode",
"the",
"given",
"{",
"@link",
"CharBuffer",
"}",
"using",
"the",
"given",
"{",
"@link",
"Charset",
"}",
"into",
"a",
"new",
"{",
"@link",
"ByteBuf",
"}",
"which",
"is",
"allocated",
"via",
"the",
"{",
"@link",
"ByteBufAllocator",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L739-L741 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.findBestMethodUsingParamNames | private AMethodWithItsArgs findBestMethodUsingParamNames(Set<Method> methods, Set<String> paramNames, ObjectNode paramNodes) {
"""
Finds the {@link Method} from the supplied {@link Set} that best matches the rest of the arguments supplied and
returns it as a {@link AMethodWithItsArgs} class.
@param methods ... | java | private AMethodWithItsArgs findBestMethodUsingParamNames(Set<Method> methods, Set<String> paramNames, ObjectNode paramNodes) {
ParameterCount max = new ParameterCount();
for (Method method : methods) {
List<Class<?>> parameterTypes = getParameterTypes(method);
int typeNameCountDiff = parameterTypes.siz... | [
"private",
"AMethodWithItsArgs",
"findBestMethodUsingParamNames",
"(",
"Set",
"<",
"Method",
">",
"methods",
",",
"Set",
"<",
"String",
">",
"paramNames",
",",
"ObjectNode",
"paramNodes",
")",
"{",
"ParameterCount",
"max",
"=",
"new",
"ParameterCount",
"(",
")",
... | Finds the {@link Method} from the supplied {@link Set} that best matches the rest of the arguments supplied and
returns it as a {@link AMethodWithItsArgs} class.
@param methods the {@link Method}s
@param paramNames the parameter allNames
@param paramNodes the parameters for matching types
@return the {@link AMethod... | [
"Finds",
"the",
"{",
"@link",
"Method",
"}",
"from",
"the",
"supplied",
"{",
"@link",
"Set",
"}",
"that",
"best",
"matches",
"the",
"rest",
"of",
"the",
"arguments",
"supplied",
"and",
"returns",
"it",
"as",
"a",
"{",
"@link",
"AMethodWithItsArgs",
"}",
... | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L768-L792 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java | BaseSerializer.deserializeTransformList | public List<Transform> deserializeTransformList(String str) {
"""
Deserialize a Transform List serialized using {@link #serializeTransformList(List)}, or
an array serialized using {@link #serialize(Transform[])}
@param str String representation (YAML/JSON) of the Transform list
@return {@code List<Transform>}... | java | public List<Transform> deserializeTransformList(String str) {
return load(str, ListWrappers.TransformList.class).getList();
} | [
"public",
"List",
"<",
"Transform",
">",
"deserializeTransformList",
"(",
"String",
"str",
")",
"{",
"return",
"load",
"(",
"str",
",",
"ListWrappers",
".",
"TransformList",
".",
"class",
")",
".",
"getList",
"(",
")",
";",
"}"
] | Deserialize a Transform List serialized using {@link #serializeTransformList(List)}, or
an array serialized using {@link #serialize(Transform[])}
@param str String representation (YAML/JSON) of the Transform list
@return {@code List<Transform>} | [
"Deserialize",
"a",
"Transform",
"List",
"serialized",
"using",
"{",
"@link",
"#serializeTransformList",
"(",
"List",
")",
"}",
"or",
"an",
"array",
"serialized",
"using",
"{",
"@link",
"#serialize",
"(",
"Transform",
"[]",
")",
"}"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/serde/BaseSerializer.java#L278-L280 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.fillBeanWithMap | public static <T> T fillBeanWithMap(Map<?, ?> map, T bean, CopyOptions copyOptions) {
"""
使用Map填充Bean对象
@param <T> Bean类型
@param map Map
@param bean Bean
@param copyOptions 属性复制选项 {@link CopyOptions}
@return Bean
"""
return fillBeanWithMap(map, bean, false, copyOptions);
} | java | public static <T> T fillBeanWithMap(Map<?, ?> map, T bean, CopyOptions copyOptions) {
return fillBeanWithMap(map, bean, false, copyOptions);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fillBeanWithMap",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"T",
"bean",
",",
"CopyOptions",
"copyOptions",
")",
"{",
"return",
"fillBeanWithMap",
"(",
"map",
",",
"bean",
",",
"false",
",",
"copyOptions"... | 使用Map填充Bean对象
@param <T> Bean类型
@param map Map
@param bean Bean
@param copyOptions 属性复制选项 {@link CopyOptions}
@return Bean | [
"使用Map填充Bean对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L408-L410 |
cloudant/sync-android | cloudant-sync-datastore-android/src/main/java/com/cloudant/sync/replication/PeriodicReplicationService.java | PeriodicReplicationService.stopPeriodicReplication | public synchronized void stopPeriodicReplication() {
"""
Stop replications currently in progress and cancel future scheduled replications.
"""
if (isPeriodicReplicationEnabled()) {
setPeriodicReplicationEnabled(false);
AlarmManager alarmManager = (AlarmManager) getSystemService(... | java | public synchronized void stopPeriodicReplication() {
if (isPeriodicReplicationEnabled()) {
setPeriodicReplicationEnabled(false);
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
Intent alarmIntent = new Intent(this, clazz);
alarm... | [
"public",
"synchronized",
"void",
"stopPeriodicReplication",
"(",
")",
"{",
"if",
"(",
"isPeriodicReplicationEnabled",
"(",
")",
")",
"{",
"setPeriodicReplicationEnabled",
"(",
"false",
")",
";",
"AlarmManager",
"alarmManager",
"=",
"(",
"AlarmManager",
")",
"getSys... | Stop replications currently in progress and cancel future scheduled replications. | [
"Stop",
"replications",
"currently",
"in",
"progress",
"and",
"cancel",
"future",
"scheduled",
"replications",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-android/src/main/java/com/cloudant/sync/replication/PeriodicReplicationService.java#L286-L300 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.passwordlessWithEmail | @SuppressWarnings("WeakerAccess")
public ParameterizableRequest<Void, AuthenticationException> passwordlessWithEmail(@NonNull String email, @NonNull PasswordlessType passwordlessType) {
"""
Start a passwordless flow with an <a href="https://auth0.com/docs/api/authentication#get-code-or-link">Email</a>
By defa... | java | @SuppressWarnings("WeakerAccess")
public ParameterizableRequest<Void, AuthenticationException> passwordlessWithEmail(@NonNull String email, @NonNull PasswordlessType passwordlessType) {
return passwordlessWithEmail(email, passwordlessType, EMAIL_CONNECTION);
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"ParameterizableRequest",
"<",
"Void",
",",
"AuthenticationException",
">",
"passwordlessWithEmail",
"(",
"@",
"NonNull",
"String",
"email",
",",
"@",
"NonNull",
"PasswordlessType",
"passwordlessType",
")"... | Start a passwordless flow with an <a href="https://auth0.com/docs/api/authentication#get-code-or-link">Email</a>
By default it will try to authenticate using "email" connection.
Requires your Application to have the <b>Resource Owner</b> Legacy Grant Type enabled. See <a href="https://auth0.com/docs/clients/client-gran... | [
"Start",
"a",
"passwordless",
"flow",
"with",
"an",
"<a",
"href",
"=",
"https",
":",
"//",
"auth0",
".",
"com",
"/",
"docs",
"/",
"api",
"/",
"authentication#get",
"-",
"code",
"-",
"or",
"-",
"link",
">",
"Email<",
"/",
"a",
">",
"By",
"default",
... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L886-L889 |
taimos/GPSd4Java | src/main/java/de/taimos/gpsd4java/backend/GISTool.java | GISTool.getDistance | public static double getDistance(final TPVObject tpv1, final TPVObject tpv2) {
"""
calculates the distance between two {@link TPVObject} in kilometers<br>
the method used is the great-circle-distance with hypersine formula
@param tpv1 - position 1
@param tpv2 - position 2
@return distance in kilometers
"... | java | public static double getDistance(final TPVObject tpv1, final TPVObject tpv2) {
return GISTool.getDistance(tpv1.getLongitude(), tpv2.getLongitude(), tpv1.getLatitude(), tpv2.getLatitude());
} | [
"public",
"static",
"double",
"getDistance",
"(",
"final",
"TPVObject",
"tpv1",
",",
"final",
"TPVObject",
"tpv2",
")",
"{",
"return",
"GISTool",
".",
"getDistance",
"(",
"tpv1",
".",
"getLongitude",
"(",
")",
",",
"tpv2",
".",
"getLongitude",
"(",
")",
",... | calculates the distance between two {@link TPVObject} in kilometers<br>
the method used is the great-circle-distance with hypersine formula
@param tpv1 - position 1
@param tpv2 - position 2
@return distance in kilometers | [
"calculates",
"the",
"distance",
"between",
"two",
"{",
"@link",
"TPVObject",
"}",
"in",
"kilometers<br",
">",
"the",
"method",
"used",
"is",
"the",
"great",
"-",
"circle",
"-",
"distance",
"with",
"hypersine",
"formula"
] | train | https://github.com/taimos/GPSd4Java/blob/f3bdfcc5eed628417ea72bf20d108519f24d105b/src/main/java/de/taimos/gpsd4java/backend/GISTool.java#L46-L48 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.tdStyle | public static String tdStyle(String style, String... content) {
"""
Build a HTML TableData with given CSS style attributes for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param style style for td element
@param ... | java | public static String tdStyle(String style, String... content) {
return tagStyle(Html.Tag.TD, style, content);
} | [
"public",
"static",
"String",
"tdStyle",
"(",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"tagStyle",
"(",
"Html",
".",
"Tag",
".",
"TD",
",",
"style",
",",
"content",
")",
";",
"}"
] | Build a HTML TableData with given CSS style attributes for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param style style for td element
@param content content string
@return HTML td element as string | [
"Build",
"a",
"HTML",
"TableData",
"with",
"given",
"CSS",
"style",
"attributes",
"for",
"a",
"string",
".",
"Given",
"content",
"does",
"<b",
">",
"not<",
"/",
"b",
">",
"consists",
"of",
"HTML",
"snippets",
"and",
"as",
"such",
"is",
"being",
"prepared... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L203-L205 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_conference_serviceName_webAccess_id_GET | public OvhConferenceWebAccess billingAccount_conference_serviceName_webAccess_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/conference/{serviceName}/webAccess/{id}
@param billingAccount [required] The name of... | java | public OvhConferenceWebAccess billingAccount_conference_serviceName_webAccess_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/conference/{serviceName}/webAccess/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id);
Strin... | [
"public",
"OvhConferenceWebAccess",
"billingAccount_conference_serviceName_webAccess_id_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/conference/{... | Get this object properties
REST: GET /telephony/{billingAccount}/conference/{serviceName}/webAccess/{id}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4824-L4829 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java | TypeRegistry.getTypeIdFor | public int getTypeIdFor(String slashname, boolean allocateIfNotFound) {
"""
Lookup the type ID for a string. First checks those allocated but not yet registered, then those that are already
registered. If not found then a new one is allocated and recorded.
@param slashname the slashed type name, eg. a/b/c/D
@... | java | public int getTypeIdFor(String slashname, boolean allocateIfNotFound) {
if (allocateIfNotFound) {
return NameRegistry.getIdOrAllocateFor(slashname);
}
else {
return NameRegistry.getIdFor(slashname);
}
} | [
"public",
"int",
"getTypeIdFor",
"(",
"String",
"slashname",
",",
"boolean",
"allocateIfNotFound",
")",
"{",
"if",
"(",
"allocateIfNotFound",
")",
"{",
"return",
"NameRegistry",
".",
"getIdOrAllocateFor",
"(",
"slashname",
")",
";",
"}",
"else",
"{",
"return",
... | Lookup the type ID for a string. First checks those allocated but not yet registered, then those that are already
registered. If not found then a new one is allocated and recorded.
@param slashname the slashed type name, eg. a/b/c/D
@param allocateIfNotFound determines whether an id should be allocated for the type if... | [
"Lookup",
"the",
"type",
"ID",
"for",
"a",
"string",
".",
"First",
"checks",
"those",
"allocated",
"but",
"not",
"yet",
"registered",
"then",
"those",
"that",
"are",
"already",
"registered",
".",
"If",
"not",
"found",
"then",
"a",
"new",
"one",
"is",
"al... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java#L986-L993 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/contentservice/GetAllContent.java | GetAllContent.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the ContentService.
ContentServiceInterface contentService =
adManagerServices.get(session, ContentServiceInterface.class);
// Create a statement to get all content.
... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the ContentService.",
"ContentServiceInterface",
"contentService",
"=",
"adManagerServices",
".",
"get",... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/contentservice/GetAllContent.java#L51-L82 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java | File.createTempFile | public static File createTempFile(String prefix, String suffix) throws IOException {
"""
Creates an empty temporary file using the given prefix and suffix as part
of the file name. If {@code suffix} is null, {@code .tmp} is used. This
method is a convenience method that calls
{@link #createTempFile(String, Stri... | java | public static File createTempFile(String prefix, String suffix) throws IOException {
return createTempFile(prefix, suffix, null);
} | [
"public",
"static",
"File",
"createTempFile",
"(",
"String",
"prefix",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"return",
"createTempFile",
"(",
"prefix",
",",
"suffix",
",",
"null",
")",
";",
"}"
] | Creates an empty temporary file using the given prefix and suffix as part
of the file name. If {@code suffix} is null, {@code .tmp} is used. This
method is a convenience method that calls
{@link #createTempFile(String, String, File)} with the third argument
being {@code null}.
@param prefix
the prefix to the temp file... | [
"Creates",
"an",
"empty",
"temporary",
"file",
"using",
"the",
"given",
"prefix",
"and",
"suffix",
"as",
"part",
"of",
"the",
"file",
"name",
".",
"If",
"{",
"@code",
"suffix",
"}",
"is",
"null",
"{",
"@code",
".",
"tmp",
"}",
"is",
"used",
".",
"Thi... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/File.java#L1061-L1063 |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.setTimeDuration | public void setTimeDuration(String name, long value, TimeUnit unit) {
"""
Set the value of <code>name</code> to the given time duration. This
is equivalent to <code>set(<name>, value + <time suffix>)</code>.
@param name Property name
@param value Time duration
@param unit Unit of time
"""
set... | java | public void setTimeDuration(String name, long value, TimeUnit unit) {
set(name, value + ParsedTimeDuration.unitFor(unit).suffix());
} | [
"public",
"void",
"setTimeDuration",
"(",
"String",
"name",
",",
"long",
"value",
",",
"TimeUnit",
"unit",
")",
"{",
"set",
"(",
"name",
",",
"value",
"+",
"ParsedTimeDuration",
".",
"unitFor",
"(",
"unit",
")",
".",
"suffix",
"(",
")",
")",
";",
"}"
] | Set the value of <code>name</code> to the given time duration. This
is equivalent to <code>set(<name>, value + <time suffix>)</code>.
@param name Property name
@param value Time duration
@param unit Unit of time | [
"Set",
"the",
"value",
"of",
"<code",
">",
"name<",
"/",
"code",
">",
"to",
"the",
"given",
"time",
"duration",
".",
"This",
"is",
"equivalent",
"to",
"<code",
">",
"set",
"(",
"<",
";",
"name>",
";",
"value",
"+",
"<",
";",
"time",
"suffix>"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1648-L1650 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/ClassUtils.java | ClassUtils.buildApplicationObject | @SuppressWarnings("unchecked")
public static <T> T buildApplicationObject(Class<T> interfaceClass, Class<? extends T> extendedInterfaceClass,
Class<? extends T> extendedInterfaceWrapperClass,
Collection<String> classNamesI... | java | @SuppressWarnings("unchecked")
public static <T> T buildApplicationObject(Class<T> interfaceClass, Class<? extends T> extendedInterfaceClass,
Class<? extends T> extendedInterfaceWrapperClass,
Collection<String> classNamesI... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"buildApplicationObject",
"(",
"Class",
"<",
"T",
">",
"interfaceClass",
",",
"Class",
"<",
"?",
"extends",
"T",
">",
"extendedInterfaceClass",
",",
"Class",
"<",
"?"... | Creates ApplicationObjects like NavigationHandler or StateManager and creates
the right wrapping chain of the ApplicationObjects known as the decorator pattern.
@param <T>
@param interfaceClass The class from which the implementation has to inherit from.
@param extendedInterfaceClass A subclass of interfaceClass which... | [
"Creates",
"ApplicationObjects",
"like",
"NavigationHandler",
"or",
"StateManager",
"and",
"creates",
"the",
"right",
"wrapping",
"chain",
"of",
"the",
"ApplicationObjects",
"known",
"as",
"the",
"decorator",
"pattern",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/ClassUtils.java#L579-L586 |
remkop/picocli | src/main/java/picocli/CommandLine.java | CommandLine.printHelpIfRequested | @Deprecated public static boolean printHelpIfRequested(List<CommandLine> parsedCommands, PrintStream out, PrintStream err, Help.ColorScheme colorScheme) {
"""
Delegates to the implementation of {@link #executeHelpRequest(ParseResult)}.
@deprecated use {@link #executeHelpRequest(ParseResult)} instead
@param parse... | java | @Deprecated public static boolean printHelpIfRequested(List<CommandLine> parsedCommands, PrintStream out, PrintStream err, Help.ColorScheme colorScheme) {
// for backwards compatibility
for (CommandLine cmd : parsedCommands) { cmd.setOut(new PrintWriter(out, true)).setErr(new PrintWriter(err, true)).set... | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"printHelpIfRequested",
"(",
"List",
"<",
"CommandLine",
">",
"parsedCommands",
",",
"PrintStream",
"out",
",",
"PrintStream",
"err",
",",
"Help",
".",
"ColorScheme",
"colorScheme",
")",
"{",
"// for backwards compat... | Delegates to the implementation of {@link #executeHelpRequest(ParseResult)}.
@deprecated use {@link #executeHelpRequest(ParseResult)} instead
@param parsedCommands the list of {@code CommandLine} objects to check if help was requested
@param out the {@code PrintStream} to print help to if requested
@param err the error... | [
"Delegates",
"to",
"the",
"implementation",
"of",
"{"
] | train | https://github.com/remkop/picocli/blob/3c5384f0d12817401d1921c3013c1282e2edcab2/src/main/java/picocli/CommandLine.java#L1468-L1472 |
SeaCloudsEU/SeaCloudsPlatform | sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ProviderRest.java | ProviderRest.getProviders | @GET
@Produces(MediaType.APPLICATION_XML)
public Response getProviders() {
"""
Get the list of available providers
<pre>
GET /providers
Request:
GET /providers HTTP/1.1
Accept: application/xml
Response:
{@code
<?xml version="1.0" encoding="UTF-8"?>
<collection href="/providers">
<items of... | java | @GET
@Produces(MediaType.APPLICATION_XML)
public Response getProviders() {
logger.debug("StartOf getProviders - REQUEST for /providers");
ProviderHelper providerRestService = getProviderHelper();
String serializedProviders = null;
try {
serializedProviders = provide... | [
"@",
"GET",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_XML",
")",
"public",
"Response",
"getProviders",
"(",
")",
"{",
"logger",
".",
"debug",
"(",
"\"StartOf getProviders - REQUEST for /providers\"",
")",
";",
"ProviderHelper",
"providerRestService",
"=",
... | Get the list of available providers
<pre>
GET /providers
Request:
GET /providers HTTP/1.1
Accept: application/xml
Response:
{@code
<?xml version="1.0" encoding="UTF-8"?>
<collection href="/providers">
<items offset="0" total="1">
<provider>
<uuid>fc923960-03fe-41eb-8a21-a56709f9370f</uuid>
<name>provider-prueba</n... | [
"Get",
"the",
"list",
"of",
"available",
"providers"
] | train | https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ProviderRest.java#L99-L115 |
cdk/cdk | tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreUtils.java | PharmacophoreUtils.writePharmacophoreDefinition | public static void writePharmacophoreDefinition(PharmacophoreQuery query, OutputStream out) throws IOException {
"""
Write out one or more pharmacophore queries in the CDK XML format.
@param query The pharmacophore queries
@param out The OutputStream to write to
@throws IOException if there is a problem wri... | java | public static void writePharmacophoreDefinition(PharmacophoreQuery query, OutputStream out) throws IOException {
writePharmacophoreDefinition(new PharmacophoreQuery[]{query}, out);
} | [
"public",
"static",
"void",
"writePharmacophoreDefinition",
"(",
"PharmacophoreQuery",
"query",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"writePharmacophoreDefinition",
"(",
"new",
"PharmacophoreQuery",
"[",
"]",
"{",
"query",
"}",
",",
"out",
... | Write out one or more pharmacophore queries in the CDK XML format.
@param query The pharmacophore queries
@param out The OutputStream to write to
@throws IOException if there is a problem writing the XML document | [
"Write",
"out",
"one",
"or",
"more",
"pharmacophore",
"queries",
"in",
"the",
"CDK",
"XML",
"format",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreUtils.java#L155-L157 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/Script.java | Script.getSigInsertionIndex | public int getSigInsertionIndex(Sha256Hash hash, ECKey signingKey) {
"""
Returns the index where a signature by the key should be inserted. Only applicable to
a P2SH scriptSig.
"""
// Iterate over existing signatures, skipping the initial OP_0, the final redeem script
// and any placeholder O... | java | public int getSigInsertionIndex(Sha256Hash hash, ECKey signingKey) {
// Iterate over existing signatures, skipping the initial OP_0, the final redeem script
// and any placeholder OP_0 sigs.
List<ScriptChunk> existingChunks = chunks.subList(1, chunks.size() - 1);
ScriptChunk redeemScript... | [
"public",
"int",
"getSigInsertionIndex",
"(",
"Sha256Hash",
"hash",
",",
"ECKey",
"signingKey",
")",
"{",
"// Iterate over existing signatures, skipping the initial OP_0, the final redeem script",
"// and any placeholder OP_0 sigs.",
"List",
"<",
"ScriptChunk",
">",
"existingChunks... | Returns the index where a signature by the key should be inserted. Only applicable to
a P2SH scriptSig. | [
"Returns",
"the",
"index",
"where",
"a",
"signature",
"by",
"the",
"key",
"should",
"be",
"inserted",
".",
"Only",
"applicable",
"to",
"a",
"P2SH",
"scriptSig",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L438-L463 |
apache/incubator-druid | server/src/main/java/org/apache/druid/server/coordination/SegmentLoadDropHandler.java | SegmentLoadDropHandler.loadSegment | private void loadSegment(DataSegment segment, DataSegmentChangeCallback callback) throws SegmentLoadingException {
"""
Load a single segment. If the segment is loaded successfully, this function simply returns. Otherwise it will
throw a SegmentLoadingException
@throws SegmentLoadingException if it fails to loa... | java | private void loadSegment(DataSegment segment, DataSegmentChangeCallback callback) throws SegmentLoadingException
{
final boolean loaded;
try {
loaded = segmentManager.loadSegment(segment);
}
catch (Exception e) {
removeSegment(segment, callback, false);
throw new SegmentLoadingExcept... | [
"private",
"void",
"loadSegment",
"(",
"DataSegment",
"segment",
",",
"DataSegmentChangeCallback",
"callback",
")",
"throws",
"SegmentLoadingException",
"{",
"final",
"boolean",
"loaded",
";",
"try",
"{",
"loaded",
"=",
"segmentManager",
".",
"loadSegment",
"(",
"se... | Load a single segment. If the segment is loaded successfully, this function simply returns. Otherwise it will
throw a SegmentLoadingException
@throws SegmentLoadingException if it fails to load the given segment | [
"Load",
"a",
"single",
"segment",
".",
"If",
"the",
"segment",
"is",
"loaded",
"successfully",
"this",
"function",
"simply",
"returns",
".",
"Otherwise",
"it",
"will",
"throw",
"a",
"SegmentLoadingException"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/server/coordination/SegmentLoadDropHandler.java#L260-L287 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/SailthruClient.java | SailthruClient.getJobStatus | public JsonResponse getJobStatus(String jobId) throws IOException {
"""
Get status of a job
@param jobId
@return JsonResponse
@throws IOException
"""
Map<String, Object> params = new HashMap<String, Object>();
params.put(Job.JOB_ID, jobId);
return apiGet(ApiAction.job, params);
} | java | public JsonResponse getJobStatus(String jobId) throws IOException {
Map<String, Object> params = new HashMap<String, Object>();
params.put(Job.JOB_ID, jobId);
return apiGet(ApiAction.job, params);
} | [
"public",
"JsonResponse",
"getJobStatus",
"(",
"String",
"jobId",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"params",
".",
"put",
"(",
... | Get status of a job
@param jobId
@return JsonResponse
@throws IOException | [
"Get",
"status",
"of",
"a",
"job"
] | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/SailthruClient.java#L405-L409 |
google/closure-templates | java/src/com/google/template/soy/error/SoyErrors.java | SoyErrors.getDidYouMeanMessageForProtoFields | public static String getDidYouMeanMessageForProtoFields(
ImmutableSet<String> fields, Descriptor descriptor, String fieldName) {
"""
Same as {@link #getDidYouMeanMessage(Iterable, String)} but with some additional heuristics for
proto fields.
"""
// TODO(b/27616446): when we have case enum support a... | java | public static String getDidYouMeanMessageForProtoFields(
ImmutableSet<String> fields, Descriptor descriptor, String fieldName) {
// TODO(b/27616446): when we have case enum support add a case here.
if (fields.contains(fieldName + "List")) {
return String.format(" Did you mean '%sList'?", fieldName);... | [
"public",
"static",
"String",
"getDidYouMeanMessageForProtoFields",
"(",
"ImmutableSet",
"<",
"String",
">",
"fields",
",",
"Descriptor",
"descriptor",
",",
"String",
"fieldName",
")",
"{",
"// TODO(b/27616446): when we have case enum support add a case here.",
"if",
"(",
"... | Same as {@link #getDidYouMeanMessage(Iterable, String)} but with some additional heuristics for
proto fields. | [
"Same",
"as",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/error/SoyErrors.java#L49-L59 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java | Widget.rotate | public void rotate(float w, float x, float y, float z) {
"""
Modify the tranform's current rotation in quaternion terms.
@param w
'W' component of the quaternion.
@param x
'X' component of the quaternion.
@param y
'Y' component of the quaternion.
@param z
'Z' component of the quaternion.
"""
... | java | public void rotate(float w, float x, float y, float z) {
getTransform().rotate(w, x, y, z);
if (mTransformCache.rotate(w, x, y, z)) {
onTransformChanged();
}
} | [
"public",
"void",
"rotate",
"(",
"float",
"w",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"getTransform",
"(",
")",
".",
"rotate",
"(",
"w",
",",
"x",
",",
"y",
",",
"z",
")",
";",
"if",
"(",
"mTransformCache",
".",
"rot... | Modify the tranform's current rotation in quaternion terms.
@param w
'W' component of the quaternion.
@param x
'X' component of the quaternion.
@param y
'Y' component of the quaternion.
@param z
'Z' component of the quaternion. | [
"Modify",
"the",
"tranform",
"s",
"current",
"rotation",
"in",
"quaternion",
"terms",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java#L1592-L1597 |
spotify/apollo | examples/spotify-api-example/src/main/java/com/spotify/apollo/example/AlbumResource.java | AlbumResource.parseResponseAlbumIds | private String parseResponseAlbumIds(String json) {
"""
Parses the album ids from a JSON response from a
<a href="https://developer.spotify.com/web-api/search-item/">Spotify API search query</a>.
@param json The JSON response
@return A comma-separated list of album ids from the response
"""
StringJoin... | java | private String parseResponseAlbumIds(String json) {
StringJoiner sj = new StringJoiner(",");
try {
JsonNode jsonNode = this.objectMapper.readTree(json);
for (JsonNode node : jsonNode.get("albums").get("items")) {
sj.add(node.get("id").asText());
}
} catch (IOException e) {
th... | [
"private",
"String",
"parseResponseAlbumIds",
"(",
"String",
"json",
")",
"{",
"StringJoiner",
"sj",
"=",
"new",
"StringJoiner",
"(",
"\",\"",
")",
";",
"try",
"{",
"JsonNode",
"jsonNode",
"=",
"this",
".",
"objectMapper",
".",
"readTree",
"(",
"json",
")",
... | Parses the album ids from a JSON response from a
<a href="https://developer.spotify.com/web-api/search-item/">Spotify API search query</a>.
@param json The JSON response
@return A comma-separated list of album ids from the response | [
"Parses",
"the",
"album",
"ids",
"from",
"a",
"JSON",
"response",
"from",
"a",
"<a",
"href",
"=",
"https",
":",
"//",
"developer",
".",
"spotify",
".",
"com",
"/",
"web",
"-",
"api",
"/",
"search",
"-",
"item",
"/",
">",
"Spotify",
"API",
"search",
... | train | https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/examples/spotify-api-example/src/main/java/com/spotify/apollo/example/AlbumResource.java#L101-L112 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/ProtempaUtil.java | ProtempaUtil.checkArray | public static void checkArray(Object[] array, String arrayName) {
"""
Checks if the specified array is null, has length zero or has null
values. If any of those criteria are me, an
{@link IllegalArgumentException} is thrown.
@param array an {@link Object[]}.
@param arrayName the variable name {@link String} ... | java | public static void checkArray(Object[] array, String arrayName) {
if (array == null) {
throw new IllegalArgumentException(arrayName
+ " cannot be null");
}
if (array.length == 0) {
throw new IllegalArgumentException(arrayName
+ " ca... | [
"public",
"static",
"void",
"checkArray",
"(",
"Object",
"[",
"]",
"array",
",",
"String",
"arrayName",
")",
"{",
"if",
"(",
"array",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"arrayName",
"+",
"\" cannot be null\"",
")",
";",
... | Checks if the specified array is null, has length zero or has null
values. If any of those criteria are me, an
{@link IllegalArgumentException} is thrown.
@param array an {@link Object[]}.
@param arrayName the variable name {@link String} of the array (
used in the exception message). Should not be <code>null</code>, ... | [
"Checks",
"if",
"the",
"specified",
"array",
"is",
"null",
"has",
"length",
"zero",
"or",
"has",
"null",
"values",
".",
"If",
"any",
"of",
"those",
"criteria",
"are",
"me",
"an",
"{",
"@link",
"IllegalArgumentException",
"}",
"is",
"thrown",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/ProtempaUtil.java#L112-L122 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java | EmvParser.findCardScheme | protected EmvCardScheme findCardScheme(final String pAid, final String pCardNumber) {
"""
Method used to find the real card scheme
@param pAid
card complete AID
@param pCardNumber
card number
@return card scheme
"""
EmvCardScheme type = EmvCardScheme.getCardTypeByAid(pAid);
// Get real type for fren... | java | protected EmvCardScheme findCardScheme(final String pAid, final String pCardNumber) {
EmvCardScheme type = EmvCardScheme.getCardTypeByAid(pAid);
// Get real type for french card
if (type == EmvCardScheme.CB) {
type = EmvCardScheme.getCardTypeByCardNumber(pCardNumber);
if (type != null) {
LOGGER.debug("R... | [
"protected",
"EmvCardScheme",
"findCardScheme",
"(",
"final",
"String",
"pAid",
",",
"final",
"String",
"pCardNumber",
")",
"{",
"EmvCardScheme",
"type",
"=",
"EmvCardScheme",
".",
"getCardTypeByAid",
"(",
"pAid",
")",
";",
"// Get real type for french card",
"if",
... | Method used to find the real card scheme
@param pAid
card complete AID
@param pCardNumber
card number
@return card scheme | [
"Method",
"used",
"to",
"find",
"the",
"real",
"card",
"scheme"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L137-L147 |
BellaDati/belladati-sdk-api | src/main/java/com/belladati/sdk/dataset/data/OverwritePolicy.java | OverwritePolicy.byDateTo | public static OverwritePolicy byDateTo(String attribute, Calendar end) {
"""
Returns an {@link OverwritePolicy} that deletes records with a date
before or on the given date in the specified column.
<p>
Records with an empty date value in existing data are also deleted.
@param attribute date attribute to comp... | java | public static OverwritePolicy byDateTo(String attribute, Calendar end) {
return new DateRangeOverwritePolicy(attribute, null, end);
} | [
"public",
"static",
"OverwritePolicy",
"byDateTo",
"(",
"String",
"attribute",
",",
"Calendar",
"end",
")",
"{",
"return",
"new",
"DateRangeOverwritePolicy",
"(",
"attribute",
",",
"null",
",",
"end",
")",
";",
"}"
] | Returns an {@link OverwritePolicy} that deletes records with a date
before or on the given date in the specified column.
<p>
Records with an empty date value in existing data are also deleted.
@param attribute date attribute to compare
@param end last day (inclusive) up to which to delete data
@return {@link Overwrite... | [
"Returns",
"an",
"{",
"@link",
"OverwritePolicy",
"}",
"that",
"deletes",
"records",
"with",
"a",
"date",
"before",
"or",
"on",
"the",
"given",
"date",
"in",
"the",
"specified",
"column",
".",
"<p",
">",
"Records",
"with",
"an",
"empty",
"date",
"value",
... | train | https://github.com/BellaDati/belladati-sdk-api/blob/ec45a42048d8255838ad0200aa6784a8e8a121c1/src/main/java/com/belladati/sdk/dataset/data/OverwritePolicy.java#L139-L141 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/PathUtils.java | PathUtils.checkCaseCanonical | private static boolean checkCaseCanonical(final File file, String pathToTest) throws PrivilegedActionException {
"""
Test that the path to a file matches a specified path.
The test does a case sensitive string comparison of the canonical path
of the file with the specified path, restricting the form of the
pa... | java | private static boolean checkCaseCanonical(final File file, String pathToTest) throws PrivilegedActionException {
// The canonical path returns the actual path on the file system so get this
String onDiskCanonicalPath = AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
/... | [
"private",
"static",
"boolean",
"checkCaseCanonical",
"(",
"final",
"File",
"file",
",",
"String",
"pathToTest",
")",
"throws",
"PrivilegedActionException",
"{",
"// The canonical path returns the actual path on the file system so get this",
"String",
"onDiskCanonicalPath",
"=",
... | Test that the path to a file matches a specified path.
The test does a case sensitive string comparison of the canonical path
of the file with the specified path, restricting the form of the
path which may be used for the test.
Trailing slashes on either the file or the path are ignored.
@param file The file which i... | [
"Test",
"that",
"the",
"path",
"to",
"a",
"file",
"matches",
"a",
"specified",
"path",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/PathUtils.java#L1298-L1330 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/MethodCompiler.java | MethodCompiler.invokespecial | public void invokespecial(Class<?> cls, String name, Class<?>... parameters) throws IOException {
"""
Invoke instance method; special handling for superclass, private, and instance initialization method invocations
<p>Stack: ..., objectref, [arg1, [arg2 ...]] => ...
@param cls
@param name
@param parameters
... | java | public void invokespecial(Class<?> cls, String name, Class<?>... parameters) throws IOException
{
invokespecial(El.getMethod(cls, name, parameters));
} | [
"public",
"void",
"invokespecial",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"...",
"parameters",
")",
"throws",
"IOException",
"{",
"invokespecial",
"(",
"El",
".",
"getMethod",
"(",
"cls",
",",
"name",
",... | Invoke instance method; special handling for superclass, private, and instance initialization method invocations
<p>Stack: ..., objectref, [arg1, [arg2 ...]] => ...
@param cls
@param name
@param parameters
@throws IOException | [
"Invoke",
"instance",
"method",
";",
"special",
"handling",
"for",
"superclass",
"private",
"and",
"instance",
"initialization",
"method",
"invocations",
"<p",
">",
"Stack",
":",
"...",
"objectref",
"[",
"arg1",
"[",
"arg2",
"...",
"]]",
"=",
">",
";",
"..... | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/MethodCompiler.java#L1091-L1094 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.findByG_N | @Override
public CommerceCountry findByG_N(long groupId, int numericISOCode)
throws NoSuchCountryException {
"""
Returns the commerce country where groupId = ? and numericISOCode = ? or throws a {@link NoSuchCountryException} if it could not be found.
@param groupId the group ID
@param numericISOCod... | java | @Override
public CommerceCountry findByG_N(long groupId, int numericISOCode)
throws NoSuchCountryException {
CommerceCountry commerceCountry = fetchByG_N(groupId, numericISOCode);
if (commerceCountry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append... | [
"@",
"Override",
"public",
"CommerceCountry",
"findByG_N",
"(",
"long",
"groupId",
",",
"int",
"numericISOCode",
")",
"throws",
"NoSuchCountryException",
"{",
"CommerceCountry",
"commerceCountry",
"=",
"fetchByG_N",
"(",
"groupId",
",",
"numericISOCode",
")",
";",
"... | Returns the commerce country where groupId = ? and numericISOCode = ? or throws a {@link NoSuchCountryException} if it could not be found.
@param groupId the group ID
@param numericISOCode the numeric iso code
@return the matching commerce country
@throws NoSuchCountryException if a matching commerce country c... | [
"Returns",
"the",
"commerce",
"country",
"where",
"groupId",
"=",
"?",
";",
"and",
"numericISOCode",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCountryException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L2257-L2283 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/OstrovskyInitialMeans.java | OstrovskyInitialMeans.initialWeights | protected static <T> double initialWeights(WritableDoubleDataStore weights, Relation<? extends T> relation, DBIDs ids, T first, T second, DistanceQuery<? super T> distQ) {
"""
Initialize the weight list.
@param weights Weight list
@param ids IDs
@param relation Data relation
@param first First ID
@param sec... | java | protected static <T> double initialWeights(WritableDoubleDataStore weights, Relation<? extends T> relation, DBIDs ids, T first, T second, DistanceQuery<? super T> distQ) {
double weightsum = 0.;
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
// distance will usually already be squared
T v... | [
"protected",
"static",
"<",
"T",
">",
"double",
"initialWeights",
"(",
"WritableDoubleDataStore",
"weights",
",",
"Relation",
"<",
"?",
"extends",
"T",
">",
"relation",
",",
"DBIDs",
"ids",
",",
"T",
"first",
",",
"T",
"second",
",",
"DistanceQuery",
"<",
... | Initialize the weight list.
@param weights Weight list
@param ids IDs
@param relation Data relation
@param first First ID
@param second Second ID
@param distQ Distance query
@return Weight sum
@param <T> Object type | [
"Initialize",
"the",
"weight",
"list",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/OstrovskyInitialMeans.java#L161-L171 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.ofSubLists | public static <T> StreamEx<List<T>> ofSubLists(List<T> source, int length) {
"""
Returns a new {@code StreamEx} which consists of non-overlapping sublists
of given source list having the specified length (the last sublist may be
shorter).
<p>
This method calls {@link List#subList(int, int)} internally, so so... | java | public static <T> StreamEx<List<T>> ofSubLists(List<T> source, int length) {
return ofSubLists(source, length, length);
} | [
"public",
"static",
"<",
"T",
">",
"StreamEx",
"<",
"List",
"<",
"T",
">",
">",
"ofSubLists",
"(",
"List",
"<",
"T",
">",
"source",
",",
"int",
"length",
")",
"{",
"return",
"ofSubLists",
"(",
"source",
",",
"length",
",",
"length",
")",
";",
"}"
] | Returns a new {@code StreamEx} which consists of non-overlapping sublists
of given source list having the specified length (the last sublist may be
shorter).
<p>
This method calls {@link List#subList(int, int)} internally, so source
list must have it properly implemented as well as provide fast random
access.
<p>
Thi... | [
"Returns",
"a",
"new",
"{",
"@code",
"StreamEx",
"}",
"which",
"consists",
"of",
"non",
"-",
"overlapping",
"sublists",
"of",
"given",
"source",
"list",
"having",
"the",
"specified",
"length",
"(",
"the",
"last",
"sublist",
"may",
"be",
"shorter",
")",
"."... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L3022-L3024 |
OpenFeign/feign | core/src/main/java/feign/template/Template.java | Template.parseFragment | private void parseFragment(String fragment, boolean query) {
"""
Parse a template fragment.
@param fragment to parse
@param query if the fragment is part of a query string.
"""
ChunkTokenizer tokenizer = new ChunkTokenizer(fragment);
while (tokenizer.hasNext()) {
/* check to see if we have a... | java | private void parseFragment(String fragment, boolean query) {
ChunkTokenizer tokenizer = new ChunkTokenizer(fragment);
while (tokenizer.hasNext()) {
/* check to see if we have an expression or a literal */
String chunk = tokenizer.next();
if (chunk.startsWith("{")) {
/* it's an expres... | [
"private",
"void",
"parseFragment",
"(",
"String",
"fragment",
",",
"boolean",
"query",
")",
"{",
"ChunkTokenizer",
"tokenizer",
"=",
"new",
"ChunkTokenizer",
"(",
"fragment",
")",
";",
"while",
"(",
"tokenizer",
".",
"hasNext",
"(",
")",
")",
"{",
"/* check... | Parse a template fragment.
@param fragment to parse
@param query if the fragment is part of a query string. | [
"Parse",
"a",
"template",
"fragment",
"."
] | train | https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/template/Template.java#L213-L235 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.writeUser | public void writeUser(CmsDbContext dbc, CmsUser user) throws CmsException {
"""
Updates the user information. <p>
The user id has to be a valid OpenCms user id.<br>
The user with the given id will be completely overridden
by the given data.<p>
@param dbc the current database context
@param user the user... | java | public void writeUser(CmsDbContext dbc, CmsUser user) throws CmsException {
CmsUser oldUser = readUser(dbc, user.getId());
m_monitor.clearUserCache(oldUser);
getUserDriver(dbc).writeUser(dbc, user);
m_monitor.flushCache(CmsMemoryMonitor.CacheType.USERGROUPS, CmsMemoryMonitor.CacheType.U... | [
"public",
"void",
"writeUser",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUser",
"user",
")",
"throws",
"CmsException",
"{",
"CmsUser",
"oldUser",
"=",
"readUser",
"(",
"dbc",
",",
"user",
".",
"getId",
"(",
")",
")",
";",
"m_monitor",
".",
"clearUserCache",
"("... | Updates the user information. <p>
The user id has to be a valid OpenCms user id.<br>
The user with the given id will be completely overridden
by the given data.<p>
@param dbc the current database context
@param user the user to be updated
@throws CmsException if operation was not successful | [
"Updates",
"the",
"user",
"information",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L10237-L10255 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/JcElement.java | JcElement.stringProperty | public JcString stringProperty(String name) {
"""
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>access a named string property, return a <b>JcString</b></i></div>
<br/>
"""
JcString ret = new JcString(name, this, OP... | java | public JcString stringProperty(String name) {
JcString ret = new JcString(name, this, OPERATOR.PropertyContainer.PROPERTY_ACCESS);
QueryRecorder.recordInvocationConditional(this, "stringProperty", ret, QueryRecorder.literal(name));
return ret;
} | [
"public",
"JcString",
"stringProperty",
"(",
"String",
"name",
")",
"{",
"JcString",
"ret",
"=",
"new",
"JcString",
"(",
"name",
",",
"this",
",",
"OPERATOR",
".",
"PropertyContainer",
".",
"PROPERTY_ACCESS",
")",
";",
"QueryRecorder",
".",
"recordInvocationCond... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>access a named string property, return a <b>JcString</b></i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/JcElement.java#L53-L57 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FilterFileSystem.java | FilterFileSystem.copyToLocalFile | public void copyToLocalFile(boolean delSrc, Path src, Path dst)
throws IOException {
"""
The src file is under FS, and the dst is on the local disk.
Copy it from FS control to the local dst name.
delSrc indicates if the src will be removed or not.
"""
fs.copyToLocalFile(delSrc, src, dst);
} | java | public void copyToLocalFile(boolean delSrc, Path src, Path dst)
throws IOException {
fs.copyToLocalFile(delSrc, src, dst);
} | [
"public",
"void",
"copyToLocalFile",
"(",
"boolean",
"delSrc",
",",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"fs",
".",
"copyToLocalFile",
"(",
"delSrc",
",",
"src",
",",
"dst",
")",
";",
"}"
] | The src file is under FS, and the dst is on the local disk.
Copy it from FS control to the local dst name.
delSrc indicates if the src will be removed or not. | [
"The",
"src",
"file",
"is",
"under",
"FS",
"and",
"the",
"dst",
"is",
"on",
"the",
"local",
"disk",
".",
"Copy",
"it",
"from",
"FS",
"control",
"to",
"the",
"local",
"dst",
"name",
".",
"delSrc",
"indicates",
"if",
"the",
"src",
"will",
"be",
"remove... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FilterFileSystem.java#L343-L346 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/QualityOfServiceBlockingQueue.java | QualityOfServiceBlockingQueue.getWriteLockWithOptionalWait | private long getWriteLockWithOptionalWait(final long timeout, final TimeUnit unit)
throws InterruptedException {
"""
Acquires a write lock either using {@link Lock#tryLock(long, TimeUnit)} if timeout >= 0 or
using {@link Lock#lock()} if timeout < 0.
@param timeout Duration to wait for lock, if less... | java | private long getWriteLockWithOptionalWait(final long timeout, final TimeUnit unit)
throws InterruptedException {
// Get the write lock and capture start time and max wait time if waiting a specified
// timeout
final long start;
if (timeout >= 0) {
start = System.c... | [
"private",
"long",
"getWriteLockWithOptionalWait",
"(",
"final",
"long",
"timeout",
",",
"final",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"// Get the write lock and capture start time and max wait time if waiting a specified",
"// timeout",
"final",
"long"... | Acquires a write lock either using {@link Lock#tryLock(long, TimeUnit)} if timeout >= 0 or
using {@link Lock#lock()} if timeout < 0.
@param timeout Duration to wait for lock, if less than 0 will wait forever via {@link
Lock#lock()}
@param unit Time units for timeout
@return If waiting with timeout the {@link System#cu... | [
"Acquires",
"a",
"write",
"lock",
"either",
"using",
"{",
"@link",
"Lock#tryLock",
"(",
"long",
"TimeUnit",
")",
"}",
"if",
"timeout",
">",
"=",
"0",
"or",
"using",
"{",
"@link",
"Lock#lock",
"()",
"}",
"if",
"timeout",
"<",
"0",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/QualityOfServiceBlockingQueue.java#L666-L685 |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/httpclient/GsonMessageBodyHandler.java | GsonMessageBodyHandler.readFrom | @Override
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations,
MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream inputStream)
throws IOException, WebApplicationException {
"""
Read a type from the InputStream.
@param type The type th... | java | @Override
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations,
MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream inputStream)
throws IOException, WebApplicationException
{
String json = null;
Object result = null;
... | [
"@",
"Override",
"public",
"Object",
"readFrom",
"(",
"Class",
"<",
"Object",
">",
"type",
",",
"Type",
"genericType",
",",
"Annotation",
"[",
"]",
"annotations",
",",
"MediaType",
"mediaType",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"httpH... | Read a type from the InputStream.
@param type The type that is to be read from the entity stream
@param genericType The type of instance to be produced
@param annotations An array of the annotations on the declaration of the artifact that will be initialized with the produced instance
@param mediaType The media type of... | [
"Read",
"a",
"type",
"from",
"the",
"InputStream",
"."
] | train | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/httpclient/GsonMessageBodyHandler.java#L358-L387 |
phax/ph-commons | ph-wsclient/src/main/java/com/helger/wsclient/WSHelper.java | WSHelper.enableSoapLogging | public static void enableSoapLogging (final boolean bServerDebug, final boolean bClientDebug) {
"""
Enable the JAX-WS SOAP debugging. This shows the exchanged SOAP messages in
the log file. By default this logging is disabled.
@param bServerDebug
<code>true</code> to enable server debugging, <code>false</code... | java | public static void enableSoapLogging (final boolean bServerDebug, final boolean bClientDebug)
{
// Server debug mode
String sDebug = Boolean.toString (bServerDebug);
SystemProperties.setPropertyValue ("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", sDebug);
SystemProperties.setPropertyV... | [
"public",
"static",
"void",
"enableSoapLogging",
"(",
"final",
"boolean",
"bServerDebug",
",",
"final",
"boolean",
"bClientDebug",
")",
"{",
"// Server debug mode",
"String",
"sDebug",
"=",
"Boolean",
".",
"toString",
"(",
"bServerDebug",
")",
";",
"SystemProperties... | Enable the JAX-WS SOAP debugging. This shows the exchanged SOAP messages in
the log file. By default this logging is disabled.
@param bServerDebug
<code>true</code> to enable server debugging, <code>false</code> to
disable it.
@param bClientDebug
<code>true</code> to enable client debugging, <code>false</code> to
disa... | [
"Enable",
"the",
"JAX",
"-",
"WS",
"SOAP",
"debugging",
".",
"This",
"shows",
"the",
"exchanged",
"SOAP",
"messages",
"in",
"the",
"log",
"file",
".",
"By",
"default",
"this",
"logging",
"is",
"disabled",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-wsclient/src/main/java/com/helger/wsclient/WSHelper.java#L62-L86 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/math/SloppyMath.java | SloppyMath.chiSquare2by2 | public static double chiSquare2by2(int k, int n, int r, int m) {
"""
Find a 2x2 chi-square value.
Note: could do this more neatly using simplified formula for 2x2 case.
@param k The number of black balls drawn
@param n The total number of balls
@param r The number of black balls
@param m The number of balls... | java | public static double chiSquare2by2(int k, int n, int r, int m) {
int[][] cg = {{k, r - k}, {m - k, n - (k + (r - k) + (m - k))}};
int[] cgr = {r, n - r};
int[] cgc = {m, n - m};
double total = 0.0;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
double exp = (double)... | [
"public",
"static",
"double",
"chiSquare2by2",
"(",
"int",
"k",
",",
"int",
"n",
",",
"int",
"r",
",",
"int",
"m",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"cg",
"=",
"{",
"{",
"k",
",",
"r",
"-",
"k",
"}",
",",
"{",
"m",
"-",
"k",
",",
"n",
... | Find a 2x2 chi-square value.
Note: could do this more neatly using simplified formula for 2x2 case.
@param k The number of black balls drawn
@param n The total number of balls
@param r The number of black balls
@param m The number of balls drawn
@return The Fisher's exact p-value | [
"Find",
"a",
"2x2",
"chi",
"-",
"square",
"value",
".",
"Note",
":",
"could",
"do",
"this",
"more",
"neatly",
"using",
"simplified",
"formula",
"for",
"2x2",
"case",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/math/SloppyMath.java#L591-L603 |
chennaione/sugar | library/src/main/java/com/orm/SugarDataSource.java | SugarDataSource.deleteAll | public void deleteAll(final SuccessCallback<Integer> successCallback, final ErrorCallback errorCallback) {
"""
Method that deletes all data in a SQLite table.
@param successCallback the callback that is executed if the operation is succesful
@param errorCallback the callback that is executed if there is an err... | java | public void deleteAll(final SuccessCallback<Integer> successCallback, final ErrorCallback errorCallback) {
delete(null, null, successCallback, errorCallback);
} | [
"public",
"void",
"deleteAll",
"(",
"final",
"SuccessCallback",
"<",
"Integer",
">",
"successCallback",
",",
"final",
"ErrorCallback",
"errorCallback",
")",
"{",
"delete",
"(",
"null",
",",
"null",
",",
"successCallback",
",",
"errorCallback",
")",
";",
"}"
] | Method that deletes all data in a SQLite table.
@param successCallback the callback that is executed if the operation is succesful
@param errorCallback the callback that is executed if there is an error | [
"Method",
"that",
"deletes",
"all",
"data",
"in",
"a",
"SQLite",
"table",
"."
] | train | https://github.com/chennaione/sugar/blob/2ff1b9d5b11563346b69b4e97324107ff680a61a/library/src/main/java/com/orm/SugarDataSource.java#L358-L360 |
visallo/vertexium | elasticsearch5/src/main/java/org/vertexium/elasticsearch5/utils/Murmur3.java | Murmur3.hash32 | public static int hash32(byte[] data, int length, int seed) {
"""
Murmur3 32-bit variant.
@param data - input byte array
@param length - length of array
@param seed - seed. (default 0)
@return - hashcode
"""
int hash = seed;
final int nblocks = length >> 2;
// body
fo... | java | public static int hash32(byte[] data, int length, int seed) {
int hash = seed;
final int nblocks = length >> 2;
// body
for (int i = 0; i < nblocks; i++) {
int i_4 = i << 2;
int k = (data[i_4] & 0xff)
| ((data[i_4 + 1] & 0xff) << 8)
... | [
"public",
"static",
"int",
"hash32",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"length",
",",
"int",
"seed",
")",
"{",
"int",
"hash",
"=",
"seed",
";",
"final",
"int",
"nblocks",
"=",
"length",
">>",
"2",
";",
"// body",
"for",
"(",
"int",
"i",
... | Murmur3 32-bit variant.
@param data - input byte array
@param length - length of array
@param seed - seed. (default 0)
@return - hashcode | [
"Murmur3",
"32",
"-",
"bit",
"variant",
"."
] | train | https://github.com/visallo/vertexium/blob/bb132b5425ac168957667164e1409b78adbea769/elasticsearch5/src/main/java/org/vertexium/elasticsearch5/utils/Murmur3.java#L59-L106 |
datacleaner/DataCleaner | engine/core/src/main/java/org/datacleaner/job/AnalysisJobImmutabilizer.java | AnalysisJobImmutabilizer.getOrCreateTransformerJob | public TransformerJob getOrCreateTransformerJob(final boolean validate, final TransformerComponentBuilder<?> tjb) {
"""
Gets or creates a {@link TransformerJob} for a particular
{@link TransformerComponentBuilder}. Since {@link MultiStreamComponent}s
are subtypes of {@link Transformer} it is necesary to have thi... | java | public TransformerJob getOrCreateTransformerJob(final boolean validate, final TransformerComponentBuilder<?> tjb) {
TransformerJob componentJob = (TransformerJob) _componentJobs.get(tjb);
if (componentJob == null) {
try {
componentJob = tjb.toTransformerJob(validate, this);
... | [
"public",
"TransformerJob",
"getOrCreateTransformerJob",
"(",
"final",
"boolean",
"validate",
",",
"final",
"TransformerComponentBuilder",
"<",
"?",
">",
"tjb",
")",
"{",
"TransformerJob",
"componentJob",
"=",
"(",
"TransformerJob",
")",
"_componentJobs",
".",
"get",
... | Gets or creates a {@link TransformerJob} for a particular
{@link TransformerComponentBuilder}. Since {@link MultiStreamComponent}s
are subtypes of {@link Transformer} it is necesary to have this caching
mechanism in place in order to allow diamond-shaped component graphs
where multiple streams include the same componen... | [
"Gets",
"or",
"creates",
"a",
"{",
"@link",
"TransformerJob",
"}",
"for",
"a",
"particular",
"{",
"@link",
"TransformerComponentBuilder",
"}",
".",
"Since",
"{",
"@link",
"MultiStreamComponent",
"}",
"s",
"are",
"subtypes",
"of",
"{",
"@link",
"Transformer",
"... | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/core/src/main/java/org/datacleaner/job/AnalysisJobImmutabilizer.java#L123-L135 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java | ArrayUtils.copyWithoutNulls | public static <T> void copyWithoutNulls(T[] src, T[] dst) {
"""
Copy src array into destination and skip null values.
Warning: It does not do any validation. It expect the dst[] is
created with right capacity.
You can calculate required capacity as <code>src.length - getNoOfNullItems(src)</code>
@param src... | java | public static <T> void copyWithoutNulls(T[] src, T[] dst) {
int skipped = 0;
for (int i = 0; i < src.length; i++) {
T object = src[i];
if (object == null) {
skipped++;
} else {
dst[i - skipped] = object;
}
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"copyWithoutNulls",
"(",
"T",
"[",
"]",
"src",
",",
"T",
"[",
"]",
"dst",
")",
"{",
"int",
"skipped",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"src",
".",
"length",
";",
"i",
... | Copy src array into destination and skip null values.
Warning: It does not do any validation. It expect the dst[] is
created with right capacity.
You can calculate required capacity as <code>src.length - getNoOfNullItems(src)</code>
@param src source array
@param dst destination. It has to have the right capacity
@pa... | [
"Copy",
"src",
"array",
"into",
"destination",
"and",
"skip",
"null",
"values",
".",
"Warning",
":",
"It",
"does",
"not",
"do",
"any",
"validation",
".",
"It",
"expect",
"the",
"dst",
"[]",
"is",
"created",
"with",
"right",
"capacity",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/collection/ArrayUtils.java#L130-L140 |
aol/cyclops | cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java | Pipes.publishToAsync | public void publishToAsync(final K key, final Publisher<V> publisher) {
"""
Asynchronously publish data to the Adapter specified by the provided Key
<pre>
{@code
Pipes<String,Integer> pipes = Pipes.of();
Queue<Integer> queue = new Queue();
pipes.register("hello", queue);
pipes.publishToAsync("hello",Reac... | java | public void publishToAsync(final K key, final Publisher<V> publisher) {
SequentialElasticPools.simpleReact.react(er -> er.of(publisher)
.peek(p -> publishTo(key, p)));
} | [
"public",
"void",
"publishToAsync",
"(",
"final",
"K",
"key",
",",
"final",
"Publisher",
"<",
"V",
">",
"publisher",
")",
"{",
"SequentialElasticPools",
".",
"simpleReact",
".",
"react",
"(",
"er",
"->",
"er",
".",
"of",
"(",
"publisher",
")",
".",
"peek... | Asynchronously publish data to the Adapter specified by the provided Key
<pre>
{@code
Pipes<String,Integer> pipes = Pipes.of();
Queue<Integer> queue = new Queue();
pipes.register("hello", queue);
pipes.publishToAsync("hello",ReactiveSeq.of(1,2,3));
Thread.sleep(100);
queue.offer(4);
queue.close();
assertThat(queue.... | [
"Asynchronously",
"publish",
"data",
"to",
"the",
"Adapter",
"specified",
"by",
"the",
"provided",
"Key"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java#L613-L616 |
sahan/RoboZombie | robozombie/src/main/java/com/lonepulse/robozombie/util/Assert.java | Assert.assertLength | public static <T extends Object> T assertLength(T arg, long length, long... optional) {
"""
<p>Asserts that the given argument is not <b>{@code null} and has the specified number of elements.
The null check is performed using {@link #assertNotNull(Object)}. If the argument does not contain
the specified number o... | java | public static <T extends Object> T assertLength(T arg, long length, long... optional) {
assertNotNull(arg);
long actualLength = arg instanceof CharSequence? ((CharSequence)arg).length() :
arg instanceof Collection<?>? ((Collection<?>)arg).size() :
arg instanceof Map<?, ?>? ((Map<?, ?>)arg).... | [
"public",
"static",
"<",
"T",
"extends",
"Object",
">",
"T",
"assertLength",
"(",
"T",
"arg",
",",
"long",
"length",
",",
"long",
"...",
"optional",
")",
"{",
"assertNotNull",
"(",
"arg",
")",
";",
"long",
"actualLength",
"=",
"arg",
"instanceof",
"CharS... | <p>Asserts that the given argument is not <b>{@code null} and has the specified number of elements.
The null check is performed using {@link #assertNotNull(Object)}. If the argument does not contain
the specified number of elements {@link IllegalArgumentException} will be thrown with the message,
<i>"The supplied argum... | [
"<p",
">",
"Asserts",
"that",
"the",
"given",
"argument",
"is",
"not",
"<b",
">",
"{",
"@code",
"null",
"}",
"and",
"has",
"the",
"specified",
"number",
"of",
"elements",
".",
"The",
"null",
"check",
"is",
"performed",
"using",
"{",
"@link",
"#assertNotN... | train | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/com/lonepulse/robozombie/util/Assert.java#L243-L279 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java | EstimateSceneCalibrated.addUnvistedToStack | void addUnvistedToStack(View viewed, List<View> open) {
"""
Looks to see which connections have yet to be visited and adds them to the open list
"""
for (int i = 0; i < viewed.connections.size(); i++) {
View other = viewed.connections.get(i).destination(viewed);
if( other.state == ViewState.UNPROCESSED... | java | void addUnvistedToStack(View viewed, List<View> open) {
for (int i = 0; i < viewed.connections.size(); i++) {
View other = viewed.connections.get(i).destination(viewed);
if( other.state == ViewState.UNPROCESSED) {
other.state = ViewState.PENDING;
open.add(other);
if( verbose != null )
verbose.p... | [
"void",
"addUnvistedToStack",
"(",
"View",
"viewed",
",",
"List",
"<",
"View",
">",
"open",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"viewed",
".",
"connections",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"View",
"other",... | Looks to see which connections have yet to be visited and adds them to the open list | [
"Looks",
"to",
"see",
"which",
"connections",
"have",
"yet",
"to",
"be",
"visited",
"and",
"adds",
"them",
"to",
"the",
"open",
"list"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/structure/EstimateSceneCalibrated.java#L653-L663 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java | TypeRegistry.getPatternsFrom | private List<TypePattern> getPatternsFrom(String value) {
"""
Process some type pattern objects from the supplied value. For example the value might be
'com.foo.Bar,!com.foo.Goo'
@param value string defining a comma separated list of type patterns
@return list of TypePatterns
"""
if (value == null) {
... | java | private List<TypePattern> getPatternsFrom(String value) {
if (value == null) {
return Collections.emptyList();
}
List<TypePattern> typePatterns = new ArrayList<TypePattern>();
StringTokenizer st = new StringTokenizer(value, ",");
while (st.hasMoreElements()) {
String typepattern = st.nextToken();
Typ... | [
"private",
"List",
"<",
"TypePattern",
">",
"getPatternsFrom",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"List",
"<",
"TypePattern",
">",
"typePatterns",
"... | Process some type pattern objects from the supplied value. For example the value might be
'com.foo.Bar,!com.foo.Goo'
@param value string defining a comma separated list of type patterns
@return list of TypePatterns | [
"Process",
"some",
"type",
"pattern",
"objects",
"from",
"the",
"supplied",
"value",
".",
"For",
"example",
"the",
"value",
"might",
"be",
"com",
".",
"foo",
".",
"Bar",
"!com",
".",
"foo",
".",
"Goo"
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java#L2070-L2094 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.