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 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/jdbc/DataSourceResourceFactoryBuilder.java | DataSourceResourceFactoryBuilder.getDataSourceID | private static final String getDataSourceID(String application, String module, String component, String jndiName) {
"""
Utility method that creates a unique identifier for an application defined data source.
For example,
application[MyApp]/module[MyModule]/dataSource[java:module/env/jdbc/ds1]
@param applicati... | java | private static final String getDataSourceID(String application, String module, String component, String jndiName) {
StringBuilder sb = new StringBuilder(jndiName.length() + 80);
if (application != null) {
sb.append(AppDefinedResource.APPLICATION).append('[').append(application).append(']').a... | [
"private",
"static",
"final",
"String",
"getDataSourceID",
"(",
"String",
"application",
",",
"String",
"module",
",",
"String",
"component",
",",
"String",
"jndiName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"jndiName",
".",
"length",... | Utility method that creates a unique identifier for an application defined data source.
For example,
application[MyApp]/module[MyModule]/dataSource[java:module/env/jdbc/ds1]
@param application application name if data source is in java:app, java:module, or java:comp. Otherwise null.
@param module module name if data s... | [
"Utility",
"method",
"that",
"creates",
"a",
"unique",
"identifier",
"for",
"an",
"application",
"defined",
"data",
"source",
".",
"For",
"example",
"application",
"[",
"MyApp",
"]",
"/",
"module",
"[",
"MyModule",
"]",
"/",
"dataSource",
"[",
"java",
":",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/jdbc/DataSourceResourceFactoryBuilder.java#L331-L342 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationBuilder.java | PointerHierarchyRepresentationBuilder.setSize | public void setSize(DBIDRef id, int size) {
"""
Set the cluster size of an object.
@param id Object to set
@param size Cluster size
"""
if(csize == null) {
csize = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1);
}
csize.putInt(id, size);
... | java | public void setSize(DBIDRef id, int size) {
if(csize == null) {
csize = DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 1);
}
csize.putInt(id, size);
} | [
"public",
"void",
"setSize",
"(",
"DBIDRef",
"id",
",",
"int",
"size",
")",
"{",
"if",
"(",
"csize",
"==",
"null",
")",
"{",
"csize",
"=",
"DataStoreUtil",
".",
"makeIntegerStorage",
"(",
"ids",
",",
"DataStoreFactory",
".",
"HINT_HOT",
"|",
"DataStoreFact... | Set the cluster size of an object.
@param id Object to set
@param size Cluster size | [
"Set",
"the",
"cluster",
"size",
"of",
"an",
"object",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerHierarchyRepresentationBuilder.java#L186-L191 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/PriceListUrl.java | PriceListUrl.deletePriceListUrl | public static MozuUrl deletePriceListUrl(Boolean cascadeDeleteEntries, String priceListCode) {
"""
Get Resource Url for DeletePriceList
@param cascadeDeleteEntries Specifies whether to deletes all price list entries associated with the price list.
@param priceListCode The unique, user-defined code of the price l... | java | public static MozuUrl deletePriceListUrl(Boolean cascadeDeleteEntries, String priceListCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/pricelists/{priceListCode}?cascadeDeleteEntries={cascadeDeleteEntries}");
formatter.formatUrl("cascadeDeleteEntries", cascadeDeleteEntries);
fo... | [
"public",
"static",
"MozuUrl",
"deletePriceListUrl",
"(",
"Boolean",
"cascadeDeleteEntries",
",",
"String",
"priceListCode",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/pricelists/{priceListCode}?cascadeDeleteEntries={cas... | Get Resource Url for DeletePriceList
@param cascadeDeleteEntries Specifies whether to deletes all price list entries associated with the price list.
@param priceListCode The unique, user-defined code of the price list.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeletePriceList"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/PriceListUrl.java#L124-L130 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java | ConditionalCheck.stateIsTrue | @ArgumentsChecked
@Throws( {
"""
Ensures that a given state is {@code true} and allows to specify the class of exception which is thrown in case
the state is not {@code true}.
@param condition
condition must be {@code true}^ so that the check will be performed
@param expression
an expression that must be {... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, RuntimeInstantiationException.class })
public static void stateIsTrue(final boolean condition, final boolean expression, final Class<? extends RuntimeException> clazz) {
if (condition) {
Check.stateIsTrue(expression, clazz);
}
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"RuntimeInstantiationException",
".",
"class",
"}",
")",
"public",
"static",
"void",
"stateIsTrue",
"(",
"final",
"boolean",
"condition",
",",
"final",
"boolean",
... | Ensures that a given state is {@code true} and allows to specify the class of exception which is thrown in case
the state is not {@code true}.
@param condition
condition must be {@code true}^ so that the check will be performed
@param expression
an expression that must be {@code true} to indicate a valid state
@param ... | [
"Ensures",
"that",
"a",
"given",
"state",
"is",
"{",
"@code",
"true",
"}",
"and",
"allows",
"to",
"specify",
"the",
"class",
"of",
"exception",
"which",
"is",
"thrown",
"in",
"case",
"the",
"state",
"is",
"not",
"{",
"@code",
"true",
"}",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L2163-L2170 |
JOML-CI/JOML | src/org/joml/Quaterniond.java | Quaterniond.rotationYXZ | public Quaterniond rotationYXZ(double angleY, double angleX, double angleZ) {
"""
Set this quaternion from the supplied euler angles (in radians) with rotation order YXZ.
<p>
This method is equivalent to calling: <code>rotationY(angleY).rotateX(angleX).rotateZ(angleZ)</code>
<p>
Reference: <a href="https://en.... | java | public Quaterniond rotationYXZ(double angleY, double angleX, double angleZ) {
double sx = Math.sin(angleX * 0.5);
double cx = Math.cosFromSin(sx, angleX * 0.5);
double sy = Math.sin(angleY * 0.5);
double cy = Math.cosFromSin(sy, angleY * 0.5);
double sz = Math.sin(angleZ * 0.5);
... | [
"public",
"Quaterniond",
"rotationYXZ",
"(",
"double",
"angleY",
",",
"double",
"angleX",
",",
"double",
"angleZ",
")",
"{",
"double",
"sx",
"=",
"Math",
".",
"sin",
"(",
"angleX",
"*",
"0.5",
")",
";",
"double",
"cx",
"=",
"Math",
".",
"cosFromSin",
"... | Set this quaternion from the supplied euler angles (in radians) with rotation order YXZ.
<p>
This method is equivalent to calling: <code>rotationY(angleY).rotateX(angleX).rotateZ(angleZ)</code>
<p>
Reference: <a href="https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles">https://en.wikipedia.or... | [
"Set",
"this",
"quaternion",
"from",
"the",
"supplied",
"euler",
"angles",
"(",
"in",
"radians",
")",
"with",
"rotation",
"order",
"YXZ",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
"to",
"calling",
":",
"<code",
">",
"rotationY",
"(",
"angleY",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaterniond.java#L1279-L1297 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/NonAtomicVolatileUpdate.java | NonAtomicVolatileUpdate.variableFromAssignmentTree | private static Matcher<AssignmentTree> variableFromAssignmentTree(
final Matcher<ExpressionTree> exprMatcher) {
"""
Extracts the variable from an AssignmentTree and applies a matcher to it.
"""
return new Matcher<AssignmentTree>() {
@Override
public boolean matches(AssignmentTree tree, Vi... | java | private static Matcher<AssignmentTree> variableFromAssignmentTree(
final Matcher<ExpressionTree> exprMatcher) {
return new Matcher<AssignmentTree>() {
@Override
public boolean matches(AssignmentTree tree, VisitorState state) {
return exprMatcher.matches(tree.getVariable(), state);
}
... | [
"private",
"static",
"Matcher",
"<",
"AssignmentTree",
">",
"variableFromAssignmentTree",
"(",
"final",
"Matcher",
"<",
"ExpressionTree",
">",
"exprMatcher",
")",
"{",
"return",
"new",
"Matcher",
"<",
"AssignmentTree",
">",
"(",
")",
"{",
"@",
"Override",
"publi... | Extracts the variable from an AssignmentTree and applies a matcher to it. | [
"Extracts",
"the",
"variable",
"from",
"an",
"AssignmentTree",
"and",
"applies",
"a",
"matcher",
"to",
"it",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/NonAtomicVolatileUpdate.java#L79-L87 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_shippingAddresses_GET | public ArrayList<OvhShippingAddress> packName_shippingAddresses_GET(String packName, OvhShippingAddressContextEnum context) throws IOException {
"""
Allowed shipping addresses given a context
REST: GET /pack/xdsl/{packName}/shippingAddresses
@param context [required] Context
@param packName [required] The int... | java | public ArrayList<OvhShippingAddress> packName_shippingAddresses_GET(String packName, OvhShippingAddressContextEnum context) throws IOException {
String qPath = "/pack/xdsl/{packName}/shippingAddresses";
StringBuilder sb = path(qPath, packName);
query(sb, "context", context);
String resp = exec(qPath, "GET", sb.... | [
"public",
"ArrayList",
"<",
"OvhShippingAddress",
">",
"packName_shippingAddresses_GET",
"(",
"String",
"packName",
",",
"OvhShippingAddressContextEnum",
"context",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack/xdsl/{packName}/shippingAddresses\"",
";",
... | Allowed shipping addresses given a context
REST: GET /pack/xdsl/{packName}/shippingAddresses
@param context [required] Context
@param packName [required] The internal name of your pack | [
"Allowed",
"shipping",
"addresses",
"given",
"a",
"context"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L984-L990 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/protocol/RedisStateMachine.java | RedisStateMachine.safeSetError | protected void safeSetError(CommandOutput<?, ?, ?> output, ByteBuffer bytes, RedisCommand<?, ?, ?> command) {
"""
Safely sets {@link CommandOutput#setError(ByteBuffer)}. Completes a command exceptionally in case an exception occurs.
@param output
@param bytes
@param command
"""
try {
... | java | protected void safeSetError(CommandOutput<?, ?, ?> output, ByteBuffer bytes, RedisCommand<?, ?, ?> command) {
try {
output.setError(bytes);
} catch (Exception e) {
command.completeExceptionally(e);
}
} | [
"protected",
"void",
"safeSetError",
"(",
"CommandOutput",
"<",
"?",
",",
"?",
",",
"?",
">",
"output",
",",
"ByteBuffer",
"bytes",
",",
"RedisCommand",
"<",
"?",
",",
"?",
",",
"?",
">",
"command",
")",
"{",
"try",
"{",
"output",
".",
"setError",
"(... | Safely sets {@link CommandOutput#setError(ByteBuffer)}. Completes a command exceptionally in case an exception occurs.
@param output
@param bytes
@param command | [
"Safely",
"sets",
"{",
"@link",
"CommandOutput#setError",
"(",
"ByteBuffer",
")",
"}",
".",
"Completes",
"a",
"command",
"exceptionally",
"in",
"case",
"an",
"exception",
"occurs",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/protocol/RedisStateMachine.java#L418-L425 |
bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/util/SimpleArrayMap.java | SimpleArrayMap.put | public V put(K key, V value) {
"""
Add a new value to the array map.
@param key The key under which to store the value. <b>Must not be null.</b> If
this key already exists in the array, its value will be replaced.
@param value The value to store for the given key.
@return Returns the old value that was store... | java | public V put(K key, V value) {
final int hash;
int index;
if (key == null) {
hash = 0;
index = indexOfNull();
} else {
hash = key.hashCode();
index = indexOf(key, hash);
}
if (index >= 0) {
index = (index<<1) + 1... | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"final",
"int",
"hash",
";",
"int",
"index",
";",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"hash",
"=",
"0",
";",
"index",
"=",
"indexOfNull",
"(",
")",
";",
"}",
"else",
"{... | Add a new value to the array map.
@param key The key under which to store the value. <b>Must not be null.</b> If
this key already exists in the array, its value will be replaced.
@param value The value to store for the given key.
@return Returns the old value that was stored for the given key, or null if there
was no... | [
"Add",
"a",
"new",
"value",
"to",
"the",
"array",
"map",
"."
] | train | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/util/SimpleArrayMap.java#L364-L408 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/AbstractTreebankParserParams.java | AbstractTreebankParserParams.unorderedUntypedDependencyObjectify | public static Collection<List<String>> unorderedUntypedDependencyObjectify(Tree t, HeadFinder hf, TreeTransformer collinizer) {
"""
Returns a collection of unordered (but directed!) untyped word-word dependencies for the tree.
"""
return dependencyObjectify(t, hf, collinizer, new UnorderedUntypedDependenc... | java | public static Collection<List<String>> unorderedUntypedDependencyObjectify(Tree t, HeadFinder hf, TreeTransformer collinizer) {
return dependencyObjectify(t, hf, collinizer, new UnorderedUntypedDependencyTyper(hf));
} | [
"public",
"static",
"Collection",
"<",
"List",
"<",
"String",
">",
">",
"unorderedUntypedDependencyObjectify",
"(",
"Tree",
"t",
",",
"HeadFinder",
"hf",
",",
"TreeTransformer",
"collinizer",
")",
"{",
"return",
"dependencyObjectify",
"(",
"t",
",",
"hf",
",",
... | Returns a collection of unordered (but directed!) untyped word-word dependencies for the tree. | [
"Returns",
"a",
"collection",
"of",
"unordered",
"(",
"but",
"directed!",
")",
"untyped",
"word",
"-",
"word",
"dependencies",
"for",
"the",
"tree",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/AbstractTreebankParserParams.java#L351-L353 |
netty/netty | common/src/main/java/io/netty/util/internal/ResourcesUtil.java | ResourcesUtil.getFile | public static File getFile(Class resourceClass, String fileName) {
"""
Returns a {@link File} named {@code fileName} associated with {@link Class} {@code resourceClass} .
@param resourceClass The associated class
@param fileName The file name
@return The file named {@code fileName} associated with {@link Clas... | java | public static File getFile(Class resourceClass, String fileName) {
try {
return new File(URLDecoder.decode(resourceClass.getResource(fileName).getFile(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
return new File(resourceClass.getResource(fileName).getFile());
... | [
"public",
"static",
"File",
"getFile",
"(",
"Class",
"resourceClass",
",",
"String",
"fileName",
")",
"{",
"try",
"{",
"return",
"new",
"File",
"(",
"URLDecoder",
".",
"decode",
"(",
"resourceClass",
".",
"getResource",
"(",
"fileName",
")",
".",
"getFile",
... | Returns a {@link File} named {@code fileName} associated with {@link Class} {@code resourceClass} .
@param resourceClass The associated class
@param fileName The file name
@return The file named {@code fileName} associated with {@link Class} {@code resourceClass} . | [
"Returns",
"a",
"{",
"@link",
"File",
"}",
"named",
"{",
"@code",
"fileName",
"}",
"associated",
"with",
"{",
"@link",
"Class",
"}",
"{",
"@code",
"resourceClass",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/ResourcesUtil.java#L34-L40 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.deleteFromTaskAsync | public Observable<Void> deleteFromTaskAsync(String jobId, String taskId, String filePath, Boolean recursive, FileDeleteFromTaskOptions fileDeleteFromTaskOptions) {
"""
Deletes the specified task file from the compute node where the task ran.
@param jobId The ID of the job that contains the task.
@param taskId ... | java | public Observable<Void> deleteFromTaskAsync(String jobId, String taskId, String filePath, Boolean recursive, FileDeleteFromTaskOptions fileDeleteFromTaskOptions) {
return deleteFromTaskWithServiceResponseAsync(jobId, taskId, filePath, recursive, fileDeleteFromTaskOptions).map(new Func1<ServiceResponseWithHeader... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteFromTaskAsync",
"(",
"String",
"jobId",
",",
"String",
"taskId",
",",
"String",
"filePath",
",",
"Boolean",
"recursive",
",",
"FileDeleteFromTaskOptions",
"fileDeleteFromTaskOptions",
")",
"{",
"return",
"deleteFromTask... | Deletes the specified task file from the compute node where the task ran.
@param jobId The ID of the job that contains the task.
@param taskId The ID of the task whose file you want to delete.
@param filePath The path to the task file or directory that you want to delete.
@param recursive Whether to delete children of... | [
"Deletes",
"the",
"specified",
"task",
"file",
"from",
"the",
"compute",
"node",
"where",
"the",
"task",
"ran",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L274-L281 |
apache/flink | flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontendParser.java | CliFrontendParser.mergeOptions | public static Options mergeOptions(@Nullable Options optionsA, @Nullable Options optionsB) {
"""
Merges the given {@link Options} into a new Options object.
@param optionsA options to merge, can be null if none
@param optionsB options to merge, can be null if none
@return
"""
final Options resultOptions... | java | public static Options mergeOptions(@Nullable Options optionsA, @Nullable Options optionsB) {
final Options resultOptions = new Options();
if (optionsA != null) {
for (Option option : optionsA.getOptions()) {
resultOptions.addOption(option);
}
}
if (optionsB != null) {
for (Option option : optionsB... | [
"public",
"static",
"Options",
"mergeOptions",
"(",
"@",
"Nullable",
"Options",
"optionsA",
",",
"@",
"Nullable",
"Options",
"optionsB",
")",
"{",
"final",
"Options",
"resultOptions",
"=",
"new",
"Options",
"(",
")",
";",
"if",
"(",
"optionsA",
"!=",
"null",... | Merges the given {@link Options} into a new Options object.
@param optionsA options to merge, can be null if none
@param optionsB options to merge, can be null if none
@return | [
"Merges",
"the",
"given",
"{",
"@link",
"Options",
"}",
"into",
"a",
"new",
"Options",
"object",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-clients/src/main/java/org/apache/flink/client/cli/CliFrontendParser.java#L445-L460 |
badamowicz/sonar-hla | sonar-hla/src/main/java/com/github/badamowicz/sonar/hla/impl/ProjectAggregated.java | ProjectAggregated.isNoMeasureAvailable | private boolean isNoMeasureAvailable(HLAMeasure measure, IProject project) {
"""
Check if the given measure is available inside the project <b>and</b> if it contains a value.
@param measure The measure to be checked.
@param project The project to be checked.
@return true, if <b>no</b> measure is available.
... | java | private boolean isNoMeasureAvailable(HLAMeasure measure, IProject project) {
return !project.getMeasures().contains(measure) || project.getMeasureValue(measure, false) == Project.VALUE_NOT_AVAILABLE;
} | [
"private",
"boolean",
"isNoMeasureAvailable",
"(",
"HLAMeasure",
"measure",
",",
"IProject",
"project",
")",
"{",
"return",
"!",
"project",
".",
"getMeasures",
"(",
")",
".",
"contains",
"(",
"measure",
")",
"||",
"project",
".",
"getMeasureValue",
"(",
"measu... | Check if the given measure is available inside the project <b>and</b> if it contains a value.
@param measure The measure to be checked.
@param project The project to be checked.
@return true, if <b>no</b> measure is available. | [
"Check",
"if",
"the",
"given",
"measure",
"is",
"available",
"inside",
"the",
"project",
"<b",
">",
"and<",
"/",
"b",
">",
"if",
"it",
"contains",
"a",
"value",
"."
] | train | https://github.com/badamowicz/sonar-hla/blob/21bd8a853d81966b47e96b518430abbc07ccd5f3/sonar-hla/src/main/java/com/github/badamowicz/sonar/hla/impl/ProjectAggregated.java#L188-L191 |
casmi/casmi | src/main/java/casmi/graphics/element/Curve.java | Curve.setNode | public void setNode(int number, double x, double y) {
"""
Sets x,y,z-coordinate of nodes of this Curve.
@param number The number of a node. The node whose number is 0 or 3 is a anchor point, and
the node whose number is 1 or 2 is a control point.
@param x The x-coordinate of this node.
@param y The y-coord... | java | public void setNode(int number, double x, double y) {
if (number <= 0) number = 0;
if (number >= 3) number = 3;
this.points[number * 3] = (float)x;
this.points[number * 3 + 1] = (float)y;
this.points[number * 3 + 2] = 0;
set();
} | [
"public",
"void",
"setNode",
"(",
"int",
"number",
",",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"number",
"<=",
"0",
")",
"number",
"=",
"0",
";",
"if",
"(",
"number",
">=",
"3",
")",
"number",
"=",
"3",
";",
"this",
".",
"point... | Sets x,y,z-coordinate of nodes of this Curve.
@param number The number of a node. The node whose number is 0 or 3 is a anchor point, and
the node whose number is 1 or 2 is a control point.
@param x The x-coordinate of this node.
@param y The y-coordinate of this node. | [
"Sets",
"x",
"y",
"z",
"-",
"coordinate",
"of",
"nodes",
"of",
"this",
"Curve",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Curve.java#L348-L355 |
PrashamTrivedi/SharedPreferenceInspector | sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java | SharedPreferenceUtils.putLong | public void putLong(String key, long value) {
"""
put the int value to shared preference
@param key
the name of the preference to save
@param value
the name of the preference to modify.
@see android.content.SharedPreferences#edit()#putLong(String, long)
"""
sharedPreferences.edit().putLong(key, valu... | java | public void putLong(String key, long value) {
sharedPreferences.edit().putLong(key, value).commit();
} | [
"public",
"void",
"putLong",
"(",
"String",
"key",
",",
"long",
"value",
")",
"{",
"sharedPreferences",
".",
"edit",
"(",
")",
".",
"putLong",
"(",
"key",
",",
"value",
")",
".",
"commit",
"(",
")",
";",
"}"
] | put the int value to shared preference
@param key
the name of the preference to save
@param value
the name of the preference to modify.
@see android.content.SharedPreferences#edit()#putLong(String, long) | [
"put",
"the",
"int",
"value",
"to",
"shared",
"preference"
] | train | https://github.com/PrashamTrivedi/SharedPreferenceInspector/blob/c04d567c4d0fc5e0f8cda308ca85df19c6b3b838/sharedpreferenceinspector/src/main/java/com/ceelites/sharedpreferenceinspector/Utils/SharedPreferenceUtils.java#L475-L477 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_allowedNetwork_networkAccessId_GET | public OvhAllowedNetwork serviceName_allowedNetwork_networkAccessId_GET(String serviceName, Long networkAccessId) throws IOException {
"""
Get this object properties
REST: GET /dedicatedCloud/{serviceName}/allowedNetwork/{networkAccessId}
@param serviceName [required] Domain of the service
@param networkAcces... | java | public OvhAllowedNetwork serviceName_allowedNetwork_networkAccessId_GET(String serviceName, Long networkAccessId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/allowedNetwork/{networkAccessId}";
StringBuilder sb = path(qPath, serviceName, networkAccessId);
String resp = exec(qPath, "GET", sb.... | [
"public",
"OvhAllowedNetwork",
"serviceName_allowedNetwork_networkAccessId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"networkAccessId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/allowedNetwork/{networkAccessId}\"",
";",
"St... | Get this object properties
REST: GET /dedicatedCloud/{serviceName}/allowedNetwork/{networkAccessId}
@param serviceName [required] Domain of the service
@param networkAccessId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L307-L312 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java | CommonOps_ZDRM.multAddTransA | public static void multAddTransA(double realAlpha , double imagAlpha , ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c ) {
"""
<p>
Performs the following operation:<br>
<br>
c = c + α * a<sup>H</sup> * b<br>
c<sub>ij</sub> =c<sub>ij</sub> + α * ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>kj</sub>... | java | public static void multAddTransA(double realAlpha , double imagAlpha , ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c )
{
// TODO add a matrix vectory multiply here
if( a.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH ||
b.numCols >= EjmlParameters.CMULT_COLUMN_SWITCH ) {
M... | [
"public",
"static",
"void",
"multAddTransA",
"(",
"double",
"realAlpha",
",",
"double",
"imagAlpha",
",",
"ZMatrixRMaj",
"a",
",",
"ZMatrixRMaj",
"b",
",",
"ZMatrixRMaj",
"c",
")",
"{",
"// TODO add a matrix vectory multiply here",
"if",
"(",
"a",
".",
"numCols",
... | <p>
Performs the following operation:<br>
<br>
c = c + α * a<sup>H</sup> * b<br>
c<sub>ij</sub> =c<sub>ij</sub> + α * ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>kj</sub>}
</p>
@param realAlpha Real component of scaling factor.
@param imagAlpha Imaginary component of scaling factor.
@param a The left m... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"c",
"+",
"&alpha",
";",
"*",
"a<sup",
">",
"H<",
"/",
"sup",
">",
"*",
"b<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"c<sub",
">",
"ij<",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L607-L616 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java | Strs.betnNext | public static Betner betnNext(String target, String leftSameWithRight) {
"""
Returns a {@code String} between matcher that matches any character
in the two instances of the same String, Adjacent tag matches.
@param target
@param leftSameWithRight
@return
"""
return betn(target).betweenNext(leftSameWith... | java | public static Betner betnNext(String target, String leftSameWithRight) {
return betn(target).betweenNext(leftSameWithRight);
} | [
"public",
"static",
"Betner",
"betnNext",
"(",
"String",
"target",
",",
"String",
"leftSameWithRight",
")",
"{",
"return",
"betn",
"(",
"target",
")",
".",
"betweenNext",
"(",
"leftSameWithRight",
")",
";",
"}"
] | Returns a {@code String} between matcher that matches any character
in the two instances of the same String, Adjacent tag matches.
@param target
@param leftSameWithRight
@return | [
"Returns",
"a",
"{",
"@code",
"String",
"}",
"between",
"matcher",
"that",
"matches",
"any",
"character",
"in",
"the",
"two",
"instances",
"of",
"the",
"same",
"String",
"Adjacent",
"tag",
"matches",
"."
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Strs.java#L443-L445 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java | FileSystemShellUtils.validatePath | public static String validatePath(String path, AlluxioConfiguration alluxioConf)
throws IOException {
"""
Validates the path, verifying that it contains the {@link Constants#HEADER} or
{@link Constants#HEADER_FT} and a hostname:port specified.
@param path the path to be verified
@param alluxioConf Allux... | java | public static String validatePath(String path, AlluxioConfiguration alluxioConf)
throws IOException {
if (path.startsWith(Constants.HEADER) || path.startsWith(Constants.HEADER_FT)) {
if (!path.contains(":")) {
throw new IOException("Invalid Path: " + path + ". Use " + Constants.HEADER
... | [
"public",
"static",
"String",
"validatePath",
"(",
"String",
"path",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"throws",
"IOException",
"{",
"if",
"(",
"path",
".",
"startsWith",
"(",
"Constants",
".",
"HEADER",
")",
"||",
"path",
".",
"startsWith",
"("... | Validates the path, verifying that it contains the {@link Constants#HEADER} or
{@link Constants#HEADER_FT} and a hostname:port specified.
@param path the path to be verified
@param alluxioConf Alluxio configuration
@return the verified path in a form like alluxio://host:port/dir. If only the "/dir" or "dir"
part is pr... | [
"Validates",
"the",
"path",
"verifying",
"that",
"it",
"contains",
"the",
"{",
"@link",
"Constants#HEADER",
"}",
"or",
"{",
"@link",
"Constants#HEADER_FT",
"}",
"and",
"a",
"hostname",
":",
"port",
"specified",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java#L80-L97 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/locale/Locale.java | Locale.getStringWithDefault | @Pure
public static String getStringWithDefault(ClassLoader classLoader, String key, String defaultValue, Object... params) {
"""
Replies the text that corresponds to the specified resource.
@param classLoader is the class loader to use.
@param key is the name of the resource into the specified file
@param d... | java | @Pure
public static String getStringWithDefault(ClassLoader classLoader, String key, String defaultValue, Object... params) {
return getStringWithDefault(classLoader, detectResourceClass(null), key, defaultValue, params);
} | [
"@",
"Pure",
"public",
"static",
"String",
"getStringWithDefault",
"(",
"ClassLoader",
"classLoader",
",",
"String",
"key",
",",
"String",
"defaultValue",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"getStringWithDefault",
"(",
"classLoader",
",",
"detectR... | Replies the text that corresponds to the specified resource.
@param classLoader is the class loader to use.
@param key is the name of the resource into the specified file
@param defaultValue is the default value to replies if the resource does not contain the specified key.
@param params is the the list of parameters ... | [
"Replies",
"the",
"text",
"that",
"corresponds",
"to",
"the",
"specified",
"resource",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/locale/Locale.java#L405-L408 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/Utils.java | Utils.loadDottedClassAsBytes | public static byte[] loadDottedClassAsBytes(ClassLoader loader, String dottedclassname) {
"""
Access the specified class as a resource accessible through the specified loader and return the bytes. The
classname should be 'dot' separated (eg. com.foo.Bar) and not suffixed .class
@param loader the classloader ag... | java | public static byte[] loadDottedClassAsBytes(ClassLoader loader, String dottedclassname) {
if (GlobalConfiguration.assertsMode) {
if (dottedclassname.endsWith(".class")) {
throw new IllegalStateException(".class suffixed name should not be passed:" + dottedclassname);
}
if (dottedclassname.indexOf('/') !=... | [
"public",
"static",
"byte",
"[",
"]",
"loadDottedClassAsBytes",
"(",
"ClassLoader",
"loader",
",",
"String",
"dottedclassname",
")",
"{",
"if",
"(",
"GlobalConfiguration",
".",
"assertsMode",
")",
"{",
"if",
"(",
"dottedclassname",
".",
"endsWith",
"(",
"\".clas... | Access the specified class as a resource accessible through the specified loader and return the bytes. The
classname should be 'dot' separated (eg. com.foo.Bar) and not suffixed .class
@param loader the classloader against which getResourceAsStream() will be invoked
@param dottedclassname the dot separated classname w... | [
"Access",
"the",
"specified",
"class",
"as",
"a",
"resource",
"accessible",
"through",
"the",
"specified",
"loader",
"and",
"return",
"the",
"bytes",
".",
"The",
"classname",
"should",
"be",
"dot",
"separated",
"(",
"eg",
".",
"com",
".",
"foo",
".",
"Bar"... | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/Utils.java#L770-L784 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java | IntegralImageOps.isInBounds | public static boolean isInBounds( int x , int y , IntegralKernel kernel , int width , int height ) {
"""
Checks to see if the kernel is applied at this specific spot if all the pixels
would be inside the image bounds or not
@param x location where the kernel is applied. x-axis
@param y location where the kern... | java | public static boolean isInBounds( int x , int y , IntegralKernel kernel , int width , int height )
{
for(ImageRectangle r : kernel.blocks ) {
if( x+r.x0 < 0 || y+r.y0 < 0 )
return false;
if( x+r.x1 >= width || y+r.y1 >= height )
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isInBounds",
"(",
"int",
"x",
",",
"int",
"y",
",",
"IntegralKernel",
"kernel",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"for",
"(",
"ImageRectangle",
"r",
":",
"kernel",
".",
"blocks",
")",
"{",
"if",
"(",
... | Checks to see if the kernel is applied at this specific spot if all the pixels
would be inside the image bounds or not
@param x location where the kernel is applied. x-axis
@param y location where the kernel is applied. y-axis
@param kernel The kernel
@param width Image's width
@param height Image's height
@return tru... | [
"Checks",
"to",
"see",
"if",
"the",
"kernel",
"is",
"applied",
"at",
"this",
"specific",
"spot",
"if",
"all",
"the",
"pixels",
"would",
"be",
"inside",
"the",
"image",
"bounds",
"or",
"not"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L560-L570 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/domassign/Variator.java | Variator.assignDefaults | public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) {
"""
Assigns the default values to all the properties.
@param properties
@param values
"""
SupportedCSS css = CSSFactory.getSupportedCSS();
for (String name : names) {
CSSProperty dp = css.getDefa... | java | public void assignDefaults(Map<String, CSSProperty> properties, Map<String, Term<?>> values) {
SupportedCSS css = CSSFactory.getSupportedCSS();
for (String name : names) {
CSSProperty dp = css.getDefaultProperty(name);
if (dp != null)
properties.put(name, dp);
Term<?> d... | [
"public",
"void",
"assignDefaults",
"(",
"Map",
"<",
"String",
",",
"CSSProperty",
">",
"properties",
",",
"Map",
"<",
"String",
",",
"Term",
"<",
"?",
">",
">",
"values",
")",
"{",
"SupportedCSS",
"css",
"=",
"CSSFactory",
".",
"getSupportedCSS",
"(",
"... | Assigns the default values to all the properties.
@param properties
@param values | [
"Assigns",
"the",
"default",
"values",
"to",
"all",
"the",
"properties",
"."
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/domassign/Variator.java#L348-L358 |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/compiler/Type.java | Type.preserveType | public static Type preserveType(Type currentType, Type newType) {
"""
Preserve the current type's generic information with the specified new
type if they have the same class.
"""
Type result = newType;
if (newType != null && currentType != null &&
currentType.getObjectClass() == ne... | java | public static Type preserveType(Type currentType, Type newType) {
Type result = newType;
if (newType != null && currentType != null &&
currentType.getObjectClass() == newType.getObjectClass()) {
if (newType.getGenericType().getGenericType() instanceof Class &&
!(c... | [
"public",
"static",
"Type",
"preserveType",
"(",
"Type",
"currentType",
",",
"Type",
"newType",
")",
"{",
"Type",
"result",
"=",
"newType",
";",
"if",
"(",
"newType",
"!=",
"null",
"&&",
"currentType",
"!=",
"null",
"&&",
"currentType",
".",
"getObjectClass"... | Preserve the current type's generic information with the specified new
type if they have the same class. | [
"Preserve",
"the",
"current",
"type",
"s",
"generic",
"information",
"with",
"the",
"specified",
"new",
"type",
"if",
"they",
"have",
"the",
"same",
"class",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/compiler/Type.java#L803-L819 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/FactoryOptimization.java | FactoryOptimization.levenbergMarquardtSchur | public static UnconstrainedLeastSquaresSchur<DMatrixRMaj> levenbergMarquardtSchur(
boolean robust,
@Nullable ConfigLevenbergMarquardt config ) {
"""
LM with Schur Complement
@param robust If true then a slow by robust solver is used. true = use SVD
@param config configuration for LM
@return the solver
... | java | public static UnconstrainedLeastSquaresSchur<DMatrixRMaj> levenbergMarquardtSchur(
boolean robust,
@Nullable ConfigLevenbergMarquardt config )
{
if( config == null )
config = new ConfigLevenbergMarquardt();
HessianSchurComplement_DDRM hessian;
if( robust ) {
LinearSolverDense<DMatrixRMaj> solverA ... | [
"public",
"static",
"UnconstrainedLeastSquaresSchur",
"<",
"DMatrixRMaj",
">",
"levenbergMarquardtSchur",
"(",
"boolean",
"robust",
",",
"@",
"Nullable",
"ConfigLevenbergMarquardt",
"config",
")",
"{",
"if",
"(",
"config",
"==",
"null",
")",
"config",
"=",
"new",
... | LM with Schur Complement
@param robust If true then a slow by robust solver is used. true = use SVD
@param config configuration for LM
@return the solver | [
"LM",
"with",
"Schur",
"Complement"
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/FactoryOptimization.java#L194-L216 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java | PactDslJsonArray.minArrayLike | public PactDslJsonArray minArrayLike(Integer size, PactDslJsonRootValue value) {
"""
Array of values with a minimum size that are not objects where each item must match the provided example
@param size minimum size of the array
@param value Value to use to match each item
"""
return minArrayLike(size, va... | java | public PactDslJsonArray minArrayLike(Integer size, PactDslJsonRootValue value) {
return minArrayLike(size, value, size);
} | [
"public",
"PactDslJsonArray",
"minArrayLike",
"(",
"Integer",
"size",
",",
"PactDslJsonRootValue",
"value",
")",
"{",
"return",
"minArrayLike",
"(",
"size",
",",
"value",
",",
"size",
")",
";",
"}"
] | Array of values with a minimum size that are not objects where each item must match the provided example
@param size minimum size of the array
@param value Value to use to match each item | [
"Array",
"of",
"values",
"with",
"a",
"minimum",
"size",
"that",
"are",
"not",
"objects",
"where",
"each",
"item",
"must",
"match",
"the",
"provided",
"example"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java#L1052-L1054 |
osglworks/java-tool | src/main/java/org/osgl/util/FastStr.java | FastStr.of | public static FastStr of(StringBuilder sb) {
"""
Construct a FastStr from a StringBuilder
@param sb the string builder
@return a FastStr
"""
int sz = sb.length();
if (0 == sz) return EMPTY_STR;
char[] buf = new char[sz];
for (int i = 0; i < sz; ++i) {
buf[i] = sb.c... | java | public static FastStr of(StringBuilder sb) {
int sz = sb.length();
if (0 == sz) return EMPTY_STR;
char[] buf = new char[sz];
for (int i = 0; i < sz; ++i) {
buf[i] = sb.charAt(i);
}
return new FastStr(buf, 0, sz);
} | [
"public",
"static",
"FastStr",
"of",
"(",
"StringBuilder",
"sb",
")",
"{",
"int",
"sz",
"=",
"sb",
".",
"length",
"(",
")",
";",
"if",
"(",
"0",
"==",
"sz",
")",
"return",
"EMPTY_STR",
";",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"[",
"sz",
... | Construct a FastStr from a StringBuilder
@param sb the string builder
@return a FastStr | [
"Construct",
"a",
"FastStr",
"from",
"a",
"StringBuilder"
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/FastStr.java#L1578-L1586 |
liyiorg/weixin-popular | src/main/java/weixin/popular/client/LocalHttpClient.java | LocalHttpClient.executeJsonResult | public static <T> T executeJsonResult(HttpUriRequest request,Class<T> clazz) {
"""
数据返回自动JSON对象解析
@param request request
@param clazz clazz
@param <T> T
@return result
"""
return execute(request,JsonResponseHandler.createResponseHandler(clazz));
} | java | public static <T> T executeJsonResult(HttpUriRequest request,Class<T> clazz){
return execute(request,JsonResponseHandler.createResponseHandler(clazz));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"executeJsonResult",
"(",
"HttpUriRequest",
"request",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"execute",
"(",
"request",
",",
"JsonResponseHandler",
".",
"createResponseHandler",
"(",
"clazz",
")",
"... | 数据返回自动JSON对象解析
@param request request
@param clazz clazz
@param <T> T
@return result | [
"数据返回自动JSON对象解析"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/client/LocalHttpClient.java#L155-L157 |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/CachedPasswordUserInfoService.java | CachedPasswordUserInfoService.isPasswordRequested | public boolean isPasswordRequested(PortletRequest request, PortletWindow plutoPortletWindow)
throws PortletContainerException {
"""
Determine whether the portlet has expects a password as one of the user attributes.
@param request portlet request
@param plutoPortletWindow portlet window
@return <c... | java | public boolean isPasswordRequested(PortletRequest request, PortletWindow plutoPortletWindow)
throws PortletContainerException {
// get the list of requested user attributes
final HttpServletRequest httpServletRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
... | [
"public",
"boolean",
"isPasswordRequested",
"(",
"PortletRequest",
"request",
",",
"PortletWindow",
"plutoPortletWindow",
")",
"throws",
"PortletContainerException",
"{",
"// get the list of requested user attributes",
"final",
"HttpServletRequest",
"httpServletRequest",
"=",
"th... | Determine whether the portlet has expects a password as one of the user attributes.
@param request portlet request
@param plutoPortletWindow portlet window
@return <code>true</code> if a password is expected, <code>false</code> otherwise
@throws PortletContainerException if expeced attributes cannot be determined | [
"Determine",
"whether",
"the",
"portlet",
"has",
"expects",
"a",
"password",
"as",
"one",
"of",
"the",
"user",
"attributes",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/services/CachedPasswordUserInfoService.java#L185-L210 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3f.java | AlignedBox3f.setZ | @Override
public void setZ(double min, double max) {
"""
Set the z bounds of the box.
@param min the min value for the z axis.
@param max the max value for the z axis.
"""
if (min <= max) {
this.minz = min;
this.maxz = max;
} else {
this.minz = max;
this.maxz = min;
}
} | java | @Override
public void setZ(double min, double max) {
if (min <= max) {
this.minz = min;
this.maxz = max;
} else {
this.minz = max;
this.maxz = min;
}
} | [
"@",
"Override",
"public",
"void",
"setZ",
"(",
"double",
"min",
",",
"double",
"max",
")",
"{",
"if",
"(",
"min",
"<=",
"max",
")",
"{",
"this",
".",
"minz",
"=",
"min",
";",
"this",
".",
"maxz",
"=",
"max",
";",
"}",
"else",
"{",
"this",
".",... | Set the z bounds of the box.
@param min the min value for the z axis.
@param max the max value for the z axis. | [
"Set",
"the",
"z",
"bounds",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3f.java#L637-L646 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeatureLaplacePyramid.java | FeatureLaplacePyramid.checkMax | private boolean checkMax(T image, double adj, double bestScore, int c_x, int c_y) {
"""
See if the best score is better than the local adjusted scores at this scale
"""
sparseLaplace.setImage(image);
boolean isMax = true;
beginLoop:
for (int i = c_y - 1; i <= c_y + 1; i++) {
for (int j = c_x - 1; j ... | java | private boolean checkMax(T image, double adj, double bestScore, int c_x, int c_y) {
sparseLaplace.setImage(image);
boolean isMax = true;
beginLoop:
for (int i = c_y - 1; i <= c_y + 1; i++) {
for (int j = c_x - 1; j <= c_x + 1; j++) {
double value = adj*sparseLaplace.compute(j, i);
if (value >= bestSc... | [
"private",
"boolean",
"checkMax",
"(",
"T",
"image",
",",
"double",
"adj",
",",
"double",
"bestScore",
",",
"int",
"c_x",
",",
"int",
"c_y",
")",
"{",
"sparseLaplace",
".",
"setImage",
"(",
"image",
")",
";",
"boolean",
"isMax",
"=",
"true",
";",
"begi... | See if the best score is better than the local adjusted scores at this scale | [
"See",
"if",
"the",
"best",
"score",
"is",
"better",
"than",
"the",
"local",
"adjusted",
"scores",
"at",
"this",
"scale"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/FeatureLaplacePyramid.java#L244-L258 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PDatabase.java | PDatabase.init | public void init(PhysicalDatabaseParent pDatabaseOwner, String strDbName, char charPDatabaseType) {
"""
Constructor.
@param pDatabaseOwner The raw data database owner (optional).
@param strDBName The database name (The key for lookup).
@param charPDatabaseType The database type.
"""
m_htTableList = ... | java | public void init(PhysicalDatabaseParent pDatabaseOwner, String strDbName, char charPDatabaseType)
{
m_htTableList = new Hashtable<Object,PTable>();
m_strDBName = strDbName;
m_charPDatabaseType = charPDatabaseType;
this.setPDatabaseParent(pDatabaseOwner);
} | [
"public",
"void",
"init",
"(",
"PhysicalDatabaseParent",
"pDatabaseOwner",
",",
"String",
"strDbName",
",",
"char",
"charPDatabaseType",
")",
"{",
"m_htTableList",
"=",
"new",
"Hashtable",
"<",
"Object",
",",
"PTable",
">",
"(",
")",
";",
"m_strDBName",
"=",
"... | Constructor.
@param pDatabaseOwner The raw data database owner (optional).
@param strDBName The database name (The key for lookup).
@param charPDatabaseType The database type. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PDatabase.java#L97-L103 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/distort/DistortImageOps.java | DistortImageOps.boundBox_F32 | public static RectangleLength2D_F32 boundBox_F32( int srcWidth , int srcHeight ,
PixelTransform<Point2D_F32> transform ,
Point2D_F32 transformed ) {
"""
Finds an axis-aligned bounding box which would contain a image after it has been transformed.
The returned bounding box can be larg... | java | public static RectangleLength2D_F32 boundBox_F32( int srcWidth , int srcHeight ,
PixelTransform<Point2D_F32> transform ,
Point2D_F32 transformed )
{
ImageRectangle_F32 r=new ImageRectangle_F32();
r.x0=r.y0=Float.MAX_VALUE;
r.x1=r.y1=-Float.MAX_VALUE;
for( int y = 0; y < srcHeigh... | [
"public",
"static",
"RectangleLength2D_F32",
"boundBox_F32",
"(",
"int",
"srcWidth",
",",
"int",
"srcHeight",
",",
"PixelTransform",
"<",
"Point2D_F32",
">",
"transform",
",",
"Point2D_F32",
"transformed",
")",
"{",
"ImageRectangle_F32",
"r",
"=",
"new",
"ImageRecta... | Finds an axis-aligned bounding box which would contain a image after it has been transformed.
The returned bounding box can be larger then the original image.
@param srcWidth Width of the source image
@param srcHeight Height of the source image
@param transform Transform being applied to the image
@return Bounding box | [
"Finds",
"an",
"axis",
"-",
"aligned",
"bounding",
"box",
"which",
"would",
"contain",
"a",
"image",
"after",
"it",
"has",
"been",
"transformed",
".",
"The",
"returned",
"bounding",
"box",
"can",
"be",
"larger",
"then",
"the",
"original",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/DistortImageOps.java#L358-L382 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/table/Rows.java | Rows.copyRowsToTable | @SuppressWarnings( {
"""
Copies the rows indicated by the row index values in the given selection from oldTable to newTable
""""rawtypes","unchecked"})
public static void copyRowsToTable(Selection rows, Table oldTable, Table newTable) {
for (int columnIndex = 0; columnIndex < oldTable.columnCount()... | java | @SuppressWarnings({"rawtypes","unchecked"})
public static void copyRowsToTable(Selection rows, Table oldTable, Table newTable) {
for (int columnIndex = 0; columnIndex < oldTable.columnCount(); columnIndex++) {
Column oldColumn = oldTable.column(columnIndex);
int r = 0;
fo... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"void",
"copyRowsToTable",
"(",
"Selection",
"rows",
",",
"Table",
"oldTable",
",",
"Table",
"newTable",
")",
"{",
"for",
"(",
"int",
"columnIndex",
"=",
"... | Copies the rows indicated by the row index values in the given selection from oldTable to newTable | [
"Copies",
"the",
"rows",
"indicated",
"by",
"the",
"row",
"index",
"values",
"in",
"the",
"given",
"selection",
"from",
"oldTable",
"to",
"newTable"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/table/Rows.java#L37-L48 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java | RecommendationsInner.getRuleDetailsByWebApp | public RecommendationRuleInner getRuleDetailsByWebApp(String resourceGroupName, String siteName, String name) {
"""
Get a recommendation rule for an app.
Get a recommendation rule for an app.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Name of the app.
@... | java | public RecommendationRuleInner getRuleDetailsByWebApp(String resourceGroupName, String siteName, String name) {
return getRuleDetailsByWebAppWithServiceResponseAsync(resourceGroupName, siteName, name).toBlocking().single().body();
} | [
"public",
"RecommendationRuleInner",
"getRuleDetailsByWebApp",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"name",
")",
"{",
"return",
"getRuleDetailsByWebAppWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"siteName",
",",
"name",... | Get a recommendation rule for an app.
Get a recommendation rule for an app.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Name of the app.
@param name Name of the recommendation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Defau... | [
"Get",
"a",
"recommendation",
"rule",
"for",
"an",
"app",
".",
"Get",
"a",
"recommendation",
"rule",
"for",
"an",
"app",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java#L1210-L1212 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/TileSystem.java | TileSystem.getY01FromLatitude | public double getY01FromLatitude(double latitude, boolean wrapEnabled) {
"""
Converts a latitude to its "Y01" value,
id est a double between 0 and 1 for the whole latitude range
@since 6.0.0
"""
latitude = wrapEnabled ? Clip(latitude, getMinLatitude(), getMaxLatitude()) : latitude;
final double result = ... | java | public double getY01FromLatitude(double latitude, boolean wrapEnabled) {
latitude = wrapEnabled ? Clip(latitude, getMinLatitude(), getMaxLatitude()) : latitude;
final double result = getY01FromLatitude(latitude);
return wrapEnabled ? Clip(result, 0, 1) : result;
} | [
"public",
"double",
"getY01FromLatitude",
"(",
"double",
"latitude",
",",
"boolean",
"wrapEnabled",
")",
"{",
"latitude",
"=",
"wrapEnabled",
"?",
"Clip",
"(",
"latitude",
",",
"getMinLatitude",
"(",
")",
",",
"getMaxLatitude",
"(",
")",
")",
":",
"latitude",
... | Converts a latitude to its "Y01" value,
id est a double between 0 and 1 for the whole latitude range
@since 6.0.0 | [
"Converts",
"a",
"latitude",
"to",
"its",
"Y01",
"value",
"id",
"est",
"a",
"double",
"between",
"0",
"and",
"1",
"for",
"the",
"whole",
"latitude",
"range"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/TileSystem.java#L230-L234 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.fat.common/src/com/ibm/ws/security/fat/common/servers/ServerBootstrapUtils.java | ServerBootstrapUtils.writeBootstrapProperty | public void writeBootstrapProperty(LibertyServer server, String propKey, String propValue) throws Exception {
"""
Writes the specified bootstrap property and value to the provided server's bootstrap.properties file.
"""
String bootProps = getBootstrapPropertiesFilePath(server);
appendBootstrapP... | java | public void writeBootstrapProperty(LibertyServer server, String propKey, String propValue) throws Exception {
String bootProps = getBootstrapPropertiesFilePath(server);
appendBootstrapPropertyToFile(bootProps, propKey, propValue);
} | [
"public",
"void",
"writeBootstrapProperty",
"(",
"LibertyServer",
"server",
",",
"String",
"propKey",
",",
"String",
"propValue",
")",
"throws",
"Exception",
"{",
"String",
"bootProps",
"=",
"getBootstrapPropertiesFilePath",
"(",
"server",
")",
";",
"appendBootstrapPr... | Writes the specified bootstrap property and value to the provided server's bootstrap.properties file. | [
"Writes",
"the",
"specified",
"bootstrap",
"property",
"and",
"value",
"to",
"the",
"provided",
"server",
"s",
"bootstrap",
".",
"properties",
"file",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.fat.common/src/com/ibm/ws/security/fat/common/servers/ServerBootstrapUtils.java#L21-L24 |
jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/EqualsVerifierApi.java | EqualsVerifierApi.withIgnoredFields | public EqualsVerifierApi<T> withIgnoredFields(String... fields) {
"""
Signals that all given fields are not relevant for the {@code equals}
contract. {@code EqualsVerifier} will not fail if one of these fields
does not affect the outcome of {@code equals}, but it will fail if one
of these fields does affect the... | java | public EqualsVerifierApi<T> withIgnoredFields(String... fields) {
return withFieldsAddedAndValidated(allExcludedFields, Arrays.asList(fields));
} | [
"public",
"EqualsVerifierApi",
"<",
"T",
">",
"withIgnoredFields",
"(",
"String",
"...",
"fields",
")",
"{",
"return",
"withFieldsAddedAndValidated",
"(",
"allExcludedFields",
",",
"Arrays",
".",
"asList",
"(",
"fields",
")",
")",
";",
"}"
] | Signals that all given fields are not relevant for the {@code equals}
contract. {@code EqualsVerifier} will not fail if one of these fields
does not affect the outcome of {@code equals}, but it will fail if one
of these fields does affect the outcome of {@code equals}.
Note that these fields will still be used to test... | [
"Signals",
"that",
"all",
"given",
"fields",
"are",
"not",
"relevant",
"for",
"the",
"{",
"@code",
"equals",
"}",
"contract",
".",
"{",
"@code",
"EqualsVerifier",
"}",
"will",
"not",
"fail",
"if",
"one",
"of",
"these",
"fields",
"does",
"not",
"affect",
... | train | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/EqualsVerifierApi.java#L155-L157 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/metastore/rocks/RocksStore.java | RocksStore.writeToCheckpoint | public synchronized void writeToCheckpoint(OutputStream output)
throws IOException, InterruptedException {
"""
Writes a checkpoint of the database's content to the given output stream.
@param output the stream to write to
"""
LOG.info("Creating rocksdb checkpoint at {}", mDbCheckpointPath);
lo... | java | public synchronized void writeToCheckpoint(OutputStream output)
throws IOException, InterruptedException {
LOG.info("Creating rocksdb checkpoint at {}", mDbCheckpointPath);
long startNano = System.nanoTime();
CheckpointOutputStream out = new CheckpointOutputStream(output, CheckpointType.ROCKS);
t... | [
"public",
"synchronized",
"void",
"writeToCheckpoint",
"(",
"OutputStream",
"output",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"LOG",
".",
"info",
"(",
"\"Creating rocksdb checkpoint at {}\"",
",",
"mDbCheckpointPath",
")",
";",
"long",
"startNano... | Writes a checkpoint of the database's content to the given output stream.
@param output the stream to write to | [
"Writes",
"a",
"checkpoint",
"of",
"the",
"database",
"s",
"content",
"to",
"the",
"given",
"output",
"stream",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metastore/rocks/RocksStore.java#L159-L177 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java | BigDecimalMath.toBigDecimal | public static BigDecimal toBigDecimal(String string, MathContext mathContext) {
"""
Creates a {@link BigDecimal} from the specified <code>String</code> representation.
<p>This method is equivalent to the String constructor {@link BigDecimal#BigDecimal(String, MathContext)}
but has been optimized for large stri... | java | public static BigDecimal toBigDecimal(String string, MathContext mathContext) {
int len = string.length();
if (len < 600) {
return new BigDecimal(string, mathContext);
}
int splitLength = len / (len >= 10000 ? 8 : 5);
return toBigDecimal(string, mathContext, splitLength);
} | [
"public",
"static",
"BigDecimal",
"toBigDecimal",
"(",
"String",
"string",
",",
"MathContext",
"mathContext",
")",
"{",
"int",
"len",
"=",
"string",
".",
"length",
"(",
")",
";",
"if",
"(",
"len",
"<",
"600",
")",
"{",
"return",
"new",
"BigDecimal",
"(",... | Creates a {@link BigDecimal} from the specified <code>String</code> representation.
<p>This method is equivalent to the String constructor {@link BigDecimal#BigDecimal(String, MathContext)}
but has been optimized for large strings (several thousand digits).</p>
@param string the string representation
@param mathConte... | [
"Creates",
"a",
"{",
"@link",
"BigDecimal",
"}",
"from",
"the",
"specified",
"<code",
">",
"String<",
"/",
"code",
">",
"representation",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigDecimalMath.java#L98-L106 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/objects/Message.java | Message.createBinarySMS | static public Message createBinarySMS(String originator, String header, String body, String recipients) {
"""
Factory to create Binary SMS message
@param originator
@param header
@param body
@param recipients
@return
"""
Message msg = new Message(originator, body, recipients);
final Map<... | java | static public Message createBinarySMS(String originator, String header, String body, String recipients) {
Message msg = new Message(originator, body, recipients);
final Map<String, Object> binarySMS = new LinkedHashMap<String, Object>(4);
binarySMS.put("udh", header);
msg.setTypeDetails(... | [
"static",
"public",
"Message",
"createBinarySMS",
"(",
"String",
"originator",
",",
"String",
"header",
",",
"String",
"body",
",",
"String",
"recipients",
")",
"{",
"Message",
"msg",
"=",
"new",
"Message",
"(",
"originator",
",",
"body",
",",
"recipients",
... | Factory to create Binary SMS message
@param originator
@param header
@param body
@param recipients
@return | [
"Factory",
"to",
"create",
"Binary",
"SMS",
"message"
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/objects/Message.java#L70-L77 |
google/closure-templates | java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java | TranslateToPyExprVisitor.visitFunctionNode | @Override
protected PyExpr visitFunctionNode(FunctionNode node) {
"""
{@inheritDoc}
<p>The source of available functions is a look-up map provided by Guice in {@link
SharedModule#provideSoyFunctionsMap}.
@see BuiltinFunction
@see SoyPySrcFunction
"""
Object soyFunction = node.getSoyFunction();
... | java | @Override
protected PyExpr visitFunctionNode(FunctionNode node) {
Object soyFunction = node.getSoyFunction();
if (soyFunction instanceof BuiltinFunction) {
return visitNonPluginFunction(node, (BuiltinFunction) soyFunction);
} else if (soyFunction instanceof SoyPythonSourceFunction) {
return pl... | [
"@",
"Override",
"protected",
"PyExpr",
"visitFunctionNode",
"(",
"FunctionNode",
"node",
")",
"{",
"Object",
"soyFunction",
"=",
"node",
".",
"getSoyFunction",
"(",
")",
";",
"if",
"(",
"soyFunction",
"instanceof",
"BuiltinFunction",
")",
"{",
"return",
"visitN... | {@inheritDoc}
<p>The source of available functions is a look-up map provided by Guice in {@link
SharedModule#provideSoyFunctionsMap}.
@see BuiltinFunction
@see SoyPySrcFunction | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/TranslateToPyExprVisitor.java#L471-L493 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_configurations_obfuscatedEmails_refresh_POST | public void serviceName_configurations_obfuscatedEmails_refresh_POST(String serviceName, OvhContactAllTypesEnum[] contacts) throws IOException {
"""
Refresh an obfuscated emails configuration
REST: POST /domain/{serviceName}/configurations/obfuscatedEmails/refresh
@param contacts [required] Contact types where... | java | public void serviceName_configurations_obfuscatedEmails_refresh_POST(String serviceName, OvhContactAllTypesEnum[] contacts) throws IOException {
String qPath = "/domain/{serviceName}/configurations/obfuscatedEmails/refresh";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<Strin... | [
"public",
"void",
"serviceName_configurations_obfuscatedEmails_refresh_POST",
"(",
"String",
"serviceName",
",",
"OvhContactAllTypesEnum",
"[",
"]",
"contacts",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/configurations/obfuscatedEmails/ref... | Refresh an obfuscated emails configuration
REST: POST /domain/{serviceName}/configurations/obfuscatedEmails/refresh
@param contacts [required] Contact types where obfuscated emails will be refreshed
@param serviceName [required] The internal name of your domain | [
"Refresh",
"an",
"obfuscated",
"emails",
"configuration"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1607-L1613 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java | BoxApiFolder.getRenameRequest | public BoxRequestsFolder.UpdateFolder getRenameRequest(String id, String newName) {
"""
Gets a request that renames a folder
@param id id of folder to rename
@param newName id of folder to retrieve info on
@return request to rename a folder
"""
BoxRequestsFolder.UpdateFolder request ... | java | public BoxRequestsFolder.UpdateFolder getRenameRequest(String id, String newName) {
BoxRequestsFolder.UpdateFolder request = new BoxRequestsFolder.UpdateFolder(id, getFolderInfoUrl(id), mSession)
.setName(newName);
return request;
} | [
"public",
"BoxRequestsFolder",
".",
"UpdateFolder",
"getRenameRequest",
"(",
"String",
"id",
",",
"String",
"newName",
")",
"{",
"BoxRequestsFolder",
".",
"UpdateFolder",
"request",
"=",
"new",
"BoxRequestsFolder",
".",
"UpdateFolder",
"(",
"id",
",",
"getFolderInfo... | Gets a request that renames a folder
@param id id of folder to rename
@param newName id of folder to retrieve info on
@return request to rename a folder | [
"Gets",
"a",
"request",
"that",
"renames",
"a",
"folder"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiFolder.java#L144-L148 |
prestodb/presto | presto-rcfile/src/main/java/com/facebook/presto/rcfile/RcFileDecoderUtils.java | RcFileDecoderUtils.findFirstSyncPosition | public static long findFirstSyncPosition(RcFileDataSource dataSource, long offset, long length, long syncFirst, long syncSecond)
throws IOException {
"""
Find the beginning of the first full sync sequence that starts within the specified range.
"""
requireNonNull(dataSource, "dataSource is ... | java | public static long findFirstSyncPosition(RcFileDataSource dataSource, long offset, long length, long syncFirst, long syncSecond)
throws IOException
{
requireNonNull(dataSource, "dataSource is null");
checkArgument(offset >= 0, "offset is negative");
checkArgument(length >= 1, "le... | [
"public",
"static",
"long",
"findFirstSyncPosition",
"(",
"RcFileDataSource",
"dataSource",
",",
"long",
"offset",
",",
"long",
"length",
",",
"long",
"syncFirst",
",",
"long",
"syncSecond",
")",
"throws",
"IOException",
"{",
"requireNonNull",
"(",
"dataSource",
"... | Find the beginning of the first full sync sequence that starts within the specified range. | [
"Find",
"the",
"beginning",
"of",
"the",
"first",
"full",
"sync",
"sequence",
"that",
"starts",
"within",
"the",
"specified",
"range",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-rcfile/src/main/java/com/facebook/presto/rcfile/RcFileDecoderUtils.java#L119-L167 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.readExcel2Objects | public <T> List<T> readExcel2Objects(InputStream is, Class<T> clazz)
throws Excel4JException, IOException, InvalidFormatException {
"""
读取Excel操作基于注解映射成绑定的java对象
@param is 待导出Excel的数据流
@param clazz 待绑定的类(绑定属性注解{@link com.github.crab2died.annotation.ExcelField})
@param <T> 绑定的数据类
@return 返回转换... | java | public <T> List<T> readExcel2Objects(InputStream is, Class<T> clazz)
throws Excel4JException, IOException, InvalidFormatException {
return readExcel2Objects(is, clazz, 0, Integer.MAX_VALUE, 0);
} | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"readExcel2Objects",
"(",
"InputStream",
"is",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"Excel4JException",
",",
"IOException",
",",
"InvalidFormatException",
"{",
"return",
"readExcel2Objects",
"(",
... | 读取Excel操作基于注解映射成绑定的java对象
@param is 待导出Excel的数据流
@param clazz 待绑定的类(绑定属性注解{@link com.github.crab2died.annotation.ExcelField})
@param <T> 绑定的数据类
@return 返回转换为设置绑定的java对象集合
@throws Excel4JException 异常
@throws IOException 异常
@throws InvalidFormatException 异常
@author Crab2Died | [
"读取Excel操作基于注解映射成绑定的java对象"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L243-L246 |
janvanbesien/java-ipv6 | src/main/java/com/googlecode/ipv6/IPv6Address.java | IPv6Address.fromBigInteger | public static IPv6Address fromBigInteger(final BigInteger bigInteger) {
"""
Create an IPv6 address from a (positive) {@link java.math.BigInteger}. The magnitude of the {@link java.math.BigInteger} represents
the IPv6 address value. Or in other words, the {@link java.math.BigInteger} with value N defines the Nth p... | java | public static IPv6Address fromBigInteger(final BigInteger bigInteger)
{
if (bigInteger == null)
throw new IllegalArgumentException("can not construct from [null]");
if (bigInteger.compareTo(BigInteger.ZERO) < 0)
throw new IllegalArgumentException("can not construct from negat... | [
"public",
"static",
"IPv6Address",
"fromBigInteger",
"(",
"final",
"BigInteger",
"bigInteger",
")",
"{",
"if",
"(",
"bigInteger",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"can not construct from [null]\"",
")",
";",
"if",
"(",
"bigIntege... | Create an IPv6 address from a (positive) {@link java.math.BigInteger}. The magnitude of the {@link java.math.BigInteger} represents
the IPv6 address value. Or in other words, the {@link java.math.BigInteger} with value N defines the Nth possible IPv6 address.
@param bigInteger {@link java.math.BigInteger} value
@retur... | [
"Create",
"an",
"IPv6",
"address",
"from",
"a",
"(",
"positive",
")",
"{",
"@link",
"java",
".",
"math",
".",
"BigInteger",
"}",
".",
"The",
"magnitude",
"of",
"the",
"{",
"@link",
"java",
".",
"math",
".",
"BigInteger",
"}",
"represents",
"the",
"IPv6... | train | https://github.com/janvanbesien/java-ipv6/blob/9af15b4a6c0074f9fa23dfa030027c631b9c2f78/src/main/java/com/googlecode/ipv6/IPv6Address.java#L159-L179 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/SpinedBuffer.java | SpinedBuffer.copyInto | public void copyInto(E[] array, int offset) {
"""
Copy the elements, starting at the specified offset, into the specified
array.
"""
long finalOffset = offset + count();
if (finalOffset > array.length || finalOffset < offset) {
throw new IndexOutOfBoundsException("does not fit");
... | java | public void copyInto(E[] array, int offset) {
long finalOffset = offset + count();
if (finalOffset > array.length || finalOffset < offset) {
throw new IndexOutOfBoundsException("does not fit");
}
if (spineIndex == 0)
System.arraycopy(curChunk, 0, array, offset, e... | [
"public",
"void",
"copyInto",
"(",
"E",
"[",
"]",
"array",
",",
"int",
"offset",
")",
"{",
"long",
"finalOffset",
"=",
"offset",
"+",
"count",
"(",
")",
";",
"if",
"(",
"finalOffset",
">",
"array",
".",
"length",
"||",
"finalOffset",
"<",
"offset",
"... | Copy the elements, starting at the specified offset, into the specified
array. | [
"Copy",
"the",
"elements",
"starting",
"at",
"the",
"specified",
"offset",
"into",
"the",
"specified",
"array",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/SpinedBuffer.java#L188-L205 |
samskivert/samskivert | src/main/java/com/samskivert/servlet/util/ParameterUtil.java | ParameterUtil.getParameter | public static String getParameter (HttpServletRequest req, String name, boolean returnNull) {
"""
Fetches the supplied parameter from the request. If the parameter does not exist, either
null or the empty string will be returned depending on the value of the
<code>returnNull</code> parameter.
"""
Str... | java | public static String getParameter (HttpServletRequest req, String name, boolean returnNull)
{
String value = req.getParameter(name);
if (value == null) {
return returnNull ? null : "";
} else {
return value.trim();
}
} | [
"public",
"static",
"String",
"getParameter",
"(",
"HttpServletRequest",
"req",
",",
"String",
"name",
",",
"boolean",
"returnNull",
")",
"{",
"String",
"value",
"=",
"req",
".",
"getParameter",
"(",
"name",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",... | Fetches the supplied parameter from the request. If the parameter does not exist, either
null or the empty string will be returned depending on the value of the
<code>returnNull</code> parameter. | [
"Fetches",
"the",
"supplied",
"parameter",
"from",
"the",
"request",
".",
"If",
"the",
"parameter",
"does",
"not",
"exist",
"either",
"null",
"or",
"the",
"empty",
"string",
"will",
"be",
"returned",
"depending",
"on",
"the",
"value",
"of",
"the",
"<code",
... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/ParameterUtil.java#L59-L67 |
jayantk/jklol | src/com/jayantkrish/jklol/models/AbstractFactorGraphBuilder.java | AbstractFactorGraphBuilder.addUnreplicatedFactor | public void addUnreplicatedFactor(String factorName, T factor, VariableNumMap vars) {
"""
Adds a parameterized, unreplicated factor to the model being
constructed. The factor will match only the variables which it is
defined over.
@param factor
"""
parametricFactors.add(factor);
factorPatterns.add... | java | public void addUnreplicatedFactor(String factorName, T factor, VariableNumMap vars) {
parametricFactors.add(factor);
factorPatterns.add(new WrapperVariablePattern(vars));
parametricFactorNames.add(factorName);
} | [
"public",
"void",
"addUnreplicatedFactor",
"(",
"String",
"factorName",
",",
"T",
"factor",
",",
"VariableNumMap",
"vars",
")",
"{",
"parametricFactors",
".",
"add",
"(",
"factor",
")",
";",
"factorPatterns",
".",
"add",
"(",
"new",
"WrapperVariablePattern",
"("... | Adds a parameterized, unreplicated factor to the model being
constructed. The factor will match only the variables which it is
defined over.
@param factor | [
"Adds",
"a",
"parameterized",
"unreplicated",
"factor",
"to",
"the",
"model",
"being",
"constructed",
".",
"The",
"factor",
"will",
"match",
"only",
"the",
"variables",
"which",
"it",
"is",
"defined",
"over",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/AbstractFactorGraphBuilder.java#L119-L123 |
ysc/word | src/main/java/org/apdplat/word/util/AutoDetector.java | AutoDetector.loadAndWatchDir | private static List<String> loadAndWatchDir(Path path, ResourceLoader resourceLoader, String resourcePaths) {
"""
递归加载目录下面的所有资源
并监控目录变化
@param path 目录路径
@param resourceLoader 资源自定义加载逻辑
@param resourcePaths 资源的所有路径,用于资源监控
@return 目录所有资源内容
"""
final List<String> result = new ArrayList<>();
t... | java | private static List<String> loadAndWatchDir(Path path, ResourceLoader resourceLoader, String resourcePaths) {
final List<String> result = new ArrayList<>();
try {
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFi... | [
"private",
"static",
"List",
"<",
"String",
">",
"loadAndWatchDir",
"(",
"Path",
"path",
",",
"ResourceLoader",
"resourceLoader",
",",
"String",
"resourcePaths",
")",
"{",
"final",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")"... | 递归加载目录下面的所有资源
并监控目录变化
@param path 目录路径
@param resourceLoader 资源自定义加载逻辑
@param resourcePaths 资源的所有路径,用于资源监控
@return 目录所有资源内容 | [
"递归加载目录下面的所有资源",
"并监控目录变化"
] | train | https://github.com/ysc/word/blob/5e45607f4e97207f55d1e3bc561abda6b34f7c54/src/main/java/org/apdplat/word/util/AutoDetector.java#L286-L331 |
ManfredTremmel/gwt-bean-validators | gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/resourceloader/JsResources.java | JsResources.whenReady | public static void whenReady(final String scriptname, final EventListener function) {
"""
async load of resources.
@param function function to call on load
"""
List<EventListener> eventList = JsResources.eventLisenerQueue.get(scriptname);
if (eventList == null) {
eventList = new ArrayList<>();... | java | public static void whenReady(final String scriptname, final EventListener function) {
List<EventListener> eventList = JsResources.eventLisenerQueue.get(scriptname);
if (eventList == null) {
eventList = new ArrayList<>();
JsResources.eventLisenerQueue.put(scriptname, eventList);
}
eventList.a... | [
"public",
"static",
"void",
"whenReady",
"(",
"final",
"String",
"scriptname",
",",
"final",
"EventListener",
"function",
")",
"{",
"List",
"<",
"EventListener",
">",
"eventList",
"=",
"JsResources",
".",
"eventLisenerQueue",
".",
"get",
"(",
"scriptname",
")",
... | async load of resources.
@param function function to call on load | [
"async",
"load",
"of",
"resources",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-mt-widgets/src/main/java/de/knightsoftnet/mtwidgets/client/ui/widget/resourceloader/JsResources.java#L32-L65 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_lusol.java | Dcs_lusol.cs_lusol | public static boolean cs_lusol(int order, Dcs A, double[] b, double tol) {
"""
Solves Ax=b, where A is square and nonsingular. b overwritten with
solution. Partial pivoting if tol = 1.
@param order
ordering method to use (0 to 3)
@param A
column-compressed matrix
@param b
size n, b on input, x on output
... | java | public static boolean cs_lusol(int order, Dcs A, double[] b, double tol) {
double[] x;
Dcss S;
Dcsn N;
int n;
boolean ok;
if (!Dcs_util.CS_CSC(A) || b == null)
return (false); /* check inputs */
n = A.n;
S = Dcs_sqr.cs_sqr(order, A, fa... | [
"public",
"static",
"boolean",
"cs_lusol",
"(",
"int",
"order",
",",
"Dcs",
"A",
",",
"double",
"[",
"]",
"b",
",",
"double",
"tol",
")",
"{",
"double",
"[",
"]",
"x",
";",
"Dcss",
"S",
";",
"Dcsn",
"N",
";",
"int",
"n",
";",
"boolean",
"ok",
"... | Solves Ax=b, where A is square and nonsingular. b overwritten with
solution. Partial pivoting if tol = 1.
@param order
ordering method to use (0 to 3)
@param A
column-compressed matrix
@param b
size n, b on input, x on output
@param tol
partial pivoting tolerance
@return true if successful, false on error | [
"Solves",
"Ax",
"=",
"b",
"where",
"A",
"is",
"square",
"and",
"nonsingular",
".",
"b",
"overwritten",
"with",
"solution",
".",
"Partial",
"pivoting",
"if",
"tol",
"=",
"1",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_lusol.java#L53-L73 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java | FacesImpl.findSimilar | public List<SimilarFace> findSimilar(UUID faceId, FindSimilarOptionalParameter findSimilarOptionalParameter) {
"""
Given query face's faceId, find the similar-looking faces from a faceId array or a faceListId.
@param faceId FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. ... | java | public List<SimilarFace> findSimilar(UUID faceId, FindSimilarOptionalParameter findSimilarOptionalParameter) {
return findSimilarWithServiceResponseAsync(faceId, findSimilarOptionalParameter).toBlocking().single().body();
} | [
"public",
"List",
"<",
"SimilarFace",
">",
"findSimilar",
"(",
"UUID",
"faceId",
",",
"FindSimilarOptionalParameter",
"findSimilarOptionalParameter",
")",
"{",
"return",
"findSimilarWithServiceResponseAsync",
"(",
"faceId",
",",
"findSimilarOptionalParameter",
")",
".",
"... | Given query face's faceId, find the similar-looking faces from a faceId array or a faceListId.
@param faceId FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. Note that this faceId is not persisted and will expire 24 hours after the detection call
@param findSimilarOptionalParamet... | [
"Given",
"query",
"face",
"s",
"faceId",
"find",
"the",
"similar",
"-",
"looking",
"faces",
"from",
"a",
"faceId",
"array",
"or",
"a",
"faceListId",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java#L120-L122 |
apache/flink | flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AggregateOperationFactory.java | AggregateOperationFactory.createResolvedWindow | public ResolvedGroupWindow createResolvedWindow(GroupWindow window, ExpressionResolver resolver) {
"""
Converts an API class to a resolved window for planning with expressions already resolved.
It performs following validations:
<ul>
<li>The alias is represented with an unresolved reference</li>
<li>The time a... | java | public ResolvedGroupWindow createResolvedWindow(GroupWindow window, ExpressionResolver resolver) {
Expression alias = window.getAlias();
if (!(alias instanceof UnresolvedReferenceExpression)) {
throw new ValidationException("Only unresolved reference supported for alias of a group window.");
}
final String... | [
"public",
"ResolvedGroupWindow",
"createResolvedWindow",
"(",
"GroupWindow",
"window",
",",
"ExpressionResolver",
"resolver",
")",
"{",
"Expression",
"alias",
"=",
"window",
".",
"getAlias",
"(",
")",
";",
"if",
"(",
"!",
"(",
"alias",
"instanceof",
"UnresolvedRef... | Converts an API class to a resolved window for planning with expressions already resolved.
It performs following validations:
<ul>
<li>The alias is represented with an unresolved reference</li>
<li>The time attribute is a single field reference of a {@link TimeIndicatorTypeInfo}(stream),
{@link SqlTimeTypeInfo}(batch),... | [
"Converts",
"an",
"API",
"class",
"to",
"a",
"resolved",
"window",
"for",
"planning",
"with",
"expressions",
"already",
"resolved",
".",
"It",
"performs",
"following",
"validations",
":",
"<ul",
">",
"<li",
">",
"The",
"alias",
"is",
"represented",
"with",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/operations/AggregateOperationFactory.java#L183-L211 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.retainTop | public static <E> void retainTop(Counter<E> c, int num) {
"""
Removes all entries from c except for the top <code>num</code>
"""
int numToPurge = c.size() - num;
if (numToPurge <= 0) {
return;
}
List<E> l = Counters.toSortedList(c);
Collections.reverse(l);
for (int i = 0;... | java | public static <E> void retainTop(Counter<E> c, int num) {
int numToPurge = c.size() - num;
if (numToPurge <= 0) {
return;
}
List<E> l = Counters.toSortedList(c);
Collections.reverse(l);
for (int i = 0; i < numToPurge; i++) {
c.remove(l.get(i));
}
} | [
"public",
"static",
"<",
"E",
">",
"void",
"retainTop",
"(",
"Counter",
"<",
"E",
">",
"c",
",",
"int",
"num",
")",
"{",
"int",
"numToPurge",
"=",
"c",
".",
"size",
"(",
")",
"-",
"num",
";",
"if",
"(",
"numToPurge",
"<=",
"0",
")",
"{",
"retur... | Removes all entries from c except for the top <code>num</code> | [
"Removes",
"all",
"entries",
"from",
"c",
"except",
"for",
"the",
"top",
"<code",
">",
"num<",
"/",
"code",
">"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L512-L523 |
jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/ResultAttribute.java | ResultAttribute.addTo | public void addTo(@Nonnull Map<String, String> attributeMap, @Nonnull Result result) {
"""
Calls the Getter defined by the {@link #get(Result)} on the
{@link Result} add adds the entry to the supplied {@link Map}
@param attributeMap
The map to add the {@link Result} data to
@param result
The {@link Result} ... | java | public void addTo(@Nonnull Map<String, String> attributeMap, @Nonnull Result result) {
attributeMap.put(name, get(result));
} | [
"public",
"void",
"addTo",
"(",
"@",
"Nonnull",
"Map",
"<",
"String",
",",
"String",
">",
"attributeMap",
",",
"@",
"Nonnull",
"Result",
"result",
")",
"{",
"attributeMap",
".",
"put",
"(",
"name",
",",
"get",
"(",
"result",
")",
")",
";",
"}"
] | Calls the Getter defined by the {@link #get(Result)} on the
{@link Result} add adds the entry to the supplied {@link Map}
@param attributeMap
The map to add the {@link Result} data to
@param result
The {@link Result} to get the data from | [
"Calls",
"the",
"Getter",
"defined",
"by",
"the",
"{",
"@link",
"#get",
"(",
"Result",
")",
"}",
"on",
"the",
"{",
"@link",
"Result",
"}",
"add",
"adds",
"the",
"entry",
"to",
"the",
"supplied",
"{",
"@link",
"Map",
"}"
] | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/ResultAttribute.java#L66-L68 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java | TransportNegotiator.checkRemoteCandidate | private void checkRemoteCandidate(final TransportCandidate offeredCandidate) {
"""
Check asynchronously the new transport candidate.
@param offeredCandidate a transport candidates to check
"""
offeredCandidate.addListener(new TransportResolverListener.Checker() {
@Override
pu... | java | private void checkRemoteCandidate(final TransportCandidate offeredCandidate) {
offeredCandidate.addListener(new TransportResolverListener.Checker() {
@Override
public void candidateChecked(TransportCandidate cand, final boolean validCandidate) {
if (validCandidate) {
... | [
"private",
"void",
"checkRemoteCandidate",
"(",
"final",
"TransportCandidate",
"offeredCandidate",
")",
"{",
"offeredCandidate",
".",
"addListener",
"(",
"new",
"TransportResolverListener",
".",
"Checker",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"candidateCh... | Check asynchronously the new transport candidate.
@param offeredCandidate a transport candidates to check | [
"Check",
"asynchronously",
"the",
"new",
"transport",
"candidate",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java#L250-L266 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java | CmsContainerpageHandler.createToggleEditSmallElementsMenuEntry | protected I_CmsContextMenuEntry createToggleEditSmallElementsMenuEntry() {
"""
Creates the context menu entry for enabling or disabling editing of small elements.<p>
@return the created context menu entry
"""
final CmsSmallElementsHandler smallElementsHandler = m_controller.getSmallElementsHandler(... | java | protected I_CmsContextMenuEntry createToggleEditSmallElementsMenuEntry() {
final CmsSmallElementsHandler smallElementsHandler = m_controller.getSmallElementsHandler();
final boolean isActive = smallElementsHandler.areSmallElementsEditable();
CmsContextMenuEntryBean entryBean = new CmsContextMen... | [
"protected",
"I_CmsContextMenuEntry",
"createToggleEditSmallElementsMenuEntry",
"(",
")",
"{",
"final",
"CmsSmallElementsHandler",
"smallElementsHandler",
"=",
"m_controller",
".",
"getSmallElementsHandler",
"(",
")",
";",
"final",
"boolean",
"isActive",
"=",
"smallElementsHa... | Creates the context menu entry for enabling or disabling editing of small elements.<p>
@return the created context menu entry | [
"Creates",
"the",
"context",
"menu",
"entry",
"for",
"enabling",
"or",
"disabling",
"editing",
"of",
"small",
"elements",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageHandler.java#L1407-L1444 |
eserating/siren4j | src/main/java/com/google/code/siren4j/component/builder/BaseBuilder.java | BaseBuilder.addStep | protected void addStep(String methodName, Object[] args, Class<?>[] argTypes, boolean builderMethod) {
"""
Adds a builder step for this builder, upon build these steps will be called in the same order they came in on.
@param methodName cannot be <code>null</code> or empty.
@param args may be <code>null</code> ... | java | protected void addStep(String methodName, Object[] args, Class<?>[] argTypes, boolean builderMethod) {
if(StringUtils.isBlank(methodName)) {
throw new IllegalArgumentException("methodName cannot be null or empty.");
}
steps.add(new Step(methodName, args, argTypes, builderMethod));
} | [
"protected",
"void",
"addStep",
"(",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
",",
"boolean",
"builderMethod",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"methodName",
")",
... | Adds a builder step for this builder, upon build these steps will be called in the same order they came in on.
@param methodName cannot be <code>null</code> or empty.
@param args may be <code>null</code> or empty.
@param argTypes argument class types can be specified to ensure the right class types
are used when we tr... | [
"Adds",
"a",
"builder",
"step",
"for",
"this",
"builder",
"upon",
"build",
"these",
"steps",
"will",
"be",
"called",
"in",
"the",
"same",
"order",
"they",
"came",
"in",
"on",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/component/builder/BaseBuilder.java#L126-L131 |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRImporter.java | LRImporter.getObtainJSONData | public LRResult getObtainJSONData(String requestID, Boolean byResourceID, Boolean byDocID, Boolean idsOnly) throws LRException {
"""
Get a result from an obtain request
@param requestID the "request_id" value to use for this request
@param byResourceID the "by_resource_id" value to use for this request
@param... | java | public LRResult getObtainJSONData(String requestID, Boolean byResourceID, Boolean byDocID, Boolean idsOnly) throws LRException
{
return getObtainJSONData(requestID, byResourceID, byDocID, idsOnly, null);
} | [
"public",
"LRResult",
"getObtainJSONData",
"(",
"String",
"requestID",
",",
"Boolean",
"byResourceID",
",",
"Boolean",
"byDocID",
",",
"Boolean",
"idsOnly",
")",
"throws",
"LRException",
"{",
"return",
"getObtainJSONData",
"(",
"requestID",
",",
"byResourceID",
",",... | Get a result from an obtain request
@param requestID the "request_id" value to use for this request
@param byResourceID the "by_resource_id" value to use for this request
@param byDocID the "by_doc_id" value to use for this request
@param idsOnly the "ids_only" value to use for this request
@return the result from thi... | [
"Get",
"a",
"result",
"from",
"an",
"obtain",
"request"
] | train | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRImporter.java#L231-L234 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLParser.java | AFPChainXMLParser.fromXML | public static AFPChain fromXML(String xml, String name1, String name2, Atom[] ca1, Atom[] ca2) throws IOException, StructureException {
"""
new utility method that checks that the order of the pair in the XML alignment is correct and flips the direction if needed
@param xml
@param name1
@param name1
@param c... | java | public static AFPChain fromXML(String xml, String name1, String name2, Atom[] ca1, Atom[] ca2) throws IOException, StructureException{
AFPChain[] afps = parseMultiXML( xml);
if ( afps.length > 0 ) {
AFPChain afpChain = afps[0];
String n1 = afpChain.getName1();
String n2 = afpChain.getName2();
i... | [
"public",
"static",
"AFPChain",
"fromXML",
"(",
"String",
"xml",
",",
"String",
"name1",
",",
"String",
"name2",
",",
"Atom",
"[",
"]",
"ca1",
",",
"Atom",
"[",
"]",
"ca2",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"AFPChain",
"[",
"]... | new utility method that checks that the order of the pair in the XML alignment is correct and flips the direction if needed
@param xml
@param name1
@param name1
@param ca1
@param ca2
@return | [
"new",
"utility",
"method",
"that",
"checks",
"that",
"the",
"order",
"of",
"the",
"pair",
"in",
"the",
"XML",
"alignment",
"is",
"correct",
"and",
"flips",
"the",
"direction",
"if",
"needed"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/AFPChainXMLParser.java#L64-L90 |
katharsis-project/katharsis-framework | katharsis-jpa/src/main/java/io/katharsis/jpa/internal/query/AnyUtils.java | AnyUtils.setValue | public static void setValue(MetaLookup metaLookup, AnyTypeObject dataObject, Object value) {
"""
Sets the value of the given anytype.
@param metaLookup to use to retrieve information
@param dataObject the anytype for which the value is set.
@param value the new value
"""
MetaDataObject meta = metaLookup... | java | public static void setValue(MetaLookup metaLookup, AnyTypeObject dataObject, Object value) {
MetaDataObject meta = metaLookup.getMeta(dataObject.getClass()).asDataObject();
if (value == null) {
for (MetaAttribute attr : meta.getAttributes()) {
attr.setValue(dataObject, null);
}
}
else {
boolean fou... | [
"public",
"static",
"void",
"setValue",
"(",
"MetaLookup",
"metaLookup",
",",
"AnyTypeObject",
"dataObject",
",",
"Object",
"value",
")",
"{",
"MetaDataObject",
"meta",
"=",
"metaLookup",
".",
"getMeta",
"(",
"dataObject",
".",
"getClass",
"(",
")",
")",
".",
... | Sets the value of the given anytype.
@param metaLookup to use to retrieve information
@param dataObject the anytype for which the value is set.
@param value the new value | [
"Sets",
"the",
"value",
"of",
"the",
"given",
"anytype",
"."
] | train | https://github.com/katharsis-project/katharsis-framework/blob/73d1a8763c49c5cf4643d43e2dbfedb647630c46/katharsis-jpa/src/main/java/io/katharsis/jpa/internal/query/AnyUtils.java#L20-L42 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/merge/VariantMerger.java | VariantMerger.updateDefaultKeys | public boolean updateDefaultKeys(String from, String to) {
"""
Update a key
@param from
@param to
@return true if there was a value to be moved.
"""
if (null == from) {
return false;
}
if (null == to) {
return false;
}
if (StringUtils.equals(fr... | java | public boolean updateDefaultKeys(String from, String to) {
if (null == from) {
return false;
}
if (null == to) {
return false;
}
if (StringUtils.equals(from, to)) {
return false;
}
String value = this.defaultValues.remove(from);... | [
"public",
"boolean",
"updateDefaultKeys",
"(",
"String",
"from",
",",
"String",
"to",
")",
"{",
"if",
"(",
"null",
"==",
"from",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"null",
"==",
"to",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",... | Update a key
@param from
@param to
@return true if there was a value to be moved. | [
"Update",
"a",
"key"
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/merge/VariantMerger.java#L165-L181 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java | DrawerBuilder.addMenuItems | private void addMenuItems(Menu mMenu, boolean subMenu) {
"""
helper method to init the drawerItems from a menu
@param mMenu
@param subMenu
"""
int groupId = R.id.material_drawer_menu_default_group;
for (int i = 0; i < mMenu.size(); i++) {
MenuItem mMenuItem = mMenu.getItem(i);
... | java | private void addMenuItems(Menu mMenu, boolean subMenu) {
int groupId = R.id.material_drawer_menu_default_group;
for (int i = 0; i < mMenu.size(); i++) {
MenuItem mMenuItem = mMenu.getItem(i);
IDrawerItem iDrawerItem;
if (!subMenu && mMenuItem.getGroupId() != groupId &... | [
"private",
"void",
"addMenuItems",
"(",
"Menu",
"mMenu",
",",
"boolean",
"subMenu",
")",
"{",
"int",
"groupId",
"=",
"R",
".",
"id",
".",
"material_drawer_menu_default_group",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mMenu",
".",
"size",
... | helper method to init the drawerItems from a menu
@param mMenu
@param subMenu | [
"helper",
"method",
"to",
"init",
"the",
"drawerItems",
"from",
"a",
"menu"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L1048-L1083 |
lessthanoptimal/ddogleg | src/org/ddogleg/nn/alg/VpTree.java | VpTree.searchNearest | private boolean searchNearest(final double[] target, double maxDistance, NnData<double[]> result) {
"""
Equivalent to the above search method to find one nearest neighbor.
It is faster as it does not need to allocate and use the heap data structure.
@param target target point
@param maxDistance maximum distance... | java | private boolean searchNearest(final double[] target, double maxDistance, NnData<double[]> result) {
if (root == null) {
return false;
}
double tau = maxDistance;
final FastQueue<Node> nodes = new FastQueue<Node>(20, Node.class, false);
nodes.add(root);
result.distance = Double.POSITIVE_INFINITY;... | [
"private",
"boolean",
"searchNearest",
"(",
"final",
"double",
"[",
"]",
"target",
",",
"double",
"maxDistance",
",",
"NnData",
"<",
"double",
"[",
"]",
">",
"result",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
... | Equivalent to the above search method to find one nearest neighbor.
It is faster as it does not need to allocate and use the heap data structure.
@param target target point
@param maxDistance maximum distance
@param result information about the nearest point (output parameter)
@return true if a nearest point was found ... | [
"Equivalent",
"to",
"the",
"above",
"search",
"method",
"to",
"find",
"one",
"nearest",
"neighbor",
".",
"It",
"is",
"faster",
"as",
"it",
"does",
"not",
"need",
"to",
"allocate",
"and",
"use",
"the",
"heap",
"data",
"structure",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/nn/alg/VpTree.java#L256-L290 |
livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/Attributes.java | Attributes.opaqueToBytes | public static byte[] opaqueToBytes(String opaqueString) {
"""
Returns a byte array containing the bytes parsed from the given opaque string,
except the initial opaque prefix \FF.
<br />
For example the string <code>\FF\CA\FE</code> will be converted into the byte array
<code>[0xCA, 0xFE]</code>.
@param opaq... | java | public static byte[] opaqueToBytes(String opaqueString)
{
if (!opaqueString.startsWith(OPAQUE_PREFIX))
throw new ServiceLocationException("Opaque strings must begin with " + OPAQUE_PREFIX, SLPError.PARSE_ERROR);
if (opaqueString.length() % 3 != 0)
throw new ServiceLocationExc... | [
"public",
"static",
"byte",
"[",
"]",
"opaqueToBytes",
"(",
"String",
"opaqueString",
")",
"{",
"if",
"(",
"!",
"opaqueString",
".",
"startsWith",
"(",
"OPAQUE_PREFIX",
")",
")",
"throw",
"new",
"ServiceLocationException",
"(",
"\"Opaque strings must begin with \"",... | Returns a byte array containing the bytes parsed from the given opaque string,
except the initial opaque prefix \FF.
<br />
For example the string <code>\FF\CA\FE</code> will be converted into the byte array
<code>[0xCA, 0xFE]</code>.
@param opaqueString The opaque string containing the bytes to parse
@return the byte... | [
"Returns",
"a",
"byte",
"array",
"containing",
"the",
"bytes",
"parsed",
"from",
"the",
"given",
"opaque",
"string",
"except",
"the",
"initial",
"opaque",
"prefix",
"\\",
"FF",
".",
"<br",
"/",
">",
"For",
"example",
"the",
"string",
"<code",
">",
"\\",
... | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/Attributes.java#L212-L233 |
census-instrumentation/opencensus-java | contrib/log_correlation/log4j2/src/main/java/io/opencensus/contrib/logcorrelation/log4j2/OpenCensusTraceContextDataInjector.java | OpenCensusTraceContextDataInjector.injectContextData | @Override
public StringMap injectContextData(@Nullable List<Property> properties, StringMap reusable) {
"""
Note that this method must return an object that can be passed to another thread.
"""
return ContextDataUtils.injectContextData(properties, reusable);
} | java | @Override
public StringMap injectContextData(@Nullable List<Property> properties, StringMap reusable) {
return ContextDataUtils.injectContextData(properties, reusable);
} | [
"@",
"Override",
"public",
"StringMap",
"injectContextData",
"(",
"@",
"Nullable",
"List",
"<",
"Property",
">",
"properties",
",",
"StringMap",
"reusable",
")",
"{",
"return",
"ContextDataUtils",
".",
"injectContextData",
"(",
"properties",
",",
"reusable",
")",
... | Note that this method must return an object that can be passed to another thread. | [
"Note",
"that",
"this",
"method",
"must",
"return",
"an",
"object",
"that",
"can",
"be",
"passed",
"to",
"another",
"thread",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/contrib/log_correlation/log4j2/src/main/java/io/opencensus/contrib/logcorrelation/log4j2/OpenCensusTraceContextDataInjector.java#L86-L89 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optChar | public static char optChar(@Nullable Bundle bundle, @Nullable String key) {
"""
Returns a optional char value. In other words, returns the value mapped by key if it exists and is a char.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns (char) 0.
@param bundle a bundle... | java | public static char optChar(@Nullable Bundle bundle, @Nullable String key) {
return optChar(bundle, key, (char) 0);
} | [
"public",
"static",
"char",
"optChar",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
")",
"{",
"return",
"optChar",
"(",
"bundle",
",",
"key",
",",
"(",
"char",
")",
"0",
")",
";",
"}"
] | Returns a optional char value. In other words, returns the value mapped by key if it exists and is a char.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns (char) 0.
@param bundle a bundle. If the bundle is null, this method will return null.
@param key a key for the value.
... | [
"Returns",
"a",
"optional",
"char",
"value",
".",
"In",
"other",
"words",
"returns",
"the",
"value",
"mapped",
"by",
"key",
"if",
"it",
"exists",
"and",
"is",
"a",
"char",
".",
"The",
"bundle",
"argument",
"is",
"allowed",
"to",
"be",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L271-L273 |
dashbuilder/dashbuilder | dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayer.java | TableDisplayer.onFilterEnabled | @Override
public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) {
"""
Reset the current navigation status on filter requests from external displayers
"""
view.gotoFirstPage();
super.onFilterEnabled(displayer, groupOp);
} | java | @Override
public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) {
view.gotoFirstPage();
super.onFilterEnabled(displayer, groupOp);
} | [
"@",
"Override",
"public",
"void",
"onFilterEnabled",
"(",
"Displayer",
"displayer",
",",
"DataSetGroup",
"groupOp",
")",
"{",
"view",
".",
"gotoFirstPage",
"(",
")",
";",
"super",
".",
"onFilterEnabled",
"(",
"displayer",
",",
"groupOp",
")",
";",
"}"
] | Reset the current navigation status on filter requests from external displayers | [
"Reset",
"the",
"current",
"navigation",
"status",
"on",
"filter",
"requests",
"from",
"external",
"displayers"
] | train | https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayer.java#L376-L380 |
graphql-java/graphql-java | src/main/java/graphql/schema/GraphQLSchema.java | GraphQLSchema.isPossibleType | public boolean isPossibleType(GraphQLType abstractType, GraphQLObjectType concreteType) {
"""
Returns true if a specified concrete type is a possible type of a provided abstract type.
If the provided abstract type is:
- an interface, it checks whether the concrete type is one of its implementations.
- a union, ... | java | public boolean isPossibleType(GraphQLType abstractType, GraphQLObjectType concreteType) {
if (abstractType instanceof GraphQLInterfaceType) {
return getImplementations((GraphQLInterfaceType) abstractType).stream()
.map(GraphQLType::getName)
.anyMatch(name -> c... | [
"public",
"boolean",
"isPossibleType",
"(",
"GraphQLType",
"abstractType",
",",
"GraphQLObjectType",
"concreteType",
")",
"{",
"if",
"(",
"abstractType",
"instanceof",
"GraphQLInterfaceType",
")",
"{",
"return",
"getImplementations",
"(",
"(",
"GraphQLInterfaceType",
")... | Returns true if a specified concrete type is a possible type of a provided abstract type.
If the provided abstract type is:
- an interface, it checks whether the concrete type is one of its implementations.
- a union, it checks whether the concrete type is one of its possible types.
@param abstractType abstract type e... | [
"Returns",
"true",
"if",
"a",
"specified",
"concrete",
"type",
"is",
"a",
"possible",
"type",
"of",
"a",
"provided",
"abstract",
"type",
".",
"If",
"the",
"provided",
"abstract",
"type",
"is",
":",
"-",
"an",
"interface",
"it",
"checks",
"whether",
"the",
... | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/GraphQLSchema.java#L187-L199 |
auth0/java-jwt | lib/src/main/java/com/auth0/jwt/impl/JsonNodeClaim.java | JsonNodeClaim.extractClaim | static Claim extractClaim(String claimName, Map<String, JsonNode> tree, ObjectReader objectReader) {
"""
Helper method to extract a Claim from the given JsonNode tree.
@param claimName the Claim to search for.
@param tree the JsonNode tree to search the Claim in.
@return a valid non-null Claim.
"""
... | java | static Claim extractClaim(String claimName, Map<String, JsonNode> tree, ObjectReader objectReader) {
JsonNode node = tree.get(claimName);
return claimFromNode(node, objectReader);
} | [
"static",
"Claim",
"extractClaim",
"(",
"String",
"claimName",
",",
"Map",
"<",
"String",
",",
"JsonNode",
">",
"tree",
",",
"ObjectReader",
"objectReader",
")",
"{",
"JsonNode",
"node",
"=",
"tree",
".",
"get",
"(",
"claimName",
")",
";",
"return",
"claim... | Helper method to extract a Claim from the given JsonNode tree.
@param claimName the Claim to search for.
@param tree the JsonNode tree to search the Claim in.
@return a valid non-null Claim. | [
"Helper",
"method",
"to",
"extract",
"a",
"Claim",
"from",
"the",
"given",
"JsonNode",
"tree",
"."
] | train | https://github.com/auth0/java-jwt/blob/890538970a9699b7251a4bfe4f26e8d7605ad530/lib/src/main/java/com/auth0/jwt/impl/JsonNodeClaim.java#L138-L141 |
Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java | ColumnPrinter.addValue | void addValue(int columnIndex, String value) {
"""
Add a value to the nth column
@param columnIndex n
@param value value to add
"""
if ( (columnIndex < 0) || (columnIndex >= data.size()) )
{
throw new IllegalArgumentException();
}
List<String> stringList =... | java | void addValue(int columnIndex, String value)
{
if ( (columnIndex < 0) || (columnIndex >= data.size()) )
{
throw new IllegalArgumentException();
}
List<String> stringList = data.get(columnIndex);
stringList.add(value);
} | [
"void",
"addValue",
"(",
"int",
"columnIndex",
",",
"String",
"value",
")",
"{",
"if",
"(",
"(",
"columnIndex",
"<",
"0",
")",
"||",
"(",
"columnIndex",
">=",
"data",
".",
"size",
"(",
")",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"("... | Add a value to the nth column
@param columnIndex n
@param value value to add | [
"Add",
"a",
"value",
"to",
"the",
"nth",
"column"
] | train | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java#L71-L80 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/ColumnList.java | ColumnList.addForeignKey | private void addForeignKey(String schema, String table, String column, int stepDepth, String alias, String[] foreignKeyParts) {
"""
add a new column
@param schema The column's schema
@param table The column's table
@param column The column
@param stepDepth The column's step ... | java | private void addForeignKey(String schema, String table, String column, int stepDepth, String alias, String[] foreignKeyParts) {
Column c = add(schema, table, column, stepDepth, alias);
c.isForeignKey = true;
if (foreignKeyParts.length == 3) {
Map<String, PropertyType> properties = th... | [
"private",
"void",
"addForeignKey",
"(",
"String",
"schema",
",",
"String",
"table",
",",
"String",
"column",
",",
"int",
"stepDepth",
",",
"String",
"alias",
",",
"String",
"[",
"]",
"foreignKeyParts",
")",
"{",
"Column",
"c",
"=",
"add",
"(",
"schema",
... | add a new column
@param schema The column's schema
@param table The column's table
@param column The column
@param stepDepth The column's step depth.
@param alias The column's alias.
@param foreignKeyParts The foreign key column broken up into its parts. schema, table and fo... | [
"add",
"a",
"new",
"column"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/sql/parse/ColumnList.java#L91-L113 |
hawkular/hawkular-apm | client/collector/src/main/java/org/hawkular/apm/client/collector/internal/DefaultTraceCollector.java | DefaultTraceCollector.spawnFragment | protected void spawnFragment(FragmentBuilder parentBuilder, Node node, int position,
FragmentBuilder spawnedBuilder) {
"""
This method creates a new linked fragment to handle some asynchronous
activities.
"""
Trace trace = parentBuilder.getTrace();
String id = UUID.... | java | protected void spawnFragment(FragmentBuilder parentBuilder, Node node, int position,
FragmentBuilder spawnedBuilder) {
Trace trace = parentBuilder.getTrace();
String id = UUID.randomUUID().toString();
String location = null;
String uri = null;
String o... | [
"protected",
"void",
"spawnFragment",
"(",
"FragmentBuilder",
"parentBuilder",
",",
"Node",
"node",
",",
"int",
"position",
",",
"FragmentBuilder",
"spawnedBuilder",
")",
"{",
"Trace",
"trace",
"=",
"parentBuilder",
".",
"getTrace",
"(",
")",
";",
"String",
"id"... | This method creates a new linked fragment to handle some asynchronous
activities. | [
"This",
"method",
"creates",
"a",
"new",
"linked",
"fragment",
"to",
"handle",
"some",
"asynchronous",
"activities",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/collector/src/main/java/org/hawkular/apm/client/collector/internal/DefaultTraceCollector.java#L1505-L1560 |
twitter/hraven | hraven-etl/src/main/java/com/twitter/hraven/etl/JobFilePartitioner.java | JobFilePartitioner.parseArgs | private static CommandLine parseArgs(String[] args) throws ParseException {
"""
Parse command-line arguments.
@param args
command line arguments passed to program.
@return parsed command line.
@throws ParseException
"""
Options options = new Options();
// Input
Option o = new Option("i", "in... | java | private static CommandLine parseArgs(String[] args) throws ParseException {
Options options = new Options();
// Input
Option o = new Option("i", "input", true,
"input directory as hdfs path, or local as file://");
o.setArgName("input-path");
o.setRequired(true);
options.addOption(o);
... | [
"private",
"static",
"CommandLine",
"parseArgs",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"ParseException",
"{",
"Options",
"options",
"=",
"new",
"Options",
"(",
")",
";",
"// Input",
"Option",
"o",
"=",
"new",
"Option",
"(",
"\"i\"",
",",
"\"input... | Parse command-line arguments.
@param args
command line arguments passed to program.
@return parsed command line.
@throws ParseException | [
"Parse",
"command",
"-",
"line",
"arguments",
"."
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobFilePartitioner.java#L124-L182 |
greatman/craftconomy3 | src/main/java/com/greatmancode/craftconomy3/account/AccountACL.java | AccountACL.setDeposit | public void setDeposit(String name, boolean deposit) {
"""
Set if a player can deposit money in the account
@param name The Player name
@param deposit Can deposit or not
"""
String newName = name.toLowerCase();
if (aclList.containsKey(newName)) {
AccountACLValue value = aclLi... | java | public void setDeposit(String name, boolean deposit) {
String newName = name.toLowerCase();
if (aclList.containsKey(newName)) {
AccountACLValue value = aclList.get(newName);
set(newName, deposit, value.canWithdraw(), value.canAcl(), value.canBalance(), value.isOwner());
}... | [
"public",
"void",
"setDeposit",
"(",
"String",
"name",
",",
"boolean",
"deposit",
")",
"{",
"String",
"newName",
"=",
"name",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"aclList",
".",
"containsKey",
"(",
"newName",
")",
")",
"{",
"AccountACLValue",
"... | Set if a player can deposit money in the account
@param name The Player name
@param deposit Can deposit or not | [
"Set",
"if",
"a",
"player",
"can",
"deposit",
"money",
"in",
"the",
"account"
] | train | https://github.com/greatman/craftconomy3/blob/51b1b3de7d039e20c7418d1e70b8c4b02b8cf840/src/main/java/com/greatmancode/craftconomy3/account/AccountACL.java#L117-L125 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/io/ModbusRTUTransport.java | ModbusRTUTransport.getRequest | private void getRequest(int function, BytesOutputStream out) throws IOException {
"""
getRequest - Read a request, after the unit and function code
@param function - Modbus function code
@param out - Byte stream buffer to hold actual message
"""
int byteCount;
byte inpBuf[] = new byte[... | java | private void getRequest(int function, BytesOutputStream out) throws IOException {
int byteCount;
byte inpBuf[] = new byte[256];
try {
if ((function & 0x80) == 0) {
switch (function) {
case Modbus.READ_EXCEPTION_STATUS:
case Modb... | [
"private",
"void",
"getRequest",
"(",
"int",
"function",
",",
"BytesOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"int",
"byteCount",
";",
"byte",
"inpBuf",
"[",
"]",
"=",
"new",
"byte",
"[",
"256",
"]",
";",
"try",
"{",
"if",
"(",
"(",
"fun... | getRequest - Read a request, after the unit and function code
@param function - Modbus function code
@param out - Byte stream buffer to hold actual message | [
"getRequest",
"-",
"Read",
"a",
"request",
"after",
"the",
"unit",
"and",
"function",
"code"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/io/ModbusRTUTransport.java#L69-L133 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java | LocalNetworkGatewaysInner.beginCreateOrUpdateAsync | public Observable<LocalNetworkGatewayInner> beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) {
"""
Creates or updates a local network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param l... | java | public Observable<LocalNetworkGatewayInner> beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1<ServiceResponse<LocalNetw... | [
"public",
"Observable",
"<",
"LocalNetworkGatewayInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"localNetworkGatewayName",
",",
"LocalNetworkGatewayInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync"... | Creates or updates a local network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param localNetworkGatewayName The name of the local network gateway.
@param parameters Parameters supplied to the create or update local network gateway operation.
@throws IllegalArgume... | [
"Creates",
"or",
"updates",
"a",
"local",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java#L220-L227 |
i-net-software/jlessc | src/com/inet/lib/less/ColorUtils.java | ColorUtils.hsla | static double hsla( HSL hsl ) {
"""
Create a color value.
@param hsl
a HSL value
@return a color as long
"""
return hsla(hsl.h, hsl.s, hsl.l, hsl.a);
} | java | static double hsla( HSL hsl ) {
return hsla(hsl.h, hsl.s, hsl.l, hsl.a);
} | [
"static",
"double",
"hsla",
"(",
"HSL",
"hsl",
")",
"{",
"return",
"hsla",
"(",
"hsl",
".",
"h",
",",
"hsl",
".",
"s",
",",
"hsl",
".",
"l",
",",
"hsl",
".",
"a",
")",
";",
"}"
] | Create a color value.
@param hsl
a HSL value
@return a color as long | [
"Create",
"a",
"color",
"value",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/ColorUtils.java#L217-L219 |
networknt/light-4j | cluster/src/main/java/com/networknt/cluster/LightCluster.java | LightCluster.serviceToUrl | @Override
public String serviceToUrl(String protocol, String serviceId, String tag, String requestKey) {
"""
Implement serviceToUrl with client side service discovery.
@param protocol String
@param serviceId String
@param requestKey String
@return String
"""
URL url = loadBalance.select(disco... | java | @Override
public String serviceToUrl(String protocol, String serviceId, String tag, String requestKey) {
URL url = loadBalance.select(discovery(protocol, serviceId, tag), requestKey);
if(logger.isDebugEnabled()) logger.debug("final url after load balance = " + url);
// construct a url in str... | [
"@",
"Override",
"public",
"String",
"serviceToUrl",
"(",
"String",
"protocol",
",",
"String",
"serviceId",
",",
"String",
"tag",
",",
"String",
"requestKey",
")",
"{",
"URL",
"url",
"=",
"loadBalance",
".",
"select",
"(",
"discovery",
"(",
"protocol",
",",
... | Implement serviceToUrl with client side service discovery.
@param protocol String
@param serviceId String
@param requestKey String
@return String | [
"Implement",
"serviceToUrl",
"with",
"client",
"side",
"service",
"discovery",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/cluster/src/main/java/com/networknt/cluster/LightCluster.java#L62-L68 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java | CharSequences.matchAfter | @Deprecated
public static int matchAfter(CharSequence a, CharSequence b, int aIndex, int bIndex) {
"""
Find the longest n such that a[aIndex,n] = b[bIndex,n], and n is on a character boundary.
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android
"""
... | java | @Deprecated
public static int matchAfter(CharSequence a, CharSequence b, int aIndex, int bIndex) {
int i = aIndex, j = bIndex;
int alen = a.length();
int blen = b.length();
for (; i < alen && j < blen; ++i, ++j) {
char ca = a.charAt(i);
char cb = b.charAt(j);
... | [
"@",
"Deprecated",
"public",
"static",
"int",
"matchAfter",
"(",
"CharSequence",
"a",
",",
"CharSequence",
"b",
",",
"int",
"aIndex",
",",
"int",
"bIndex",
")",
"{",
"int",
"i",
"=",
"aIndex",
",",
"j",
"=",
"bIndex",
";",
"int",
"alen",
"=",
"a",
".... | Find the longest n such that a[aIndex,n] = b[bIndex,n], and n is on a character boundary.
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android | [
"Find",
"the",
"longest",
"n",
"such",
"that",
"a",
"[",
"aIndex",
"n",
"]",
"=",
"b",
"[",
"bIndex",
"n",
"]",
"and",
"n",
"is",
"on",
"a",
"character",
"boundary",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java#L54-L72 |
OpenTSDB/opentsdb | src/meta/TSUIDQuery.java | TSUIDQuery.setQuery | public void setQuery(final String metric, final Map<String, String> tags) {
"""
Sets the query to perform
@param metric Name of the metric to search for
@param tags A map of tag value pairs or simply an empty map
@throws NoSuchUniqueName if the metric or any of the tag names/values did
not exist
@deprecated P... | java | public void setQuery(final String metric, final Map<String, String> tags) {
this.metric = metric;
this.tags = tags;
metric_uid = tsdb.getUID(UniqueIdType.METRIC, metric);
tag_uids = Tags.resolveAll(tsdb, tags);
} | [
"public",
"void",
"setQuery",
"(",
"final",
"String",
"metric",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"this",
".",
"metric",
"=",
"metric",
";",
"this",
".",
"tags",
"=",
"tags",
";",
"metric_uid",
"=",
"tsdb",
"."... | Sets the query to perform
@param metric Name of the metric to search for
@param tags A map of tag value pairs or simply an empty map
@throws NoSuchUniqueName if the metric or any of the tag names/values did
not exist
@deprecated Please use one of the constructors instead. Will be removed in 2.3 | [
"Sets",
"the",
"query",
"to",
"perform"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/TSUIDQuery.java#L227-L232 |
alkacon/opencms-core | src/org/opencms/ugc/CmsUgcSession.java | CmsUgcSession.checkEditResourceNotSet | private void checkEditResourceNotSet() throws CmsUgcException {
"""
Throws an error if the edit resource is already set.<p>
@throws CmsUgcException if the edit resource is already set
"""
if (m_editResource != null) {
String message = Messages.get().container(Messages.ERR_CANT_EDIT_MULT... | java | private void checkEditResourceNotSet() throws CmsUgcException {
if (m_editResource != null) {
String message = Messages.get().container(Messages.ERR_CANT_EDIT_MULTIPLE_CONTENTS_IN_SESSION_0).key(
getCmsObject().getRequestContext().getLocale());
throw new CmsUgcException(... | [
"private",
"void",
"checkEditResourceNotSet",
"(",
")",
"throws",
"CmsUgcException",
"{",
"if",
"(",
"m_editResource",
"!=",
"null",
")",
"{",
"String",
"message",
"=",
"Messages",
".",
"get",
"(",
")",
".",
"container",
"(",
"Messages",
".",
"ERR_CANT_EDIT_MU... | Throws an error if the edit resource is already set.<p>
@throws CmsUgcException if the edit resource is already set | [
"Throws",
"an",
"error",
"if",
"the",
"edit",
"resource",
"is",
"already",
"set",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSession.java#L673-L681 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/MediaFormat.java | MediaFormat.guessHumanReadableRatioString | private static String guessHumanReadableRatioString(double ratio, NumberFormat numberFormat) {
"""
Try to guess a nice human readable ratio string from the given decimal ratio
@param ratio Ratio
@param numberFormat Number format
@return Ratio display string or null if no nice string was found
"""
for (l... | java | private static String guessHumanReadableRatioString(double ratio, NumberFormat numberFormat) {
for (long width = 1; width <= 50; width++) {
double height = width / ratio;
if (isLong(height)) {
return numberFormat.format(width) + ":" + numberFormat.format(height);
}
}
for (long widt... | [
"private",
"static",
"String",
"guessHumanReadableRatioString",
"(",
"double",
"ratio",
",",
"NumberFormat",
"numberFormat",
")",
"{",
"for",
"(",
"long",
"width",
"=",
"1",
";",
"width",
"<=",
"50",
";",
"width",
"++",
")",
"{",
"double",
"height",
"=",
"... | Try to guess a nice human readable ratio string from the given decimal ratio
@param ratio Ratio
@param numberFormat Number format
@return Ratio display string or null if no nice string was found | [
"Try",
"to",
"guess",
"a",
"nice",
"human",
"readable",
"ratio",
"string",
"from",
"the",
"given",
"decimal",
"ratio"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/MediaFormat.java#L265-L279 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractDataStore.java | AbstractDataStore.readData | protected static final Data readData(@Nonnull final DataReader reader, @Nonnull final URL url, @Nonnull final Charset charset) {
"""
This method reads the given {@link URL} by using an {@link DataReader}. The new created instance of {@link Data}
will be returned.
@param reader
data reader to read the given {@... | java | protected static final Data readData(@Nonnull final DataReader reader, @Nonnull final URL url, @Nonnull final Charset charset) {
Check.notNull(reader, "reader");
Check.notNull(url, "url");
Check.notNull(charset, "charset");
return reader.read(url, charset);
} | [
"protected",
"static",
"final",
"Data",
"readData",
"(",
"@",
"Nonnull",
"final",
"DataReader",
"reader",
",",
"@",
"Nonnull",
"final",
"URL",
"url",
",",
"@",
"Nonnull",
"final",
"Charset",
"charset",
")",
"{",
"Check",
".",
"notNull",
"(",
"reader",
",",... | This method reads the given {@link URL} by using an {@link DataReader}. The new created instance of {@link Data}
will be returned.
@param reader
data reader to read the given {@code dataUrl}
@param url
URL to <em>UAS data</em>
@param charset
the character set in which the data should be read
@return an instance of {@c... | [
"This",
"method",
"reads",
"the",
"given",
"{",
"@link",
"URL",
"}",
"by",
"using",
"an",
"{",
"@link",
"DataReader",
"}",
".",
"The",
"new",
"created",
"instance",
"of",
"{",
"@link",
"Data",
"}",
"will",
"be",
"returned",
"."
] | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/AbstractDataStore.java#L67-L73 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/v1/DbxClientV1.java | DbxClientV1.chunkedUploadFinish | public DbxEntry.File chunkedUploadFinish(String targetPath, DbxWriteMode writeMode, String uploadId)
throws DbxException {
"""
Creates a file in the user's Dropbox at the given path, with file data previously uploaded
via {@link #chunkedUploadFirst} and {@link #chunkedUploadAppend}.
@param targetPath
... | java | public DbxEntry.File chunkedUploadFinish(String targetPath, DbxWriteMode writeMode, String uploadId)
throws DbxException
{
DbxPathV1.checkArgNonRoot("targetPath", targetPath);
String apiPath = "1/commit_chunked_upload/auto" + targetPath;
String[] params = {
"upload_id",... | [
"public",
"DbxEntry",
".",
"File",
"chunkedUploadFinish",
"(",
"String",
"targetPath",
",",
"DbxWriteMode",
"writeMode",
",",
"String",
"uploadId",
")",
"throws",
"DbxException",
"{",
"DbxPathV1",
".",
"checkArgNonRoot",
"(",
"\"targetPath\"",
",",
"targetPath",
")"... | Creates a file in the user's Dropbox at the given path, with file data previously uploaded
via {@link #chunkedUploadFirst} and {@link #chunkedUploadAppend}.
@param targetPath
The path to the file on Dropbox (see {@link DbxPathV1}). If a file at
that path already exists on Dropbox, then the {@code writeMode} parameter... | [
"Creates",
"a",
"file",
"in",
"the",
"user",
"s",
"Dropbox",
"at",
"the",
"given",
"path",
"with",
"file",
"data",
"previously",
"uploaded",
"via",
"{",
"@link",
"#chunkedUploadFirst",
"}",
"and",
"{",
"@link",
"#chunkedUploadAppend",
"}",
"."
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1205-L1225 |
moparisthebest/beehive | beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/FlowControllerInfo.java | FlowControllerInfo.addReturnAction | public TypeInstance addReturnAction( String returnActionName, AnnotationInstance annotation, TypeDeclaration outerType ) {
"""
Add a return-action from an annotation.
@return the form bean type, or null</code> if there is no form bean.
"""
TypeInstance formBeanType = CompilerUtils.getTypeInstance( ann... | java | public TypeInstance addReturnAction( String returnActionName, AnnotationInstance annotation, TypeDeclaration outerType )
{
TypeInstance formBeanType = CompilerUtils.getTypeInstance( annotation, OUTPUT_FORM_BEAN_TYPE_ATTR, true );
if ( formBeanType == null )
{
String memb... | [
"public",
"TypeInstance",
"addReturnAction",
"(",
"String",
"returnActionName",
",",
"AnnotationInstance",
"annotation",
",",
"TypeDeclaration",
"outerType",
")",
"{",
"TypeInstance",
"formBeanType",
"=",
"CompilerUtils",
".",
"getTypeInstance",
"(",
"annotation",
",",
... | Add a return-action from an annotation.
@return the form bean type, or null</code> if there is no form bean. | [
"Add",
"a",
"return",
"-",
"action",
"from",
"an",
"annotation",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-compiler/src/main/java/org/apache/beehive/netui/compiler/FlowControllerInfo.java#L320-L341 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java | SARLJvmModelInferrer.skipTypeParameters | protected JvmTypeReference skipTypeParameters(JvmTypeReference type, Notifier context) {
"""
Remove the type parameters from the given type.
<p><table>
<thead><tr><th>Referenced type</th><th>Input</th><th>Replied referenced type</th><th>Output</th></tr></thead>
<tbody>
<tr><td>Type with generic type paramete... | java | protected JvmTypeReference skipTypeParameters(JvmTypeReference type, Notifier context) {
final LightweightTypeReference ltr = Utils.toLightweightTypeReference(type, this.services);
return ltr.getRawTypeReference().toJavaCompliantTypeReference();
} | [
"protected",
"JvmTypeReference",
"skipTypeParameters",
"(",
"JvmTypeReference",
"type",
",",
"Notifier",
"context",
")",
"{",
"final",
"LightweightTypeReference",
"ltr",
"=",
"Utils",
".",
"toLightweightTypeReference",
"(",
"type",
",",
"this",
".",
"services",
")",
... | Remove the type parameters from the given type.
<p><table>
<thead><tr><th>Referenced type</th><th>Input</th><th>Replied referenced type</th><th>Output</th></tr></thead>
<tbody>
<tr><td>Type with generic type parameter</td><td>{@code T<G>}</td><td>the type itself</td><td>{@code T}</td></tr>
<tr><td>Type without generic... | [
"Remove",
"the",
"type",
"parameters",
"from",
"the",
"given",
"type",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java#L2926-L2929 |
GwtMaterialDesign/gwt-material-table | src/main/java/gwt/material/design/client/ui/table/cell/Column.java | Column.onBrowserEvent | public void onBrowserEvent(Context context, Element elem, final T object, NativeEvent event) {
"""
Handle a browser event that took place within the column.
@param context the cell context
@param elem the parent Element
@param object the base object to be updated
@param event the native browser event
"""... | java | public void onBrowserEvent(Context context, Element elem, final T object, NativeEvent event) {
final int index = context.getIndex();
ValueUpdater<C> valueUpdater = (fieldUpdater == null) ? null : (ValueUpdater<C>) value -> {
fieldUpdater.update(index, object, value);
};
cell.... | [
"public",
"void",
"onBrowserEvent",
"(",
"Context",
"context",
",",
"Element",
"elem",
",",
"final",
"T",
"object",
",",
"NativeEvent",
"event",
")",
"{",
"final",
"int",
"index",
"=",
"context",
".",
"getIndex",
"(",
")",
";",
"ValueUpdater",
"<",
"C",
... | Handle a browser event that took place within the column.
@param context the cell context
@param elem the parent Element
@param object the base object to be updated
@param event the native browser event | [
"Handle",
"a",
"browser",
"event",
"that",
"took",
"place",
"within",
"the",
"column",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material-table/blob/1352cafdcbff747bc1f302e709ed376df6642ef5/src/main/java/gwt/material/design/client/ui/table/cell/Column.java#L107-L113 |
rundeck/rundeck | core/src/main/java/com/dtolabs/launcher/Preferences.java | Preferences.parseNonReqOptionsAsProperties | public static void parseNonReqOptionsAsProperties(final Properties defaultProperties, final String[] args) throws Exception {
"""
Parse arguments that match "--key=value" and populate the Properties with the values.
@param defaultProperties the properties
@param args the arguments
@throws Exception if an error ... | java | public static void parseNonReqOptionsAsProperties(final Properties defaultProperties, final String[] args) throws Exception {
// loop thru each argument on cmdline
for (final String argProp : args) {
//System.out.println("parseNonReqOptionsAsProperties(), argProp: " + argProp);
... | [
"public",
"static",
"void",
"parseNonReqOptionsAsProperties",
"(",
"final",
"Properties",
"defaultProperties",
",",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"// loop thru each argument on cmdline",
"for",
"(",
"final",
"String",
"argProp",
... | Parse arguments that match "--key=value" and populate the Properties with the values.
@param defaultProperties the properties
@param args the arguments
@throws Exception if an error occurs | [
"Parse",
"arguments",
"that",
"match",
"--",
"key",
"=",
"value",
"and",
"populate",
"the",
"Properties",
"with",
"the",
"values",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/launcher/Preferences.java#L192-L218 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java | SRTPCryptoContext.computeIv | private void computeIv(long label, long index) {
"""
Compute the initialization vector, used later by encryption algorithms,
based on the lable, the packet index, key derivation rate and master salt
key.
@param label
label specified for each type of iv
@param index
48bit RTP packet index
"""
long key... | java | private void computeIv(long label, long index) {
long key_id;
if (keyDerivationRate == 0) {
key_id = label << 48;
} else {
key_id = ((label << 48) | (index / keyDerivationRate));
}
for (int i = 0; i < 7; i++) {
ivStore[i] = masterSalt[i];
}
for (int i = 7; i < 14; i++) {
ivStore[i] = (byte) (... | [
"private",
"void",
"computeIv",
"(",
"long",
"label",
",",
"long",
"index",
")",
"{",
"long",
"key_id",
";",
"if",
"(",
"keyDerivationRate",
"==",
"0",
")",
"{",
"key_id",
"=",
"label",
"<<",
"48",
";",
"}",
"else",
"{",
"key_id",
"=",
"(",
"(",
"l... | Compute the initialization vector, used later by encryption algorithms,
based on the lable, the packet index, key derivation rate and master salt
key.
@param label
label specified for each type of iv
@param index
48bit RTP packet index | [
"Compute",
"the",
"initialization",
"vector",
"used",
"later",
"by",
"encryption",
"algorithms",
"based",
"on",
"the",
"lable",
"the",
"packet",
"index",
"key",
"derivation",
"rate",
"and",
"master",
"salt",
"key",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCryptoContext.java#L587-L602 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/themes/ThemeUiHelper.java | ThemeUiHelper.iconComponent | public static void iconComponent(Component component, UiIcon icon) {
"""
Method to display your composant as an icon
@param component
Wicket component
@param icon
Icon to display
"""
component.add(AttributeModifier.append("class", "ui-icon " + icon.getCssClass()));
} | java | public static void iconComponent(Component component, UiIcon icon)
{
component.add(AttributeModifier.append("class", "ui-icon " + icon.getCssClass()));
} | [
"public",
"static",
"void",
"iconComponent",
"(",
"Component",
"component",
",",
"UiIcon",
"icon",
")",
"{",
"component",
".",
"add",
"(",
"AttributeModifier",
".",
"append",
"(",
"\"class\"",
",",
"\"ui-icon \"",
"+",
"icon",
".",
"getCssClass",
"(",
")",
"... | Method to display your composant as an icon
@param component
Wicket component
@param icon
Icon to display | [
"Method",
"to",
"display",
"your",
"composant",
"as",
"an",
"icon"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/themes/ThemeUiHelper.java#L358-L361 |
graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/AngleCalc.java | AngleCalc.alignOrientation | public double alignOrientation(double baseOrientation, double orientation) {
"""
Change the representation of an orientation, so the difference to the given baseOrientation
will be smaller or equal to PI (180 degree). This is achieved by adding or subtracting a
2*PI, so the direction of the orientation will not ... | java | public double alignOrientation(double baseOrientation, double orientation) {
double resultOrientation;
if (baseOrientation >= 0) {
if (orientation < -Math.PI + baseOrientation)
resultOrientation = orientation + 2 * Math.PI;
else
resultOrientation =... | [
"public",
"double",
"alignOrientation",
"(",
"double",
"baseOrientation",
",",
"double",
"orientation",
")",
"{",
"double",
"resultOrientation",
";",
"if",
"(",
"baseOrientation",
">=",
"0",
")",
"{",
"if",
"(",
"orientation",
"<",
"-",
"Math",
".",
"PI",
"+... | Change the representation of an orientation, so the difference to the given baseOrientation
will be smaller or equal to PI (180 degree). This is achieved by adding or subtracting a
2*PI, so the direction of the orientation will not be changed | [
"Change",
"the",
"representation",
"of",
"an",
"orientation",
"so",
"the",
"difference",
"to",
"the",
"given",
"baseOrientation",
"will",
"be",
"smaller",
"or",
"equal",
"to",
"PI",
"(",
"180",
"degree",
")",
".",
"This",
"is",
"achieved",
"by",
"adding",
... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/AngleCalc.java#L94-L107 |
yidongnan/grpc-spring-boot-starter | grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java | AbstractChannelFactory.configureKeepAlive | protected void configureKeepAlive(final T builder, final String name) {
"""
Configures the keep alive options that should be used by the channel.
@param builder The channel builder to configure.
@param name The name of the client to configure.
"""
final GrpcChannelProperties properties = getPropert... | java | protected void configureKeepAlive(final T builder, final String name) {
final GrpcChannelProperties properties = getPropertiesFor(name);
if (properties.isEnableKeepAlive()) {
builder.keepAliveTime(properties.getKeepAliveTime().toNanos(), TimeUnit.NANOSECONDS)
.keepAliveTi... | [
"protected",
"void",
"configureKeepAlive",
"(",
"final",
"T",
"builder",
",",
"final",
"String",
"name",
")",
"{",
"final",
"GrpcChannelProperties",
"properties",
"=",
"getPropertiesFor",
"(",
"name",
")",
";",
"if",
"(",
"properties",
".",
"isEnableKeepAlive",
... | Configures the keep alive options that should be used by the channel.
@param builder The channel builder to configure.
@param name The name of the client to configure. | [
"Configures",
"the",
"keep",
"alive",
"options",
"that",
"should",
"be",
"used",
"by",
"the",
"channel",
"."
] | train | https://github.com/yidongnan/grpc-spring-boot-starter/blob/07f8853cfafc9707584f2371aff012e590217b85/grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java#L168-L175 |
google/closure-compiler | src/com/google/javascript/jscomp/deps/PathUtil.java | PathUtil.makeRelative | public static String makeRelative(String basePath, String targetPath) {
"""
Returns targetPath relative to basePath.
<p>basePath and targetPath must either both be relative, or both be
absolute paths.</p>
<p>This function is different from makeRelative
in that it is able to add in ../ components and collap... | java | public static String makeRelative(String basePath, String targetPath) {
// Ensure the paths are both absolute or both relative.
if (isAbsolute(basePath) !=
isAbsolute(targetPath)) {
throw new IllegalArgumentException(
"Paths must both be relative or both absolute.\n" +
" baseP... | [
"public",
"static",
"String",
"makeRelative",
"(",
"String",
"basePath",
",",
"String",
"targetPath",
")",
"{",
"// Ensure the paths are both absolute or both relative.",
"if",
"(",
"isAbsolute",
"(",
"basePath",
")",
"!=",
"isAbsolute",
"(",
"targetPath",
")",
")",
... | Returns targetPath relative to basePath.
<p>basePath and targetPath must either both be relative, or both be
absolute paths.</p>
<p>This function is different from makeRelative
in that it is able to add in ../ components and collapse existing ones as well.</p>
Examples:
base="some/relative/path" target="some/relativ... | [
"Returns",
"targetPath",
"relative",
"to",
"basePath",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/PathUtil.java#L165-L210 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.getValueForCell | public Object getValueForCell(final FacesContext context, final String rowKey, final int col) {
"""
Gets the object value of the row and col specified. If a local value exists, that is returned, otherwise the actual value is return.
@param context
@param rowKey
@param col
@return
"""
// if we hav... | java | public Object getValueForCell(final FacesContext context, final String rowKey, final int col) {
// if we have a local value, use it
// note: can't check for null, as null may be the submitted value
final SheetRowColIndex index = new SheetRowColIndex(rowKey, col);
if (localValues.contains... | [
"public",
"Object",
"getValueForCell",
"(",
"final",
"FacesContext",
"context",
",",
"final",
"String",
"rowKey",
",",
"final",
"int",
"col",
")",
"{",
"// if we have a local value, use it",
"// note: can't check for null, as null may be the submitted value",
"final",
"SheetR... | Gets the object value of the row and col specified. If a local value exists, that is returned, otherwise the actual value is return.
@param context
@param rowKey
@param col
@return | [
"Gets",
"the",
"object",
"value",
"of",
"the",
"row",
"and",
"col",
"specified",
".",
"If",
"a",
"local",
"value",
"exists",
"that",
"is",
"returned",
"otherwise",
"the",
"actual",
"value",
"is",
"return",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L342-L353 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java | CommerceShippingMethodPersistenceImpl.fetchByG_E | @Override
public CommerceShippingMethod fetchByG_E(long groupId, String engineKey) {
"""
Returns the commerce shipping method where groupId = ? and engineKey = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param engineKey the engine key
@... | java | @Override
public CommerceShippingMethod fetchByG_E(long groupId, String engineKey) {
return fetchByG_E(groupId, engineKey, true);
} | [
"@",
"Override",
"public",
"CommerceShippingMethod",
"fetchByG_E",
"(",
"long",
"groupId",
",",
"String",
"engineKey",
")",
"{",
"return",
"fetchByG_E",
"(",
"groupId",
",",
"engineKey",
",",
"true",
")",
";",
"}"
] | Returns the commerce shipping method where groupId = ? and engineKey = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param engineKey the engine key
@return the matching commerce shipping method, or <code>null</code> if a matching commerce shipping ... | [
"Returns",
"the",
"commerce",
"shipping",
"method",
"where",
"groupId",
"=",
"?",
";",
"and",
"engineKey",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"fi... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java#L661-L664 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java | JBossASClient.getStringAttribute | public String getStringAttribute(boolean runtime, String attributeName, Address address) throws Exception {
"""
Convienence method that allows you to obtain a single attribute's string value from
a resource.
@param runtime if <code>true</code>, the attribute to be retrieved is a runtime attribute
@param attri... | java | public String getStringAttribute(boolean runtime, String attributeName, Address address) throws Exception {
return getAttribute(runtime, attributeName, address).asString();
} | [
"public",
"String",
"getStringAttribute",
"(",
"boolean",
"runtime",
",",
"String",
"attributeName",
",",
"Address",
"address",
")",
"throws",
"Exception",
"{",
"return",
"getAttribute",
"(",
"runtime",
",",
"attributeName",
",",
"address",
")",
".",
"asString",
... | Convienence method that allows you to obtain a single attribute's string value from
a resource.
@param runtime if <code>true</code>, the attribute to be retrieved is a runtime attribute
@param attributeName the attribute whose value is to be returned
@param address identifies the resource
@return the attribute value
... | [
"Convienence",
"method",
"that",
"allows",
"you",
"to",
"obtain",
"a",
"single",
"attribute",
"s",
"string",
"value",
"from",
"a",
"resource",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java#L397-L399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.