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 |
|---|---|---|---|---|---|---|---|---|---|---|
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java | TermOfUsePanel.newDisclaimerPanel | protected Component newDisclaimerPanel(final String id,
final IModel<HeaderContentListModelBean> model) {
"""
Factory method for creating the new {@link Component} for the disclaimer. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version... | java | protected Component newDisclaimerPanel(final String id,
final IModel<HeaderContentListModelBean> model)
{
return new DisclaimerPanel(id, Model.of(model.getObject()));
} | [
"protected",
"Component",
"newDisclaimerPanel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"HeaderContentListModelBean",
">",
"model",
")",
"{",
"return",
"new",
"DisclaimerPanel",
"(",
"id",
",",
"Model",
".",
"of",
"(",
"model",
".",
"getObje... | Factory method for creating the new {@link Component} for the disclaimer. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new {@link Component} for the disclaimer.
@param id
the id
@param model
the model
@return the new {@link Compone... | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Component",
"}",
"for",
"the",
"disclaimer",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/TermOfUsePanel.java#L242-L246 |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/MessageMLContext.java | MessageMLContext.parseMessageML | public void parseMessageML(String message, String entityJson, String version) throws InvalidInputException, IOException,
ProcessingException {
"""
Parse the text contents of the message and optionally EntityJSON into a MessageMLV2 message. Expands
Freemarker templates and generates document tree structures ... | java | public void parseMessageML(String message, String entityJson, String version) throws InvalidInputException, IOException,
ProcessingException {
this.messageML = messageMLParser.parse(message, entityJson, version);
this.entityJson = messageMLParser.getEntityJson();
this.markdownRenderer = new MarkdownR... | [
"public",
"void",
"parseMessageML",
"(",
"String",
"message",
",",
"String",
"entityJson",
",",
"String",
"version",
")",
"throws",
"InvalidInputException",
",",
"IOException",
",",
"ProcessingException",
"{",
"this",
".",
"messageML",
"=",
"messageMLParser",
".",
... | Parse the text contents of the message and optionally EntityJSON into a MessageMLV2 message. Expands
Freemarker templates and generates document tree structures for serialization into output formats with the
respective get() methods.
@param message string containing a MessageMLV2 message with optional Freemarker templa... | [
"Parse",
"the",
"text",
"contents",
"of",
"the",
"message",
"and",
"optionally",
"EntityJSON",
"into",
"a",
"MessageMLV2",
"message",
".",
"Expands",
"Freemarker",
"templates",
"and",
"generates",
"document",
"tree",
"structures",
"for",
"serialization",
"into",
"... | train | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/MessageMLContext.java#L69-L75 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveCopyEntityHelper.java | HiveCopyEntityHelper.getCopyEntities | Iterator<FileSet<CopyEntity>> getCopyEntities(CopyConfiguration configuration, Comparator<FileSet<CopyEntity>> prioritizer,
PushDownRequestor<FileSet<CopyEntity>> requestor) throws IOException {
"""
Finds all files read by the table and generates {@link CopyEntity}s for duplicating the table. The semantics a... | java | Iterator<FileSet<CopyEntity>> getCopyEntities(CopyConfiguration configuration, Comparator<FileSet<CopyEntity>> prioritizer,
PushDownRequestor<FileSet<CopyEntity>> requestor) throws IOException {
if (HiveUtils.isPartitioned(this.dataset.table)) {
return new PartitionIterator(this.sourcePartitions, config... | [
"Iterator",
"<",
"FileSet",
"<",
"CopyEntity",
">",
">",
"getCopyEntities",
"(",
"CopyConfiguration",
"configuration",
",",
"Comparator",
"<",
"FileSet",
"<",
"CopyEntity",
">",
">",
"prioritizer",
",",
"PushDownRequestor",
"<",
"FileSet",
"<",
"CopyEntity",
">",
... | Finds all files read by the table and generates {@link CopyEntity}s for duplicating the table. The semantics are as follows:
1. Find all valid {@link org.apache.hadoop.hive.metastore.api.StorageDescriptor}. If the table is partitioned, the
{@link org.apache.hadoop.hive.metastore.api.StorageDescriptor} of the base
table... | [
"Finds",
"all",
"files",
"read",
"by",
"the",
"table",
"and",
"generates",
"{",
"@link",
"CopyEntity",
"}",
"s",
"for",
"duplicating",
"the",
"table",
".",
"The",
"semantics",
"are",
"as",
"follows",
":",
"1",
".",
"Find",
"all",
"valid",
"{",
"@link",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveCopyEntityHelper.java#L408-L416 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.loginWithPhoneNumber | @SuppressWarnings("WeakerAccess")
public AuthenticationRequest loginWithPhoneNumber(@NonNull String phoneNumber, @NonNull String verificationCode) {
"""
Log in a user using a phone number and a verification code received via SMS (Part of passwordless login flow).
By default it will try to authenticate using t... | java | @SuppressWarnings("WeakerAccess")
public AuthenticationRequest loginWithPhoneNumber(@NonNull String phoneNumber, @NonNull String verificationCode) {
return loginWithPhoneNumber(phoneNumber, verificationCode, SMS_CONNECTION);
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"AuthenticationRequest",
"loginWithPhoneNumber",
"(",
"@",
"NonNull",
"String",
"phoneNumber",
",",
"@",
"NonNull",
"String",
"verificationCode",
")",
"{",
"return",
"loginWithPhoneNumber",
"(",
"phoneNumb... | Log in a user using a phone number and a verification code received via SMS (Part of passwordless login flow).
By default it will try to authenticate using the "sms" connection.
Example usage:
<pre>
{@code
client.loginWithPhoneNumber("{phone number}", "{code}")
.start(new BaseCallback<Credentials>() {
{@literal}Overrid... | [
"Log",
"in",
"a",
"user",
"using",
"a",
"phone",
"number",
"and",
"a",
"verification",
"code",
"received",
"via",
"SMS",
"(",
"Part",
"of",
"passwordless",
"login",
"flow",
")",
".",
"By",
"default",
"it",
"will",
"try",
"to",
"authenticate",
"using",
"t... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L373-L376 |
EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.checkImage | public void checkImage(IFD ifd, int n, IfdTags metadata) {
"""
Check if the tags that define the image are correct and consistent.
@param ifd the ifd
@param n the ifd number
@param metadata the ifd metadata
"""
CheckCommonFields(ifd, n, metadata);
if (!metadata.containsTagId(TiffTags.getTagId("Ph... | java | public void checkImage(IFD ifd, int n, IfdTags metadata) {
CheckCommonFields(ifd, n, metadata);
if (!metadata.containsTagId(TiffTags.getTagId("PhotometricInterpretation"))) {
validation.addErrorLoc("Missing Photometric Interpretation", "IFD" + n);
} else if (metadata.get(TiffTags.getTagId("Photometri... | [
"public",
"void",
"checkImage",
"(",
"IFD",
"ifd",
",",
"int",
"n",
",",
"IfdTags",
"metadata",
")",
"{",
"CheckCommonFields",
"(",
"ifd",
",",
"n",
",",
"metadata",
")",
";",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"get... | Check if the tags that define the image are correct and consistent.
@param ifd the ifd
@param n the ifd number
@param metadata the ifd metadata | [
"Check",
"if",
"the",
"tags",
"that",
"define",
"the",
"image",
"are",
"correct",
"and",
"consistent",
"."
] | train | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L193-L246 |
sarl/sarl | main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/scoping/extensions/numbers/arithmetic/AtomicLongArithmeticExtensions.java | AtomicLongArithmeticExtensions.operator_minus | @Pure
@Inline(value = "($1.longValue() - $2)", constantExpression = true)
public static long operator_minus(AtomicLong left, long right) {
"""
The binary {@code minus} operator. This is the equivalent to
the Java {@code -} operator. This function is not null-safe.
@param left a number.
@param right a number... | java | @Pure
@Inline(value = "($1.longValue() - $2)", constantExpression = true)
public static long operator_minus(AtomicLong left, long right) {
return left.longValue() - right;
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"($1.longValue() - $2)\"",
",",
"constantExpression",
"=",
"true",
")",
"public",
"static",
"long",
"operator_minus",
"(",
"AtomicLong",
"left",
",",
"long",
"right",
")",
"{",
"return",
"left",
".",
"longValue"... | The binary {@code minus} operator. This is the equivalent to
the Java {@code -} operator. This function is not null-safe.
@param left a number.
@param right a number.
@return {@code left-right} | [
"The",
"binary",
"{",
"@code",
"minus",
"}",
"operator",
".",
"This",
"is",
"the",
"equivalent",
"to",
"the",
"Java",
"{",
"@code",
"-",
"}",
"operator",
".",
"This",
"function",
"is",
"not",
"null",
"-",
"safe",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/scoping/extensions/numbers/arithmetic/AtomicLongArithmeticExtensions.java#L65-L69 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/compiler/CommandLineCompiler.java | CommandLineCompiler.getTotalArgumentLengthForInputFile | protected int getTotalArgumentLengthForInputFile(final File outputDir, final String inputFile) {
"""
Get total command line length due to the input file.
@param outputDir
File output directory
@param inputFile
String input file
@return int characters added to command line for the input file.
"""
fin... | java | protected int getTotalArgumentLengthForInputFile(final File outputDir, final String inputFile) {
final int argumentCountPerInputFile = getArgumentCountPerInputFile();
int len=0;
for (int k = 0; k < argumentCountPerInputFile; k++) {
len+=getInputFileArgument(outputDir, inputFile, k).length();
}
... | [
"protected",
"int",
"getTotalArgumentLengthForInputFile",
"(",
"final",
"File",
"outputDir",
",",
"final",
"String",
"inputFile",
")",
"{",
"final",
"int",
"argumentCountPerInputFile",
"=",
"getArgumentCountPerInputFile",
"(",
")",
";",
"int",
"len",
"=",
"0",
";",
... | Get total command line length due to the input file.
@param outputDir
File output directory
@param inputFile
String input file
@return int characters added to command line for the input file. | [
"Get",
"total",
"command",
"line",
"length",
"due",
"to",
"the",
"input",
"file",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/compiler/CommandLineCompiler.java#L552-L559 |
sculptor/sculptor | sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/GeneratorMojo.java | GeneratorMojo.extendResources | private void extendResources(File resourceDir, boolean isTest) {
"""
Extends {@link MavenProject}s <code>Resources</code> and
<code>TestResources</code> (depending on <code>isTest</code>) with the
directories holding the generated resource artifacts.
<p>
There's no problem in adding the same directory multiple... | java | private void extendResources(File resourceDir, boolean isTest) {
List<Resource> resources = (isTest ? project.getTestResources() : project.getResources());
// Check if resource directory is already added
for (Resource resource : resources) {
if (resource.getDirectory().equalsIgnoreCase(resourceDir.getAbsolute... | [
"private",
"void",
"extendResources",
"(",
"File",
"resourceDir",
",",
"boolean",
"isTest",
")",
"{",
"List",
"<",
"Resource",
">",
"resources",
"=",
"(",
"isTest",
"?",
"project",
".",
"getTestResources",
"(",
")",
":",
"project",
".",
"getResources",
"(",
... | Extends {@link MavenProject}s <code>Resources</code> and
<code>TestResources</code> (depending on <code>isTest</code>) with the
directories holding the generated resource artifacts.
<p>
There's no problem in adding the same directory multiple times.
@param resourceDir
resource directory to be added
@param isTest
if <c... | [
"Extends",
"{",
"@link",
"MavenProject",
"}",
"s",
"<code",
">",
"Resources<",
"/",
"code",
">",
"and",
"<code",
">",
"TestResources<",
"/",
"code",
">",
"(",
"depending",
"on",
"<code",
">",
"isTest<",
"/",
"code",
">",
")",
"with",
"the",
"directories"... | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-maven/sculptor-maven-plugin/src/main/java/org/sculptor/maven/plugin/GeneratorMojo.java#L313-L330 |
aol/micro-server | micro-s3/src/main/java/com/oath/micro/server/s3/data/ReadUtils.java | ReadUtils.getInputStream | public InputStream getInputStream(String bucketName, String key, Supplier<File> tempFileSupplier)
throws AmazonServiceException, AmazonClientException, InterruptedException, IOException {
"""
Method returns InputStream from S3Object. Multi-part download is used to
get file. s3.tmp.dir property used to... | java | public InputStream getInputStream(String bucketName, String key, Supplier<File> tempFileSupplier)
throws AmazonServiceException, AmazonClientException, InterruptedException, IOException {
File file = tempFileSupplier.get();
try {
Download download = transferManager.download(bucke... | [
"public",
"InputStream",
"getInputStream",
"(",
"String",
"bucketName",
",",
"String",
"key",
",",
"Supplier",
"<",
"File",
">",
"tempFileSupplier",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
",",
"InterruptedException",
",",
"IOException",
... | Method returns InputStream from S3Object. Multi-part download is used to
get file. s3.tmp.dir property used to store temporary files. You can
specify temporary file name by using tempFileSupplier object.
@param bucketName
@param key
-
@param tempFileSupplier
- Supplier providing temporary filenames
@return InputStream... | [
"Method",
"returns",
"InputStream",
"from",
"S3Object",
".",
"Multi",
"-",
"part",
"download",
"is",
"used",
"to",
"get",
"file",
".",
"s3",
".",
"tmp",
".",
"dir",
"property",
"used",
"to",
"store",
"temporary",
"files",
".",
"You",
"can",
"specify",
"t... | train | https://github.com/aol/micro-server/blob/5c7103c5b43d2f4d16350dbd2f9802af307c63f7/micro-s3/src/main/java/com/oath/micro/server/s3/data/ReadUtils.java#L43-L54 |
zeromq/jeromq | src/main/java/org/zeromq/ZFrame.java | ZFrame.sendAndDestroy | public boolean sendAndDestroy(Socket socket, int flags) {
"""
Sends frame to socket if it contains data.
Use this method to send a frame and destroy the data after.
@param socket
0MQ socket to send frame
@param flags
Valid send() method flags, defined in org.zeromq.ZMQ class
@return
True if success, else Fa... | java | public boolean sendAndDestroy(Socket socket, int flags)
{
boolean ret = send(socket, flags);
if (ret) {
destroy();
}
return ret;
} | [
"public",
"boolean",
"sendAndDestroy",
"(",
"Socket",
"socket",
",",
"int",
"flags",
")",
"{",
"boolean",
"ret",
"=",
"send",
"(",
"socket",
",",
"flags",
")",
";",
"if",
"(",
"ret",
")",
"{",
"destroy",
"(",
")",
";",
"}",
"return",
"ret",
";",
"}... | Sends frame to socket if it contains data.
Use this method to send a frame and destroy the data after.
@param socket
0MQ socket to send frame
@param flags
Valid send() method flags, defined in org.zeromq.ZMQ class
@return
True if success, else False | [
"Sends",
"frame",
"to",
"socket",
"if",
"it",
"contains",
"data",
".",
"Use",
"this",
"method",
"to",
"send",
"a",
"frame",
"and",
"destroy",
"the",
"data",
"after",
"."
] | train | https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZFrame.java#L178-L185 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.trimToSize | public static String trimToSize(String source, int length, String suffix) {
"""
Returns a substring of the source, which is at most length characters long.<p>
If a char is cut, the given <code>suffix</code> is appended to the result.<p>
This is almost the same as calling {@link #trimToSize(String, int, int, ... | java | public static String trimToSize(String source, int length, String suffix) {
int area = (length > 100) ? length / 2 : length;
return trimToSize(source, length, area, suffix);
} | [
"public",
"static",
"String",
"trimToSize",
"(",
"String",
"source",
",",
"int",
"length",
",",
"String",
"suffix",
")",
"{",
"int",
"area",
"=",
"(",
"length",
">",
"100",
")",
"?",
"length",
"/",
"2",
":",
"length",
";",
"return",
"trimToSize",
"(",
... | Returns a substring of the source, which is at most length characters long.<p>
If a char is cut, the given <code>suffix</code> is appended to the result.<p>
This is almost the same as calling {@link #trimToSize(String, int, int, String)} with the
parameters <code>(source, length, length*, suffix)</code>. If <code>len... | [
"Returns",
"a",
"substring",
"of",
"the",
"source",
"which",
"is",
"at",
"most",
"length",
"characters",
"long",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L2164-L2168 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.indexOf | public static int indexOf(short[] array, short value) {
"""
返回数组中指定元素所在位置,未找到返回{@link #INDEX_NOT_FOUND}
@param array 数组
@param value 被检查的元素
@return 数组中指定元素所在位置,未找到返回{@link #INDEX_NOT_FOUND}
@since 3.0.7
"""
if (null != array) {
for (int i = 0; i < array.length; i++) {
if (value == array[i]) {... | java | public static int indexOf(short[] array, short value) {
if (null != array) {
for (int i = 0; i < array.length; i++) {
if (value == array[i]) {
return i;
}
}
}
return INDEX_NOT_FOUND;
} | [
"public",
"static",
"int",
"indexOf",
"(",
"short",
"[",
"]",
"array",
",",
"short",
"value",
")",
"{",
"if",
"(",
"null",
"!=",
"array",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
... | 返回数组中指定元素所在位置,未找到返回{@link #INDEX_NOT_FOUND}
@param array 数组
@param value 被检查的元素
@return 数组中指定元素所在位置,未找到返回{@link #INDEX_NOT_FOUND}
@since 3.0.7 | [
"返回数组中指定元素所在位置,未找到返回",
"{",
"@link",
"#INDEX_NOT_FOUND",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L1100-L1109 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/os/AsyncTask.java | AsyncTask.get | public final Result get(long timeout, TimeUnit unit) throws InterruptedException,
ExecutionException, TimeoutException {
"""
Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result.
@param timeout Time to wait before cancelling the operation.
@p... | java | public final Result get(long timeout, TimeUnit unit) throws InterruptedException,
ExecutionException, TimeoutException {
return mFuture.get(timeout, unit);
} | [
"public",
"final",
"Result",
"get",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
"{",
"return",
"mFuture",
".",
"get",
"(",
"timeout",
",",
"unit",
")",
";",
"}"
] | Waits if necessary for at most the given time for the computation
to complete, and then retrieves its result.
@param timeout Time to wait before cancelling the operation.
@param unit The time unit for the timeout.
@return The computed result.
@throws CancellationException If the computation was cancelled.
@throws Ex... | [
"Waits",
"if",
"necessary",
"for",
"at",
"most",
"the",
"given",
"time",
"for",
"the",
"computation",
"to",
"complete",
"and",
"then",
"retrieves",
"its",
"result",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/os/AsyncTask.java#L495-L498 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.addMessageJobDeclaration | protected void addMessageJobDeclaration(MessageJobDeclaration messageJobDeclaration, ActivityImpl activity, boolean exclusive) {
"""
Adds the new message job declaration to existing declarations.
There will be executed an existing check before the adding is executed.
@param messageJobDeclaration the new messag... | java | protected void addMessageJobDeclaration(MessageJobDeclaration messageJobDeclaration, ActivityImpl activity, boolean exclusive) {
ProcessDefinition procDef = (ProcessDefinition) activity.getProcessDefinition();
if (!exists(messageJobDeclaration, procDef.getKey(), activity.getActivityId())) {
messageJobDecl... | [
"protected",
"void",
"addMessageJobDeclaration",
"(",
"MessageJobDeclaration",
"messageJobDeclaration",
",",
"ActivityImpl",
"activity",
",",
"boolean",
"exclusive",
")",
"{",
"ProcessDefinition",
"procDef",
"=",
"(",
"ProcessDefinition",
")",
"activity",
".",
"getProcess... | Adds the new message job declaration to existing declarations.
There will be executed an existing check before the adding is executed.
@param messageJobDeclaration the new message job declaration
@param activity the corresponding activity
@param exclusive the flag which indicates if the async should be exclusive | [
"Adds",
"the",
"new",
"message",
"job",
"declaration",
"to",
"existing",
"declarations",
".",
"There",
"will",
"be",
"executed",
"an",
"existing",
"check",
"before",
"the",
"adding",
"is",
"executed",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1829-L1839 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.moveAll | public void moveAll(ParticleEmitter emitter, float x, float y) {
"""
Move all the particles owned by the specified emitter
@param emitter The emitter owning the particles that should be released
@param x The amount on the x axis to move the particles
@param y The amount on the y axis to move the particles
... | java | public void moveAll(ParticleEmitter emitter, float x, float y) {
ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
for (int i=0;i<pool.particles.length;i++) {
if (pool.particles[i].inUse()) {
pool.particles[i].move(x, y);
}
}
} | [
"public",
"void",
"moveAll",
"(",
"ParticleEmitter",
"emitter",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"ParticlePool",
"pool",
"=",
"(",
"ParticlePool",
")",
"particlesByEmitter",
".",
"get",
"(",
"emitter",
")",
";",
"for",
"(",
"int",
"i",
"="... | Move all the particles owned by the specified emitter
@param emitter The emitter owning the particles that should be released
@param x The amount on the x axis to move the particles
@param y The amount on the y axis to move the particles | [
"Move",
"all",
"the",
"particles",
"owned",
"by",
"the",
"specified",
"emitter"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L607-L614 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelBasicFormatter.java | HpelBasicFormatter.formatRecord | @Override
public String formatRecord(RepositoryLogRecord record, Locale locale) {
"""
Formats a RepositoryLogRecord into a localized basic format output String.
@param record the RepositoryLogRecord to be formatted
@param locale the Locale to use for localization when formatting this record.
@return the ... | java | @Override
public String formatRecord(RepositoryLogRecord record, Locale locale) {
if (null == record) {
throw new IllegalArgumentException("Record cannot be null");
}
StringBuilder sb = new StringBuilder(300);
String lineSeparatorPlusPadding = "";
// Use basic format
createEventHeader(record, sb);
l... | [
"@",
"Override",
"public",
"String",
"formatRecord",
"(",
"RepositoryLogRecord",
"record",
",",
"Locale",
"locale",
")",
"{",
"if",
"(",
"null",
"==",
"record",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Record cannot be null\"",
")",
";",
"}"... | Formats a RepositoryLogRecord into a localized basic format output String.
@param record the RepositoryLogRecord to be formatted
@param locale the Locale to use for localization when formatting this record.
@return the formated string output. | [
"Formats",
"a",
"RepositoryLogRecord",
"into",
"a",
"localized",
"basic",
"format",
"output",
"String",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/HpelBasicFormatter.java#L36-L58 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java | UndertowServletWebServerFactory.getUndertowWebServer | protected UndertowServletWebServer getUndertowWebServer(Builder builder,
DeploymentManager manager, int port) {
"""
Factory method called to create the {@link UndertowServletWebServer}. Subclasses
can override this method to return a different {@link UndertowServletWebServer} or
apply additional processing to... | java | protected UndertowServletWebServer getUndertowWebServer(Builder builder,
DeploymentManager manager, int port) {
return new UndertowServletWebServer(builder, manager, getContextPath(),
isUseForwardHeaders(), port >= 0, getCompression(), getServerHeader());
} | [
"protected",
"UndertowServletWebServer",
"getUndertowWebServer",
"(",
"Builder",
"builder",
",",
"DeploymentManager",
"manager",
",",
"int",
"port",
")",
"{",
"return",
"new",
"UndertowServletWebServer",
"(",
"builder",
",",
"manager",
",",
"getContextPath",
"(",
")",... | Factory method called to create the {@link UndertowServletWebServer}. Subclasses
can override this method to return a different {@link UndertowServletWebServer} or
apply additional processing to the {@link Builder} and {@link DeploymentManager}
used to bootstrap Undertow
@param builder the builder
@param manager the de... | [
"Factory",
"method",
"called",
"to",
"create",
"the",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java#L445-L449 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/Utils.java | Utils.createPackageFile | private static FileWriter createPackageFile(String name, String packageName, String directory, String outDir)
throws IOException {
"""
Create file in the package
@param name The name of the class
@param packageName The package name
@param directory layout directory
@param outDir output... | java | private static FileWriter createPackageFile(String name, String packageName, String directory, String outDir)
throws IOException
{
if (packageName != null && !packageName.trim().equals(""))
{
directory = directory + File.separatorChar +
packageName.replace('.', File.separ... | [
"private",
"static",
"FileWriter",
"createPackageFile",
"(",
"String",
"name",
",",
"String",
"packageName",
",",
"String",
"directory",
",",
"String",
"outDir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"packageName",
"!=",
"null",
"&&",
"!",
"packageName",... | Create file in the package
@param name The name of the class
@param packageName The package name
@param directory layout directory
@param outDir output directory
@return The file
@throws IOException Thrown if an error occurs | [
"Create",
"file",
"in",
"the",
"package"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/Utils.java#L134-L159 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.scale | public static void scale(ImageInputStream srcStream, ImageOutputStream destStream, int width, int height, Color fixedColor) throws IORuntimeException {
"""
缩放图像(按高度和宽度缩放)<br>
缩放后默认为jpeg格式,此方法并不关闭流
@param srcStream 源图像流
@param destStream 缩放后的图像目标流
@param width 缩放后的宽度
@param height 缩放后的高度
@param fixedColor 比... | java | public static void scale(ImageInputStream srcStream, ImageOutputStream destStream, int width, int height, Color fixedColor) throws IORuntimeException {
scale(read(srcStream), destStream, width, height, fixedColor);
} | [
"public",
"static",
"void",
"scale",
"(",
"ImageInputStream",
"srcStream",
",",
"ImageOutputStream",
"destStream",
",",
"int",
"width",
",",
"int",
"height",
",",
"Color",
"fixedColor",
")",
"throws",
"IORuntimeException",
"{",
"scale",
"(",
"read",
"(",
"srcStr... | 缩放图像(按高度和宽度缩放)<br>
缩放后默认为jpeg格式,此方法并不关闭流
@param srcStream 源图像流
@param destStream 缩放后的图像目标流
@param width 缩放后的宽度
@param height 缩放后的高度
@param fixedColor 比例不对时补充的颜色,不补充为<code>null</code>
@throws IORuntimeException IO异常 | [
"缩放图像(按高度和宽度缩放)<br",
">",
"缩放后默认为jpeg格式,此方法并不关闭流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L214-L216 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java | OperationSupport.handleReplace | protected <T> T handleReplace(T updated, Class<T> type, Map<String, String> parameters) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
"""
Replace a resource, optionally performing placeholder substitution to the response.
@param updated updated object
@param type typ... | java | protected <T> T handleReplace(T updated, Class<T> type, Map<String, String> parameters) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
RequestBody body = RequestBody.create(JSON, JSON_MAPPER.writeValueAsString(updated));
Request.Builder requestBuilder = new Request.Bui... | [
"protected",
"<",
"T",
">",
"T",
"handleReplace",
"(",
"T",
"updated",
",",
"Class",
"<",
"T",
">",
"type",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
",",
"KubernetesClientE... | Replace a resource, optionally performing placeholder substitution to the response.
@param updated updated object
@param type type of object provided
@param parameters a HashMap containing parameters for processing object
@param <T> template argument provided
@return returns de-serialized version of api server respon... | [
"Replace",
"a",
"resource",
"optionally",
"performing",
"placeholder",
"substitution",
"to",
"the",
"response",
"."
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java#L269-L273 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java | BigtableClusterUtilities.waitForOperation | public void waitForOperation(String operationName, int maxSeconds) throws InterruptedException {
"""
Waits for an operation like cluster resizing to complete.
@param operationName The fully qualified name of the operation
@param maxSeconds The maximum amount of seconds to wait for the operation to complete.
@th... | java | public void waitForOperation(String operationName, int maxSeconds) throws InterruptedException {
long endTimeMillis = TimeUnit.SECONDS.toMillis(maxSeconds) + System.currentTimeMillis();
GetOperationRequest request = GetOperationRequest.newBuilder().setName(operationName).build();
do {
Thread.sleep(50... | [
"public",
"void",
"waitForOperation",
"(",
"String",
"operationName",
",",
"int",
"maxSeconds",
")",
"throws",
"InterruptedException",
"{",
"long",
"endTimeMillis",
"=",
"TimeUnit",
".",
"SECONDS",
".",
"toMillis",
"(",
"maxSeconds",
")",
"+",
"System",
".",
"cu... | Waits for an operation like cluster resizing to complete.
@param operationName The fully qualified name of the operation
@param maxSeconds The maximum amount of seconds to wait for the operation to complete.
@throws InterruptedException if a user interrupts the process, usually with a ^C. | [
"Waits",
"for",
"an",
"operation",
"like",
"cluster",
"resizing",
"to",
"complete",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java#L251-L273 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/view/ViewFactory.java | ViewFactory.assembleViewClassName | public String assembleViewClassName(String packageRoot, String packagePrefix, String modelClassName) {
"""
Give the model name, return the view name.
@param packagePrefix The prefix package to place before the class name (if any).
@param modelClassName The Model's class name.
@return The class name for the view... | java | public String assembleViewClassName(String packageRoot, String packagePrefix, String modelClassName)
{
if (modelClassName.length() > 1)
if (Character.isUpperCase(modelClassName.charAt(1)))
if (modelClassName.charAt(0) == 'S')
modelClassName = modelClassName.su... | [
"public",
"String",
"assembleViewClassName",
"(",
"String",
"packageRoot",
",",
"String",
"packagePrefix",
",",
"String",
"modelClassName",
")",
"{",
"if",
"(",
"modelClassName",
".",
"length",
"(",
")",
">",
"1",
")",
"if",
"(",
"Character",
".",
"isUpperCase... | Give the model name, return the view name.
@param packagePrefix The prefix package to place before the class name (if any).
@param modelClassName The Model's class name.
@return The class name for the view. | [
"Give",
"the",
"model",
"name",
"return",
"the",
"view",
"name",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/view/ViewFactory.java#L178-L190 |
aws/aws-sdk-java | aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/TrainingJobDefinition.java | TrainingJobDefinition.withHyperParameters | public TrainingJobDefinition withHyperParameters(java.util.Map<String, String> hyperParameters) {
"""
<p>
The hyperparameters used for the training job.
</p>
@param hyperParameters
The hyperparameters used for the training job.
@return Returns a reference to this object so that method calls can be chained t... | java | public TrainingJobDefinition withHyperParameters(java.util.Map<String, String> hyperParameters) {
setHyperParameters(hyperParameters);
return this;
} | [
"public",
"TrainingJobDefinition",
"withHyperParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"hyperParameters",
")",
"{",
"setHyperParameters",
"(",
"hyperParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The hyperparameters used for the training job.
</p>
@param hyperParameters
The hyperparameters used for the training job.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"hyperparameters",
"used",
"for",
"the",
"training",
"job",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/TrainingJobDefinition.java#L230-L233 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/Record.java | Record.getUnits | public Number getUnits(int field) throws MPXJException {
"""
Accessor method used to retrieve a Number instance representing the
contents of an individual field. If the field does not exist in the
record, null is returned.
@param field the index number of the field to be retrieved
@return the value of the re... | java | public Number getUnits(int field) throws MPXJException
{
Number result;
if ((field < m_fields.length) && (m_fields[field].length() != 0))
{
try
{
result = Double.valueOf(m_formats.getUnitsDecimalFormat().parse(m_fields[field]).doubleValue() * 100);
}
... | [
"public",
"Number",
"getUnits",
"(",
"int",
"field",
")",
"throws",
"MPXJException",
"{",
"Number",
"result",
";",
"if",
"(",
"(",
"field",
"<",
"m_fields",
".",
"length",
")",
"&&",
"(",
"m_fields",
"[",
"field",
"]",
".",
"length",
"(",
")",
"!=",
... | Accessor method used to retrieve a Number instance representing the
contents of an individual field. If the field does not exist in the
record, null is returned.
@param field the index number of the field to be retrieved
@return the value of the required field
@throws MPXJException normally thrown when parsing fails | [
"Accessor",
"method",
"used",
"to",
"retrieve",
"a",
"Number",
"instance",
"representing",
"the",
"contents",
"of",
"an",
"individual",
"field",
".",
"If",
"the",
"field",
"does",
"not",
"exist",
"in",
"the",
"record",
"null",
"is",
"returned",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/Record.java#L509-L531 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/BuildTool.java | BuildTool.buildMeta | public static void buildMeta(Writer writer ,String indexType,String indexName, Object params,String action,ClientOptions clientOption,boolean upper7) throws IOException {
"""
String docIdKey,String parentIdKey,String routingKey
@param writer
@param indexType
@param indexName
@param params
@param action
@thro... | java | public static void buildMeta(Writer writer ,String indexType,String indexName, Object params,String action,ClientOptions clientOption,boolean upper7) throws IOException {
if(params instanceof Map){
buildMapMeta( writer , indexType, indexName, (Map) params, action, clientOption, upper7);
return;
}
Obje... | [
"public",
"static",
"void",
"buildMeta",
"(",
"Writer",
"writer",
",",
"String",
"indexType",
",",
"String",
"indexName",
",",
"Object",
"params",
",",
"String",
"action",
",",
"ClientOptions",
"clientOption",
",",
"boolean",
"upper7",
")",
"throws",
"IOExceptio... | String docIdKey,String parentIdKey,String routingKey
@param writer
@param indexType
@param indexName
@param params
@param action
@throws IOException | [
"String",
"docIdKey",
"String",
"parentIdKey",
"String",
"routingKey"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/BuildTool.java#L347-L369 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsBreadCrumb.java | CmsBreadCrumb.setEntries | public void setEntries(Map<String, String> entries) {
"""
Sets the bread crumb entries.<p>
@param entries the bread crumb entries
"""
String[][] entriesArray = null;
if ((entries != null) && !entries.isEmpty()) {
entriesArray = new String[entries.size()][];
int i = 0... | java | public void setEntries(Map<String, String> entries) {
String[][] entriesArray = null;
if ((entries != null) && !entries.isEmpty()) {
entriesArray = new String[entries.size()][];
int i = 0;
for (Entry<String, String> entry : entries.entrySet()) {
entri... | [
"public",
"void",
"setEntries",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"entries",
")",
"{",
"String",
"[",
"]",
"[",
"]",
"entriesArray",
"=",
"null",
";",
"if",
"(",
"(",
"entries",
"!=",
"null",
")",
"&&",
"!",
"entries",
".",
"isEmpty",
... | Sets the bread crumb entries.<p>
@param entries the bread crumb entries | [
"Sets",
"the",
"bread",
"crumb",
"entries",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsBreadCrumb.java#L60-L73 |
facebook/nailgun | nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java | NGCommunicator.readCommandContext | CommandContext readCommandContext() throws IOException {
"""
Get nail command context from the header and start reading for stdin and heartbeats
"""
// client info - command line arguments and environment
List<String> remoteArgs = new ArrayList();
Properties remoteEnv = new Properties();
String... | java | CommandContext readCommandContext() throws IOException {
// client info - command line arguments and environment
List<String> remoteArgs = new ArrayList();
Properties remoteEnv = new Properties();
String cwd = null; // working directory
String command = null; // alias or class name
// read every... | [
"CommandContext",
"readCommandContext",
"(",
")",
"throws",
"IOException",
"{",
"// client info - command line arguments and environment",
"List",
"<",
"String",
">",
"remoteArgs",
"=",
"new",
"ArrayList",
"(",
")",
";",
"Properties",
"remoteEnv",
"=",
"new",
"Propertie... | Get nail command context from the header and start reading for stdin and heartbeats | [
"Get",
"nail",
"command",
"context",
"from",
"the",
"header",
"and",
"start",
"reading",
"for",
"stdin",
"and",
"heartbeats"
] | train | https://github.com/facebook/nailgun/blob/948c51c5fce138c65bb3df369c3f7b4d01440605/nailgun-server/src/main/java/com/facebook/nailgun/NGCommunicator.java#L129-L178 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/index/btree/BTreeLeaf.java | BTreeLeaf.moveTo | private void moveTo(long blkNum, int slot) {
"""
Opens the page for the specified block and moves the current slot to the
specified position.
"""
moveFrom = currentPage.currentBlk().number(); // for deletion
BlockId blk = new BlockId(currentPage.currentBlk().fileName(), blkNum);
ccMgr.readLeafBlock(b... | java | private void moveTo(long blkNum, int slot) {
moveFrom = currentPage.currentBlk().number(); // for deletion
BlockId blk = new BlockId(currentPage.currentBlk().fileName(), blkNum);
ccMgr.readLeafBlock(blk);
currentPage.close();
currentPage = new BTreePage(blk, NUM_FLAGS, schema, tx);
currentSlot = slot;... | [
"private",
"void",
"moveTo",
"(",
"long",
"blkNum",
",",
"int",
"slot",
")",
"{",
"moveFrom",
"=",
"currentPage",
".",
"currentBlk",
"(",
")",
".",
"number",
"(",
")",
";",
"// for deletion\r",
"BlockId",
"blk",
"=",
"new",
"BlockId",
"(",
"currentPage",
... | Opens the page for the specified block and moves the current slot to the
specified position. | [
"Opens",
"the",
"page",
"for",
"the",
"specified",
"block",
"and",
"moves",
"the",
"current",
"slot",
"to",
"the",
"specified",
"position",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/index/btree/BTreeLeaf.java#L464-L471 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java | SessionManagerUtil.parseSipApplicationSessionKey | public static SipApplicationSessionKey parseSipApplicationSessionKey(
String sipApplicationKey) throws ParseException {
"""
Parse a sip application key that was previously generated and put as an http request param
through the encodeURL method of SipApplicationSession
@param sipApplicationKey the stringified... | java | public static SipApplicationSessionKey parseSipApplicationSessionKey(
String sipApplicationKey) throws ParseException {
int indexOfComma = sipApplicationKey.indexOf(SESSION_KEY_SEPARATOR);
if(indexOfComma == -1) {
throw new ParseException("The comma could not be found in the following key " + sipApp... | [
"public",
"static",
"SipApplicationSessionKey",
"parseSipApplicationSessionKey",
"(",
"String",
"sipApplicationKey",
")",
"throws",
"ParseException",
"{",
"int",
"indexOfComma",
"=",
"sipApplicationKey",
".",
"indexOf",
"(",
"SESSION_KEY_SEPARATOR",
")",
";",
"if",
"(",
... | Parse a sip application key that was previously generated and put as an http request param
through the encodeURL method of SipApplicationSession
@param sipApplicationKey the stringified version of the sip application key
@return the corresponding sip application session key
@throws ParseException if the stringfied key ... | [
"Parse",
"a",
"sip",
"application",
"key",
"that",
"was",
"previously",
"generated",
"and",
"put",
"as",
"an",
"http",
"request",
"param",
"through",
"the",
"encodeURL",
"method",
"of",
"SipApplicationSession"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SessionManagerUtil.java#L134-L157 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/googlecode/eyesfree/utils/ClassLoadingManager.java | ClassLoadingManager.checkInstanceOf | public boolean checkInstanceOf(Context context, CharSequence targetClassName,
CharSequence loaderPackage, CharSequence referenceClassName) {
"""
Returns whether a target class is an instance of a reference class.
<p>
If a class cannot be loaded by the default {@link ClassLoader}, this
method will at... | java | public boolean checkInstanceOf(Context context, CharSequence targetClassName,
CharSequence loaderPackage, CharSequence referenceClassName) {
if ((targetClassName == null) || (referenceClassName == null)) {
return false;
}
// Try a shortcut for efficiency.
if (Tex... | [
"public",
"boolean",
"checkInstanceOf",
"(",
"Context",
"context",
",",
"CharSequence",
"targetClassName",
",",
"CharSequence",
"loaderPackage",
",",
"CharSequence",
"referenceClassName",
")",
"{",
"if",
"(",
"(",
"targetClassName",
"==",
"null",
")",
"||",
"(",
"... | Returns whether a target class is an instance of a reference class.
<p>
If a class cannot be loaded by the default {@link ClassLoader}, this
method will attempt to use the loader for the specified app package.
</p> | [
"Returns",
"whether",
"a",
"target",
"class",
"is",
"an",
"instance",
"of",
"a",
"reference",
"class",
".",
"<p",
">",
"If",
"a",
"class",
"cannot",
"be",
"loaded",
"by",
"the",
"default",
"{"
] | train | https://github.com/google/Accessibility-Test-Framework-for-Android/blob/a6117fe0059c82dd764fa628d3817d724570f69e/src/main/java/com/googlecode/eyesfree/utils/ClassLoadingManager.java#L211-L229 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.metersToPixelsWithScaleFactor | public static double metersToPixelsWithScaleFactor(float meters, double latitude, double scaleFactor, int tileSize) {
"""
Converts meters to pixels at latitude for zoom-level.
@param meters the meters to convert
@param latitude the latitude for the conversion.
@param scaleFactor the scale factor for t... | java | public static double metersToPixelsWithScaleFactor(float meters, double latitude, double scaleFactor, int tileSize) {
return meters / MercatorProjection.calculateGroundResolutionWithScaleFactor(latitude, scaleFactor, tileSize);
} | [
"public",
"static",
"double",
"metersToPixelsWithScaleFactor",
"(",
"float",
"meters",
",",
"double",
"latitude",
",",
"double",
"scaleFactor",
",",
"int",
"tileSize",
")",
"{",
"return",
"meters",
"/",
"MercatorProjection",
".",
"calculateGroundResolutionWithScaleFacto... | Converts meters to pixels at latitude for zoom-level.
@param meters the meters to convert
@param latitude the latitude for the conversion.
@param scaleFactor the scale factor for the conversion.
@return pixels that represent the meters at the given zoom-level and latitude. | [
"Converts",
"meters",
"to",
"pixels",
"at",
"latitude",
"for",
"zoom",
"-",
"level",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L312-L314 |
soi-toolkit/soi-toolkit-mule | commons/components/module-logger/src/main/java/org/soitoolkit/commons/module/logger/SoitoolkitLoggerModule.java | SoitoolkitLoggerModule.logTrace | @Processor
public Object logTrace(
String message,
@Optional String integrationScenario,
@Optional String contractId,
@Optional String correlationId,
@Optional Map<String, String> extra) {
"""
Log processor for level TRACE
{@sample.xml ../../../doc/SoitoolkitLogger-connector.xml.... | java | @Processor
public Object logTrace(
String message,
@Optional String integrationScenario,
@Optional String contractId,
@Optional String correlationId,
@Optional Map<String, String> extra) {
return doLog(LogLevelType.TRACE, message, integrationScenario, contractId, correlationId, ext... | [
"@",
"Processor",
"public",
"Object",
"logTrace",
"(",
"String",
"message",
",",
"@",
"Optional",
"String",
"integrationScenario",
",",
"@",
"Optional",
"String",
"contractId",
",",
"@",
"Optional",
"String",
"correlationId",
",",
"@",
"Optional",
"Map",
"<",
... | Log processor for level TRACE
{@sample.xml ../../../doc/SoitoolkitLogger-connector.xml.sample soitoolkitlogger:log}
@param message Log-message to be processed
@param integrationScenario Optional name of the integration scenario or business process
@param contractId Optional name of the contract in use
@param correlat... | [
"Log",
"processor",
"for",
"level",
"TRACE"
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/module-logger/src/main/java/org/soitoolkit/commons/module/logger/SoitoolkitLoggerModule.java#L98-L107 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobQueueClient.java | JobQueueClient.displayQueueInfo | private void displayQueueInfo(String queue, boolean showJobs) throws IOException {
"""
Method used to display information pertaining to a Single JobQueue
registered with the {@link QueueManager}. Display of the Jobs is
determine by the boolean
@throws IOException
"""
JobQueueInfo schedInfo = jc.getQue... | java | private void displayQueueInfo(String queue, boolean showJobs) throws IOException {
JobQueueInfo schedInfo = jc.getQueueInfo(queue);
if (schedInfo == null) {
System.out.printf("Queue Name : %s has no scheduling information \n", queue);
} else {
System.out.printf("Queue Name : %s \n", schedInfo.ge... | [
"private",
"void",
"displayQueueInfo",
"(",
"String",
"queue",
",",
"boolean",
"showJobs",
")",
"throws",
"IOException",
"{",
"JobQueueInfo",
"schedInfo",
"=",
"jc",
".",
"getQueueInfo",
"(",
"queue",
")",
";",
"if",
"(",
"schedInfo",
"==",
"null",
")",
"{",... | Method used to display information pertaining to a Single JobQueue
registered with the {@link QueueManager}. Display of the Jobs is
determine by the boolean
@throws IOException | [
"Method",
"used",
"to",
"display",
"information",
"pertaining",
"to",
"a",
"Single",
"JobQueue",
"registered",
"with",
"the",
"{",
"@link",
"QueueManager",
"}",
".",
"Display",
"of",
"the",
"Jobs",
"is",
"determine",
"by",
"the",
"boolean"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobQueueClient.java#L114-L129 |
twilio/twilio-java | src/main/java/com/twilio/rest/proxy/v1/service/session/InteractionReader.java | InteractionReader.previousPage | @Override
public Page<Interaction> previousPage(final Page<Interaction> page,
final TwilioRestClient client) {
"""
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previ... | java | @Override
public Page<Interaction> previousPage(final Page<Interaction> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.PROXY.toString(),
... | [
"@",
"Override",
"public",
"Page",
"<",
"Interaction",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"Interaction",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/proxy/v1/service/session/InteractionReader.java#L118-L129 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java | ODataRendererUtils.getContextURL | public static String getContextURL(ODataUri oDataUri, EntityDataModel entityDataModel) throws ODataRenderException {
"""
This method returns odata context based on oDataUri.
Throws ODataRenderException in case context is not defined.
@param entityDataModel The entity data model.
@param oDataUri is obje... | java | public static String getContextURL(ODataUri oDataUri, EntityDataModel entityDataModel) throws ODataRenderException {
return getContextURL(oDataUri, entityDataModel, false);
} | [
"public",
"static",
"String",
"getContextURL",
"(",
"ODataUri",
"oDataUri",
",",
"EntityDataModel",
"entityDataModel",
")",
"throws",
"ODataRenderException",
"{",
"return",
"getContextURL",
"(",
"oDataUri",
",",
"entityDataModel",
",",
"false",
")",
";",
"}"
] | This method returns odata context based on oDataUri.
Throws ODataRenderException in case context is not defined.
@param entityDataModel The entity data model.
@param oDataUri is object which is the root of an abstract syntax tree that describes
@return string that represents context
@throws ODataRenderException... | [
"This",
"method",
"returns",
"odata",
"context",
"based",
"on",
"oDataUri",
".",
"Throws",
"ODataRenderException",
"in",
"case",
"context",
"is",
"not",
"defined",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/ODataRendererUtils.java#L51-L53 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_ownLogs_id_userLogs_login_changePassword_POST | public String serviceName_ownLogs_id_userLogs_login_changePassword_POST(String serviceName, Long id, String login, String password) throws IOException {
"""
Request a password change
REST: POST /hosting/web/{serviceName}/ownLogs/{id}/userLogs/{login}/changePassword
@param password [required] The new userLogs p... | java | public String serviceName_ownLogs_id_userLogs_login_changePassword_POST(String serviceName, Long id, String login, String password) throws IOException {
String qPath = "/hosting/web/{serviceName}/ownLogs/{id}/userLogs/{login}/changePassword";
StringBuilder sb = path(qPath, serviceName, id, login);
HashMap<String,... | [
"public",
"String",
"serviceName_ownLogs_id_userLogs_login_changePassword_POST",
"(",
"String",
"serviceName",
",",
"Long",
"id",
",",
"String",
"login",
",",
"String",
"password",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/ow... | Request a password change
REST: POST /hosting/web/{serviceName}/ownLogs/{id}/userLogs/{login}/changePassword
@param password [required] The new userLogs password
@param serviceName [required] The internal name of your hosting
@param id [required] Id of the object
@param login [required] The userLogs login used to conn... | [
"Request",
"a",
"password",
"change"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1050-L1057 |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/ServerListSubsetFilter.java | ServerListSubsetFilter.compare | @Override
public int compare(T server1, T server2) {
"""
Function to sort the list by server health condition, with
unhealthy servers before healthy servers. The servers are first sorted by
failures count, and then concurrent connection count.
"""
LoadBalancerStats lbStats = getLoadBalancerStats(... | java | @Override
public int compare(T server1, T server2) {
LoadBalancerStats lbStats = getLoadBalancerStats();
ServerStats stats1 = lbStats.getSingleServerStat(server1);
ServerStats stats2 = lbStats.getSingleServerStat(server2);
int failuresDiff = (int) (stats2.getFailureCount() - stats1.g... | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"T",
"server1",
",",
"T",
"server2",
")",
"{",
"LoadBalancerStats",
"lbStats",
"=",
"getLoadBalancerStats",
"(",
")",
";",
"ServerStats",
"stats1",
"=",
"lbStats",
".",
"getSingleServerStat",
"(",
"server1",
")... | Function to sort the list by server health condition, with
unhealthy servers before healthy servers. The servers are first sorted by
failures count, and then concurrent connection count. | [
"Function",
"to",
"sort",
"the",
"list",
"by",
"server",
"health",
"condition",
"with",
"unhealthy",
"servers",
"before",
"healthy",
"servers",
".",
"The",
"servers",
"are",
"first",
"sorted",
"by",
"failures",
"count",
"and",
"then",
"concurrent",
"connection",... | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/ServerListSubsetFilter.java#L193-L204 |
jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/KeyOutWriter.java | KeyOutWriter.internalWrite | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
"""
The meat of the output. Reuses the GraphiteWriter2 class but writes in a logfile
instead of a network socket.
"""
graphiteWriter.write(logwriter, server, query, results);
} | java | @Override
public void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {
graphiteWriter.write(logwriter, server, query, results);
} | [
"@",
"Override",
"public",
"void",
"internalWrite",
"(",
"Server",
"server",
",",
"Query",
"query",
",",
"ImmutableList",
"<",
"Result",
">",
"results",
")",
"throws",
"Exception",
"{",
"graphiteWriter",
".",
"write",
"(",
"logwriter",
",",
"server",
",",
"q... | The meat of the output. Reuses the GraphiteWriter2 class but writes in a logfile
instead of a network socket. | [
"The",
"meat",
"of",
"the",
"output",
".",
"Reuses",
"the",
"GraphiteWriter2",
"class",
"but",
"writes",
"in",
"a",
"logfile",
"instead",
"of",
"a",
"network",
"socket",
"."
] | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-logback/src/main/java/com/googlecode/jmxtrans/model/output/KeyOutWriter.java#L193-L196 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java | GVRPointLight.setSpecularIntensity | public void setSpecularIntensity(float r, float g, float b, float a) {
"""
Set the specular intensity of the light.
This designates the color of the specular reflection.
It is multiplied by the material specular color to derive
the hue of the specular reflection for that material.
The built-in phong shader {... | java | public void setSpecularIntensity(float r, float g, float b, float a) {
setVec4("specular_intensity", r, g, b, a);
} | [
"public",
"void",
"setSpecularIntensity",
"(",
"float",
"r",
",",
"float",
"g",
",",
"float",
"b",
",",
"float",
"a",
")",
"{",
"setVec4",
"(",
"\"specular_intensity\"",
",",
"r",
",",
"g",
",",
"b",
",",
"a",
")",
";",
"}"
] | Set the specular intensity of the light.
This designates the color of the specular reflection.
It is multiplied by the material specular color to derive
the hue of the specular reflection for that material.
The built-in phong shader {@link GVRPhongShader} uses a {@code vec4} uniform named
{@code specular_intensity} to... | [
"Set",
"the",
"specular",
"intensity",
"of",
"the",
"light",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java#L183-L185 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java | MSPDIWriter.writeCostRateTables | private void writeCostRateTables(Project.Resources.Resource xml, Resource mpx) {
"""
Writes a resource's cost rate tables.
@param xml MSPDI resource
@param mpx MPXJ resource
"""
//Rates rates = m_factory.createProjectResourcesResourceRates();
//xml.setRates(rates);
//List<Project.Resource... | java | private void writeCostRateTables(Project.Resources.Resource xml, Resource mpx)
{
//Rates rates = m_factory.createProjectResourcesResourceRates();
//xml.setRates(rates);
//List<Project.Resources.Resource.Rates.Rate> ratesList = rates.getRate();
List<Project.Resources.Resource.Rates.Rate> rate... | [
"private",
"void",
"writeCostRateTables",
"(",
"Project",
".",
"Resources",
".",
"Resource",
"xml",
",",
"Resource",
"mpx",
")",
"{",
"//Rates rates = m_factory.createProjectResourcesResourceRates();",
"//xml.setRates(rates);",
"//List<Project.Resources.Resource.Rates.Rate> ratesLi... | Writes a resource's cost rate tables.
@param xml MSPDI resource
@param mpx MPXJ resource | [
"Writes",
"a",
"resource",
"s",
"cost",
"rate",
"tables",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java#L945-L986 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.copyNameAnnotations | static void copyNameAnnotations(Node source, Node destination) {
"""
Copy any annotations that follow a named value.
@param source
@param destination
"""
if (source.getBooleanProp(Node.IS_CONSTANT_NAME)) {
destination.putBooleanProp(Node.IS_CONSTANT_NAME, true);
}
} | java | static void copyNameAnnotations(Node source, Node destination) {
if (source.getBooleanProp(Node.IS_CONSTANT_NAME)) {
destination.putBooleanProp(Node.IS_CONSTANT_NAME, true);
}
} | [
"static",
"void",
"copyNameAnnotations",
"(",
"Node",
"source",
",",
"Node",
"destination",
")",
"{",
"if",
"(",
"source",
".",
"getBooleanProp",
"(",
"Node",
".",
"IS_CONSTANT_NAME",
")",
")",
"{",
"destination",
".",
"putBooleanProp",
"(",
"Node",
".",
"IS... | Copy any annotations that follow a named value.
@param source
@param destination | [
"Copy",
"any",
"annotations",
"that",
"follow",
"a",
"named",
"value",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L3927-L3931 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java | AbstractAsymmetricCrypto.decryptFromBcd | public byte[] decryptFromBcd(String data, KeyType keyType) {
"""
解密BCD
@param data 数据
@param keyType 密钥类型
@return 解密后的密文
@since 4.1.0
"""
return decryptFromBcd(data, keyType, CharsetUtil.CHARSET_UTF_8);
} | java | public byte[] decryptFromBcd(String data, KeyType keyType) {
return decryptFromBcd(data, keyType, CharsetUtil.CHARSET_UTF_8);
} | [
"public",
"byte",
"[",
"]",
"decryptFromBcd",
"(",
"String",
"data",
",",
"KeyType",
"keyType",
")",
"{",
"return",
"decryptFromBcd",
"(",
"data",
",",
"keyType",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
")",
";",
"}"
] | 解密BCD
@param data 数据
@param keyType 密钥类型
@return 解密后的密文
@since 4.1.0 | [
"解密BCD"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/AbstractAsymmetricCrypto.java#L283-L285 |
biezhi/webp-io | src/main/java/io/github/biezhi/webp/WebpIO.java | WebpIO.toNormalImage | public void toNormalImage(File src, File dest) {
"""
Converter webp file to normal image
@param src webp file path
@param dest normal image path
"""
String command = commandDir + (dest.getName().endsWith(".gif") ? "/gif2webp" : "/dwebp ") + src.getPath() + " -o " + dest.getPath();
this.exe... | java | public void toNormalImage(File src, File dest) {
String command = commandDir + (dest.getName().endsWith(".gif") ? "/gif2webp" : "/dwebp ") + src.getPath() + " -o " + dest.getPath();
this.executeCommand(command);
} | [
"public",
"void",
"toNormalImage",
"(",
"File",
"src",
",",
"File",
"dest",
")",
"{",
"String",
"command",
"=",
"commandDir",
"+",
"(",
"dest",
".",
"getName",
"(",
")",
".",
"endsWith",
"(",
"\".gif\"",
")",
"?",
"\"/gif2webp\"",
":",
"\"/dwebp \"",
")"... | Converter webp file to normal image
@param src webp file path
@param dest normal image path | [
"Converter",
"webp",
"file",
"to",
"normal",
"image"
] | train | https://github.com/biezhi/webp-io/blob/8eefe535087b3abccacff76de2b6e27bb7301bcc/src/main/java/io/github/biezhi/webp/WebpIO.java#L86-L89 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/Console.java | Console.readLine | public String readLine(String format, Object... args) {
"""
Reads a line from this console, using the specified prompt.
The prompt is given as a format string and optional arguments.
Note that this can be a source of errors: if it is possible that your
prompt contains {@code %} characters, you must use the form... | java | public String readLine(String format, Object... args) {
synchronized (CONSOLE_LOCK) {
format(format, args);
return readLine();
}
} | [
"public",
"String",
"readLine",
"(",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"synchronized",
"(",
"CONSOLE_LOCK",
")",
"{",
"format",
"(",
"format",
",",
"args",
")",
";",
"return",
"readLine",
"(",
")",
";",
"}",
"}"
] | Reads a line from this console, using the specified prompt.
The prompt is given as a format string and optional arguments.
Note that this can be a source of errors: if it is possible that your
prompt contains {@code %} characters, you must use the format string {@code "%s"}
and pass the actual prompt as a parameter.
@... | [
"Reads",
"a",
"line",
"from",
"this",
"console",
"using",
"the",
"specified",
"prompt",
".",
"The",
"prompt",
"is",
"given",
"as",
"a",
"format",
"string",
"and",
"optional",
"arguments",
".",
"Note",
"that",
"this",
"can",
"be",
"a",
"source",
"of",
"er... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/Console.java#L123-L128 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/WritableName.java | WritableName.setName | public static synchronized void setName(Class writableClass, String name) {
"""
Set the name that a class should be known as to something other than the
class name.
"""
CLASS_TO_NAME.put(writableClass, name);
NAME_TO_CLASS.put(name, writableClass);
} | java | public static synchronized void setName(Class writableClass, String name) {
CLASS_TO_NAME.put(writableClass, name);
NAME_TO_CLASS.put(name, writableClass);
} | [
"public",
"static",
"synchronized",
"void",
"setName",
"(",
"Class",
"writableClass",
",",
"String",
"name",
")",
"{",
"CLASS_TO_NAME",
".",
"put",
"(",
"writableClass",
",",
"name",
")",
";",
"NAME_TO_CLASS",
".",
"put",
"(",
"name",
",",
"writableClass",
"... | Set the name that a class should be known as to something other than the
class name. | [
"Set",
"the",
"name",
"that",
"a",
"class",
"should",
"be",
"known",
"as",
"to",
"something",
"other",
"than",
"the",
"class",
"name",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/WritableName.java#L46-L49 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/ExistPolicyIndex.java | ExistPolicyIndex.sortDescending | protected static String[] sortDescending(String[] s) {
"""
sorts a string array in descending order of length
@param s
@return
"""
Arrays.sort(s,
new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
if (o1.length(... | java | protected static String[] sortDescending(String[] s) {
Arrays.sort(s,
new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
if (o1.length() < o2.length())
return 1;
if (o1.length() > o2.len... | [
"protected",
"static",
"String",
"[",
"]",
"sortDescending",
"(",
"String",
"[",
"]",
"s",
")",
"{",
"Arrays",
".",
"sort",
"(",
"s",
",",
"new",
"Comparator",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"compare",
"(",
"Stri... | sorts a string array in descending order of length
@param s
@return | [
"sorts",
"a",
"string",
"array",
"in",
"descending",
"order",
"of",
"length"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/ExistPolicyIndex.java#L342-L356 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/filecache/DistributedCache.java | DistributedCache.addCacheArchive | public static void addCacheArchive(URI uri, Configuration conf) {
"""
Add a archives to be localized to the conf
@param uri The uri of the cache to be localized
@param conf Configuration to add the cache to
"""
String archives = conf.get("mapred.cache.archives");
conf.set("mapred.cache.archives", arc... | java | public static void addCacheArchive(URI uri, Configuration conf) {
String archives = conf.get("mapred.cache.archives");
conf.set("mapred.cache.archives", archives == null ? uri.toString()
: archives + "," + uri.toString());
} | [
"public",
"static",
"void",
"addCacheArchive",
"(",
"URI",
"uri",
",",
"Configuration",
"conf",
")",
"{",
"String",
"archives",
"=",
"conf",
".",
"get",
"(",
"\"mapred.cache.archives\"",
")",
";",
"conf",
".",
"set",
"(",
"\"mapred.cache.archives\"",
",",
"arc... | Add a archives to be localized to the conf
@param uri The uri of the cache to be localized
@param conf Configuration to add the cache to | [
"Add",
"a",
"archives",
"to",
"be",
"localized",
"to",
"the",
"conf"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/filecache/DistributedCache.java#L923-L927 |
phax/ph-oton | ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java | FineUploader5Request.addCustomHeaders | @Nonnull
public FineUploader5Request addCustomHeaders (@Nullable final Map <String, String> aCustomHeaders) {
"""
Additional headers sent along with each upload request.
@param aCustomHeaders
Custom headers to be added.
@return this
"""
m_aRequestCustomHeaders.addAll (aCustomHeaders);
return thi... | java | @Nonnull
public FineUploader5Request addCustomHeaders (@Nullable final Map <String, String> aCustomHeaders)
{
m_aRequestCustomHeaders.addAll (aCustomHeaders);
return this;
} | [
"@",
"Nonnull",
"public",
"FineUploader5Request",
"addCustomHeaders",
"(",
"@",
"Nullable",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"aCustomHeaders",
")",
"{",
"m_aRequestCustomHeaders",
".",
"addAll",
"(",
"aCustomHeaders",
")",
";",
"return",
"this",
... | Additional headers sent along with each upload request.
@param aCustomHeaders
Custom headers to be added.
@return this | [
"Additional",
"headers",
"sent",
"along",
"with",
"each",
"upload",
"request",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload5/FineUploader5Request.java#L92-L97 |
kaichunlin/android-transition | core/src/main/java/com/kaichunlin/transition/AbstractTransitionBuilder.java | AbstractTransitionBuilder.transitFloat | public T transitFloat(int propertyId, float... vals) {
"""
Transits a float propertyId from the start value to the end value.
@param propertyId
@param vals
@return self
"""
String property = getPropertyName(propertyId);
mHolders.put(propertyId, PropertyValuesHolder.ofFloat(property, vals))... | java | public T transitFloat(int propertyId, float... vals) {
String property = getPropertyName(propertyId);
mHolders.put(propertyId, PropertyValuesHolder.ofFloat(property, vals));
mShadowHolders.put(propertyId, ShadowValuesHolder.ofFloat(property, vals));
return self();
} | [
"public",
"T",
"transitFloat",
"(",
"int",
"propertyId",
",",
"float",
"...",
"vals",
")",
"{",
"String",
"property",
"=",
"getPropertyName",
"(",
"propertyId",
")",
";",
"mHolders",
".",
"put",
"(",
"propertyId",
",",
"PropertyValuesHolder",
".",
"ofFloat",
... | Transits a float propertyId from the start value to the end value.
@param propertyId
@param vals
@return self | [
"Transits",
"a",
"float",
"propertyId",
"from",
"the",
"start",
"value",
"to",
"the",
"end",
"value",
"."
] | train | https://github.com/kaichunlin/android-transition/blob/7b53074206622f5cf5d82091d891a7ed8b9f06cd/core/src/main/java/com/kaichunlin/transition/AbstractTransitionBuilder.java#L642-L647 |
rackerlabs/clouddocs-maven-plugin | src/main/java/com/rackspace/cloud/api/docs/CalabashHelper.java | CalabashHelper.createSource | public static Source createSource(Log log, Source source, String pipelineURI, Map<String, Object> map)
throws MojoExecutionException {
"""
Creates a {@link Source} for use in a Calabash pipeline.
<p>The {@code map} values may instances of {@link String}, {@link File},
{@link URI}, or {@link URL}.</... | java | public static Source createSource(Log log, Source source, String pipelineURI, Map<String, Object> map)
throws MojoExecutionException {
try {
if (!(source instanceof SAXSource)) {
throw new MojoExecutionException("Expecting a SAXSource");
}
SAXSour... | [
"public",
"static",
"Source",
"createSource",
"(",
"Log",
"log",
",",
"Source",
"source",
",",
"String",
"pipelineURI",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"throws",
"MojoExecutionException",
"{",
"try",
"{",
"if",
"(",
"!",
"(",
"... | Creates a {@link Source} for use in a Calabash pipeline.
<p>The {@code map} values may instances of {@link String}, {@link File},
{@link URI}, or {@link URL}.</p>
<ul>
<li>{@link String}: These are passed to the pipeline unchanged.</li>
<li>{@link URI}: The results of {@link URI#toString()} is passed to the pipeline.... | [
"Creates",
"a",
"{",
"@link",
"Source",
"}",
"for",
"use",
"in",
"a",
"Calabash",
"pipeline",
"."
] | train | https://github.com/rackerlabs/clouddocs-maven-plugin/blob/ba8554dc340db674307efdaac647c6fd2b58a34b/src/main/java/com/rackspace/cloud/api/docs/CalabashHelper.java#L113-L127 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamselector.java | streamselector.get | public static streamselector get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch streamselector resource of given name .
"""
streamselector obj = new streamselector();
obj.set_name(name);
streamselector response = (streamselector) obj.get_resource(service);
return respo... | java | public static streamselector get(nitro_service service, String name) throws Exception{
streamselector obj = new streamselector();
obj.set_name(name);
streamselector response = (streamselector) obj.get_resource(service);
return response;
} | [
"public",
"static",
"streamselector",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"streamselector",
"obj",
"=",
"new",
"streamselector",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"stream... | Use this API to fetch streamselector resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"streamselector",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/stream/streamselector.java#L234-L239 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.leftShift | public static OutputStream leftShift(OutputStream self, byte[] value) throws IOException {
"""
Overloads the leftShift operator to provide an append mechanism to add bytes to a stream.
@param self an OutputStream
@param value a value to append
@return an OutputStream
@throws IOException if an I/O error occu... | java | public static OutputStream leftShift(OutputStream self, byte[] value) throws IOException {
self.write(value);
self.flush();
return self;
} | [
"public",
"static",
"OutputStream",
"leftShift",
"(",
"OutputStream",
"self",
",",
"byte",
"[",
"]",
"value",
")",
"throws",
"IOException",
"{",
"self",
".",
"write",
"(",
"value",
")",
";",
"self",
".",
"flush",
"(",
")",
";",
"return",
"self",
";",
"... | Overloads the leftShift operator to provide an append mechanism to add bytes to a stream.
@param self an OutputStream
@param value a value to append
@return an OutputStream
@throws IOException if an I/O error occurs.
@since 1.0 | [
"Overloads",
"the",
"leftShift",
"operator",
"to",
"provide",
"an",
"append",
"mechanism",
"to",
"add",
"bytes",
"to",
"a",
"stream",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L225-L229 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobExecutionsInner.java | JobExecutionsInner.listByAgentWithServiceResponseAsync | public Observable<ServiceResponse<Page<JobExecutionInner>>> listByAgentWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String jobAgentName) {
"""
Lists all executions in a job agent.
@param resourceGroupName The name of the resource group that contains the resource. You c... | java | public Observable<ServiceResponse<Page<JobExecutionInner>>> listByAgentWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String jobAgentName) {
return listByAgentSinglePageAsync(resourceGroupName, serverName, jobAgentName)
.concatMap(new Func1<ServiceResponse<Pa... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"JobExecutionInner",
">",
">",
">",
"listByAgentWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"jobAgentName",
")",... | Lists all executions in a job agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@throws IllegalArgumentException... | [
"Lists",
"all",
"executions",
"in",
"a",
"job",
"agent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobExecutionsInner.java#L177-L189 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoFactoryBuilder.java | BindDaoFactoryBuilder.buildDaoFactoryInterfaceInternal | public TypeSpec.Builder buildDaoFactoryInterfaceInternal(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception {
"""
Build dao factory interface.
@param elementUtils the element utils
@param filer the filer
@param schema the schema
@return schema typeName
@throws Exception the ex... | java | public TypeSpec.Builder buildDaoFactoryInterfaceInternal(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception {
String schemaName = buildDaoFactoryName(schema);
classBuilder = TypeSpec.interfaceBuilder(schemaName).addModifiers(Modifier.PUBLIC).addSuperinterface(BindDaoFactory.class);
... | [
"public",
"TypeSpec",
".",
"Builder",
"buildDaoFactoryInterfaceInternal",
"(",
"Elements",
"elementUtils",
",",
"Filer",
"filer",
",",
"SQLiteDatabaseSchema",
"schema",
")",
"throws",
"Exception",
"{",
"String",
"schemaName",
"=",
"buildDaoFactoryName",
"(",
"schema",
... | Build dao factory interface.
@param elementUtils the element utils
@param filer the filer
@param schema the schema
@return schema typeName
@throws Exception the exception | [
"Build",
"dao",
"factory",
"interface",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindDaoFactoryBuilder.java#L118-L158 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.isNumber | @ArgumentsChecked
@Throws( {
"""
Ensures that a String argument is a number. This overload supports all subclasses of {@code Number}. The number
is first converted to a {@code BigDecimal} or {@code BigInteger}. Floating point types are only supported if the
{@code type} is one of {@code Float, Double, BigDecima... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class })
public static <T extends Number> T isNumber(@Nonnull final String value, @Nullable final String name, @Nonnull final Class<T> type) {
Check.notNull(value, "value");
Check.notNull(type, "type");
final Number ... | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalNumberArgumentException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"Number",
">",
"T",
"isNumber",
"(",
"@",
"Nonnull",
"final",
... | Ensures that a String argument is a number. This overload supports all subclasses of {@code Number}. The number
is first converted to a {@code BigDecimal} or {@code BigInteger}. Floating point types are only supported if the
{@code type} is one of {@code Float, Double, BigDecimal}.
<p>
This method does also check agai... | [
"Ensures",
"that",
"a",
"String",
"argument",
"is",
"a",
"number",
".",
"This",
"overload",
"supports",
"all",
"subclasses",
"of",
"{",
"@code",
"Number",
"}",
".",
"The",
"number",
"is",
"first",
"converted",
"to",
"a",
"{",
"@code",
"BigDecimal",
"}",
... | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L1294-L1312 |
spotify/helios | helios-tools/src/main/java/com/spotify/helios/cli/command/HostResolver.java | HostResolver.scoreMatches | private List<ScoredHost> scoreMatches(final List<String> results) {
"""
Score matches based upon the position in the dns search domain that matches the result
"""
final ImmutableList.Builder<ScoredHost> scored = ImmutableList.builder();
for (final String name : results) {
int score = Integer.MAX_... | java | private List<ScoredHost> scoreMatches(final List<String> results) {
final ImmutableList.Builder<ScoredHost> scored = ImmutableList.builder();
for (final String name : results) {
int score = Integer.MAX_VALUE;
for (int i = 0; i < searchPath.length; i++) {
if (name.endsWith(searchPath[i].toStr... | [
"private",
"List",
"<",
"ScoredHost",
">",
"scoreMatches",
"(",
"final",
"List",
"<",
"String",
">",
"results",
")",
"{",
"final",
"ImmutableList",
".",
"Builder",
"<",
"ScoredHost",
">",
"scored",
"=",
"ImmutableList",
".",
"builder",
"(",
")",
";",
"for"... | Score matches based upon the position in the dns search domain that matches the result | [
"Score",
"matches",
"based",
"upon",
"the",
"position",
"in",
"the",
"dns",
"search",
"domain",
"that",
"matches",
"the",
"result"
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-tools/src/main/java/com/spotify/helios/cli/command/HostResolver.java#L144-L158 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJ.java | IfmapJ.createClockSkewDetector | public static ClockSkewDetector createClockSkewDetector(SSRC ssrc, Device dev) {
"""
Create a {@link ClockSkewDetector} instance which can be used to
synchronize the time with the MAPS.
@param ssrc
the {@link SSRC} instance to be used for synchronization
@param dev
the {@link Device} used for time synchroni... | java | public static ClockSkewDetector createClockSkewDetector(SSRC ssrc, Device dev) {
return ClockSkewDetector.newInstance(ssrc, dev);
} | [
"public",
"static",
"ClockSkewDetector",
"createClockSkewDetector",
"(",
"SSRC",
"ssrc",
",",
"Device",
"dev",
")",
"{",
"return",
"ClockSkewDetector",
".",
"newInstance",
"(",
"ssrc",
",",
"dev",
")",
";",
"}"
] | Create a {@link ClockSkewDetector} instance which can be used to
synchronize the time with the MAPS.
@param ssrc
the {@link SSRC} instance to be used for synchronization
@param dev
the {@link Device} used for time synchronization
@return | [
"Create",
"a",
"{",
"@link",
"ClockSkewDetector",
"}",
"instance",
"which",
"can",
"be",
"used",
"to",
"synchronize",
"the",
"time",
"with",
"the",
"MAPS",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/IfmapJ.java#L246-L248 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexResponse.java | CmsFlexResponse.addDateHeader | @Override
public void addDateHeader(String name, long date) {
"""
Method overload from the standard HttpServletRequest API.<p>
@see javax.servlet.http.HttpServletResponse#addDateHeader(java.lang.String, long)
"""
addHeader(name, CmsDateUtil.getHeaderDate(date));
} | java | @Override
public void addDateHeader(String name, long date) {
addHeader(name, CmsDateUtil.getHeaderDate(date));
} | [
"@",
"Override",
"public",
"void",
"addDateHeader",
"(",
"String",
"name",
",",
"long",
"date",
")",
"{",
"addHeader",
"(",
"name",
",",
"CmsDateUtil",
".",
"getHeaderDate",
"(",
"date",
")",
")",
";",
"}"
] | Method overload from the standard HttpServletRequest API.<p>
@see javax.servlet.http.HttpServletResponse#addDateHeader(java.lang.String, long) | [
"Method",
"overload",
"from",
"the",
"standard",
"HttpServletRequest",
"API",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexResponse.java#L425-L429 |
knowm/Yank | src/main/java/org/knowm/yank/Yank.java | Yank.queryBeanList | public static <T> List<T> queryBeanList(String sql, Class<T> beanType, Object[] params)
throws YankSQLException {
"""
Return a List of Beans given an SQL statement using the default connection pool.
@param sql The SQL statement
@param beanType The Class of the desired return Objects matching the table
@... | java | public static <T> List<T> queryBeanList(String sql, Class<T> beanType, Object[] params)
throws YankSQLException {
return queryBeanList(YankPoolManager.DEFAULT_POOL_NAME, sql, beanType, params);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"queryBeanList",
"(",
"String",
"sql",
",",
"Class",
"<",
"T",
">",
"beanType",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"YankSQLException",
"{",
"return",
"queryBeanList",
"(",
"YankPool... | Return a List of Beans given an SQL statement using the default connection pool.
@param sql The SQL statement
@param beanType The Class of the desired return Objects matching the table
@param params The replacement parameters
@return The List of Objects | [
"Return",
"a",
"List",
"of",
"Beans",
"given",
"an",
"SQL",
"statement",
"using",
"the",
"default",
"connection",
"pool",
"."
] | train | https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L470-L474 |
tvesalainen/util | util/src/main/java/org/vesalainen/navi/ElasticChain.java | ElasticChain.minimalLineLength | public double minimalLineLength(double T, double Th) {
"""
Minimum line length required (or suspended length for a given fairlead
tension) for gravity anchor:
@param T Fairlead tension
@param Th Horizontal force
@return
"""
return Math.sqrt(T*T-Th*Th)/w;
} | java | public double minimalLineLength(double T, double Th)
{
return Math.sqrt(T*T-Th*Th)/w;
} | [
"public",
"double",
"minimalLineLength",
"(",
"double",
"T",
",",
"double",
"Th",
")",
"{",
"return",
"Math",
".",
"sqrt",
"(",
"T",
"*",
"T",
"-",
"Th",
"*",
"Th",
")",
"/",
"w",
";",
"}"
] | Minimum line length required (or suspended length for a given fairlead
tension) for gravity anchor:
@param T Fairlead tension
@param Th Horizontal force
@return | [
"Minimum",
"line",
"length",
"required",
"(",
"or",
"suspended",
"length",
"for",
"a",
"given",
"fairlead",
"tension",
")",
"for",
"gravity",
"anchor",
":"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/navi/ElasticChain.java#L61-L64 |
johncarl81/transfuse | transfuse-support/src/main/java/org/androidtransfuse/adapter/classes/ASTClassFactory.java | ASTClassFactory.getMethod | public ASTMethod getMethod(Method method) {
"""
Builds an AST Method fromm the given input method.
@param method
@return AST Method
"""
ImmutableList<ASTParameter> astParameters = getParameters(method);
ASTAccessModifier modifier = ASTAccessModifier.getModifier(method.getModifiers());
... | java | public ASTMethod getMethod(Method method) {
ImmutableList<ASTParameter> astParameters = getParameters(method);
ASTAccessModifier modifier = ASTAccessModifier.getModifier(method.getModifiers());
ImmutableSet<ASTType> throwsTypes = getTypes(method.getExceptionTypes());
return new ASTClas... | [
"public",
"ASTMethod",
"getMethod",
"(",
"Method",
"method",
")",
"{",
"ImmutableList",
"<",
"ASTParameter",
">",
"astParameters",
"=",
"getParameters",
"(",
"method",
")",
";",
"ASTAccessModifier",
"modifier",
"=",
"ASTAccessModifier",
".",
"getModifier",
"(",
"m... | Builds an AST Method fromm the given input method.
@param method
@return AST Method | [
"Builds",
"an",
"AST",
"Method",
"fromm",
"the",
"given",
"input",
"method",
"."
] | train | https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-support/src/main/java/org/androidtransfuse/adapter/classes/ASTClassFactory.java#L211-L218 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java | Alignments.getAllPairsScores | public static <S extends Sequence<C>, C extends Compound> double[] getAllPairsScores( List<S> sequences,
PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) {
"""
Factory method which computes a sequence pair score for all {@link Sequence} pairs in the given {@link List}.
T... | java | public static <S extends Sequence<C>, C extends Compound> double[] getAllPairsScores( List<S> sequences,
PairwiseSequenceScorerType type, GapPenalty gapPenalty, SubstitutionMatrix<C> subMatrix) {
return runPairwiseScorers(getAllPairsScorers(sequences, type, gapPenalty, subMatrix));
} | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"double",
"[",
"]",
"getAllPairsScores",
"(",
"List",
"<",
"S",
">",
"sequences",
",",
"PairwiseSequenceScorerType",
"type",
",",
"GapPenalty",
"gapPena... | Factory method which computes a sequence pair score for all {@link Sequence} pairs in the given {@link List}.
This method runs the scorings in parallel by submitting all of the scorings to the shared thread pool of the
{@link ConcurrencyTools} utility.
@param <S> each {@link Sequence} of a pair is of type S
@param <C>... | [
"Factory",
"method",
"which",
"computes",
"a",
"sequence",
"pair",
"score",
"for",
"all",
"{",
"@link",
"Sequence",
"}",
"pairs",
"in",
"the",
"given",
"{",
"@link",
"List",
"}",
".",
"This",
"method",
"runs",
"the",
"scorings",
"in",
"parallel",
"by",
"... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L281-L284 |
carrotsearch/hppc | hppc/src/main/java/com/carrotsearch/hppc/BitUtil.java | BitUtil.pop_intersect | public static long pop_intersect(long[] arr1, long[] arr2, int wordOffset, int numWords) {
"""
Returns the popcount or cardinality of the two sets after an intersection.
Neither array is modified.
"""
long popCount = 0;
for (int i = wordOffset, end = wordOffset + numWords; i < end; ++i) {
popCou... | java | public static long pop_intersect(long[] arr1, long[] arr2, int wordOffset, int numWords) {
long popCount = 0;
for (int i = wordOffset, end = wordOffset + numWords; i < end; ++i) {
popCount += Long.bitCount(arr1[i] & arr2[i]);
}
return popCount;
} | [
"public",
"static",
"long",
"pop_intersect",
"(",
"long",
"[",
"]",
"arr1",
",",
"long",
"[",
"]",
"arr2",
",",
"int",
"wordOffset",
",",
"int",
"numWords",
")",
"{",
"long",
"popCount",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"wordOffset",
",",
... | Returns the popcount or cardinality of the two sets after an intersection.
Neither array is modified. | [
"Returns",
"the",
"popcount",
"or",
"cardinality",
"of",
"the",
"two",
"sets",
"after",
"an",
"intersection",
".",
"Neither",
"array",
"is",
"modified",
"."
] | train | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/java/com/carrotsearch/hppc/BitUtil.java#L50-L56 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/FactorGraph.java | FactorGraph.addVar | public void addVar(Var var) {
"""
Adds a variable to this factor graph, if not already present.
@param var The variable to add.
@return The node for this variable.
"""
int id = var.getId();
boolean alreadyAdded = (0 <= id && id < vars.size());
if (alreadyAdded) {
if (var... | java | public void addVar(Var var) {
int id = var.getId();
boolean alreadyAdded = (0 <= id && id < vars.size());
if (alreadyAdded) {
if (vars.get(id) != var) {
throw new IllegalStateException("Var id already set, but factor not yet added.");
}
} else {
... | [
"public",
"void",
"addVar",
"(",
"Var",
"var",
")",
"{",
"int",
"id",
"=",
"var",
".",
"getId",
"(",
")",
";",
"boolean",
"alreadyAdded",
"=",
"(",
"0",
"<=",
"id",
"&&",
"id",
"<",
"vars",
".",
"size",
"(",
")",
")",
";",
"if",
"(",
"alreadyAd... | Adds a variable to this factor graph, if not already present.
@param var The variable to add.
@return The node for this variable. | [
"Adds",
"a",
"variable",
"to",
"this",
"factor",
"graph",
"if",
"not",
"already",
"present",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/FactorGraph.java#L124-L145 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/watched/WatchedDoubleStepQREigen_DDRM.java | WatchedDoubleStepQREigen_DDRM.exceptionalShift | public void exceptionalShift( int x1 , int x2) {
"""
Perform a shift in a random direction that is of the same magnitude as the elements in the matrix.
"""
if( printHumps )
System.out.println("Performing exceptional implicit double step");
// perform a random shift that is of the ... | java | public void exceptionalShift( int x1 , int x2) {
if( printHumps )
System.out.println("Performing exceptional implicit double step");
// perform a random shift that is of the same magnitude as the matrix
double val = Math.abs(A.get(x2,x2));
if( val == 0 )
val = ... | [
"public",
"void",
"exceptionalShift",
"(",
"int",
"x1",
",",
"int",
"x2",
")",
"{",
"if",
"(",
"printHumps",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"Performing exceptional implicit double step\"",
")",
";",
"// perform a random shift that is of the same mag... | Perform a shift in a random direction that is of the same magnitude as the elements in the matrix. | [
"Perform",
"a",
"shift",
"in",
"a",
"random",
"direction",
"that",
"is",
"of",
"the",
"same",
"magnitude",
"as",
"the",
"elements",
"in",
"the",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/watched/WatchedDoubleStepQREigen_DDRM.java#L166-L187 |
wkgcass/Style | src/main/java/net/cassite/style/aggregation/MapFuncSup.java | MapFuncSup.forEach | public <R> R forEach(RFunc3<R, K, V, IteratorInfo<R>> func) {
"""
define a function to deal with each entry in the map
@param func a function takes in each entry from map and iterator
info<br>
and returns 'last loop result'
@return return 'last loop value'.<br>
check
<a href="https://github.com/wkgcass/Sty... | java | public <R> R forEach(RFunc3<R, K, V, IteratorInfo<R>> func) {
return forEach(Style.$(func));
} | [
"public",
"<",
"R",
">",
"R",
"forEach",
"(",
"RFunc3",
"<",
"R",
",",
"K",
",",
"V",
",",
"IteratorInfo",
"<",
"R",
">",
">",
"func",
")",
"{",
"return",
"forEach",
"(",
"Style",
".",
"$",
"(",
"func",
")",
")",
";",
"}"
] | define a function to deal with each entry in the map
@param func a function takes in each entry from map and iterator
info<br>
and returns 'last loop result'
@return return 'last loop value'.<br>
check
<a href="https://github.com/wkgcass/Style/">tutorial</a> for
more info about 'last loop value'
@see IteratorInfo | [
"define",
"a",
"function",
"to",
"deal",
"with",
"each",
"entry",
"in",
"the",
"map"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/aggregation/MapFuncSup.java#L83-L85 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Single.java | Single.takeUntil | @BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <E> Single<T> takeUntil(final Publisher<E> other) {
"""
Returns a Single that emits the item emitted by the source Single until a Publisher emits an item. Upon
emission of an item from {... | java | @BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <E> Single<T> takeUntil(final Publisher<E> other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new SingleTakeUntil<T, E>(this, other))... | [
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"E",
">",
"Single",
"<",
"T",
">",
"takeUntil",
"(",
"final",
"Publisher... | Returns a Single that emits the item emitted by the source Single until a Publisher emits an item. Upon
emission of an item from {@code other}, this will emit a {@link CancellationException} rather than go to
{@link SingleObserver#onSuccess(Object)}.
<p>
<img width="640" height="380" src="https://raw.github.com/wiki/Re... | [
"Returns",
"a",
"Single",
"that",
"emits",
"the",
"item",
"emitted",
"by",
"the",
"source",
"Single",
"until",
"a",
"Publisher",
"emits",
"an",
"item",
".",
"Upon",
"emission",
"of",
"an",
"item",
"from",
"{",
"@code",
"other",
"}",
"this",
"will",
"emit... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Single.java#L3559-L3565 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/replicator/PullerInternal.java | PullerInternal.processChangeTrackerChange | protected void processChangeTrackerChange(final Map<String, Object> change) {
"""
in CBL_Puller.m
- (void) changeTrackerReceivedSequence: (id)remoteSequenceID
docID: (NSString*)docID
revIDs: (NSArray*)revIDs
deleted: (BOOL)deleted
"""
// Process each change from the feed:
String docID = (St... | java | protected void processChangeTrackerChange(final Map<String, Object> change) {
// Process each change from the feed:
String docID = (String) change.get("id");
if (docID == null || !Document.isValidDocumentId(docID))
return;
String lastSequence = change.get("seq").toString();
... | [
"protected",
"void",
"processChangeTrackerChange",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"change",
")",
"{",
"// Process each change from the feed:",
"String",
"docID",
"=",
"(",
"String",
")",
"change",
".",
"get",
"(",
"\"id\"",
")",
";",
"... | in CBL_Puller.m
- (void) changeTrackerReceivedSequence: (id)remoteSequenceID
docID: (NSString*)docID
revIDs: (NSArray*)revIDs
deleted: (BOOL)deleted | [
"in",
"CBL_Puller",
".",
"m",
"-",
"(",
"void",
")",
"changeTrackerReceivedSequence",
":",
"(",
"id",
")",
"remoteSequenceID",
"docID",
":",
"(",
"NSString",
"*",
")",
"docID",
"revIDs",
":",
"(",
"NSArray",
"*",
")",
"revIDs",
"deleted",
":",
"(",
"BOOL... | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/replicator/PullerInternal.java#L883-L920 |
mozilla/rhino | src/org/mozilla/javascript/IRFactory.java | IRFactory.createCatch | private Node createCatch(String varName, Node catchCond, Node stmts,
int lineno) {
"""
Catch clause of try/catch/finally
@param varName the name of the variable to bind to the exception
@param catchCond the condition under which to catch the exception.
May be null if no condition is... | java | private Node createCatch(String varName, Node catchCond, Node stmts,
int lineno) {
if (catchCond == null) {
catchCond = new Node(Token.EMPTY);
}
return new Node(Token.CATCH, createName(varName),
catchCond, stmts, lineno);
} | [
"private",
"Node",
"createCatch",
"(",
"String",
"varName",
",",
"Node",
"catchCond",
",",
"Node",
"stmts",
",",
"int",
"lineno",
")",
"{",
"if",
"(",
"catchCond",
"==",
"null",
")",
"{",
"catchCond",
"=",
"new",
"Node",
"(",
"Token",
".",
"EMPTY",
")"... | Catch clause of try/catch/finally
@param varName the name of the variable to bind to the exception
@param catchCond the condition under which to catch the exception.
May be null if no condition is given.
@param stmts the statements in the catch clause
@param lineno the starting line number of the catch clause | [
"Catch",
"clause",
"of",
"try",
"/",
"catch",
"/",
"finally"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/IRFactory.java#L1451-L1458 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java | DataSetUtils.zipWithUniqueId | public static <T> DataSet<Tuple2<Long, T>> zipWithUniqueId (DataSet <T> input) {
"""
Method that assigns a unique {@link Long} value to all elements in the input data set as described below.
<ul>
<li> a map function is applied to the input data set
<li> each map task holds a counter c which is increased for eac... | java | public static <T> DataSet<Tuple2<Long, T>> zipWithUniqueId (DataSet <T> input) {
return input.mapPartition(new RichMapPartitionFunction<T, Tuple2<Long, T>>() {
long maxBitSize = getBitSize(Long.MAX_VALUE);
long shifter = 0;
long start = 0;
long taskId = 0;
long label = 0;
@Override
public void... | [
"public",
"static",
"<",
"T",
">",
"DataSet",
"<",
"Tuple2",
"<",
"Long",
",",
"T",
">",
">",
"zipWithUniqueId",
"(",
"DataSet",
"<",
"T",
">",
"input",
")",
"{",
"return",
"input",
".",
"mapPartition",
"(",
"new",
"RichMapPartitionFunction",
"<",
"T",
... | Method that assigns a unique {@link Long} value to all elements in the input data set as described below.
<ul>
<li> a map function is applied to the input data set
<li> each map task holds a counter c which is increased for each record
<li> c is shifted by n bits where n = log2(number of parallel tasks)
<li> to create ... | [
"Method",
"that",
"assigns",
"a",
"unique",
"{",
"@link",
"Long",
"}",
"value",
"to",
"all",
"elements",
"in",
"the",
"input",
"data",
"set",
"as",
"described",
"below",
".",
"<ul",
">",
"<li",
">",
"a",
"map",
"function",
"is",
"applied",
"to",
"the",... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java#L149-L180 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/vpn/vpnvserver_stats.java | vpnvserver_stats.get | public static vpnvserver_stats get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch statistics of vpnvserver_stats resource of given name .
"""
vpnvserver_stats obj = new vpnvserver_stats();
obj.set_name(name);
vpnvserver_stats response = (vpnvserver_stats) obj.stat_resour... | java | public static vpnvserver_stats get(nitro_service service, String name) throws Exception{
vpnvserver_stats obj = new vpnvserver_stats();
obj.set_name(name);
vpnvserver_stats response = (vpnvserver_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"vpnvserver_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"vpnvserver_stats",
"obj",
"=",
"new",
"vpnvserver_stats",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"... | Use this API to fetch statistics of vpnvserver_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"vpnvserver_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/vpn/vpnvserver_stats.java#L249-L254 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ResourceUtils.java | ResourceUtils.doesResourceExist | public static boolean doesResourceExist(final String resource, final ResourceLoader resourceLoader) {
"""
Does resource exist?
@param resource the resource
@param resourceLoader the resource loader
@return the boolean
"""
try {
if (StringUtils.isNotBlank(resource)) {
... | java | public static boolean doesResourceExist(final String resource, final ResourceLoader resourceLoader) {
try {
if (StringUtils.isNotBlank(resource)) {
val res = resourceLoader.getResource(resource);
return doesResourceExist(res);
}
} catch (final Exce... | [
"public",
"static",
"boolean",
"doesResourceExist",
"(",
"final",
"String",
"resource",
",",
"final",
"ResourceLoader",
"resourceLoader",
")",
"{",
"try",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"resource",
")",
")",
"{",
"val",
"res",
"=",
"r... | Does resource exist?
@param resource the resource
@param resourceLoader the resource loader
@return the boolean | [
"Does",
"resource",
"exist?"
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ResourceUtils.java#L68-L78 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/TaskGroup.java | TaskGroup.invokeTaskAsync | private Observable<Indexable> invokeTaskAsync(final TaskGroupEntry<TaskItem> entry, final InvocationContext context) {
"""
Invokes the task stored in the given entry.
<p>
if the task cannot be invoked because the group marked as cancelled then an observable
that emit {@link TaskCancelledException} will be retur... | java | private Observable<Indexable> invokeTaskAsync(final TaskGroupEntry<TaskItem> entry, final InvocationContext context) {
return Observable.defer(new Func0<Observable<Indexable>>() {
@Override
public Observable<Indexable> call() {
if (isGroupCancelled.get()) {
... | [
"private",
"Observable",
"<",
"Indexable",
">",
"invokeTaskAsync",
"(",
"final",
"TaskGroupEntry",
"<",
"TaskItem",
">",
"entry",
",",
"final",
"InvocationContext",
"context",
")",
"{",
"return",
"Observable",
".",
"defer",
"(",
"new",
"Func0",
"<",
"Observable"... | Invokes the task stored in the given entry.
<p>
if the task cannot be invoked because the group marked as cancelled then an observable
that emit {@link TaskCancelledException} will be returned.
@param entry the entry holding task
@param context a group level shared context that is passed to {@link TaskItem#invokeAsync... | [
"Invokes",
"the",
"task",
"stored",
"in",
"the",
"given",
"entry",
".",
"<p",
">",
"if",
"the",
"task",
"cannot",
"be",
"invoked",
"because",
"the",
"group",
"marked",
"as",
"cancelled",
"then",
"an",
"observable",
"that",
"emit",
"{",
"@link",
"TaskCancel... | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/dag/TaskGroup.java#L380-L418 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/UnsignedUtils.java | UnsignedUtils.parseInt | public static int parseInt(String s, int radix) {
"""
Returns the unsigned {@code int} value represented by a string with the
given radix.
@param s
the string containing the unsigned integer representation to
be parsed.
@param radix
the radix to use while parsing {@code s}; must be between
{@link Characte... | java | public static int parseInt(String s, int radix) {
if (s == null || s.length() == 0 || s.trim().length() == 0) {
throw new NumberFormatException("Null or empty string");
}
long result = parseLong(s, radix);
if ((result & INT_MASK) != result) {
throw new NumberForma... | [
"public",
"static",
"int",
"parseInt",
"(",
"String",
"s",
",",
"int",
"radix",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"length",
"(",
")",
"==",
"0",
"||",
"s",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
... | Returns the unsigned {@code int} value represented by a string with the
given radix.
@param s
the string containing the unsigned integer representation to
be parsed.
@param radix
the radix to use while parsing {@code s}; must be between
{@link Character#MIN_RADIX} and {@link #MAX_RADIX}.
@throws NumberFormatException
... | [
"Returns",
"the",
"unsigned",
"{",
"@code",
"int",
"}",
"value",
"represented",
"by",
"a",
"string",
"with",
"the",
"given",
"radix",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/UnsignedUtils.java#L113-L123 |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/OptionsBuilder.java | OptionsBuilder.addStep | public void addStep(String name, String robot, Map<String, Object> options) {
"""
Adds a step to the steps.
@param name {@link String} name of the step
@param robot {@link String} name of the robot used by the step.
@param options {@link Map} extra options required for the step.
"""
steps.addStep(... | java | public void addStep(String name, String robot, Map<String, Object> options){
steps.addStep(name, robot, options);
} | [
"public",
"void",
"addStep",
"(",
"String",
"name",
",",
"String",
"robot",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
")",
"{",
"steps",
".",
"addStep",
"(",
"name",
",",
"robot",
",",
"options",
")",
";",
"}"
] | Adds a step to the steps.
@param name {@link String} name of the step
@param robot {@link String} name of the robot used by the step.
@param options {@link Map} extra options required for the step. | [
"Adds",
"a",
"step",
"to",
"the",
"steps",
"."
] | train | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/OptionsBuilder.java#L20-L22 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/CaretNode.java | CaretNode.moveContentBreaks | private void moveContentBreaks(int numOfBreaks, BreakIterator breakIterator, boolean followingNotPreceding) {
"""
Helper method for reducing duplicate code
@param numOfBreaks the number of breaks
@param breakIterator the type of iterator to use
@param followingNotPreceding if true, use {@link BreakIterator#foll... | java | private void moveContentBreaks(int numOfBreaks, BreakIterator breakIterator, boolean followingNotPreceding) {
if (area.getLength() == 0) {
return;
}
breakIterator.setText(area.getText());
if (followingNotPreceding) {
breakIterator.following(getPosition());
... | [
"private",
"void",
"moveContentBreaks",
"(",
"int",
"numOfBreaks",
",",
"BreakIterator",
"breakIterator",
",",
"boolean",
"followingNotPreceding",
")",
"{",
"if",
"(",
"area",
".",
"getLength",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
"breakIterator"... | Helper method for reducing duplicate code
@param numOfBreaks the number of breaks
@param breakIterator the type of iterator to use
@param followingNotPreceding if true, use {@link BreakIterator#following(int)}.
Otherwise, use {@link BreakIterator#preceding(int)}. | [
"Helper",
"method",
"for",
"reducing",
"duplicate",
"code"
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/CaretNode.java#L372-L387 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putShortLittleEndian | public final void putShortLittleEndian(int index, short value) {
"""
Writes the given short integer value (16 bit, 2 bytes) to the given position in little-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putShort(int, short)}. For most case... | java | public final void putShortLittleEndian(int index, short value) {
if (LITTLE_ENDIAN) {
putShort(index, value);
} else {
putShort(index, Short.reverseBytes(value));
}
} | [
"public",
"final",
"void",
"putShortLittleEndian",
"(",
"int",
"index",
",",
"short",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putShort",
"(",
"index",
",",
"value",
")",
";",
"}",
"else",
"{",
"putShort",
"(",
"index",
",",
"Short",
"... | Writes the given short integer value (16 bit, 2 bytes) to the given position in little-endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putShort(int, short)}. For most cases (such as
transient storage in memory or serialization for I/O and network)... | [
"Writes",
"the",
"given",
"short",
"integer",
"value",
"(",
"16",
"bit",
"2",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"little",
"-",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"n... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L647-L653 |
EdwardRaff/JSAT | JSAT/src/jsat/math/Complex.java | Complex.mutableMultiply | public void mutableMultiply(double c, double d) {
"""
Alters this complex number as if a multiplication of another complex number was performed.
@param c the real part of the other number
@param d the imaginary part of the other number
"""
double newR = this.real*c-this.imag*d;
double newI = ... | java | public void mutableMultiply(double c, double d)
{
double newR = this.real*c-this.imag*d;
double newI = this.imag*c+this.real*d;
this.real = newR;
this.imag = newI;
} | [
"public",
"void",
"mutableMultiply",
"(",
"double",
"c",
",",
"double",
"d",
")",
"{",
"double",
"newR",
"=",
"this",
".",
"real",
"*",
"c",
"-",
"this",
".",
"imag",
"*",
"d",
";",
"double",
"newI",
"=",
"this",
".",
"imag",
"*",
"c",
"+",
"this... | Alters this complex number as if a multiplication of another complex number was performed.
@param c the real part of the other number
@param d the imaginary part of the other number | [
"Alters",
"this",
"complex",
"number",
"as",
"if",
"a",
"multiplication",
"of",
"another",
"complex",
"number",
"was",
"performed",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/Complex.java#L156-L162 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotationUtil.java | AnnotationUtil.getAnnotations | static List<Annotation> getAnnotations(AnnotatedElement element, EnumSet<FindOption> findOptions) {
"""
Returns all annotations searching from the specified {@code element}. The search range depends on
the specified {@link FindOption}s.
@param element the {@link AnnotatedElement} to find annotations
@param fi... | java | static List<Annotation> getAnnotations(AnnotatedElement element, EnumSet<FindOption> findOptions) {
return getAnnotations(element, findOptions, annotation -> true);
} | [
"static",
"List",
"<",
"Annotation",
">",
"getAnnotations",
"(",
"AnnotatedElement",
"element",
",",
"EnumSet",
"<",
"FindOption",
">",
"findOptions",
")",
"{",
"return",
"getAnnotations",
"(",
"element",
",",
"findOptions",
",",
"annotation",
"->",
"true",
")",... | Returns all annotations searching from the specified {@code element}. The search range depends on
the specified {@link FindOption}s.
@param element the {@link AnnotatedElement} to find annotations
@param findOptions the options to be applied when retrieving annotations | [
"Returns",
"all",
"annotations",
"searching",
"from",
"the",
"specified",
"{",
"@code",
"element",
"}",
".",
"The",
"search",
"range",
"depends",
"on",
"the",
"specified",
"{",
"@link",
"FindOption",
"}",
"s",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotationUtil.java#L290-L292 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/MultiPath.java | MultiPath.addPath | void addPath(Point2D[] points, int count, boolean bForward) {
"""
Adds a new path to this multipath.
@param points
The array of points to add to this multipath.
@param count
The number of points added to the mulitpath.
@param bForward
When FALSE, the points are inserted in reverse order.
"""
m_impl.a... | java | void addPath(Point2D[] points, int count, boolean bForward) {
m_impl.addPath(points, count, bForward);
} | [
"void",
"addPath",
"(",
"Point2D",
"[",
"]",
"points",
",",
"int",
"count",
",",
"boolean",
"bForward",
")",
"{",
"m_impl",
".",
"addPath",
"(",
"points",
",",
"count",
",",
"bForward",
")",
";",
"}"
] | Adds a new path to this multipath.
@param points
The array of points to add to this multipath.
@param count
The number of points added to the mulitpath.
@param bForward
When FALSE, the points are inserted in reverse order. | [
"Adds",
"a",
"new",
"path",
"to",
"this",
"multipath",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MultiPath.java#L276-L278 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.listSasTokensAsync | public Observable<Page<SasTokenInfoInner>> listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) {
"""
Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination.
@pa... | java | public Observable<Page<SasTokenInfoInner>> listSasTokensAsync(final String resourceGroupName, final String accountName, final String storageAccountName, final String containerName) {
return listSasTokensWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, containerName)
.map(... | [
"public",
"Observable",
"<",
"Page",
"<",
"SasTokenInfoInner",
">",
">",
"listSasTokensAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
",",
"final",
"String",
"storageAccountName",
",",
"final",
"String",
"containerName",
... | Gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and container combination.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics account from which an Azure Stora... | [
"Gets",
"the",
"SAS",
"token",
"associated",
"with",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"and",
"Azure",
"Storage",
"account",
"and",
"container",
"combination",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L852-L860 |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.createPlaylist | public CreatePlaylistRequest.Builder createPlaylist(String user_id, String name) {
"""
Create a playlist.
@param user_id The playlists owner.
@param name The name of the playlist.
@return A {@link CreatePlaylistRequest.Builder}.
@see <a href="https://developer.spotify.com/web-api/user-guide/#spotify-uris-... | java | public CreatePlaylistRequest.Builder createPlaylist(String user_id, String name) {
return new CreatePlaylistRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.user_id(user_id)
.name(name);
} | [
"public",
"CreatePlaylistRequest",
".",
"Builder",
"createPlaylist",
"(",
"String",
"user_id",
",",
"String",
"name",
")",
"{",
"return",
"new",
"CreatePlaylistRequest",
".",
"Builder",
"(",
"accessToken",
")",
".",
"setDefaults",
"(",
"httpManager",
",",
"scheme"... | Create a playlist.
@param user_id The playlists owner.
@param name The name of the playlist.
@return A {@link CreatePlaylistRequest.Builder}.
@see <a href="https://developer.spotify.com/web-api/user-guide/#spotify-uris-and-ids">Spotify: URLs & IDs</a> | [
"Create",
"a",
"playlist",
"."
] | train | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L1158-L1163 |
code4everything/util | src/main/java/com/zhazhapan/util/ReflectUtils.java | ReflectUtils.addClassesInPackageByFile | public static void addClassesInPackageByFile(String packageName, String packagePath, List<Class<?>> classes) throws ClassNotFoundException {
"""
以文件的形式来获取包下的所有类
@param packageName 包名
@param packagePath 包路径
@param classes 文件列表
@throws ClassNotFoundException 异常
"""
File dir = new File(packagePath... | java | public static void addClassesInPackageByFile(String packageName, String packagePath, List<Class<?>> classes) throws ClassNotFoundException {
File dir = new File(packagePath);
if (!dir.exists() || !dir.isDirectory()) {
return;
}
File[] files = dir.listFiles(file -> (file.isDir... | [
"public",
"static",
"void",
"addClassesInPackageByFile",
"(",
"String",
"packageName",
",",
"String",
"packagePath",
",",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
")",
"throws",
"ClassNotFoundException",
"{",
"File",
"dir",
"=",
"new",
"File",
"(",... | 以文件的形式来获取包下的所有类
@param packageName 包名
@param packagePath 包路径
@param classes 文件列表
@throws ClassNotFoundException 异常 | [
"以文件的形式来获取包下的所有类"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/ReflectUtils.java#L277-L293 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/MetamodelImpl.java | MetamodelImpl.getEntityAttribute | public Attribute getEntityAttribute(Class clazz, String fieldName) {
"""
Returns entity attribute for given managed entity class.
@param clazz
Entity class
@param fieldName
field name
@return entity attribute
"""
if (entityTypes != null && entityTypes.containsKey(clazz))
{
... | java | public Attribute getEntityAttribute(Class clazz, String fieldName)
{
if (entityTypes != null && entityTypes.containsKey(clazz))
{
EntityType entityType = entityTypes.get(clazz);
return entityType.getAttribute(fieldName);
}
throw new IllegalArgumentExcep... | [
"public",
"Attribute",
"getEntityAttribute",
"(",
"Class",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"if",
"(",
"entityTypes",
"!=",
"null",
"&&",
"entityTypes",
".",
"containsKey",
"(",
"clazz",
")",
")",
"{",
"EntityType",
"entityType",
"=",
"entityType... | Returns entity attribute for given managed entity class.
@param clazz
Entity class
@param fieldName
field name
@return entity attribute | [
"Returns",
"entity",
"attribute",
"for",
"given",
"managed",
"entity",
"class",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/MetamodelImpl.java#L367-L375 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java | Utils.createOdataFilterForTags | public static String createOdataFilterForTags(String tagName, String tagValue) {
"""
Creates an Odata filter string that can be used for filtering list results by tags.
@param tagName the name of the tag. If not provided, all resources will be returned.
@param tagValue the value of the tag. If not provided, on... | java | public static String createOdataFilterForTags(String tagName, String tagValue) {
if (tagName == null) {
return null;
} else if (tagValue == null) {
return String.format("tagname eq '%s'", tagName);
} else {
return String.format("tagname eq '%s' and tagvalue eq... | [
"public",
"static",
"String",
"createOdataFilterForTags",
"(",
"String",
"tagName",
",",
"String",
"tagValue",
")",
"{",
"if",
"(",
"tagName",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"tagValue",
"==",
"null",
")",
"{",
"ret... | Creates an Odata filter string that can be used for filtering list results by tags.
@param tagName the name of the tag. If not provided, all resources will be returned.
@param tagValue the value of the tag. If not provided, only tag name will be filtered.
@return the Odata filter to pass into list methods | [
"Creates",
"an",
"Odata",
"filter",
"string",
"that",
"can",
"be",
"used",
"for",
"filtering",
"list",
"results",
"by",
"tags",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/utils/Utils.java#L90-L98 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.invokeMethod | @SuppressWarnings("unchecked")
public static synchronized <T> T invokeMethod(Object tested, Object... arguments) throws Exception {
"""
Invoke a private or inner class method without the need to specify the
method name. This is thus a more refactor friendly version of the
@param <T> the generic type
... | java | @SuppressWarnings("unchecked")
public static synchronized <T> T invokeMethod(Object tested, Object... arguments) throws Exception {
return (T) doInvokeMethod(tested, null, null, arguments);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"invokeMethod",
"(",
"Object",
"tested",
",",
"Object",
"...",
"arguments",
")",
"throws",
"Exception",
"{",
"return",
"(",
"T",
")",
"doInvokeMethod",
... | Invoke a private or inner class method without the need to specify the
method name. This is thus a more refactor friendly version of the
@param <T> the generic type
@param tested the tested
@param arguments the arguments
@return the t
@throws Exception the exception
{@link #invokeMethod(Object, String, Object... | [
"Invoke",
"a",
"private",
"or",
"inner",
"class",
"method",
"without",
"the",
"need",
"to",
"specify",
"the",
"method",
"name",
".",
"This",
"is",
"thus",
"a",
"more",
"refactor",
"friendly",
"version",
"of",
"the"
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L644-L647 |
iipc/openwayback-access-control | access-control/src/main/java/org/archive/accesscontrol/AccessControlClient.java | AccessControlClient.getPolicy | public String getPolicy(String url, Date captureDate, Date retrievalDate,
String who) throws RobotsUnavailableException,
RuleOracleUnavailableException {
"""
Return the best-matching policy for the requested document.
@param url
URL of the requested document.
@param... | java | public String getPolicy(String url, Date captureDate, Date retrievalDate,
String who) throws RobotsUnavailableException,
RuleOracleUnavailableException {
return getPolicy(url, getRule(url, captureDate, retrievalDate, who));
} | [
"public",
"String",
"getPolicy",
"(",
"String",
"url",
",",
"Date",
"captureDate",
",",
"Date",
"retrievalDate",
",",
"String",
"who",
")",
"throws",
"RobotsUnavailableException",
",",
"RuleOracleUnavailableException",
"{",
"return",
"getPolicy",
"(",
"url",
",",
... | Return the best-matching policy for the requested document.
@param url
URL of the requested document.
@param captureDate
Date the document was archived.
@param retrievalDate
Date of retrieval (usually now).
@param who
Group name of the user accessing the document.
@return Access-control policy that should be enforced.... | [
"Return",
"the",
"best",
"-",
"matching",
"policy",
"for",
"the",
"requested",
"document",
"."
] | train | https://github.com/iipc/openwayback-access-control/blob/4a0f70f200fd8d7b6e313624b7628656d834bf31/access-control/src/main/java/org/archive/accesscontrol/AccessControlClient.java#L89-L93 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Iterables.java | Iterables.powerSet | public static <E> Set<Set<E>> powerSet(Set<E> set) {
"""
Note: copy from Google Guava under Apache License v2.
<br />
Returns the set of all possible subsets of {@code set}. For example,
{@code powerSet(ImmutableSet.of(1, 2))} returns the set {@code {{},
{1}, {2}, {1, 2}}}.
<p>Elements appear in these sub... | java | public static <E> Set<Set<E>> powerSet(Set<E> set) {
return new PowerSet<>(set);
} | [
"public",
"static",
"<",
"E",
">",
"Set",
"<",
"Set",
"<",
"E",
">",
">",
"powerSet",
"(",
"Set",
"<",
"E",
">",
"set",
")",
"{",
"return",
"new",
"PowerSet",
"<>",
"(",
"set",
")",
";",
"}"
] | Note: copy from Google Guava under Apache License v2.
<br />
Returns the set of all possible subsets of {@code set}. For example,
{@code powerSet(ImmutableSet.of(1, 2))} returns the set {@code {{},
{1}, {2}, {1, 2}}}.
<p>Elements appear in these subsets in the same iteration order as they
appeared in the input set. T... | [
"Note",
":",
"copy",
"from",
"Google",
"Guava",
"under",
"Apache",
"License",
"v2",
".",
"<br",
"/",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Iterables.java#L610-L612 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/api/API.java | API.getBaseURL | public String getBaseURL(API.Format format, String prefix, API.RequestType type, String name, boolean proxy) {
"""
Returns a URI for the specified parameters.
<p>
An {@link #getOneTimeNonce(String) one time nonce query parameter} is added to the resulting URL, if required (that is,
not a view). In this case the... | java | public String getBaseURL(API.Format format, String prefix, API.RequestType type, String name, boolean proxy) {
String apiPath = format.name() + "/" + prefix + "/" + type.name() + "/" + name + "/";
if (!RequestType.view.equals(type)) {
return getBaseURL(proxy) + apiPath + "?" + API_NONCE_PARAM + "=" + this.getOne... | [
"public",
"String",
"getBaseURL",
"(",
"API",
".",
"Format",
"format",
",",
"String",
"prefix",
",",
"API",
".",
"RequestType",
"type",
",",
"String",
"name",
",",
"boolean",
"proxy",
")",
"{",
"String",
"apiPath",
"=",
"format",
".",
"name",
"(",
")",
... | Returns a URI for the specified parameters.
<p>
An {@link #getOneTimeNonce(String) one time nonce query parameter} is added to the resulting URL, if required (that is,
not a view). In this case the URL is ended with an ampersand (for example,
{@code https://zap/format/prefix/action/name/?apinonce=xyz&}), otherwise it h... | [
"Returns",
"a",
"URI",
"for",
"the",
"specified",
"parameters",
".",
"<p",
">",
"An",
"{",
"@link",
"#getOneTimeNonce",
"(",
"String",
")",
"one",
"time",
"nonce",
"query",
"parameter",
"}",
"is",
"added",
"to",
"the",
"resulting",
"URL",
"if",
"required",... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/api/API.java#L637-L643 |
atteo/classindex | classindex/src/main/java/org/atteo/classindex/ClassIndex.java | ClassIndex.getSubclassesNames | @SuppressWarnings("unchecked")
public static <T> Iterable<String> getSubclassesNames(Class<T> superClass) {
"""
Retrieves names of subclasses of the given class.
<p/>
<p>
The class must be annotated with {@link IndexSubclasses} for it's subclasses to be indexed
at compile-time by {@link org.atteo.classindex.p... | java | @SuppressWarnings("unchecked")
public static <T> Iterable<String> getSubclassesNames(Class<T> superClass) {
return getSubclassesNames(superClass, Thread.currentThread().getContextClassLoader());
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"String",
">",
"getSubclassesNames",
"(",
"Class",
"<",
"T",
">",
"superClass",
")",
"{",
"return",
"getSubclassesNames",
"(",
"superClass",
",",
"Thread",
... | Retrieves names of subclasses of the given class.
<p/>
<p>
The class must be annotated with {@link IndexSubclasses} for it's subclasses to be indexed
at compile-time by {@link org.atteo.classindex.processor.ClassIndexProcessor}.
</p>
@param superClass class to find subclasses for
@return names of subclasses | [
"Retrieves",
"names",
"of",
"subclasses",
"of",
"the",
"given",
"class",
".",
"<p",
"/",
">",
"<p",
">",
"The",
"class",
"must",
"be",
"annotated",
"with",
"{",
"@link",
"IndexSubclasses",
"}",
"for",
"it",
"s",
"subclasses",
"to",
"be",
"indexed",
"at",... | train | https://github.com/atteo/classindex/blob/ad76c6bd8b4e84c594d94e48f466a095ffe2306a/classindex/src/main/java/org/atteo/classindex/ClassIndex.java#L140-L143 |
legsem/legstar-core2 | legstar-base/src/main/java/com/legstar/base/type/primitive/CobolPrimitiveType.java | CobolPrimitiveType.isValid | public boolean isValid(CobolContext cobolContext, byte[] hostData, int start) {
"""
Check if a byte array contains valid mainframe data for this type
characteristics.
@param cobolContext host COBOL configuration parameters
@param hostData the byte array containing mainframe data
@param start the start positi... | java | public boolean isValid(CobolContext cobolContext, byte[] hostData, int start) {
return isValid(javaClass, cobolContext, hostData, start);
} | [
"public",
"boolean",
"isValid",
"(",
"CobolContext",
"cobolContext",
",",
"byte",
"[",
"]",
"hostData",
",",
"int",
"start",
")",
"{",
"return",
"isValid",
"(",
"javaClass",
",",
"cobolContext",
",",
"hostData",
",",
"start",
")",
";",
"}"
] | Check if a byte array contains valid mainframe data for this type
characteristics.
@param cobolContext host COBOL configuration parameters
@param hostData the byte array containing mainframe data
@param start the start position for the expected type in the byte array
@return true if the byte array contains a valid typ... | [
"Check",
"if",
"a",
"byte",
"array",
"contains",
"valid",
"mainframe",
"data",
"for",
"this",
"type",
"characteristics",
"."
] | train | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base/src/main/java/com/legstar/base/type/primitive/CobolPrimitiveType.java#L54-L56 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/QuickSelect.java | QuickSelect.insertionSort | private static <T> void insertionSort(T data, Adapter<T> adapter, int start, int end) {
"""
Sort a small array using repetitive insertion sort.
@param data Data to sort
@param start Interval start
@param end Interval end
"""
for(int i = start + 1; i < end; i++) {
for(int j = i; j > start && adap... | java | private static <T> void insertionSort(T data, Adapter<T> adapter, int start, int end) {
for(int i = start + 1; i < end; i++) {
for(int j = i; j > start && adapter.compare(data, j - 1, j) > 0; j--) {
adapter.swap(data, j, j - 1);
}
}
} | [
"private",
"static",
"<",
"T",
">",
"void",
"insertionSort",
"(",
"T",
"data",
",",
"Adapter",
"<",
"T",
">",
"adapter",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
"+",
"1",
";",
"i",
"<",
"end",
";"... | Sort a small array using repetitive insertion sort.
@param data Data to sort
@param start Interval start
@param end Interval end | [
"Sort",
"a",
"small",
"array",
"using",
"repetitive",
"insertion",
"sort",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/QuickSelect.java#L196-L202 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java | ApiOvhVrack.serviceName_dedicatedCloud_dedicatedCloud_GET | public OvhDedicatedCloud serviceName_dedicatedCloud_dedicatedCloud_GET(String serviceName, String dedicatedCloud) throws IOException {
"""
Get this object properties
REST: GET /vrack/{serviceName}/dedicatedCloud/{dedicatedCloud}
@param serviceName [required] The internal name of your vrack
@param dedicatedClo... | java | public OvhDedicatedCloud serviceName_dedicatedCloud_dedicatedCloud_GET(String serviceName, String dedicatedCloud) throws IOException {
String qPath = "/vrack/{serviceName}/dedicatedCloud/{dedicatedCloud}";
StringBuilder sb = path(qPath, serviceName, dedicatedCloud);
String resp = exec(qPath, "GET", sb.toString(),... | [
"public",
"OvhDedicatedCloud",
"serviceName_dedicatedCloud_dedicatedCloud_GET",
"(",
"String",
"serviceName",
",",
"String",
"dedicatedCloud",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vrack/{serviceName}/dedicatedCloud/{dedicatedCloud}\"",
";",
"StringBuilde... | Get this object properties
REST: GET /vrack/{serviceName}/dedicatedCloud/{dedicatedCloud}
@param serviceName [required] The internal name of your vrack
@param dedicatedCloud [required] your dedicated cloud service | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vrack/src/main/java/net/minidev/ovh/api/ApiOvhVrack.java#L513-L518 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Multiset.java | Multiset.replaceAll | public <E extends Exception> void replaceAll(Try.BiFunction<? super T, ? super Integer, Integer, E> function) throws E {
"""
The associated elements will be removed if zero or negative occurrences are returned by the specified <code>function</code>.
@param function
"""
List<T> keyToRemove = null;
... | java | public <E extends Exception> void replaceAll(Try.BiFunction<? super T, ? super Integer, Integer, E> function) throws E {
List<T> keyToRemove = null;
Integer newVal = null;
for (Map.Entry<T, MutableInt> entry : this.valueMap.entrySet()) {
newVal = function.apply(entry.getKey(), ... | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"void",
"replaceAll",
"(",
"Try",
".",
"BiFunction",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"Integer",
",",
"Integer",
",",
"E",
">",
"function",
")",
"throws",
"E",
"{",
"List",
"<",
"T",
">",
"... | The associated elements will be removed if zero or negative occurrences are returned by the specified <code>function</code>.
@param function | [
"The",
"associated",
"elements",
"will",
"be",
"removed",
"if",
"zero",
"or",
"negative",
"occurrences",
"are",
"returned",
"by",
"the",
"specified",
"<code",
">",
"function<",
"/",
"code",
">",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Multiset.java#L979-L1002 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsVfsTabHandler.java | CmsVfsTabHandler.getSubFolders | public void getSubFolders(String path, AsyncCallback<List<CmsVfsEntryBean>> callback) {
"""
Gets the sub-folders of a given folder.<p>
@param path the path of the folder whose subfolders should be retrieved
@param callback the callback for processing the subfolders
"""
m_controller.getSubFolders(p... | java | public void getSubFolders(String path, AsyncCallback<List<CmsVfsEntryBean>> callback) {
m_controller.getSubFolders(path, callback);
} | [
"public",
"void",
"getSubFolders",
"(",
"String",
"path",
",",
"AsyncCallback",
"<",
"List",
"<",
"CmsVfsEntryBean",
">",
">",
"callback",
")",
"{",
"m_controller",
".",
"getSubFolders",
"(",
"path",
",",
"callback",
")",
";",
"}"
] | Gets the sub-folders of a given folder.<p>
@param path the path of the folder whose subfolders should be retrieved
@param callback the callback for processing the subfolders | [
"Gets",
"the",
"sub",
"-",
"folders",
"of",
"a",
"given",
"folder",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsVfsTabHandler.java#L123-L126 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/QueryParserBase.java | QueryParserBase.appendPagination | protected void appendPagination(SolrQuery query, @Nullable Long offset, @Nullable Integer rows) {
"""
Append pagination information {@code start, rows} to {@link SolrQuery}
@param query
@param offset
@param rows
"""
if (offset != null && offset.intValue() >= 0) {
query.setStart(offset.intValue());
... | java | protected void appendPagination(SolrQuery query, @Nullable Long offset, @Nullable Integer rows) {
if (offset != null && offset.intValue() >= 0) {
query.setStart(offset.intValue());
}
if (rows != null && rows >= 0) {
query.setRows(rows);
}
} | [
"protected",
"void",
"appendPagination",
"(",
"SolrQuery",
"query",
",",
"@",
"Nullable",
"Long",
"offset",
",",
"@",
"Nullable",
"Integer",
"rows",
")",
"{",
"if",
"(",
"offset",
"!=",
"null",
"&&",
"offset",
".",
"intValue",
"(",
")",
">=",
"0",
")",
... | Append pagination information {@code start, rows} to {@link SolrQuery}
@param query
@param offset
@param rows | [
"Append",
"pagination",
"information",
"{",
"@code",
"start",
"rows",
"}",
"to",
"{",
"@link",
"SolrQuery",
"}"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/QueryParserBase.java#L420-L428 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/frameworks/angularjs/FunctionWriter.java | FunctionWriter.writeInjectDependenciesOnObject | public void writeInjectDependenciesOnObject(Writer writer, String object, String... dependencies) throws IOException {
"""
\tobject.$inject = ['dep1', 'dep2'];
@param writer
@param object
@param dependencies
@throws IOException
"""
if (dependencies != null && dependencies.length > 0) {
writer.append... | java | public void writeInjectDependenciesOnObject(Writer writer, String object, String... dependencies) throws IOException {
if (dependencies != null && dependencies.length > 0) {
writer.append(TAB).append(object).append(DOT).append("$inject").append(SPACEOPTIONAL).append(EQUALS).append(SPACEOPTIONAL).append(OPENBRACKET... | [
"public",
"void",
"writeInjectDependenciesOnObject",
"(",
"Writer",
"writer",
",",
"String",
"object",
",",
"String",
"...",
"dependencies",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dependencies",
"!=",
"null",
"&&",
"dependencies",
".",
"length",
">",
"0"... | \tobject.$inject = ['dep1', 'dep2'];
@param writer
@param object
@param dependencies
@throws IOException | [
"\\",
"tobject",
".",
"$inject",
"=",
"[",
"dep1",
"dep2",
"]",
";"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/frameworks/angularjs/FunctionWriter.java#L23-L29 |
js-lib-com/dom | src/main/java/js/dom/w3c/DocumentBuilderImpl.java | DocumentBuilderImpl.loadHTML | private static Document loadHTML(InputSource source, boolean useNamespace) throws SAXException, IOException {
"""
Helper for loading HTML document from input source.
@param source input source,
@param useNamespace flag set to true if document should be name space aware.
@return newly created HTML document.
@... | java | private static Document loadHTML(InputSource source, boolean useNamespace) throws SAXException, IOException {
DOMParser parser = new DOMParser();
// source http://nekohtml.sourceforge.net/faq.html#hierarchy
parser.setFeature(FEAT_NAMESPACES, useNamespace);
parser.parse(source);
return new DocumentImpl(pa... | [
"private",
"static",
"Document",
"loadHTML",
"(",
"InputSource",
"source",
",",
"boolean",
"useNamespace",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"DOMParser",
"parser",
"=",
"new",
"DOMParser",
"(",
")",
";",
"// source http://nekohtml.sourceforge.net... | Helper for loading HTML document from input source.
@param source input source,
@param useNamespace flag set to true if document should be name space aware.
@return newly created HTML document.
@throws SAXException if input source is not valid XML,
@throws IOException if reading from input stream fails. | [
"Helper",
"for",
"loading",
"HTML",
"document",
"from",
"input",
"source",
"."
] | train | https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/DocumentBuilderImpl.java#L344-L350 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/tasks/net/ThreadBoundJschLogger.java | ThreadBoundJschLogger.getInstance | public static ThreadBoundJschLogger getInstance(final PluginLogger logger, final int loggingLevel) {
"""
Bind to static Jsch logger, and return the logger instance
@return the shared instance
@param logger logger
@param loggingLevel level
"""
getInstance();
instance.setThreadLogger(logger, l... | java | public static ThreadBoundJschLogger getInstance(final PluginLogger logger, final int loggingLevel) {
getInstance();
instance.setThreadLogger(logger, loggingLevel);
return instance;
} | [
"public",
"static",
"ThreadBoundJschLogger",
"getInstance",
"(",
"final",
"PluginLogger",
"logger",
",",
"final",
"int",
"loggingLevel",
")",
"{",
"getInstance",
"(",
")",
";",
"instance",
".",
"setThreadLogger",
"(",
"logger",
",",
"loggingLevel",
")",
";",
"re... | Bind to static Jsch logger, and return the logger instance
@return the shared instance
@param logger logger
@param loggingLevel level | [
"Bind",
"to",
"static",
"Jsch",
"logger",
"and",
"return",
"the",
"logger",
"instance"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/tasks/net/ThreadBoundJschLogger.java#L58-L62 |
protegeproject/jpaul | src/main/java/jpaul/Constraints/SetConstraints/SVar.java | SVar.join | public boolean join(Set<T> s1, Set<T> s2) {
"""
Adds all the elements from <code>s2</code> to
<code>s1</code>.
"""
return s1.addAll(s2);
} | java | public boolean join(Set<T> s1, Set<T> s2) {
return s1.addAll(s2);
} | [
"public",
"boolean",
"join",
"(",
"Set",
"<",
"T",
">",
"s1",
",",
"Set",
"<",
"T",
">",
"s2",
")",
"{",
"return",
"s1",
".",
"addAll",
"(",
"s2",
")",
";",
"}"
] | Adds all the elements from <code>s2</code> to
<code>s1</code>. | [
"Adds",
"all",
"the",
"elements",
"from",
"<code",
">",
"s2<",
"/",
"code",
">",
"to",
"<code",
">",
"s1<",
"/",
"code",
">",
"."
] | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Constraints/SetConstraints/SVar.java#L55-L57 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.