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 |
|---|---|---|---|---|---|---|---|---|---|---|
spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java | MainFrameComponentFactory.setSourceTab | void setSourceTab(String title, @CheckForNull BugInstance bug) {
"""
Sets the title of the source tabs for either docking or non-docking
versions.
"""
JComponent label = mainFrame.getGuiLayout().getSourceViewComponent();
if (label != null) {
removeLink(label);
}
mai... | java | void setSourceTab(String title, @CheckForNull BugInstance bug) {
JComponent label = mainFrame.getGuiLayout().getSourceViewComponent();
if (label != null) {
removeLink(label);
}
mainFrame.getGuiLayout().setSourceTitle(title);
} | [
"void",
"setSourceTab",
"(",
"String",
"title",
",",
"@",
"CheckForNull",
"BugInstance",
"bug",
")",
"{",
"JComponent",
"label",
"=",
"mainFrame",
".",
"getGuiLayout",
"(",
")",
".",
"getSourceViewComponent",
"(",
")",
";",
"if",
"(",
"label",
"!=",
"null",
... | Sets the title of the source tabs for either docking or non-docking
versions. | [
"Sets",
"the",
"title",
"of",
"the",
"source",
"tabs",
"for",
"either",
"docking",
"or",
"non",
"-",
"docking",
"versions",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrameComponentFactory.java#L198-L204 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java | SecStrucCalc.hasBulge | private boolean hasBulge(Ladder l1, Ladder l2) {
"""
For beta structures, we define explicitly: a bulge-linked
ladder consists of two (perfect) ladder or bridges of the
same type connected by at most one extra residue on one
strand and at most four extra residues on the other strand,
all residues in bulge-link... | java | private boolean hasBulge(Ladder l1, Ladder l2) {
boolean bulge = ((l1.btype.equals(l2.btype)) &&
(l2.from - l1.to < 6) &&
(l1.to < l2.from) &&
(l2.connectedTo == 0));
if (!bulge) return bulge;
switch(l1.btype){
case parallel:
bulge = ( (l2.lfrom - l1.lto > 0) &&
((( l2.lfrom -l1.lto < 6) ... | [
"private",
"boolean",
"hasBulge",
"(",
"Ladder",
"l1",
",",
"Ladder",
"l2",
")",
"{",
"boolean",
"bulge",
"=",
"(",
"(",
"l1",
".",
"btype",
".",
"equals",
"(",
"l2",
".",
"btype",
")",
")",
"&&",
"(",
"l2",
".",
"from",
"-",
"l1",
".",
"to",
"... | For beta structures, we define explicitly: a bulge-linked
ladder consists of two (perfect) ladder or bridges of the
same type connected by at most one extra residue on one
strand and at most four extra residues on the other strand,
all residues in bulge-linked ladders are marked "E,"
including the extra residues. | [
"For",
"beta",
"structures",
"we",
"define",
"explicitly",
":",
"a",
"bulge",
"-",
"linked",
"ladder",
"consists",
"of",
"two",
"(",
"perfect",
")",
"ladder",
"or",
"bridges",
"of",
"the",
"same",
"type",
"connected",
"by",
"at",
"most",
"one",
"extra",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java#L327-L355 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java | RunsInner.getLogSasUrl | public RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId) {
"""
Gets a link to download the run logs.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param runI... | java | public RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId) {
return getLogSasUrlWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body();
} | [
"public",
"RunGetLogResultInner",
"getLogSasUrl",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"runId",
")",
"{",
"return",
"getLogSasUrlWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"runId",
")",
"."... | Gets a link to download the run logs.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param runId The run ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown... | [
"Gets",
"a",
"link",
"to",
"download",
"the",
"run",
"logs",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/RunsInner.java#L788-L790 |
pmlopes/yoke | framework/src/main/java/com/jetdrone/vertx/yoke/util/Utils.java | Utils.readResourceToString | public static String readResourceToString(@NotNull Class<?> clazz, @NotNull String resource) {
"""
Avoid using this method for constant reads, use it only for one time only reads from resources in the classpath
"""
try {
try (Reader r = new BufferedReader(new InputStreamReader(clazz.getReso... | java | public static String readResourceToString(@NotNull Class<?> clazz, @NotNull String resource) {
try {
try (Reader r = new BufferedReader(new InputStreamReader(clazz.getResourceAsStream(resource), "UTF-8"))) {
Writer writer = new StringWriter();
char[] buffer = new ch... | [
"public",
"static",
"String",
"readResourceToString",
"(",
"@",
"NotNull",
"Class",
"<",
"?",
">",
"clazz",
",",
"@",
"NotNull",
"String",
"resource",
")",
"{",
"try",
"{",
"try",
"(",
"Reader",
"r",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamRe... | Avoid using this method for constant reads, use it only for one time only reads from resources in the classpath | [
"Avoid",
"using",
"this",
"method",
"for",
"constant",
"reads",
"use",
"it",
"only",
"for",
"one",
"time",
"only",
"reads",
"from",
"resources",
"in",
"the",
"classpath"
] | train | https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/util/Utils.java#L60-L77 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/FileInfo.java | FileInfo.convertToDirectoryPath | public static URI convertToDirectoryPath(PathCodec pathCodec, URI path) {
"""
Converts the given path to look like a directory path.
If the path already looks like a directory path then
this call is a no-op.
@param path Path to convert.
@return Directory path for the given path.
"""
StorageResourceId... | java | public static URI convertToDirectoryPath(PathCodec pathCodec, URI path) {
StorageResourceId resourceId = pathCodec.validatePathAndGetId(path, true);
if (resourceId.isStorageObject()) {
if (!objectHasDirectoryPath(resourceId.getObjectName())) {
resourceId = convertToDirectoryPath(resourceId);
... | [
"public",
"static",
"URI",
"convertToDirectoryPath",
"(",
"PathCodec",
"pathCodec",
",",
"URI",
"path",
")",
"{",
"StorageResourceId",
"resourceId",
"=",
"pathCodec",
".",
"validatePathAndGetId",
"(",
"path",
",",
"true",
")",
";",
"if",
"(",
"resourceId",
".",
... | Converts the given path to look like a directory path.
If the path already looks like a directory path then
this call is a no-op.
@param path Path to convert.
@return Directory path for the given path. | [
"Converts",
"the",
"given",
"path",
"to",
"look",
"like",
"a",
"directory",
"path",
".",
"If",
"the",
"path",
"already",
"looks",
"like",
"a",
"directory",
"path",
"then",
"this",
"call",
"is",
"a",
"no",
"-",
"op",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/FileInfo.java#L301-L312 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/IntervalRegistry.java | IntervalRegistry.createInterval | private Interval createInterval(String aName, int aLength) {
"""
This method creates a new Interval with the given name and length.
@param aName the name of the new Interval
@param aLength the length of the Interval in seconds
@return the new Interval
"""
if (aName.equals("1m")){
System.out.println("... | java | private Interval createInterval(String aName, int aLength) {
if (aName.equals("1m")){
System.out.println("CREATE INTERVAL 1M CALLED ");
new RuntimeException().fillInStackTrace().printStackTrace();
}
IntervalImpl interval = new IntervalImpl(obtainNextUniqueId(), aName, aLength);
if (aLength!=-1)
upda... | [
"private",
"Interval",
"createInterval",
"(",
"String",
"aName",
",",
"int",
"aLength",
")",
"{",
"if",
"(",
"aName",
".",
"equals",
"(",
"\"1m\"",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"CREATE INTERVAL 1M CALLED \"",
")",
";",
"new",... | This method creates a new Interval with the given name and length.
@param aName the name of the new Interval
@param aLength the length of the Interval in seconds
@return the new Interval | [
"This",
"method",
"creates",
"a",
"new",
"Interval",
"with",
"the",
"given",
"name",
"and",
"length",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/stats/impl/IntervalRegistry.java#L182-L206 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupResourceVaultConfigsInner.java | BackupResourceVaultConfigsInner.getAsync | public Observable<BackupResourceVaultConfigResourceInner> getAsync(String vaultName, String resourceGroupName) {
"""
Fetches resource vault config.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@t... | java | public Observable<BackupResourceVaultConfigResourceInner> getAsync(String vaultName, String resourceGroupName) {
return getWithServiceResponseAsync(vaultName, resourceGroupName).map(new Func1<ServiceResponse<BackupResourceVaultConfigResourceInner>, BackupResourceVaultConfigResourceInner>() {
@Overri... | [
"public",
"Observable",
"<",
"BackupResourceVaultConfigResourceInner",
">",
"getAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"vaultName",
",",
"resourceGroupName",
")",
".",
"map",
"(",
... | Fetches resource vault config.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the BackupResourceVaultConfi... | [
"Fetches",
"resource",
"vault",
"config",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupResourceVaultConfigsInner.java#L102-L109 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkingIteratorSorted.java | WalkingIteratorSorted.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize) {
"""
This function is used to perform some extra analysis of the iterator.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable referenc... | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
super.fixupVariables(vars, globalsSize);
int analysis = getAnalysisBits();
if(WalkerFactory.isNaturalDocOrder(analysis))
{
m_inNaturalOrderStatic = true;
}
else
{
m_inNaturalOrderStatic = false;
// System.... | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"super",
".",
"fixupVariables",
"(",
"vars",
",",
"globalsSize",
")",
";",
"int",
"analysis",
"=",
"getAnalysisBits",
"(",
")",
";",
... | This function is used to perform some extra analysis of the iterator.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector from the start of the vector wil... | [
"This",
"function",
"is",
"used",
"to",
"perform",
"some",
"extra",
"analysis",
"of",
"the",
"iterator",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkingIteratorSorted.java#L196-L212 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageLoaderCurrent.java | ImageLoaderCurrent.processPermission | private void processPermission(DataInputStream in, ImageVisitor v)
throws IOException {
"""
Extract the INode permissions stored in the fsimage file.
@param in Datastream to process
@param v Visitor to walk over inodes
"""
v.visitEnclosingElement(ImageElement.PERMISSIONS);
v.visit(ImageElemen... | java | private void processPermission(DataInputStream in, ImageVisitor v)
throws IOException {
v.visitEnclosingElement(ImageElement.PERMISSIONS);
v.visit(ImageElement.USER_NAME, Text.readStringOpt(in));
v.visit(ImageElement.GROUP_NAME, Text.readStringOpt(in));
FsPermission fsp = new FsPermission(in.readS... | [
"private",
"void",
"processPermission",
"(",
"DataInputStream",
"in",
",",
"ImageVisitor",
"v",
")",
"throws",
"IOException",
"{",
"v",
".",
"visitEnclosingElement",
"(",
"ImageElement",
".",
"PERMISSIONS",
")",
";",
"v",
".",
"visit",
"(",
"ImageElement",
".",
... | Extract the INode permissions stored in the fsimage file.
@param in Datastream to process
@param v Visitor to walk over inodes | [
"Extract",
"the",
"INode",
"permissions",
"stored",
"in",
"the",
"fsimage",
"file",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/ImageLoaderCurrent.java#L302-L310 |
OSSIndex/java-api | src/main/java/net/ossindex/common/request/OssIndexHttpClient.java | OssIndexHttpClient.performPostRequest | public String performPostRequest(String requestString, String data) throws IOException {
"""
Perform the request with the given URL and JSON data.
@param requestString Server request relative URL
@param data JSON data for the request
@return JSON results of the request
@throws IOException On query problems
... | java | public String performPostRequest(String requestString, String data) throws IOException {
HttpPost request = new HttpPost(getBaseUrl() + requestString);
String json = null;
CloseableHttpClient httpClient = HttpClients.createDefault();
if (proxies.size() > 0) {
// We only check the first proxy for ... | [
"public",
"String",
"performPostRequest",
"(",
"String",
"requestString",
",",
"String",
"data",
")",
"throws",
"IOException",
"{",
"HttpPost",
"request",
"=",
"new",
"HttpPost",
"(",
"getBaseUrl",
"(",
")",
"+",
"requestString",
")",
";",
"String",
"json",
"=... | Perform the request with the given URL and JSON data.
@param requestString Server request relative URL
@param data JSON data for the request
@return JSON results of the request
@throws IOException On query problems | [
"Perform",
"the",
"request",
"with",
"the",
"given",
"URL",
"and",
"JSON",
"data",
"."
] | train | https://github.com/OSSIndex/java-api/blob/9caca34f08a0ca4a6ec6bdad4102de24d1b3fe0f/src/main/java/net/ossindex/common/request/OssIndexHttpClient.java#L103-L140 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setStart | public void setStart(int index, Date value) {
"""
Set a start value.
@param index start index (1-10)
@param value start value
"""
set(selectField(ResourceFieldLists.CUSTOM_START, index), value);
} | java | public void setStart(int index, Date value)
{
set(selectField(ResourceFieldLists.CUSTOM_START, index), value);
} | [
"public",
"void",
"setStart",
"(",
"int",
"index",
",",
"Date",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"CUSTOM_START",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set a start value.
@param index start index (1-10)
@param value start value | [
"Set",
"a",
"start",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L1595-L1598 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/HtmlBaseTag.java | HtmlBaseTag.setAttribute | public void setAttribute(String name, String value, String facet)
throws JspException {
"""
Base support for the <code>attribute</code> tag. This requires that the tag buffer their body and
write attribute in the end tag. For the HTML tags it is not legal to set
the <code>id</code> or <code>name</c... | java | public void setAttribute(String name, String value, String facet)
throws JspException
{
if (facet != null) {
String s = Bundle.getString("Tags_AttributeFacetNotSupported", new Object[]{facet});
registerTagError(s, null);
}
AbstractHtmlState tsh = getState(... | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"if",
"(",
"facet",
"!=",
"null",
")",
"{",
"String",
"s",
"=",
"Bundle",
".",
"getString",
"(",
"\"Tags_AttributeF... | Base support for the <code>attribute</code> tag. This requires that the tag buffer their body and
write attribute in the end tag. For the HTML tags it is not legal to set
the <code>id</code> or <code>name</code> attributes. In addition, the base tag does
not allow facets to be set. If the attribute is legal it will... | [
"Base",
"support",
"for",
"the",
"<code",
">",
"attribute<",
"/",
"code",
">",
"tag",
".",
"This",
"requires",
"that",
"the",
"tag",
"buffer",
"their",
"body",
"and",
"write",
"attribute",
"in",
"the",
"end",
"tag",
".",
"For",
"the",
"HTML",
"tags",
"... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/HtmlBaseTag.java#L488-L497 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Envelope2D.java | Envelope2D.isIntersecting | public boolean isIntersecting(double xmin_, double ymin_, double xmax_, double ymax_) {
"""
Checks if this envelope intersects the other.
@param xmin_
@param ymin_
@param xmax_
@param ymax_
@return True if this envelope intersects the other.
"""
// No need to check if empty, this will work for empty geo... | java | public boolean isIntersecting(double xmin_, double ymin_, double xmax_, double ymax_) {
// No need to check if empty, this will work for empty geoms too (IEEE
// math)
return ((xmin <= xmin_) ? xmax >= xmin_ : xmax_ >= xmin) && // check
// that x
// projections
/... | [
"public",
"boolean",
"isIntersecting",
"(",
"double",
"xmin_",
",",
"double",
"ymin_",
",",
"double",
"xmax_",
",",
"double",
"ymax_",
")",
"{",
"// No need to check if empty, this will work for empty geoms too (IEEE",
"// math)",
"return",
"(",
"(",
"xmin",
"<=",
"xm... | Checks if this envelope intersects the other.
@param xmin_
@param ymin_
@param xmax_
@param ymax_
@return True if this envelope intersects the other. | [
"Checks",
"if",
"this",
"envelope",
"intersects",
"the",
"other",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Envelope2D.java#L303-L314 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/attributedefinition/attributes/AttributeVocabularyValueUrl.java | AttributeVocabularyValueUrl.getAttributeVocabularyValueLocalizedContentsUrl | public static MozuUrl getAttributeVocabularyValueLocalizedContentsUrl(String attributeFQN, String value) {
"""
Get Resource Url for GetAttributeVocabularyValueLocalizedContents
@param attributeFQN Fully qualified name for an attribute.
@param value The value string to create.
@return String Resource Url
"... | java | public static MozuUrl getAttributeVocabularyValueLocalizedContentsUrl(String attributeFQN, String value)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/VocabularyValues/{value}/LocalizedContent");
formatter.formatUrl("attributeFQN", attribu... | [
"public",
"static",
"MozuUrl",
"getAttributeVocabularyValueLocalizedContentsUrl",
"(",
"String",
"attributeFQN",
",",
"String",
"value",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/attributedefinition/attributes/{attribut... | Get Resource Url for GetAttributeVocabularyValueLocalizedContents
@param attributeFQN Fully qualified name for an attribute.
@param value The value string to create.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetAttributeVocabularyValueLocalizedContents"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/attributedefinition/attributes/AttributeVocabularyValueUrl.java#L34-L40 |
arnaudroger/SimpleFlatMapper | sfm-map/src/main/java/org/simpleflatmapper/map/mapper/MapperBuilder.java | MapperBuilder.addMapper | @SuppressWarnings("unchecked")
public final B addMapper(FieldMapper<ROW, T> mapper) {
"""
append a FieldMapper to the mapping list.
@param mapper the field jdbcMapper
@return the current builder
"""
setRowMapperBuilder.addMapper(mapper);
return (B) this;
} | java | @SuppressWarnings("unchecked")
public final B addMapper(FieldMapper<ROW, T> mapper) {
setRowMapperBuilder.addMapper(mapper);
return (B) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"B",
"addMapper",
"(",
"FieldMapper",
"<",
"ROW",
",",
"T",
">",
"mapper",
")",
"{",
"setRowMapperBuilder",
".",
"addMapper",
"(",
"mapper",
")",
";",
"return",
"(",
"B",
")",
"this",
... | append a FieldMapper to the mapping list.
@param mapper the field jdbcMapper
@return the current builder | [
"append",
"a",
"FieldMapper",
"to",
"the",
"mapping",
"list",
"."
] | train | https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-map/src/main/java/org/simpleflatmapper/map/mapper/MapperBuilder.java#L133-L137 |
ppicas/custom-typeface | library/src/main/java/cat/ppicas/customtypeface/CustomTypeface.java | CustomTypeface.registerTypeface | public void registerTypeface(String typefaceName, AssetManager assets, String filePath) {
"""
This is a shortcut to let {@code CustomTypeface} create directly a {@link Typeface}
for you. This will create the Typeface from a file located in the assets directory.
For more information see the {@link #registerTypefa... | java | public void registerTypeface(String typefaceName, AssetManager assets, String filePath) {
Typeface typeface = Typeface.createFromAsset(assets, filePath);
mTypefaces.put(typefaceName, typeface);
} | [
"public",
"void",
"registerTypeface",
"(",
"String",
"typefaceName",
",",
"AssetManager",
"assets",
",",
"String",
"filePath",
")",
"{",
"Typeface",
"typeface",
"=",
"Typeface",
".",
"createFromAsset",
"(",
"assets",
",",
"filePath",
")",
";",
"mTypefaces",
".",... | This is a shortcut to let {@code CustomTypeface} create directly a {@link Typeface}
for you. This will create the Typeface from a file located in the assets directory.
For more information see the {@link #registerTypeface(String, Typeface)} method.
@param typefaceName a name that will identify this {@code Typeface}
@p... | [
"This",
"is",
"a",
"shortcut",
"to",
"let",
"{",
"@code",
"CustomTypeface",
"}",
"create",
"directly",
"a",
"{",
"@link",
"Typeface",
"}",
"for",
"you",
".",
"This",
"will",
"create",
"the",
"Typeface",
"from",
"a",
"file",
"located",
"in",
"the",
"asset... | train | https://github.com/ppicas/custom-typeface/blob/3a2a68cc8584a72076c545a8b7c9f741f6002241/library/src/main/java/cat/ppicas/customtypeface/CustomTypeface.java#L255-L258 |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java | AbsSetting.getStr | public String getStr(String key, String group, String defaultValue) {
"""
获得字符串类型值
@param key KEY
@param group 分组
@param defaultValue 默认值
@return 值或默认值
"""
final String value = getByGroup(key, group);
if (StrUtil.isBlank(value)) {
return defaultValue;
}
return value;
} | java | public String getStr(String key, String group, String defaultValue) {
final String value = getByGroup(key, group);
if (StrUtil.isBlank(value)) {
return defaultValue;
}
return value;
} | [
"public",
"String",
"getStr",
"(",
"String",
"key",
",",
"String",
"group",
",",
"String",
"defaultValue",
")",
"{",
"final",
"String",
"value",
"=",
"getByGroup",
"(",
"key",
",",
"group",
")",
";",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"value",
... | 获得字符串类型值
@param key KEY
@param group 分组
@param defaultValue 默认值
@return 值或默认值 | [
"获得字符串类型值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L43-L49 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/validate/PropertyValidator.java | PropertyValidator.assertOneOrMore | public void assertOneOrMore(final String propertyName,
final PropertyList properties) throws ValidationException {
"""
Ensure a property occurs at least once.
@param propertyName
the property name
@param properties
a list of properties to query
@throws ValidationException
when the specified pro... | java | public void assertOneOrMore(final String propertyName,
final PropertyList properties) throws ValidationException {
if (properties.getProperties(propertyName).size() < 1) {
throw new ValidationException(ASSERT_ONE_OR_MORE_MESSAGE, new Object[] {propertyName});
}
} | [
"public",
"void",
"assertOneOrMore",
"(",
"final",
"String",
"propertyName",
",",
"final",
"PropertyList",
"properties",
")",
"throws",
"ValidationException",
"{",
"if",
"(",
"properties",
".",
"getProperties",
"(",
"propertyName",
")",
".",
"size",
"(",
")",
"<... | Ensure a property occurs at least once.
@param propertyName
the property name
@param properties
a list of properties to query
@throws ValidationException
when the specified property occurs more than once | [
"Ensure",
"a",
"property",
"occurs",
"at",
"least",
"once",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/validate/PropertyValidator.java#L89-L95 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java | DescribePointSurf.describe | public void describe(double x, double y, double angle, double scale, TupleDesc_F64 ret) {
"""
Compute SURF descriptor, but without laplacian sign
@param x Location of interest point.
@param y Location of interest point.
@param angle The angle the feature is pointing at in radians.
@param scale Scale of the i... | java | public void describe(double x, double y, double angle, double scale, TupleDesc_F64 ret)
{
double c = Math.cos(angle),s=Math.sin(angle);
// By assuming that the entire feature is inside the image faster algorithms can be used
// the results are also of dubious value when interacting with the image border.
bool... | [
"public",
"void",
"describe",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"angle",
",",
"double",
"scale",
",",
"TupleDesc_F64",
"ret",
")",
"{",
"double",
"c",
"=",
"Math",
".",
"cos",
"(",
"angle",
")",
",",
"s",
"=",
"Math",
".",
"sin... | Compute SURF descriptor, but without laplacian sign
@param x Location of interest point.
@param y Location of interest point.
@param angle The angle the feature is pointing at in radians.
@param scale Scale of the interest point. Null is returned if the feature goes outside the image border.
@param ret storage for the... | [
"Compute",
"SURF",
"descriptor",
"but",
"without",
"laplacian",
"sign"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSurf.java#L190-L213 |
etourdot/xincproc | xinclude/src/main/java/org/etourdot/xincproc/xinclude/XIncProcUtils.java | XIncProcUtils.resolveBase | public static URI resolveBase(final URI baseURI, final Stack<URI> stack) throws XIncludeFatalException {
"""
Resolve base {@link java.net.URI} against a {@link java.util.Stack} of uris.
@param baseURI the base uRI
@param stack the stack
@return the resolved URI
@throws XIncludeFatalException in case of inclu... | java | public static URI resolveBase(final URI baseURI, final Stack<URI> stack) throws XIncludeFatalException
{
final URI computedUri = XIncProcUtils.computeBase(stack);
final URI resolvedUri = baseURI.resolve(computedUri);
if (0 == resolvedUri.compareTo(baseURI))
{
throw new XI... | [
"public",
"static",
"URI",
"resolveBase",
"(",
"final",
"URI",
"baseURI",
",",
"final",
"Stack",
"<",
"URI",
">",
"stack",
")",
"throws",
"XIncludeFatalException",
"{",
"final",
"URI",
"computedUri",
"=",
"XIncProcUtils",
".",
"computeBase",
"(",
"stack",
")",... | Resolve base {@link java.net.URI} against a {@link java.util.Stack} of uris.
@param baseURI the base uRI
@param stack the stack
@return the resolved URI
@throws XIncludeFatalException in case of inclusion loop | [
"Resolve",
"base",
"{",
"@link",
"java",
".",
"net",
".",
"URI",
"}",
"against",
"a",
"{",
"@link",
"java",
".",
"util",
".",
"Stack",
"}",
"of",
"uris",
"."
] | train | https://github.com/etourdot/xincproc/blob/6e9e9352e1975957ae6821a04c248ea49c7323ec/xinclude/src/main/java/org/etourdot/xincproc/xinclude/XIncProcUtils.java#L123-L132 |
knowm/Datasets | datasets-reuters-21578/src/main/java/org/knowm/datasets/reuters21578/RawData2DB.java | RawData2DB.extractAttribute | protected String extractAttribute(String stringContainingAttributes, String attributeName) {
"""
Given a String containing XML-like attributes and a key, it extracts a value
@param stringContainingAttributes
@param attributeName
@return
"""
String attributeValue = "";
stringContainingAttributes ... | java | protected String extractAttribute(String stringContainingAttributes, String attributeName) {
String attributeValue = "";
stringContainingAttributes = stringContainingAttributes.replaceAll("<", "").replaceAll(">", "");
String[] keyValues = stringContainingAttributes.split(" ");
for (int i = 0; i < key... | [
"protected",
"String",
"extractAttribute",
"(",
"String",
"stringContainingAttributes",
",",
"String",
"attributeName",
")",
"{",
"String",
"attributeValue",
"=",
"\"\"",
";",
"stringContainingAttributes",
"=",
"stringContainingAttributes",
".",
"replaceAll",
"(",
"\"<\""... | Given a String containing XML-like attributes and a key, it extracts a value
@param stringContainingAttributes
@param attributeName
@return | [
"Given",
"a",
"String",
"containing",
"XML",
"-",
"like",
"attributes",
"and",
"a",
"key",
"it",
"extracts",
"a",
"value"
] | train | https://github.com/knowm/Datasets/blob/4ea16ccda1d4190a551accff78bbbe05c9c38c79/datasets-reuters-21578/src/main/java/org/knowm/datasets/reuters21578/RawData2DB.java#L293-L309 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java | ByteBufferOutputStream.prewrite | public void prewrite(byte[] b,int offset, int length) {
"""
Write byte range to start of the buffer.
@param b
@param offset
@param length
"""
ensureReserve(length);
System.arraycopy(b,offset,_buf,_start-length,length);
_start-=length;
} | java | public void prewrite(byte[] b,int offset, int length)
{
ensureReserve(length);
System.arraycopy(b,offset,_buf,_start-length,length);
_start-=length;
} | [
"public",
"void",
"prewrite",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"ensureReserve",
"(",
"length",
")",
";",
"System",
".",
"arraycopy",
"(",
"b",
",",
"offset",
",",
"_buf",
",",
"_start",
"-",
"length",
... | Write byte range to start of the buffer.
@param b
@param offset
@param length | [
"Write",
"byte",
"range",
"to",
"start",
"of",
"the",
"buffer",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L230-L235 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.recoverDeletedCertificate | public CertificateBundle recoverDeletedCertificate(String vaultBaseUrl, String certificateName) {
"""
Recovers the deleted certificate back to its current version under /certificates.
The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabl... | java | public CertificateBundle recoverDeletedCertificate(String vaultBaseUrl, String certificateName) {
return recoverDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body();
} | [
"public",
"CertificateBundle",
"recoverDeletedCertificate",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"recoverDeletedCertificateWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
")",
".",
"toBlocking",
"(",
")... | Recovers the deleted certificate back to its current version under /certificates.
The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate's... | [
"Recovers",
"the",
"deleted",
"certificate",
"back",
"to",
"its",
"current",
"version",
"under",
"/",
"certificates",
".",
"The",
"RecoverDeletedCertificate",
"operation",
"performs",
"the",
"reversal",
"of",
"the",
"Delete",
"operation",
".",
"The",
"operation",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L8709-L8711 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/font/MalisisFont.java | MalisisFont.getStringWidth | public float getStringWidth(String text, FontOptions options) {
"""
Gets the rendering width of the text.
@param text the text
@param options the options
@return the string width
"""
if (StringUtils.isEmpty(text))
return 0;
StringWalker walker = new StringWalker(text, options);
walker.walkToEnd(... | java | public float getStringWidth(String text, FontOptions options)
{
if (StringUtils.isEmpty(text))
return 0;
StringWalker walker = new StringWalker(text, options);
walker.walkToEnd();
return walker.width();
} | [
"public",
"float",
"getStringWidth",
"(",
"String",
"text",
",",
"FontOptions",
"options",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"text",
")",
")",
"return",
"0",
";",
"StringWalker",
"walker",
"=",
"new",
"StringWalker",
"(",
"text",
","... | Gets the rendering width of the text.
@param text the text
@param options the options
@return the string width | [
"Gets",
"the",
"rendering",
"width",
"of",
"the",
"text",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/font/MalisisFont.java#L457-L465 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/CFFFontSubset.java | CFFFontSubset.CountRange | int CountRange(int NumofGlyphs,int Type) {
"""
Function calculates the number of ranges in the Charset
@param NumofGlyphs The number of glyphs in the font
@param Type The format of the Charset
@return The number of ranges in the Charset data structure
"""
int num=0;
@SuppressWarnings("unused")
c... | java | int CountRange(int NumofGlyphs,int Type){
int num=0;
@SuppressWarnings("unused")
char Sid;
int i=1,nLeft;
while (i<NumofGlyphs){
num++;
Sid = getCard16();
if (Type==1)
nLeft = getCard8();
else
nLeft = getCard16();
i += nLeft+1;
}
return num;
... | [
"int",
"CountRange",
"(",
"int",
"NumofGlyphs",
",",
"int",
"Type",
")",
"{",
"int",
"num",
"=",
"0",
";",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"char",
"Sid",
";",
"int",
"i",
"=",
"1",
",",
"nLeft",
";",
"while",
"(",
"i",
"<",
"NumofG... | Function calculates the number of ranges in the Charset
@param NumofGlyphs The number of glyphs in the font
@param Type The format of the Charset
@return The number of ranges in the Charset data structure | [
"Function",
"calculates",
"the",
"number",
"of",
"ranges",
"in",
"the",
"Charset"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/CFFFontSubset.java#L243-L258 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseBlobAuditingPoliciesInner.java | DatabaseBlobAuditingPoliciesInner.getAsync | public Observable<DatabaseBlobAuditingPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Gets a database's blob auditing policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manage... | java | public Observable<DatabaseBlobAuditingPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<DatabaseBlobAuditingPolicyInner>, DatabaseBlobAuditingPolicyInner>() {
... | [
"public",
"Observable",
"<",
"DatabaseBlobAuditingPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",... | Gets a database's blob auditing policy.
@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 databaseName The name of the database.
@throws IllegalArgumentExcepti... | [
"Gets",
"a",
"database",
"s",
"blob",
"auditing",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseBlobAuditingPoliciesInner.java#L105-L112 |
geomajas/geomajas-project-client-gwt2 | plugin/corewidget/corewidget/src/main/java/org/geomajas/gwt2/plugin/corewidget/client/map/layercontrolpanel/LayerControlPanelPresenterImpl.java | LayerControlPanelPresenterImpl.isLayerVisibleAtViewPortResolution | public boolean isLayerVisibleAtViewPortResolution(ViewPort viewPort, Layer layer) {
"""
Check if current viewPort resolution is between the minimum (inclusive) and
the maximum scale (exclusive) of the layer.
Inclusive/exclusive follows SLD convention: exclusive minResolution, inclusive maxResolution.
@param v... | java | public boolean isLayerVisibleAtViewPortResolution(ViewPort viewPort, Layer layer) {
if (viewPort.getResolution() > layer.getMinResolution()
&& viewPort.getResolution() <= layer.getMaxResolution()) {
return true;
}
return false;
} | [
"public",
"boolean",
"isLayerVisibleAtViewPortResolution",
"(",
"ViewPort",
"viewPort",
",",
"Layer",
"layer",
")",
"{",
"if",
"(",
"viewPort",
".",
"getResolution",
"(",
")",
">",
"layer",
".",
"getMinResolution",
"(",
")",
"&&",
"viewPort",
".",
"getResolution... | Check if current viewPort resolution is between the minimum (inclusive) and
the maximum scale (exclusive) of the layer.
Inclusive/exclusive follows SLD convention: exclusive minResolution, inclusive maxResolution.
@param viewPort the viewPort
@param layer layer
@return whether the layer is visible in the provided view... | [
"Check",
"if",
"current",
"viewPort",
"resolution",
"is",
"between",
"the",
"minimum",
"(",
"inclusive",
")",
"and",
"the",
"maximum",
"scale",
"(",
"exclusive",
")",
"of",
"the",
"layer",
".",
"Inclusive",
"/",
"exclusive",
"follows",
"SLD",
"convention",
"... | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/corewidget/corewidget/src/main/java/org/geomajas/gwt2/plugin/corewidget/client/map/layercontrolpanel/LayerControlPanelPresenterImpl.java#L117-L123 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.leaveChat | public ApiSuccessResponse leaveChat(String id, LeaveData leaveData) throws ApiException {
"""
Leave a chat
Leave the specified chat or conference. If the agent is in a conference, the chat session stays open for the customer. If the agent is not in a conference, the chat ends for the customer but the agent can st... | java | public ApiSuccessResponse leaveChat(String id, LeaveData leaveData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = leaveChatWithHttpInfo(id, leaveData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"leaveChat",
"(",
"String",
"id",
",",
"LeaveData",
"leaveData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"leaveChatWithHttpInfo",
"(",
"id",
",",
"leaveData",
")",
";",
"return... | Leave a chat
Leave the specified chat or conference. If the agent is in a conference, the chat session stays open for the customer. If the agent is not in a conference, the chat ends for the customer but the agent can still update user data and set disposition.
@param id The ID of the chat interaction. (required)
@para... | [
"Leave",
"a",
"chat",
"Leave",
"the",
"specified",
"chat",
"or",
"conference",
".",
"If",
"the",
"agent",
"is",
"in",
"a",
"conference",
"the",
"chat",
"session",
"stays",
"open",
"for",
"the",
"customer",
".",
"If",
"the",
"agent",
"is",
"not",
"in",
... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L1186-L1189 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.listSecurityGroups | public ListSecurityGroupsResponse listSecurityGroups(ListSecurityGroupsRequest request) {
"""
Listing SecurityGroup owned by the authenticated user.
@param request The request containing all options for listing SecurityGroup owned by user.
@return The response with list of SecurityGroup which contains Security... | java | public ListSecurityGroupsResponse listSecurityGroups(ListSecurityGroupsRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, SECURITYGROUP_PREFIX);
if (!Strings.isNullOrEmpty(request.getMarker())... | [
"public",
"ListSecurityGroupsResponse",
"listSecurityGroups",
"(",
"ListSecurityGroupsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"this",
".",
"createRequest",
"(... | Listing SecurityGroup owned by the authenticated user.
@param request The request containing all options for listing SecurityGroup owned by user.
@return The response with list of SecurityGroup which contains SecurityGroup rules owned by user. | [
"Listing",
"SecurityGroup",
"owned",
"by",
"the",
"authenticated",
"user",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L1500-L1516 |
lightblueseas/jcommons-lang | src/main/java/de/alpharogroup/lang/thread/ThreadExtensions.java | ThreadExtensions.runCallableWithCpuCores | public static <T> T runCallableWithCpuCores(Callable<T> task, int cpuCores)
throws ExecutionException, InterruptedException {
"""
Creates a custom thread pool that are executed in parallel processes with the given number of
the cpu cores
@param task
the {@link Callable} task to execute
@param cpuCores
the... | java | public static <T> T runCallableWithCpuCores(Callable<T> task, int cpuCores)
throws ExecutionException, InterruptedException
{
ForkJoinPool forkJoinPool = new ForkJoinPool(cpuCores);
return forkJoinPool.submit(task).get();
} | [
"public",
"static",
"<",
"T",
">",
"T",
"runCallableWithCpuCores",
"(",
"Callable",
"<",
"T",
">",
"task",
",",
"int",
"cpuCores",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
"{",
"ForkJoinPool",
"forkJoinPool",
"=",
"new",
"ForkJoinPool",
... | Creates a custom thread pool that are executed in parallel processes with the given number of
the cpu cores
@param task
the {@link Callable} task to execute
@param cpuCores
the number of the cpu cores to run with
@param <T>
the generic type of the result
@return the result of the given task
@throws ExecutionException
... | [
"Creates",
"a",
"custom",
"thread",
"pool",
"that",
"are",
"executed",
"in",
"parallel",
"processes",
"with",
"the",
"given",
"number",
"of",
"the",
"cpu",
"cores"
] | train | https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/thread/ThreadExtensions.java#L62-L67 |
Labs64/swid-generator | src/main/java/com/labs64/utils/swid/processor/ExtendedSwidProcessor.java | ExtendedSwidProcessor.setKeywords | public ExtendedSwidProcessor setKeywords(final String... keywordList) {
"""
Defines product keywords (tag: keywords).
@param keywordList
product keywords
@return a reference to this object.
"""
KeywordsComplexType kct = new KeywordsComplexType();
if (keywordList.length > 0) {
f... | java | public ExtendedSwidProcessor setKeywords(final String... keywordList) {
KeywordsComplexType kct = new KeywordsComplexType();
if (keywordList.length > 0) {
for (String keyword : keywordList) {
kct.getKeyword().add(new Token(keyword, idGenerator.nextId()));
}
... | [
"public",
"ExtendedSwidProcessor",
"setKeywords",
"(",
"final",
"String",
"...",
"keywordList",
")",
"{",
"KeywordsComplexType",
"kct",
"=",
"new",
"KeywordsComplexType",
"(",
")",
";",
"if",
"(",
"keywordList",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
... | Defines product keywords (tag: keywords).
@param keywordList
product keywords
@return a reference to this object. | [
"Defines",
"product",
"keywords",
"(",
"tag",
":",
"keywords",
")",
"."
] | train | https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/processor/ExtendedSwidProcessor.java#L71-L80 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java | WDataTableRenderer.paintRowExpansionElement | private void paintRowExpansionElement(final WDataTable table, final XmlStringBuilder xml) {
"""
Paint the rowSelection aspects of the WDataTable.
@param table the WDataTable being rendered
@param xml the string builder in use
"""
xml.appendTagOpen("ui:rowexpansion");
switch (table.getExpandMode()) {
... | java | private void paintRowExpansionElement(final WDataTable table, final XmlStringBuilder xml) {
xml.appendTagOpen("ui:rowexpansion");
switch (table.getExpandMode()) {
case CLIENT:
xml.appendAttribute("mode", "client");
break;
case LAZY:
xml.appendAttribute("mode", "lazy");
break;
case SERVER:
... | [
"private",
"void",
"paintRowExpansionElement",
"(",
"final",
"WDataTable",
"table",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"xml",
".",
"appendTagOpen",
"(",
"\"ui:rowexpansion\"",
")",
";",
"switch",
"(",
"table",
".",
"getExpandMode",
"(",
")",
")",... | Paint the rowSelection aspects of the WDataTable.
@param table the WDataTable being rendered
@param xml the string builder in use | [
"Paint",
"the",
"rowSelection",
"aspects",
"of",
"the",
"WDataTable",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java#L190-L213 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java | Utility.encodeRun | private static final <T extends Appendable> void encodeRun(T buffer, int value, int length) {
"""
Encode a run, possibly a degenerate run (of < 4 values).
@param length The length of the run; must be > 0 && <= 0xFFFF.
"""
if (length < 4) {
for (int j=0; j<length; ++j) {
if ... | java | private static final <T extends Appendable> void encodeRun(T buffer, int value, int length) {
if (length < 4) {
for (int j=0; j<length; ++j) {
if (value == ESCAPE) {
appendInt(buffer, value);
}
appendInt(buffer, value);
... | [
"private",
"static",
"final",
"<",
"T",
"extends",
"Appendable",
">",
"void",
"encodeRun",
"(",
"T",
"buffer",
",",
"int",
"value",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"<",
"4",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j... | Encode a run, possibly a degenerate run (of < 4 values).
@param length The length of the run; must be > 0 && <= 0xFFFF. | [
"Encode",
"a",
"run",
"possibly",
"a",
"degenerate",
"run",
"(",
"of",
"<",
"4",
"values",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java#L366-L387 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/JavacState.java | JavacState.addFileToTransform | private void addFileToTransform(Map<Transformer,Map<String,Set<URI>>> gs, Transformer t, Source s) {
"""
Store the source into the set of sources belonging to the given transform.
"""
Map<String,Set<URI>> fs = gs.get(t);
if (fs == null) {
fs = new HashMap<String,Set<URI>>();
... | java | private void addFileToTransform(Map<Transformer,Map<String,Set<URI>>> gs, Transformer t, Source s) {
Map<String,Set<URI>> fs = gs.get(t);
if (fs == null) {
fs = new HashMap<String,Set<URI>>();
gs.put(t, fs);
}
Set<URI> ss = fs.get(s.pkg().name());
if (ss =... | [
"private",
"void",
"addFileToTransform",
"(",
"Map",
"<",
"Transformer",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"URI",
">",
">",
">",
"gs",
",",
"Transformer",
"t",
",",
"Source",
"s",
")",
"{",
"Map",
"<",
"String",
",",
"Set",
"<",
"URI",
">... | Store the source into the set of sources belonging to the given transform. | [
"Store",
"the",
"source",
"into",
"the",
"set",
"of",
"sources",
"belonging",
"to",
"the",
"given",
"transform",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/JavacState.java#L679-L691 |
jboss/jboss-el-api_spec | src/main/java/javax/el/ELContext.java | ELContext.putContext | public void putContext(Class key, Object contextObject) {
"""
Associates a context object with this <code>ELContext</code>.
<p>The <code>ELContext</code> maintains a collection of context objects
relevant to the evaluation of an expression. These context objects
are used by <code>ELResolver</code>s. This met... | java | public void putContext(Class key, Object contextObject) {
if((key == null) || (contextObject == null)) {
throw new NullPointerException();
}
map.put(key, contextObject);
} | [
"public",
"void",
"putContext",
"(",
"Class",
"key",
",",
"Object",
"contextObject",
")",
"{",
"if",
"(",
"(",
"key",
"==",
"null",
")",
"||",
"(",
"contextObject",
"==",
"null",
")",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}"... | Associates a context object with this <code>ELContext</code>.
<p>The <code>ELContext</code> maintains a collection of context objects
relevant to the evaluation of an expression. These context objects
are used by <code>ELResolver</code>s. This method is used to
add a context object to that collection.</p>
<p>By conv... | [
"Associates",
"a",
"context",
"object",
"with",
"this",
"<code",
">",
"ELContext<",
"/",
"code",
">",
"."
] | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELContext.java#L194-L199 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/passport/AbstractHBCIPassport.java | AbstractHBCIPassport.getLowlevelJobRestrictions | public Map<String, String> getLowlevelJobRestrictions(String gvname) {
"""
<p>Gibt für einen Job alle bekannten Einschränkungen zurück, die bei
der Ausführung des jeweiligen Jobs zu beachten sind. Diese Daten werden aus den
Bankparameterdaten des aktuellen Passports extrahiert. Sie können von einer HBCI-Anwendun... | java | public Map<String, String> getLowlevelJobRestrictions(String gvname) {
if (gvname == null || gvname.length() == 0)
throw new InvalidArgumentException(HBCIUtils.getLocMsg("EXCMSG_EMPTY_JOBNAME"));
String version = getSupportedLowlevelJobs().get(gvname);
if (version == null)
... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getLowlevelJobRestrictions",
"(",
"String",
"gvname",
")",
"{",
"if",
"(",
"gvname",
"==",
"null",
"||",
"gvname",
".",
"length",
"(",
")",
"==",
"0",
")",
"throw",
"new",
"InvalidArgumentException",
"("... | <p>Gibt für einen Job alle bekannten Einschränkungen zurück, die bei
der Ausführung des jeweiligen Jobs zu beachten sind. Diese Daten werden aus den
Bankparameterdaten des aktuellen Passports extrahiert. Sie können von einer HBCI-Anwendung
benutzt werden, um gleich entsprechende Restriktionen bei der Eingabe von
Geschä... | [
"<p",
">",
"Gibt",
"für",
"einen",
"Job",
"alle",
"bekannten",
"Einschränkungen",
"zurück",
"die",
"bei",
"der",
"Ausführung",
"des",
"jeweiligen",
"Jobs",
"zu",
"beachten",
"sind",
".",
"Diese",
"Daten",
"werden",
"aus",
"den",
"Bankparameterdaten",
"des",
"a... | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/passport/AbstractHBCIPassport.java#L550-L559 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicated_server_serviceName_ipMigration_duration_POST | public OvhOrder dedicated_server_serviceName_ipMigration_duration_POST(String serviceName, String duration, String ip, String token) throws IOException {
"""
Create order
REST: POST /order/dedicated/server/{serviceName}/ipMigration/{duration}
@param ip [required] The IP to move to this server
@param token [re... | java | public OvhOrder dedicated_server_serviceName_ipMigration_duration_POST(String serviceName, String duration, String ip, String token) throws IOException {
String qPath = "/order/dedicated/server/{serviceName}/ipMigration/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
HashMap<String, Object>o =... | [
"public",
"OvhOrder",
"dedicated_server_serviceName_ipMigration_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"String",
"ip",
",",
"String",
"token",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/dedicated/server/{ser... | Create order
REST: POST /order/dedicated/server/{serviceName}/ipMigration/{duration}
@param ip [required] The IP to move to this server
@param token [required] IP migration token
@param serviceName [required] The internal name of your dedicated server
@param duration [required] Duration | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2590-L2598 |
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseEventManager.java | DatabaseEventManager.fireObjectChanged | private void fireObjectChanged(DBIDRef object, Type type) {
"""
Handles a DataStoreEvent with the specified type. If the current event type
is not equal to the specified type, the events accumulated up to now will
be fired first.
The new event will be aggregated and fired on demand if
{@link #accumulateDataS... | java | private void fireObjectChanged(DBIDRef object, Type type) {
// flush first
if(currentDataStoreEventType != null && !currentDataStoreEventType.equals(type)) {
flushDataStoreEvents();
}
if(this.dataStoreObjects == null) {
this.dataStoreObjects = DBIDUtil.newHashSet();
}
this.dataStoreO... | [
"private",
"void",
"fireObjectChanged",
"(",
"DBIDRef",
"object",
",",
"Type",
"type",
")",
"{",
"// flush first",
"if",
"(",
"currentDataStoreEventType",
"!=",
"null",
"&&",
"!",
"currentDataStoreEventType",
".",
"equals",
"(",
"type",
")",
")",
"{",
"flushData... | Handles a DataStoreEvent with the specified type. If the current event type
is not equal to the specified type, the events accumulated up to now will
be fired first.
The new event will be aggregated and fired on demand if
{@link #accumulateDataStoreEvents} is set, otherwise all registered
<code>DataStoreListener</code... | [
"Handles",
"a",
"DataStoreEvent",
"with",
"the",
"specified",
"type",
".",
"If",
"the",
"current",
"event",
"type",
"is",
"not",
"equal",
"to",
"the",
"specified",
"type",
"the",
"events",
"accumulated",
"up",
"to",
"now",
"will",
"be",
"fired",
"first",
"... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseEventManager.java#L289-L303 |
craftercms/search | crafter-search-api/src/main/java/org/craftercms/search/utils/SolrQueryUtils.java | SolrQueryUtils.escapeChars | public static String escapeChars(String str, String chars) {
"""
Escapes the characters from {@code chars} in the {@code str} parameter.
@param str
the string to escape
@param chars
the characters to escape
@return the escaped string
"""
StringBuilder sb = new StringBuilder();
for (int ... | java | public static String escapeChars(String str, String chars) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (chars.indexOf(c) >= 0) {
sb.append('\\');
}
sb.append(c);
}... | [
"public",
"static",
"String",
"escapeChars",
"(",
"String",
"str",
",",
"String",
"chars",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"str",
".",
"length",
"(",
")",
... | Escapes the characters from {@code chars} in the {@code str} parameter.
@param str
the string to escape
@param chars
the characters to escape
@return the escaped string | [
"Escapes",
"the",
"characters",
"from",
"{",
"@code",
"chars",
"}",
"in",
"the",
"{",
"@code",
"str",
"}",
"parameter",
"."
] | train | https://github.com/craftercms/search/blob/337ba446badbfbc4912cd8ccd7d50fd62d6be2cc/crafter-search-api/src/main/java/org/craftercms/search/utils/SolrQueryUtils.java#L52-L66 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.mkString | public String mkString(String rowsDelimiter, String columnsDelimiter) {
"""
Converts this matrix into the string representation.
@param rowsDelimiter the rows' delimiter
@param columnsDelimiter the columns' delimiter
@return the matrix converted to a string
"""
return mkString(DEFAULT_FORMATTER,... | java | public String mkString(String rowsDelimiter, String columnsDelimiter) {
return mkString(DEFAULT_FORMATTER, rowsDelimiter, columnsDelimiter);
} | [
"public",
"String",
"mkString",
"(",
"String",
"rowsDelimiter",
",",
"String",
"columnsDelimiter",
")",
"{",
"return",
"mkString",
"(",
"DEFAULT_FORMATTER",
",",
"rowsDelimiter",
",",
"columnsDelimiter",
")",
";",
"}"
] | Converts this matrix into the string representation.
@param rowsDelimiter the rows' delimiter
@param columnsDelimiter the columns' delimiter
@return the matrix converted to a string | [
"Converts",
"this",
"matrix",
"into",
"the",
"string",
"representation",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L1820-L1822 |
pmwmedia/tinylog | log4j1.2-api/src/main/java/org/apache/log4j/Category.java | Category.l7dlog | public void l7dlog(final Priority priority, final String key, final Throwable t) {
"""
Log a localized message. The user supplied parameter {@code key} is replaced by its localized version from the
resource bundle.
@param priority
Priority for log entry
@param key
Resource key for translation
@param t
Exc... | java | public void l7dlog(final Priority priority, final String key, final Throwable t) {
ResourceBundle bundle = this.bundle;
String message = bundle == null ? key : bundle.getString(key);
provider.log(STACKTRACE_DEPTH, null, translatePriority(priority), t, message, (Object[]) null);
} | [
"public",
"void",
"l7dlog",
"(",
"final",
"Priority",
"priority",
",",
"final",
"String",
"key",
",",
"final",
"Throwable",
"t",
")",
"{",
"ResourceBundle",
"bundle",
"=",
"this",
".",
"bundle",
";",
"String",
"message",
"=",
"bundle",
"==",
"null",
"?",
... | Log a localized message. The user supplied parameter {@code key} is replaced by its localized version from the
resource bundle.
@param priority
Priority for log entry
@param key
Resource key for translation
@param t
Exception to log
@see #setResourceBundle
@since 0.8.4 | [
"Log",
"a",
"localized",
"message",
".",
"The",
"user",
"supplied",
"parameter",
"{",
"@code",
"key",
"}",
"is",
"replaced",
"by",
"its",
"localized",
"version",
"from",
"the",
"resource",
"bundle",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/log4j1.2-api/src/main/java/org/apache/log4j/Category.java#L628-L633 |
bladecoder/blade-ink | src/main/java/com/bladecoder/ink/runtime/Story.java | Story.choosePathString | public void choosePathString(String path, boolean resetCallstack, Object[] arguments) throws Exception {
"""
Change the current position of the story to the given path. From here you can
call Continue() to evaluate the next line.
The path String is a dot-separated path as used ly by the engine. These
examples... | java | public void choosePathString(String path, boolean resetCallstack, Object[] arguments) throws Exception {
ifAsyncWeCant("call ChoosePathString right now");
if (resetCallstack) {
resetCallstack();
} else {
// ChoosePathString is potentially dangerous since you can call it when the
// stack is
// pretty... | [
"public",
"void",
"choosePathString",
"(",
"String",
"path",
",",
"boolean",
"resetCallstack",
",",
"Object",
"[",
"]",
"arguments",
")",
"throws",
"Exception",
"{",
"ifAsyncWeCant",
"(",
"\"call ChoosePathString right now\"",
")",
";",
"if",
"(",
"resetCallstack",
... | Change the current position of the story to the given path. From here you can
call Continue() to evaluate the next line.
The path String is a dot-separated path as used ly by the engine. These
examples should work:
myKnot myKnot.myStitch
Note however that this won't necessarily work:
myKnot.myStitch.myLabelledChoic... | [
"Change",
"the",
"current",
"position",
"of",
"the",
"story",
"to",
"the",
"given",
"path",
".",
"From",
"here",
"you",
"can",
"call",
"Continue",
"()",
"to",
"evaluate",
"the",
"next",
"line",
"."
] | train | https://github.com/bladecoder/blade-ink/blob/930922099f7073f50f956479adaa3cbd47c70225/src/main/java/com/bladecoder/ink/runtime/Story.java#L472-L495 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Graphics.java | Graphics.getArea | public void getArea(int x, int y, int width, int height, ByteBuffer target) {
"""
Get an ara of pixels as RGBA values into a buffer
@param x The x position in the context to grab from
@param y The y position in the context to grab from
@param width The width of the area to grab from
@param height The hiehgt ... | java | public void getArea(int x, int y, int width, int height, ByteBuffer target)
{
if (target.capacity() < width * height * 4)
{
throw new IllegalArgumentException("Byte buffer provided to get area is not big enough");
}
predraw();
GL.glReadPixels(x, screenHeight - y - height, width, height, SGL.G... | [
"public",
"void",
"getArea",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
",",
"ByteBuffer",
"target",
")",
"{",
"if",
"(",
"target",
".",
"capacity",
"(",
")",
"<",
"width",
"*",
"height",
"*",
"4",
")",
"{",
"thr... | Get an ara of pixels as RGBA values into a buffer
@param x The x position in the context to grab from
@param y The y position in the context to grab from
@param width The width of the area to grab from
@param height The hiehgt of the area to grab from
@param target The target buffer to grab into | [
"Get",
"an",
"ara",
"of",
"pixels",
"as",
"RGBA",
"values",
"into",
"a",
"buffer"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Graphics.java#L1564-L1575 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/IndexedCollectionCertStore.java | IndexedCollectionCertStore.matchX509CRLs | private void matchX509CRLs(CRLSelector selector, Collection<CRL> matches) {
"""
Iterate through all the X509CRLs and add matches to the
collection.
"""
for (Object obj : crlIssuers.values()) {
if (obj instanceof X509CRL) {
X509CRL crl = (X509CRL)obj;
if (sel... | java | private void matchX509CRLs(CRLSelector selector, Collection<CRL> matches) {
for (Object obj : crlIssuers.values()) {
if (obj instanceof X509CRL) {
X509CRL crl = (X509CRL)obj;
if (selector.match(crl)) {
matches.add(crl);
}
... | [
"private",
"void",
"matchX509CRLs",
"(",
"CRLSelector",
"selector",
",",
"Collection",
"<",
"CRL",
">",
"matches",
")",
"{",
"for",
"(",
"Object",
"obj",
":",
"crlIssuers",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"X509CRL",
")"... | Iterate through all the X509CRLs and add matches to the
collection. | [
"Iterate",
"through",
"all",
"the",
"X509CRLs",
"and",
"add",
"matches",
"to",
"the",
"collection",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/provider/certpath/IndexedCollectionCertStore.java#L404-L422 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java | ListApi.getMap | public static <A, B> Optional<Map<A, B>> getMap(final List list, final Integer... path) {
"""
Get map value by path.
@param <A> map key type
@param <B> map value type
@param list subject
@param path nodes to walk in map
@return value
"""
return get(list, Map.class, path).map(m -> (Map<A, B>) m);
... | java | public static <A, B> Optional<Map<A, B>> getMap(final List list, final Integer... path) {
return get(list, Map.class, path).map(m -> (Map<A, B>) m);
} | [
"public",
"static",
"<",
"A",
",",
"B",
">",
"Optional",
"<",
"Map",
"<",
"A",
",",
"B",
">",
">",
"getMap",
"(",
"final",
"List",
"list",
",",
"final",
"Integer",
"...",
"path",
")",
"{",
"return",
"get",
"(",
"list",
",",
"Map",
".",
"class",
... | Get map value by path.
@param <A> map key type
@param <B> map value type
@param list subject
@param path nodes to walk in map
@return value | [
"Get",
"map",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java#L172-L174 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java | SubnetworkInfo.newBuilder | public static Builder newBuilder(SubnetworkId subnetworkId, NetworkId network, String ipRange) {
"""
Returns a builder for a {@code SubnetworkInfo} object given the identity of the subnetwork, the
identity of the network this subnetwork belongs to and the range of IPv4 addresses owned by
this subnetwork. {@code ... | java | public static Builder newBuilder(SubnetworkId subnetworkId, NetworkId network, String ipRange) {
return new BuilderImpl(subnetworkId, network, ipRange);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"SubnetworkId",
"subnetworkId",
",",
"NetworkId",
"network",
",",
"String",
"ipRange",
")",
"{",
"return",
"new",
"BuilderImpl",
"(",
"subnetworkId",
",",
"network",
",",
"ipRange",
")",
";",
"}"
] | Returns a builder for a {@code SubnetworkInfo} object given the identity of the subnetwork, the
identity of the network this subnetwork belongs to and the range of IPv4 addresses owned by
this subnetwork. {@code ipRange} must be a CIDR specification, for example: {@code
192.168.0.0/16}.
@see <a href="https://wikipedia... | [
"Returns",
"a",
"builder",
"for",
"a",
"{",
"@code",
"SubnetworkInfo",
"}",
"object",
"given",
"the",
"identity",
"of",
"the",
"subnetwork",
"the",
"identity",
"of",
"the",
"network",
"this",
"subnetwork",
"belongs",
"to",
"and",
"the",
"range",
"of",
"IPv4"... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkInfo.java#L319-L321 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/security/internal/J2CSecurityHelper.java | J2CSecurityHelper.addSubjectCustomData | public static void addSubjectCustomData(Subject callSubject, Hashtable<String, Object> newCred) {
"""
This method adds the custom Hashtable provided to the private credentials of the
Subject passed in.
@param callSubject The Subject which should have its private credentials updated with the custom Hashtable
@... | java | public static void addSubjectCustomData(Subject callSubject, Hashtable<String, Object> newCred) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "addSubjectCustomData", newCred);
}
AddPrivateCredentials action = new AddPrivateCredentials(callSubject, ... | [
"public",
"static",
"void",
"addSubjectCustomData",
"(",
"Subject",
"callSubject",
",",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"newCred",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"... | This method adds the custom Hashtable provided to the private credentials of the
Subject passed in.
@param callSubject The Subject which should have its private credentials updated with the custom Hashtable
@param newCred The custom Hashtable with information in the format required for WebSphere
to do a Hashtable logi... | [
"This",
"method",
"adds",
"the",
"custom",
"Hashtable",
"provided",
"to",
"the",
"private",
"credentials",
"of",
"the",
"Subject",
"passed",
"in",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/security/internal/J2CSecurityHelper.java#L161-L170 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java | Utils.splitNicely | public static List<String> splitNicely( String toSplit, String separator ) {
"""
Splits a string and formats the result.
@param toSplit the string to split (can be null)
@param separator the separator (cannot be null or the empty string)
@return a list of items (never null), with every item being trimmed
""... | java | public static List<String> splitNicely( String toSplit, String separator ) {
if( separator == null || separator.isEmpty())
throw new IllegalArgumentException( "The separator cannot be null or the empty string." );
return splitNicelyWithPattern( toSplit, Pattern.quote( separator ));
} | [
"public",
"static",
"List",
"<",
"String",
">",
"splitNicely",
"(",
"String",
"toSplit",
",",
"String",
"separator",
")",
"{",
"if",
"(",
"separator",
"==",
"null",
"||",
"separator",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",... | Splits a string and formats the result.
@param toSplit the string to split (can be null)
@param separator the separator (cannot be null or the empty string)
@return a list of items (never null), with every item being trimmed | [
"Splits",
"a",
"string",
"and",
"formats",
"the",
"result",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/Utils.java#L132-L138 |
sannies/mp4parser | muxer/src/main/java/org/mp4parser/muxer/builder/FragmentedMp4Builder.java | FragmentedMp4Builder.createMoof | protected ParsableBox createMoof(long startSample, long endSample, Track track, int sequenceNumber) {
"""
Creates a 'moof' box for a given sequence of samples.
@param startSample low endpoint (inclusive) of the sample sequence
@param endSample high endpoint (exclusive) of the sample sequence
@param tr... | java | protected ParsableBox createMoof(long startSample, long endSample, Track track, int sequenceNumber) {
MovieFragmentBox moof = new MovieFragmentBox();
createMfhd(startSample, endSample, track, sequenceNumber, moof);
createTraf(startSample, endSample, track, sequenceNumber, moof);
TrackRu... | [
"protected",
"ParsableBox",
"createMoof",
"(",
"long",
"startSample",
",",
"long",
"endSample",
",",
"Track",
"track",
",",
"int",
"sequenceNumber",
")",
"{",
"MovieFragmentBox",
"moof",
"=",
"new",
"MovieFragmentBox",
"(",
")",
";",
"createMfhd",
"(",
"startSam... | Creates a 'moof' box for a given sequence of samples.
@param startSample low endpoint (inclusive) of the sample sequence
@param endSample high endpoint (exclusive) of the sample sequence
@param track source of the samples
@param sequenceNumber the fragment index of the requested list of samples
@retur... | [
"Creates",
"a",
"moof",
"box",
"for",
"a",
"given",
"sequence",
"of",
"samples",
"."
] | train | https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/muxer/src/main/java/org/mp4parser/muxer/builder/FragmentedMp4Builder.java#L498-L508 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newAlternateOf | public AlternateOf newAlternateOf(QualifiedName entity1, QualifiedName entity2) {
"""
A factory method to create an instance of an alternate {@link AlternateOf}
@param entity1 an identifier for the first {@link Entity}
@param entity2 an identifier for the second {@link Entity}
@return an instance of {@link Alte... | java | public AlternateOf newAlternateOf(QualifiedName entity1, QualifiedName entity2) {
AlternateOf res = of.createAlternateOf();
res.setAlternate1(entity1);
res.setAlternate2(entity2);
return res;
} | [
"public",
"AlternateOf",
"newAlternateOf",
"(",
"QualifiedName",
"entity1",
",",
"QualifiedName",
"entity2",
")",
"{",
"AlternateOf",
"res",
"=",
"of",
".",
"createAlternateOf",
"(",
")",
";",
"res",
".",
"setAlternate1",
"(",
"entity1",
")",
";",
"res",
".",
... | A factory method to create an instance of an alternate {@link AlternateOf}
@param entity1 an identifier for the first {@link Entity}
@param entity2 an identifier for the second {@link Entity}
@return an instance of {@link AlternateOf} | [
"A",
"factory",
"method",
"to",
"create",
"an",
"instance",
"of",
"an",
"alternate",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L472-L477 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesInner.java | FirewallRulesInner.updateAsync | public Observable<FirewallRuleInner> updateAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) {
"""
Updates the specified firewall rule.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake... | java | public Observable<FirewallRuleInner> updateAsync(String resourceGroupName, String accountName, String firewallRuleName, UpdateFirewallRuleParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, accountName, firewallRuleName, parameters).map(new Func1<ServiceResponse<FirewallRuleInner>,... | [
"public",
"Observable",
"<",
"FirewallRuleInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"firewallRuleName",
",",
"UpdateFirewallRuleParameters",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync"... | Updates the specified firewall rule.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Store account.
@param firewallRuleName The name of the firewall rule to update.
@param parameters Parameters supplied to update the firewall rule.
@throws IllegalArgumentExce... | [
"Updates",
"the",
"specified",
"firewall",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/FirewallRulesInner.java#L538-L545 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/internal/Utils.java | Utils.coerceToFloat | public static float coerceToFloat(Object value, float defaultValue) {
"""
Returns the float representation at {@code value} if it exists and is a float or can be coerced
to a float. Returns {@code defaultValue} otherwise.
"""
if (value instanceof Float) {
return (float) value;
}
if (value in... | java | public static float coerceToFloat(Object value, float defaultValue) {
if (value instanceof Float) {
return (float) value;
}
if (value instanceof Number) {
return ((Number) value).floatValue();
} else if (value instanceof String) {
try {
return Float.valueOf((String) value);
... | [
"public",
"static",
"float",
"coerceToFloat",
"(",
"Object",
"value",
",",
"float",
"defaultValue",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Float",
")",
"{",
"return",
"(",
"float",
")",
"value",
";",
"}",
"if",
"(",
"value",
"instanceof",
"Number",
... | Returns the float representation at {@code value} if it exists and is a float or can be coerced
to a float. Returns {@code defaultValue} otherwise. | [
"Returns",
"the",
"float",
"representation",
"at",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/internal/Utils.java#L123-L136 |
alipay/sofa-rpc | core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AllConnectConnectionHolder.java | AllConnectConnectionHolder.printSuccess | protected void printSuccess(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
"""
打印连接成功日志
@param interfaceId 接口名称
@param providerInfo 服务端
@param transport 连接
"""
if (LOGGER.isInfoEnabled(consumerConfig.getAppName())) {
LOGGER.infoWithApp(consumerConfig.ge... | java | protected void printSuccess(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
if (LOGGER.isInfoEnabled(consumerConfig.getAppName())) {
LOGGER.infoWithApp(consumerConfig.getAppName(), "Connect to {} provider:{} success ! The connection is "
+ NetUtils.connect... | [
"protected",
"void",
"printSuccess",
"(",
"String",
"interfaceId",
",",
"ProviderInfo",
"providerInfo",
",",
"ClientTransport",
"transport",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isInfoEnabled",
"(",
"consumerConfig",
".",
"getAppName",
"(",
")",
")",
")",
"{",
... | 打印连接成功日志
@param interfaceId 接口名称
@param providerInfo 服务端
@param transport 连接 | [
"打印连接成功日志"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AllConnectConnectionHolder.java#L696-L702 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java | SecurityCenterClient.setFindingState | public final Finding setFindingState(String name, Finding.State state, Timestamp startTime) {
"""
Updates the state of a finding.
<p>Sample code:
<pre><code>
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[F... | java | public final Finding setFindingState(String name, Finding.State state, Timestamp startTime) {
SetFindingStateRequest request =
SetFindingStateRequest.newBuilder()
.setName(name)
.setState(state)
.setStartTime(startTime)
.build();
return setFindingState(re... | [
"public",
"final",
"Finding",
"setFindingState",
"(",
"String",
"name",
",",
"Finding",
".",
"State",
"state",
",",
"Timestamp",
"startTime",
")",
"{",
"SetFindingStateRequest",
"request",
"=",
"SetFindingStateRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",... | Updates the state of a finding.
<p>Sample code:
<pre><code>
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
Finding.State state = Finding.State.STATE_UNSPECIFIED;
Timestamp startTime = Timestamp.newBuilder(... | [
"Updates",
"the",
"state",
"of",
"a",
"finding",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java#L1453-L1462 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationRootElements.java | CollationRootElements.getSecondaryAfter | int getSecondaryAfter(int index, int s) {
"""
Returns the secondary weight after [p, s] where index=findPrimary(p)
except use index=0 for p=0.
<p>Must return a weight for every root [p, s] as well as for every weight
returned by getSecondaryBefore(). If p!=0 then s can be BEFORE_WEIGHT16.
<p>Exception: [0,... | java | int getSecondaryAfter(int index, int s) {
long secTer;
int secLimit;
if(index == 0) {
// primary = 0
assert(s != 0);
index = (int)elements[IX_FIRST_SECONDARY_INDEX];
secTer = elements[index];
// Gap at the end of the secondary CE range.... | [
"int",
"getSecondaryAfter",
"(",
"int",
"index",
",",
"int",
"s",
")",
"{",
"long",
"secTer",
";",
"int",
"secLimit",
";",
"if",
"(",
"index",
"==",
"0",
")",
"{",
"// primary = 0",
"assert",
"(",
"s",
"!=",
"0",
")",
";",
"index",
"=",
"(",
"int",... | Returns the secondary weight after [p, s] where index=findPrimary(p)
except use index=0 for p=0.
<p>Must return a weight for every root [p, s] as well as for every weight
returned by getSecondaryBefore(). If p!=0 then s can be BEFORE_WEIGHT16.
<p>Exception: [0, 0] is handled by the CollationBuilder:
Both its lower an... | [
"Returns",
"the",
"secondary",
"weight",
"after",
"[",
"p",
"s",
"]",
"where",
"index",
"=",
"findPrimary",
"(",
"p",
")",
"except",
"use",
"index",
"=",
"0",
"for",
"p",
"=",
"0",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/coll/CollationRootElements.java#L353-L376 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/SurfaceConfig.java | SurfaceConfig.imports | public static SurfaceConfig imports(Xml root) {
"""
Create the surface data from node.
@param root The root reference (must not be <code>null</code>).
@return The surface data.
@throws LionEngineException If unable to read node.
"""
Check.notNull(root);
final Xml node = root.getChild(N... | java | public static SurfaceConfig imports(Xml root)
{
Check.notNull(root);
final Xml node = root.getChild(NODE_SURFACE);
final String surface = node.readString(ATT_IMAGE);
final String icon = node.readString(null, ATT_ICON);
return new SurfaceConfig(surface, icon);
} | [
"public",
"static",
"SurfaceConfig",
"imports",
"(",
"Xml",
"root",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"final",
"Xml",
"node",
"=",
"root",
".",
"getChild",
"(",
"NODE_SURFACE",
")",
";",
"final",
"String",
"surface",
"=",
"node",
... | Create the surface data from node.
@param root The root reference (must not be <code>null</code>).
@return The surface data.
@throws LionEngineException If unable to read node. | [
"Create",
"the",
"surface",
"data",
"from",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/SurfaceConfig.java#L65-L74 |
b3dgs/lionengine | lionengine-network/src/main/java/com/b3dgs/lionengine/network/ServerImpl.java | ServerImpl.receiveMessage | private void receiveMessage(ClientSocket client, DataInputStream buffer, byte from, StateConnection expected)
throws IOException {
"""
Update the receive standard message state.
@param client The client to test.
@param buffer The data buffer.
@param from The id from.
@param expected The expected ... | java | private void receiveMessage(ClientSocket client, DataInputStream buffer, byte from, StateConnection expected)
throws IOException
{
if (ServerImpl.checkValidity(client, from, expected))
{
final byte dest = buffer.readByte();
final byte type = buffer.readByte();
... | [
"private",
"void",
"receiveMessage",
"(",
"ClientSocket",
"client",
",",
"DataInputStream",
"buffer",
",",
"byte",
"from",
",",
"StateConnection",
"expected",
")",
"throws",
"IOException",
"{",
"if",
"(",
"ServerImpl",
".",
"checkValidity",
"(",
"client",
",",
"... | Update the receive standard message state.
@param client The client to test.
@param buffer The data buffer.
@param from The id from.
@param expected The expected client state.
@throws IOException If error. | [
"Update",
"the",
"receive",
"standard",
"message",
"state",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-network/src/main/java/com/b3dgs/lionengine/network/ServerImpl.java#L360-L380 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setStorageAccountAsync | public ServiceFuture<StorageBundle> setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, final ServiceCallback<StorageBundle> serviceCallback) {
"""
Creates or updates a new storage account. This operation requires the storage/se... | java | public ServiceFuture<StorageBundle> setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, final ServiceCallback<StorageBundle> serviceCallback) {
return ServiceFuture.fromResponse(setStorageAccountWithServiceResponseAsync(vault... | [
"public",
"ServiceFuture",
"<",
"StorageBundle",
">",
"setStorageAccountAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"resourceId",
",",
"String",
"activeKeyName",
",",
"boolean",
"autoRegenerateKey",
",",
"final",
"ServiceCa... | Creates or updates a new storage account. This operation requires the storage/set permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@param resourceId Storage account resource id.
@param activeKeyName Current active st... | [
"Creates",
"or",
"updates",
"a",
"new",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"set",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L9884-L9886 |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.listEntities | public List<String> listEntities(final String entityType) throws AtlasServiceException {
"""
List entities for a given entity type
@param entityType
@return
@throws AtlasServiceException
"""
JSONObject jsonResponse = callAPIWithRetries(API.LIST_ENTITIES, null, new ResourceCreator() {
@Ov... | java | public List<String> listEntities(final String entityType) throws AtlasServiceException {
JSONObject jsonResponse = callAPIWithRetries(API.LIST_ENTITIES, null, new ResourceCreator() {
@Override
public WebResource createResource() {
WebResource resource = getResource(API.LI... | [
"public",
"List",
"<",
"String",
">",
"listEntities",
"(",
"final",
"String",
"entityType",
")",
"throws",
"AtlasServiceException",
"{",
"JSONObject",
"jsonResponse",
"=",
"callAPIWithRetries",
"(",
"API",
".",
"LIST_ENTITIES",
",",
"null",
",",
"new",
"ResourceCr... | List entities for a given entity type
@param entityType
@return
@throws AtlasServiceException | [
"List",
"entities",
"for",
"a",
"given",
"entity",
"type"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L689-L699 |
dita-ot/dita-ot | src/main/java/org/dita/dost/index/Messages.java | Messages.getString | public static String getString (final String key, final Locale msgLocale) {
"""
get specific message by key and locale.
@param key key
@param msgLocale locale
@return string
"""
/*read message resource file.*/
ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, msgLocale);... | java | public static String getString (final String key, final Locale msgLocale) {
/*read message resource file.*/
ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, msgLocale);
try {
return RESOURCE_BUNDLE.getString(key);
} catch (final MissingResourceException ... | [
"public",
"static",
"String",
"getString",
"(",
"final",
"String",
"key",
",",
"final",
"Locale",
"msgLocale",
")",
"{",
"/*read message resource file.*/",
"ResourceBundle",
"RESOURCE_BUNDLE",
"=",
"ResourceBundle",
".",
"getBundle",
"(",
"BUNDLE_NAME",
",",
"msgLocal... | get specific message by key and locale.
@param key key
@param msgLocale locale
@return string | [
"get",
"specific",
"message",
"by",
"key",
"and",
"locale",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/index/Messages.java#L33-L41 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/localization/MessageInterpolator.java | MessageInterpolator.evaluateExpression | protected String evaluateExpression(final String expression, final Map<String, ?> values) throws ExpressionEvaluationException {
"""
EL式を評価する。
@param expression EL式
@param values EL式中の変数。
@return 評価した式。
@throws ExpressionEvaluationException
"""
final Map<String, Object> context = new Lin... | java | protected String evaluateExpression(final String expression, final Map<String, ?> values) throws ExpressionEvaluationException {
final Map<String, Object> context = new LinkedHashMap<String, Object>();
context.putAll(values);
// フォーマッターの追加
context.computeIfAbsent(... | [
"protected",
"String",
"evaluateExpression",
"(",
"final",
"String",
"expression",
",",
"final",
"Map",
"<",
"String",
",",
"?",
">",
"values",
")",
"throws",
"ExpressionEvaluationException",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"context",
"... | EL式を評価する。
@param expression EL式
@param values EL式中の変数。
@return 評価した式。
@throws ExpressionEvaluationException | [
"EL式を評価する。"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/localization/MessageInterpolator.java#L259-L273 |
alkacon/opencms-core | src/org/opencms/cache/CmsVfsMemoryObjectCache.java | CmsVfsMemoryObjectCache.putCachedObject | public void putCachedObject(CmsObject cms, String rootPath, Object value) {
"""
Puts an object into the cache.<p>
@param cms the CmsObject
@param rootPath the rootPath of the VFS resource to store the object for
@param value the object to store
"""
String key = getCacheKeyForCurrentProject(cms, r... | java | public void putCachedObject(CmsObject cms, String rootPath, Object value) {
String key = getCacheKeyForCurrentProject(cms, rootPath);
OpenCms.getMemoryMonitor().cacheVfsObject(key, value);
} | [
"public",
"void",
"putCachedObject",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
",",
"Object",
"value",
")",
"{",
"String",
"key",
"=",
"getCacheKeyForCurrentProject",
"(",
"cms",
",",
"rootPath",
")",
";",
"OpenCms",
".",
"getMemoryMonitor",
"(",
")"... | Puts an object into the cache.<p>
@param cms the CmsObject
@param rootPath the rootPath of the VFS resource to store the object for
@param value the object to store | [
"Puts",
"an",
"object",
"into",
"the",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cache/CmsVfsMemoryObjectCache.java#L122-L126 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/internal/CouchDbUtil.java | CouchDbUtil.setEntity | public static void setEntity(HttpConnection connnection, String body, String contentType) {
"""
Sets a JSON String as a request entity.
@param connnection The request of {@link HttpConnection}
@param body The JSON String to set.
"""
connnection.requestProperties.put("Content-type", contentTy... | java | public static void setEntity(HttpConnection connnection, String body, String contentType) {
connnection.requestProperties.put("Content-type", contentType);
connnection.setRequestBody(body);
} | [
"public",
"static",
"void",
"setEntity",
"(",
"HttpConnection",
"connnection",
",",
"String",
"body",
",",
"String",
"contentType",
")",
"{",
"connnection",
".",
"requestProperties",
".",
"put",
"(",
"\"Content-type\"",
",",
"contentType",
")",
";",
"connnection",... | Sets a JSON String as a request entity.
@param connnection The request of {@link HttpConnection}
@param body The JSON String to set. | [
"Sets",
"a",
"JSON",
"String",
"as",
"a",
"request",
"entity",
"."
] | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/internal/CouchDbUtil.java#L195-L198 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTElementDef.java | XSLTElementDef.QNameEquals | private boolean QNameEquals(String uri, String localName) {
"""
Tell if the namespace URI and local name match this
element.
@param uri The namespace uri, which may be null.
@param localName The local name of an element, which may be null.
@return true if the uri and local name arguments are considered
to m... | java | private boolean QNameEquals(String uri, String localName)
{
return (equalsMayBeNullOrZeroLen(m_namespace, uri)
&& (equalsMayBeNullOrZeroLen(m_name, localName)
|| equalsMayBeNullOrZeroLen(m_nameAlias, localName)));
} | [
"private",
"boolean",
"QNameEquals",
"(",
"String",
"uri",
",",
"String",
"localName",
")",
"{",
"return",
"(",
"equalsMayBeNullOrZeroLen",
"(",
"m_namespace",
",",
"uri",
")",
"&&",
"(",
"equalsMayBeNullOrZeroLen",
"(",
"m_name",
",",
"localName",
")",
"||",
... | Tell if the namespace URI and local name match this
element.
@param uri The namespace uri, which may be null.
@param localName The local name of an element, which may be null.
@return true if the uri and local name arguments are considered
to match the uri and local name of this element def. | [
"Tell",
"if",
"the",
"namespace",
"URI",
"and",
"local",
"name",
"match",
"this",
"element",
".",
"@param",
"uri",
"The",
"namespace",
"uri",
"which",
"may",
"be",
"null",
".",
"@param",
"localName",
"The",
"local",
"name",
"of",
"an",
"element",
"which",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTElementDef.java#L445-L451 |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.setStrings | public void setStrings(String name, String... values) {
"""
Set the array of string values for the <code>name</code> property as
as comma delimited values.
@param name property name.
@param values The values
"""
set(name, StringUtils.arrayToString(values));
} | java | public void setStrings(String name, String... values) {
set(name, StringUtils.arrayToString(values));
} | [
"public",
"void",
"setStrings",
"(",
"String",
"name",
",",
"String",
"...",
"values",
")",
"{",
"set",
"(",
"name",
",",
"StringUtils",
".",
"arrayToString",
"(",
"values",
")",
")",
";",
"}"
] | Set the array of string values for the <code>name</code> property as
as comma delimited values.
@param name property name.
@param values The values | [
"Set",
"the",
"array",
"of",
"string",
"values",
"for",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"as",
"as",
"comma",
"delimited",
"values",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L2142-L2144 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java | SubItemUtil.selectItem | @Deprecated
@SuppressWarnings("unchecked")
public static boolean selectItem(final FastAdapter adapter, final long identifier, final boolean select) {
"""
select or unselect an item with the given identifier
This will not handle the `only one selected` case. Please deselect all items first for this require... | java | @Deprecated
@SuppressWarnings("unchecked")
public static boolean selectItem(final FastAdapter adapter, final long identifier, final boolean select) {
Triple<Boolean, IItem, Integer> res = adapter.recursive(new AdapterPredicate() {
@Override
public boolean apply(@NonNull IAdapter ... | [
"@",
"Deprecated",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"boolean",
"selectItem",
"(",
"final",
"FastAdapter",
"adapter",
",",
"final",
"long",
"identifier",
",",
"final",
"boolean",
"select",
")",
"{",
"Triple",
"<",
"Boolean",... | select or unselect an item with the given identifier
This will not handle the `only one selected` case. Please deselect all items first for this requirement.
@param adapter the adapter instance
@param identifier the identifier of the item to select / deselect
@param select the new selected state of the sub item... | [
"select",
"or",
"unselect",
"an",
"item",
"with",
"the",
"given",
"identifier",
"This",
"will",
"not",
"handle",
"the",
"only",
"one",
"selected",
"case",
".",
"Please",
"deselect",
"all",
"items",
"first",
"for",
"this",
"requirement",
"."
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/utilities/SubItemUtil.java#L267-L292 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java | MSPDIWriter.writeExceptions | private void writeExceptions(Project.Calendars.Calendar calendar, List<Project.Calendars.Calendar.WeekDays.WeekDay> dayList, List<ProjectCalendarException> exceptions) {
"""
Main entry point used to determine the format used to write
calendar exceptions.
@param calendar parent calendar
@param dayList list of ... | java | private void writeExceptions(Project.Calendars.Calendar calendar, List<Project.Calendars.Calendar.WeekDays.WeekDay> dayList, List<ProjectCalendarException> exceptions)
{
// Always write legacy exception data:
// Powerproject appears not to recognise new format data at all,
// and legacy data is ign... | [
"private",
"void",
"writeExceptions",
"(",
"Project",
".",
"Calendars",
".",
"Calendar",
"calendar",
",",
"List",
"<",
"Project",
".",
"Calendars",
".",
"Calendar",
".",
"WeekDays",
".",
"WeekDay",
">",
"dayList",
",",
"List",
"<",
"ProjectCalendarException",
... | Main entry point used to determine the format used to write
calendar exceptions.
@param calendar parent calendar
@param dayList list of calendar days
@param exceptions list of exceptions | [
"Main",
"entry",
"point",
"used",
"to",
"determine",
"the",
"format",
"used",
"to",
"write",
"calendar",
"exceptions",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java#L469-L480 |
opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/tools/Reflection.java | Reflection.defaultInvoker | public static MethodHandle defaultInvoker( Method method ) {
"""
Returns a method handle that invoke a default method of an interface.
@param method the (default) method to get a method handle for.
@return a method handle that invokes the specific default method.
"""
if ( !method.isDefault() )
... | java | public static MethodHandle defaultInvoker( Method method )
{
if ( !method.isDefault() )
{
throw new IllegalArgumentException( "Not a default method: " + method );
}
try
{
return LOOKUP.unreflectSpecial( method, method.getDeclaringClass() );
}
... | [
"public",
"static",
"MethodHandle",
"defaultInvoker",
"(",
"Method",
"method",
")",
"{",
"if",
"(",
"!",
"method",
".",
"isDefault",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Not a default method: \"",
"+",
"method",
")",
";",
"}"... | Returns a method handle that invoke a default method of an interface.
@param method the (default) method to get a method handle for.
@return a method handle that invokes the specific default method. | [
"Returns",
"a",
"method",
"handle",
"that",
"invoke",
"a",
"default",
"method",
"of",
"an",
"interface",
"."
] | train | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/tools/Reflection.java#L181-L195 |
ReactiveX/RxJavaComputationExpressions | src/main/java/rx/Statement.java | Statement.ifThen | public static <R> Observable<R> ifThen(Func0<Boolean> condition, Observable<? extends R> then) {
"""
Return an Observable that emits the emissions from a specified Observable
if a condition evaluates to true, otherwise return an empty Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/R... | java | public static <R> Observable<R> ifThen(Func0<Boolean> condition, Observable<? extends R> then) {
return ifThen(condition, then, Observable.<R> empty());
} | [
"public",
"static",
"<",
"R",
">",
"Observable",
"<",
"R",
">",
"ifThen",
"(",
"Func0",
"<",
"Boolean",
">",
"condition",
",",
"Observable",
"<",
"?",
"extends",
"R",
">",
"then",
")",
"{",
"return",
"ifThen",
"(",
"condition",
",",
"then",
",",
"Obs... | Return an Observable that emits the emissions from a specified Observable
if a condition evaluates to true, otherwise return an empty Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/ifThen.png" alt="">
@param <R>
the result value type
@param condition
the conditio... | [
"Return",
"an",
"Observable",
"that",
"emits",
"the",
"emissions",
"from",
"a",
"specified",
"Observable",
"if",
"a",
"condition",
"evaluates",
"to",
"true",
"otherwise",
"return",
"an",
"empty",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"sr... | train | https://github.com/ReactiveX/RxJavaComputationExpressions/blob/f9d04ab762223b36fad47402ac36ce7969320d69/src/main/java/rx/Statement.java#L157-L159 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java | Configurations.getLong | public static long getLong(String name, long defaultVal) {
"""
Get the property object as long, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as long, return defaultVal if property is undefined.
"""
i... | java | public static long getLong(String name, long defaultVal){
if(getConfiguration().containsKey(name)){
return getConfiguration().getLong(name);
} else {
return defaultVal;
}
} | [
"public",
"static",
"long",
"getLong",
"(",
"String",
"name",
",",
"long",
"defaultVal",
")",
"{",
"if",
"(",
"getConfiguration",
"(",
")",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"getConfiguration",
"(",
")",
".",
"getLong",
"(",
"name... | Get the property object as long, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as long, return defaultVal if property is undefined. | [
"Get",
"the",
"property",
"object",
"as",
"long",
"or",
"return",
"defaultVal",
"if",
"property",
"is",
"not",
"defined",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/Configurations.java#L260-L266 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java | Transliterator.registerFactory | public static void registerFactory(String ID, Factory factory) {
"""
Register a factory object with the given ID. The factory
method should return a new instance of the given transliterator.
<p>Because ICU may choose to cache Transliterator objects internally, this must
be called at application startup, prio... | java | public static void registerFactory(String ID, Factory factory) {
registry.put(ID, factory, true);
} | [
"public",
"static",
"void",
"registerFactory",
"(",
"String",
"ID",
",",
"Factory",
"factory",
")",
"{",
"registry",
".",
"put",
"(",
"ID",
",",
"factory",
",",
"true",
")",
";",
"}"
] | Register a factory object with the given ID. The factory
method should return a new instance of the given transliterator.
<p>Because ICU may choose to cache Transliterator objects internally, this must
be called at application startup, prior to any calls to
Transliterator.getInstance to avoid undefined behavior.
@pa... | [
"Register",
"a",
"factory",
"object",
"with",
"the",
"given",
"ID",
".",
"The",
"factory",
"method",
"should",
"return",
"a",
"new",
"instance",
"of",
"the",
"given",
"transliterator",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java#L1689-L1691 |
Alluxio/alluxio | core/common/src/main/java/alluxio/master/ZkMasterInquireClient.java | ZkMasterInquireClient.getClient | public static synchronized ZkMasterInquireClient getClient(String zookeeperAddress,
String electionPath, String leaderPath, int inquireRetryCount) {
"""
Gets the client.
@param zookeeperAddress the address for Zookeeper
@param electionPath the path of the master election
@param leaderPath the path of th... | java | public static synchronized ZkMasterInquireClient getClient(String zookeeperAddress,
String electionPath, String leaderPath, int inquireRetryCount) {
ZkMasterConnectDetails connectDetails =
new ZkMasterConnectDetails(zookeeperAddress, leaderPath);
if (!sCreatedClients.containsKey(connectDetails)) {... | [
"public",
"static",
"synchronized",
"ZkMasterInquireClient",
"getClient",
"(",
"String",
"zookeeperAddress",
",",
"String",
"electionPath",
",",
"String",
"leaderPath",
",",
"int",
"inquireRetryCount",
")",
"{",
"ZkMasterConnectDetails",
"connectDetails",
"=",
"new",
"Z... | Gets the client.
@param zookeeperAddress the address for Zookeeper
@param electionPath the path of the master election
@param leaderPath the path of the leader
@param inquireRetryCount the number of times to retry connections
@return the client | [
"Gets",
"the",
"client",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/master/ZkMasterInquireClient.java#L65-L74 |
czyzby/gdx-lml | kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/asset/Disposables.java | Disposables.disposeOf | public static void disposeOf(final ObjectMap<?, ? extends Disposable> disposables) {
"""
Performs null checks and disposes of assets.
@param disposables its values will be disposed of (if they exist). Can be null.
"""
if (disposables != null) {
for (final Disposable disposable : disposab... | java | public static void disposeOf(final ObjectMap<?, ? extends Disposable> disposables) {
if (disposables != null) {
for (final Disposable disposable : disposables.values()) {
disposeOf(disposable);
}
}
} | [
"public",
"static",
"void",
"disposeOf",
"(",
"final",
"ObjectMap",
"<",
"?",
",",
"?",
"extends",
"Disposable",
">",
"disposables",
")",
"{",
"if",
"(",
"disposables",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Disposable",
"disposable",
":",
"disposab... | Performs null checks and disposes of assets.
@param disposables its values will be disposed of (if they exist). Can be null. | [
"Performs",
"null",
"checks",
"and",
"disposes",
"of",
"assets",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/asset/Disposables.java#L51-L57 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.mountZipExpanded | public static Closeable mountZipExpanded(InputStream zipData, String zipName, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
"""
Create and mount an expanded zip file in a temporary file system, returning a single handle which will unmount and
close the filesystem when closed. Th... | java | public static Closeable mountZipExpanded(InputStream zipData, String zipName, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
try {
boolean ok = false;
final TempDir tempDir = tempFileProvider.createTempDir(zipName);
try {
final... | [
"public",
"static",
"Closeable",
"mountZipExpanded",
"(",
"InputStream",
"zipData",
",",
"String",
"zipName",
",",
"VirtualFile",
"mountPoint",
",",
"TempFileProvider",
"tempFileProvider",
")",
"throws",
"IOException",
"{",
"try",
"{",
"boolean",
"ok",
"=",
"false",... | Create and mount an expanded zip file in a temporary file system, returning a single handle which will unmount and
close the filesystem when closed. The given zip data stream is closed.
@param zipData an input stream containing the zip data
@param zipName the name of the archive
@param mountPoint ... | [
"Create",
"and",
"mount",
"an",
"expanded",
"zip",
"file",
"in",
"a",
"temporary",
"file",
"system",
"returning",
"a",
"single",
"handle",
"which",
"will",
"unmount",
"and",
"close",
"the",
"filesystem",
"when",
"closed",
".",
"The",
"given",
"zip",
"data",
... | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L444-L478 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.createOrUpdate | public IotHubDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) {
"""
Create or update the metadata of an IoT hub.
Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub me... | java | public IotHubDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch).toBlocking().last().body();
} | [
"public",
"IotHubDescriptionInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"IotHubDescriptionInner",
"iotHubDescription",
",",
"String",
"ifMatch",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceG... | Create or update the metadata of an IoT hub.
Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update the IoT hub.
@param resourceGroupName The name of the resour... | [
"Create",
"or",
"update",
"the",
"metadata",
"of",
"an",
"IoT",
"hub",
".",
"Create",
"or",
"update",
"the",
"metadata",
"of",
"an",
"Iot",
"hub",
".",
"The",
"usual",
"pattern",
"to",
"modify",
"a",
"property",
"is",
"to",
"retrieve",
"the",
"IoT",
"h... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L400-L402 |
playn/playn | core/src/playn/core/TextFormat.java | TextFormat.withFont | public TextFormat withFont(String name, Font.Style style, float size) {
"""
Returns a clone of this text format with the font configured as specified.
"""
return withFont(new Font(name, style, size));
} | java | public TextFormat withFont(String name, Font.Style style, float size) {
return withFont(new Font(name, style, size));
} | [
"public",
"TextFormat",
"withFont",
"(",
"String",
"name",
",",
"Font",
".",
"Style",
"style",
",",
"float",
"size",
")",
"{",
"return",
"withFont",
"(",
"new",
"Font",
"(",
"name",
",",
"style",
",",
"size",
")",
")",
";",
"}"
] | Returns a clone of this text format with the font configured as specified. | [
"Returns",
"a",
"clone",
"of",
"this",
"text",
"format",
"with",
"the",
"font",
"configured",
"as",
"specified",
"."
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/TextFormat.java#L51-L53 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java | WorkbookUtil.createSXSSFBook | public static SXSSFWorkbook createSXSSFBook(File excelFile, String password) {
"""
创建或加载SXSSFWorkbook工作簿,只读模式
@param excelFile Excel文件
@param password Excel工作簿密码,如果无密码传{@code null}
@return {@link SXSSFWorkbook}
@since 4.1.13
"""
return toSXSSFBook(createBook(excelFile, password));
} | java | public static SXSSFWorkbook createSXSSFBook(File excelFile, String password) {
return toSXSSFBook(createBook(excelFile, password));
} | [
"public",
"static",
"SXSSFWorkbook",
"createSXSSFBook",
"(",
"File",
"excelFile",
",",
"String",
"password",
")",
"{",
"return",
"toSXSSFBook",
"(",
"createBook",
"(",
"excelFile",
",",
"password",
")",
")",
";",
"}"
] | 创建或加载SXSSFWorkbook工作簿,只读模式
@param excelFile Excel文件
@param password Excel工作簿密码,如果无密码传{@code null}
@return {@link SXSSFWorkbook}
@since 4.1.13 | [
"创建或加载SXSSFWorkbook工作簿,只读模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java#L145-L147 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.entries | public Iterable<Map.Entry<Integer, Record>> entries() {
"""
Returns a read-only Iterable on the keys and Records of the Dataframe.
@return
"""
return () -> new Iterator<Map.Entry<Integer, Record>>() {
private final Iterator<Map.Entry<Integer, Record>> it = data.records.entrySet().iterato... | java | public Iterable<Map.Entry<Integer, Record>> entries() {
return () -> new Iterator<Map.Entry<Integer, Record>>() {
private final Iterator<Map.Entry<Integer, Record>> it = data.records.entrySet().iterator();
/** {@inheritDoc} */
@Override
public boolean hasNext() {... | [
"public",
"Iterable",
"<",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Record",
">",
">",
"entries",
"(",
")",
"{",
"return",
"(",
")",
"->",
"new",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Record",
">",
">",
"(",
")",
"{",
"pri... | Returns a read-only Iterable on the keys and Records of the Dataframe.
@return | [
"Returns",
"a",
"read",
"-",
"only",
"Iterable",
"on",
"the",
"keys",
"and",
"Records",
"of",
"the",
"Dataframe",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L775-L797 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java | UrlTileGenerator.replaceXYZ | private String replaceXYZ(String url, int z, long x, long y) {
"""
Replace x, y, and z in the url
@param url
@param z
@param x
@param y
@return
"""
url = url.replaceAll(Z_VARIABLE, String.valueOf(z));
url = url.replaceAll(X_VARIABLE, String.valueOf(x));
url = url.replaceAll(Y_VARIABLE, String.val... | java | private String replaceXYZ(String url, int z, long x, long y) {
url = url.replaceAll(Z_VARIABLE, String.valueOf(z));
url = url.replaceAll(X_VARIABLE, String.valueOf(x));
url = url.replaceAll(Y_VARIABLE, String.valueOf(y));
return url;
} | [
"private",
"String",
"replaceXYZ",
"(",
"String",
"url",
",",
"int",
"z",
",",
"long",
"x",
",",
"long",
"y",
")",
"{",
"url",
"=",
"url",
".",
"replaceAll",
"(",
"Z_VARIABLE",
",",
"String",
".",
"valueOf",
"(",
"z",
")",
")",
";",
"url",
"=",
"... | Replace x, y, and z in the url
@param url
@param z
@param x
@param y
@return | [
"Replace",
"x",
"y",
"and",
"z",
"in",
"the",
"url"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/UrlTileGenerator.java#L228-L234 |
tminglei/form-binder-java | src/main/java/com/github/tminglei/bind/Mappings.java | Mappings.floatv | public static Mapping<Float> floatv(Constraint... constraints) {
"""
(convert to Float) mapping
@param constraints constraints
@return new created mapping
"""
return new FieldMapping(
InputMode.SINGLE,
mkSimpleConverter(s ->
isEmptyStr(s) ? 0.0f : F... | java | public static Mapping<Float> floatv(Constraint... constraints) {
return new FieldMapping(
InputMode.SINGLE,
mkSimpleConverter(s ->
isEmptyStr(s) ? 0.0f : Float.parseFloat(s)
), new MappingMeta(MAPPING_FLOAT, Float.class)
).constrain... | [
"public",
"static",
"Mapping",
"<",
"Float",
">",
"floatv",
"(",
"Constraint",
"...",
"constraints",
")",
"{",
"return",
"new",
"FieldMapping",
"(",
"InputMode",
".",
"SINGLE",
",",
"mkSimpleConverter",
"(",
"s",
"->",
"isEmptyStr",
"(",
"s",
")",
"?",
"0.... | (convert to Float) mapping
@param constraints constraints
@return new created mapping | [
"(",
"convert",
"to",
"Float",
")",
"mapping"
] | train | https://github.com/tminglei/form-binder-java/blob/4c0bd1e8f81ae56b21142bb525ee6b4deb7f92ab/src/main/java/com/github/tminglei/bind/Mappings.java#L92-L100 |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/writers/SarlConstructorWriter.java | SarlConstructorWriter.addAnnotations | protected void addAnnotations(ExecutableMemberDoc member, Content htmlTree) {
"""
Add annotations, except the reserved annotations.
@param member the members.
@param htmlTree the output.
"""
WriterUtils.addAnnotations(member, htmlTree, this.configuration, this.writer);
} | java | protected void addAnnotations(ExecutableMemberDoc member, Content htmlTree) {
WriterUtils.addAnnotations(member, htmlTree, this.configuration, this.writer);
} | [
"protected",
"void",
"addAnnotations",
"(",
"ExecutableMemberDoc",
"member",
",",
"Content",
"htmlTree",
")",
"{",
"WriterUtils",
".",
"addAnnotations",
"(",
"member",
",",
"htmlTree",
",",
"this",
".",
"configuration",
",",
"this",
".",
"writer",
")",
";",
"}... | Add annotations, except the reserved annotations.
@param member the members.
@param htmlTree the output. | [
"Add",
"annotations",
"except",
"the",
"reserved",
"annotations",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/writers/SarlConstructorWriter.java#L82-L84 |
wirecardBrasil/moip-sdk-java | src/main/java/br/com/moip/api/request/RequestTools.java | RequestTools.getBody | String getBody(Object object, ContentType contentType) {
"""
This method is used to get a serialized object into its equivalent JSON representation.
@param object
{@code Object} the body object.
@param contentType
{@ContentType} the content type header.
@return {@code String}
"""
if (co... | java | String getBody(Object object, ContentType contentType) {
if (contentType == ContentType.APPLICATION_FORM_URLENCODED) {
return jsonToUrlEncodedString((JsonObject) new JsonParser().parse(gson.toJson(object)));
}
return gson.toJson(object);
} | [
"String",
"getBody",
"(",
"Object",
"object",
",",
"ContentType",
"contentType",
")",
"{",
"if",
"(",
"contentType",
"==",
"ContentType",
".",
"APPLICATION_FORM_URLENCODED",
")",
"{",
"return",
"jsonToUrlEncodedString",
"(",
"(",
"JsonObject",
")",
"new",
"JsonPar... | This method is used to get a serialized object into its equivalent JSON representation.
@param object
{@code Object} the body object.
@param contentType
{@ContentType} the content type header.
@return {@code String} | [
"This",
"method",
"is",
"used",
"to",
"get",
"a",
"serialized",
"object",
"into",
"its",
"equivalent",
"JSON",
"representation",
"."
] | train | https://github.com/wirecardBrasil/moip-sdk-java/blob/5bee84fa9457d7becfd18954bf5105037f49829c/src/main/java/br/com/moip/api/request/RequestTools.java#L62-L68 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.listFromTaskNext | public PagedList<NodeFile> listFromTaskNext(final String nextPageLink) {
"""
Lists the files in a task's directory on its compute node.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws BatchE... | java | public PagedList<NodeFile> listFromTaskNext(final String nextPageLink) {
ServiceResponseWithHeaders<Page<NodeFile>, FileListFromTaskHeaders> response = listFromTaskNextSinglePageAsync(nextPageLink).toBlocking().single();
return new PagedList<NodeFile>(response.body()) {
@Override
... | [
"public",
"PagedList",
"<",
"NodeFile",
">",
"listFromTaskNext",
"(",
"final",
"String",
"nextPageLink",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"NodeFile",
">",
",",
"FileListFromTaskHeaders",
">",
"response",
"=",
"listFromTaskNextSinglePageAsync",
... | Lists the files in a task's directory on its compute node.
@param nextPageLink The NextLink from the previous successful call to List operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws BatchErrorException thrown if the request is rejected by server
@throws RuntimeException all... | [
"Lists",
"the",
"files",
"in",
"a",
"task",
"s",
"directory",
"on",
"its",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L2230-L2238 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/InstanceOfAndCastMatchWrongType.java | InstanceOfAndCastMatchWrongType.expressionsEqual | private static boolean expressionsEqual(ExpressionTree expr1, ExpressionTree expr2) {
"""
Determines whether two {@link ExpressionTree} instances are equal. Only handles the cases
relevant to this checker: array accesses, identifiers, and literals. Returns false for all
other cases.
"""
if (!expr1.getKin... | java | private static boolean expressionsEqual(ExpressionTree expr1, ExpressionTree expr2) {
if (!expr1.getKind().equals(expr2.getKind())) {
return false;
}
if (!expr1.getKind().equals(Kind.ARRAY_ACCESS)
&& !expr1.getKind().equals(Kind.IDENTIFIER)
&& !(expr1 instanceof LiteralTree)) {
... | [
"private",
"static",
"boolean",
"expressionsEqual",
"(",
"ExpressionTree",
"expr1",
",",
"ExpressionTree",
"expr2",
")",
"{",
"if",
"(",
"!",
"expr1",
".",
"getKind",
"(",
")",
".",
"equals",
"(",
"expr2",
".",
"getKind",
"(",
")",
")",
")",
"{",
"return... | Determines whether two {@link ExpressionTree} instances are equal. Only handles the cases
relevant to this checker: array accesses, identifiers, and literals. Returns false for all
other cases. | [
"Determines",
"whether",
"two",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/InstanceOfAndCastMatchWrongType.java#L203-L228 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java | CurrencyHelper.setMinimumFractionDigits | public static void setMinimumFractionDigits (@Nullable final ECurrency eCurrency, @Nonnegative final int nDecimals) {
"""
Set the minimum fraction digits to be used for formatting. Applies to the
currency-formatting and the value-formatting.
@param eCurrency
The currency it is about. If <code>null</code> is p... | java | public static void setMinimumFractionDigits (@Nullable final ECurrency eCurrency, @Nonnegative final int nDecimals)
{
getSettings (eCurrency).setMinimumFractionDigits (nDecimals);
} | [
"public",
"static",
"void",
"setMinimumFractionDigits",
"(",
"@",
"Nullable",
"final",
"ECurrency",
"eCurrency",
",",
"@",
"Nonnegative",
"final",
"int",
"nDecimals",
")",
"{",
"getSettings",
"(",
"eCurrency",
")",
".",
"setMinimumFractionDigits",
"(",
"nDecimals",
... | Set the minimum fraction digits to be used for formatting. Applies to the
currency-formatting and the value-formatting.
@param eCurrency
The currency it is about. If <code>null</code> is provided
{@link #DEFAULT_CURRENCY} is used instead.
@param nDecimals
The new minimum fraction digits. May not be negative. | [
"Set",
"the",
"minimum",
"fraction",
"digits",
"to",
"be",
"used",
"for",
"formatting",
".",
"Applies",
"to",
"the",
"currency",
"-",
"formatting",
"and",
"the",
"value",
"-",
"formatting",
"."
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java#L378-L381 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/ServerLock.java | ServerLock.createServerRunningMarkerFile | public static void createServerRunningMarkerFile(BootstrapConfig bootConfig) {
"""
Create a marker file when the server is running to determine if the JVM terminated normally.
This file is deleted automatically when the JVM exits normally, on a normal server stop.
If the marker file already exists when the serve... | java | public static void createServerRunningMarkerFile(BootstrapConfig bootConfig) {
File serverWorkArea = bootConfig.getWorkareaFile(null);
File serverRunningMarkerFile = null;
try {
serverRunningMarkerFile = new File(serverWorkArea, BootstrapConstants.SERVER_RUNNING_FILE);
se... | [
"public",
"static",
"void",
"createServerRunningMarkerFile",
"(",
"BootstrapConfig",
"bootConfig",
")",
"{",
"File",
"serverWorkArea",
"=",
"bootConfig",
".",
"getWorkareaFile",
"(",
"null",
")",
";",
"File",
"serverRunningMarkerFile",
"=",
"null",
";",
"try",
"{",
... | Create a marker file when the server is running to determine if the JVM terminated normally.
This file is deleted automatically when the JVM exits normally, on a normal server stop.
If the marker file already exists when the server is starting, it assumes the JVM abended or
the JVM process was forcefully terminated. In... | [
"Create",
"a",
"marker",
"file",
"when",
"the",
"server",
"is",
"running",
"to",
"determine",
"if",
"the",
"JVM",
"terminated",
"normally",
".",
"This",
"file",
"is",
"deleted",
"automatically",
"when",
"the",
"JVM",
"exits",
"normally",
"on",
"a",
"normal",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/ServerLock.java#L590-L603 |
facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairSchedulerServlet.java | FairSchedulerServlet.showAdminFormJobComparator | private void showAdminFormJobComparator(PrintWriter out, boolean advancedView) {
"""
Print the administration form at the bottom of the page, which currently
only includes the button for switching between FIFO and Fair Scheduling.
"""
out.print("<h2>Scheduling Mode</h2>\n");
String curMode = scheduler... | java | private void showAdminFormJobComparator(PrintWriter out, boolean advancedView) {
out.print("<h2>Scheduling Mode</h2>\n");
String curMode = scheduler.getJobComparator().toString();
String advParam = advancedView ? "&advanced" : "";
out.printf("<p>The scheduler is currently using <b>%s mode</b>.",
... | [
"private",
"void",
"showAdminFormJobComparator",
"(",
"PrintWriter",
"out",
",",
"boolean",
"advancedView",
")",
"{",
"out",
".",
"print",
"(",
"\"<h2>Scheduling Mode</h2>\\n\"",
")",
";",
"String",
"curMode",
"=",
"scheduler",
".",
"getJobComparator",
"(",
")",
"... | Print the administration form at the bottom of the page, which currently
only includes the button for switching between FIFO and Fair Scheduling. | [
"Print",
"the",
"administration",
"form",
"at",
"the",
"bottom",
"of",
"the",
"page",
"which",
"currently",
"only",
"includes",
"the",
"button",
"for",
"switching",
"between",
"FIFO",
"and",
"Fair",
"Scheduling",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairSchedulerServlet.java#L703-L711 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java | BaseDao.getFromCache | protected Object getFromCache(String cacheName, String key) {
"""
Gets an entry from cache.
@param cacheName
@param key
@return
"""
try {
ICache cache = getCache(cacheName);
return cache != null ? cache.get(key) : null;
} catch (CacheException e) {
LOGGE... | java | protected Object getFromCache(String cacheName, String key) {
try {
ICache cache = getCache(cacheName);
return cache != null ? cache.get(key) : null;
} catch (CacheException e) {
LOGGER.warn(e.getMessage(), e);
return null;
}
} | [
"protected",
"Object",
"getFromCache",
"(",
"String",
"cacheName",
",",
"String",
"key",
")",
"{",
"try",
"{",
"ICache",
"cache",
"=",
"getCache",
"(",
"cacheName",
")",
";",
"return",
"cache",
"!=",
"null",
"?",
"cache",
".",
"get",
"(",
"key",
")",
"... | Gets an entry from cache.
@param cacheName
@param key
@return | [
"Gets",
"an",
"entry",
"from",
"cache",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/BaseDao.java#L210-L218 |
michael-rapp/AndroidMaterialDialog | library/src/main/java/de/mrapp/android/dialog/decorator/WizardDialogDecorator.java | WizardDialogDecorator.inflateTabLayout | private void inflateTabLayout(@NonNull final View headerView, @NonNull final View contentView) {
"""
Inflates the tab layout, which indicates the currently shown fragment.
@param headerView
The view, which contains the dialog's header, as an instance of the class {@link
View}. The view may not be null
@param... | java | private void inflateTabLayout(@NonNull final View headerView, @NonNull final View contentView) {
LayoutInflater layoutInflater = LayoutInflater.from(getContext());
ViewGroup headerContentContainer = headerView.findViewById(R.id.header_content_container);
ViewGroup contentContainer = contentView.... | [
"private",
"void",
"inflateTabLayout",
"(",
"@",
"NonNull",
"final",
"View",
"headerView",
",",
"@",
"NonNull",
"final",
"View",
"contentView",
")",
"{",
"LayoutInflater",
"layoutInflater",
"=",
"LayoutInflater",
".",
"from",
"(",
"getContext",
"(",
")",
")",
... | Inflates the tab layout, which indicates the currently shown fragment.
@param headerView
The view, which contains the dialog's header, as an instance of the class {@link
View}. The view may not be null
@param contentView
The view, which contains the dialog's content, as an instance of the class {@link
View}. The view ... | [
"Inflates",
"the",
"tab",
"layout",
"which",
"indicates",
"the",
"currently",
"shown",
"fragment",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/library/src/main/java/de/mrapp/android/dialog/decorator/WizardDialogDecorator.java#L350-L379 |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/server/database/DatabaseSchema.java | DatabaseSchema.dumpDatabaseSchemaToFile | public static boolean dumpDatabaseSchemaToFile( DatabaseContext ctx, File file ) {
"""
Writes the current database schema to a file, in JSON format.
This file can be used to update another database.
@param ctx Database context
@param file File to be written
@return <code>true</code> if successful
"""
l... | java | public static boolean dumpDatabaseSchemaToFile( DatabaseContext ctx, File file )
{
log.info( "Dumping database schema to file " + file.getAbsolutePath() );
DatabaseDescriptionInspector inspector = new DatabaseDescriptionInspector();
DatabaseDescription dbDesc = inspector.getDatabaseDescription( ctx.db, ctx.dbh ... | [
"public",
"static",
"boolean",
"dumpDatabaseSchemaToFile",
"(",
"DatabaseContext",
"ctx",
",",
"File",
"file",
")",
"{",
"log",
".",
"info",
"(",
"\"Dumping database schema to file \"",
"+",
"file",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"DatabaseDescriptionIns... | Writes the current database schema to a file, in JSON format.
This file can be used to update another database.
@param ctx Database context
@param file File to be written
@return <code>true</code> if successful | [
"Writes",
"the",
"current",
"database",
"schema",
"to",
"a",
"file",
"in",
"JSON",
"format",
".",
"This",
"file",
"can",
"be",
"used",
"to",
"update",
"another",
"database",
"."
] | train | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/server/database/DatabaseSchema.java#L106-L130 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java | HFCAClient.createNewInstance | public static HFCAClient createNewInstance(NetworkConfig.CAInfo caInfo) throws MalformedURLException, InvalidArgumentException {
"""
Create HFCAClient from a NetworkConfig.CAInfo using default crypto suite.
@param caInfo created from NetworkConfig.getOrganizationInfo("org_name").getCertificateAuthorities()
@re... | java | public static HFCAClient createNewInstance(NetworkConfig.CAInfo caInfo) throws MalformedURLException, InvalidArgumentException {
try {
return createNewInstance(caInfo, CryptoSuite.Factory.getCryptoSuite());
} catch (MalformedURLException e) {
throw e;
} catch (Exception ... | [
"public",
"static",
"HFCAClient",
"createNewInstance",
"(",
"NetworkConfig",
".",
"CAInfo",
"caInfo",
")",
"throws",
"MalformedURLException",
",",
"InvalidArgumentException",
"{",
"try",
"{",
"return",
"createNewInstance",
"(",
"caInfo",
",",
"CryptoSuite",
".",
"Fact... | Create HFCAClient from a NetworkConfig.CAInfo using default crypto suite.
@param caInfo created from NetworkConfig.getOrganizationInfo("org_name").getCertificateAuthorities()
@return HFCAClient
@throws MalformedURLException
@throws InvalidArgumentException | [
"Create",
"HFCAClient",
"from",
"a",
"NetworkConfig",
".",
"CAInfo",
"using",
"default",
"crypto",
"suite",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java#L322-L331 |
michael-rapp/AndroidPreferenceActivity | example/src/main/java/de/mrapp/android/preference/activity/example/MainActivity.java | MainActivity.createWizardButtonListener | private OnClickListener createWizardButtonListener() {
"""
Creates and returns a listener, which allows to show a {@link PreferenceActivity}, which is
used as a wizard.
@return The listener, which has been created, as an instance of the type {@link
OnClickListener}
"""
return new OnClickListener()... | java | private OnClickListener createWizardButtonListener() {
return new OnClickListener() {
@Override
public void onClick(final View v) {
Intent intent = new Intent(MainActivity.this, WizardActivity.class);
intent.putExtra(PreferenceActivity.EXTRA_SHOW_BUTTON_B... | [
"private",
"OnClickListener",
"createWizardButtonListener",
"(",
")",
"{",
"return",
"new",
"OnClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onClick",
"(",
"final",
"View",
"v",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"M... | Creates and returns a listener, which allows to show a {@link PreferenceActivity}, which is
used as a wizard.
@return The listener, which has been created, as an instance of the type {@link
OnClickListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"show",
"a",
"{",
"@link",
"PreferenceActivity",
"}",
"which",
"is",
"used",
"as",
"a",
"wizard",
"."
] | train | https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/example/src/main/java/de/mrapp/android/preference/activity/example/MainActivity.java#L155-L171 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/SqlClosure.java | SqlClosure.sqlExecute | public static <V> V sqlExecute(final SqlVarArgsFunction<V> functional, final Object... args) {
"""
Execute a lambda {@code SqlVarArgsFunction} closure.
@param functional the lambda function
@param args arguments to pass to the lamba function
@param <V> the result type
@return the result specified by the lamb... | java | public static <V> V sqlExecute(final SqlVarArgsFunction<V> functional, final Object... args)
{
return new SqlClosure<V>() {
@Override
public V execute(Connection connection, Object... params) throws SQLException
{
return functional.execute(connection, params);
}
... | [
"public",
"static",
"<",
"V",
">",
"V",
"sqlExecute",
"(",
"final",
"SqlVarArgsFunction",
"<",
"V",
">",
"functional",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"SqlClosure",
"<",
"V",
">",
"(",
")",
"{",
"@",
"Override",
"publi... | Execute a lambda {@code SqlVarArgsFunction} closure.
@param functional the lambda function
@param args arguments to pass to the lamba function
@param <V> the result type
@return the result specified by the lambda
@since 2.5 | [
"Execute",
"a",
"lambda",
"{",
"@code",
"SqlVarArgsFunction",
"}",
"closure",
"."
] | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/SqlClosure.java#L134-L143 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XNodeSet.java | XNodeSet.greaterThanOrEqual | public boolean greaterThanOrEqual(XObject obj2)
throws javax.xml.transform.TransformerException {
"""
Tell if one object is less than the other.
@param obj2 object to compare this nodeset to
@return see this.compare(...)
@throws javax.xml.transform.TransformerException
"""
return compare... | java | public boolean greaterThanOrEqual(XObject obj2)
throws javax.xml.transform.TransformerException
{
return compare(obj2, S_GTE);
} | [
"public",
"boolean",
"greaterThanOrEqual",
"(",
"XObject",
"obj2",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"return",
"compare",
"(",
"obj2",
",",
"S_GTE",
")",
";",
"}"
] | Tell if one object is less than the other.
@param obj2 object to compare this nodeset to
@return see this.compare(...)
@throws javax.xml.transform.TransformerException | [
"Tell",
"if",
"one",
"object",
"is",
"less",
"than",
"the",
"other",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/objects/XNodeSet.java#L686-L690 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java | ActionUtil.addAction | public static ActionListener addAction(BaseComponent component, IAction action, String eventName) {
"""
Adds/removes an action to/from a component.
@param component Component to be associated with the action.
@param action Action to invoke when listener event is triggered. If null, dissociates the
event liste... | java | public static ActionListener addAction(BaseComponent component, IAction action, String eventName) {
ActionListener listener;
if (action == null) {
listener = removeAction(component, eventName);
} else {
listener = getListener(component, eventName);
... | [
"public",
"static",
"ActionListener",
"addAction",
"(",
"BaseComponent",
"component",
",",
"IAction",
"action",
",",
"String",
"eventName",
")",
"{",
"ActionListener",
"listener",
";",
"if",
"(",
"action",
"==",
"null",
")",
"{",
"listener",
"=",
"removeAction",... | Adds/removes an action to/from a component.
@param component Component to be associated with the action.
@param action Action to invoke when listener event is triggered. If null, dissociates the
event listener from the component.
@param eventName The name of the event that will trigger the action.
@return The newly cr... | [
"Adds",
"/",
"removes",
"an",
"action",
"to",
"/",
"from",
"a",
"component",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java#L111-L127 |
alkacon/opencms-core | src/org/opencms/xml/page/CmsXmlPage.java | CmsXmlPage.removeValue | public void removeValue(String name, Locale locale) {
"""
Removes an existing value with the given name and locale
from this XML document.<p>
@param name the name of the value
@param locale the locale of the value
"""
I_CmsXmlContentValue value = removeBookmark(CmsXmlUtils.createXpath(name, 1), l... | java | public void removeValue(String name, Locale locale) {
I_CmsXmlContentValue value = removeBookmark(CmsXmlUtils.createXpath(name, 1), locale);
if (value != null) {
Element element = value.getElement();
element.detach();
}
} | [
"public",
"void",
"removeValue",
"(",
"String",
"name",
",",
"Locale",
"locale",
")",
"{",
"I_CmsXmlContentValue",
"value",
"=",
"removeBookmark",
"(",
"CmsXmlUtils",
".",
"createXpath",
"(",
"name",
",",
"1",
")",
",",
"locale",
")",
";",
"if",
"(",
"valu... | Removes an existing value with the given name and locale
from this XML document.<p>
@param name the name of the value
@param locale the locale of the value | [
"Removes",
"an",
"existing",
"value",
"with",
"the",
"given",
"name",
"and",
"locale",
"from",
"this",
"XML",
"document",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/page/CmsXmlPage.java#L351-L358 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.findByUUID_G | @Override
public CommerceOrder findByUUID_G(String uuid, long groupId)
throws NoSuchOrderException {
"""
Returns the commerce order where uuid = ? and groupId = ? or throws a {@link NoSuchOrderException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching... | java | @Override
public CommerceOrder findByUUID_G(String uuid, long groupId)
throws NoSuchOrderException {
CommerceOrder commerceOrder = fetchByUUID_G(uuid, groupId);
if (commerceOrder == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("uuid=");
msg.app... | [
"@",
"Override",
"public",
"CommerceOrder",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchOrderException",
"{",
"CommerceOrder",
"commerceOrder",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"if",
"(",
"comm... | Returns the commerce order where uuid = ? and groupId = ? or throws a {@link NoSuchOrderException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce order
@throws NoSuchOrderException if a matching commerce order could not be found | [
"Returns",
"the",
"commerce",
"order",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchOrderException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L665-L691 |
Squarespace/cldr | runtime/src/main/java/com/squarespace/cldr/MessageArgsUnitParser.java | MessageArgsUnitParser.getDefaultFactorSet | protected static UnitFactorSet getDefaultFactorSet(UnitCategory category, UnitConverter converter) {
"""
Default conversion factors for each category. Some of these differ based on the locale
of the converter.
"""
switch (category) {
case ANGLE:
return UnitFactorSets.ANGLE;
case AREA:
... | java | protected static UnitFactorSet getDefaultFactorSet(UnitCategory category, UnitConverter converter) {
switch (category) {
case ANGLE:
return UnitFactorSets.ANGLE;
case AREA:
return converter.areaFactors();
case DURATION:
return UnitFactorSets.DURATION;
case ELECTRIC:
... | [
"protected",
"static",
"UnitFactorSet",
"getDefaultFactorSet",
"(",
"UnitCategory",
"category",
",",
"UnitConverter",
"converter",
")",
"{",
"switch",
"(",
"category",
")",
"{",
"case",
"ANGLE",
":",
"return",
"UnitFactorSets",
".",
"ANGLE",
";",
"case",
"AREA",
... | Default conversion factors for each category. Some of these differ based on the locale
of the converter. | [
"Default",
"conversion",
"factors",
"for",
"each",
"category",
".",
"Some",
"of",
"these",
"differ",
"based",
"on",
"the",
"locale",
"of",
"the",
"converter",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/runtime/src/main/java/com/squarespace/cldr/MessageArgsUnitParser.java#L215-L241 |
s1-platform/s1 | s1-core/src/java/org/s1/format/json/org_json_simple/JSONObject.java | JSONObject.writeJSONString | public static void writeJSONString(Map map, Writer out) throws IOException {
"""
Encode a map into JSON text and write it to out.
If this map is also a JSONAware or JSONStreamAware, JSONAware or JSONStreamAware specific behaviours will be ignored at this top level.
@see org.json.simple.JSONValue#writeJSONStrin... | java | public static void writeJSONString(Map map, Writer out) throws IOException {
if(map == null){
out.write("null");
return;
}
boolean first = true;
Iterator iter=map.entrySet().iterator();
out.write('{');
while(iter.hasNext()){
if(first)
first = false;
... | [
"public",
"static",
"void",
"writeJSONString",
"(",
"Map",
"map",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"out",
".",
"write",
"(",
"\"null\"",
")",
";",
"return",
";",
"}",
"boolean",
"first",... | Encode a map into JSON text and write it to out.
If this map is also a JSONAware or JSONStreamAware, JSONAware or JSONStreamAware specific behaviours will be ignored at this top level.
@see org.json.simple.JSONValue#writeJSONString(Object, java.io.Writer)
@param map
@param out | [
"Encode",
"a",
"map",
"into",
"JSON",
"text",
"and",
"write",
"it",
"to",
"out",
".",
"If",
"this",
"map",
"is",
"also",
"a",
"JSONAware",
"or",
"JSONStreamAware",
"JSONAware",
"or",
"JSONStreamAware",
"specific",
"behaviours",
"will",
"be",
"ignored",
"at",... | train | https://github.com/s1-platform/s1/blob/370101c13fef01af524bc171bcc1a97e5acc76e8/s1-core/src/java/org/s1/format/json/org_json_simple/JSONObject.java#L64-L87 |
jqno/equalsverifier | src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java | FieldAccessor.changeField | public void changeField(PrefabValues prefabValues, TypeTag enclosingType) {
"""
Changes the field's value to something else. The new value will never be
null. Other than that, the precise value is undefined.
Ignores static fields and fields that can't be modified reflectively.
@param prefabValues If the fie... | java | public void changeField(PrefabValues prefabValues, TypeTag enclosingType) {
modify(() -> {
Object newValue = prefabValues.giveOther(TypeTag.of(field, enclosingType), field.get(object));
field.set(object, newValue);
}, false);
} | [
"public",
"void",
"changeField",
"(",
"PrefabValues",
"prefabValues",
",",
"TypeTag",
"enclosingType",
")",
"{",
"modify",
"(",
"(",
")",
"->",
"{",
"Object",
"newValue",
"=",
"prefabValues",
".",
"giveOther",
"(",
"TypeTag",
".",
"of",
"(",
"field",
",",
... | Changes the field's value to something else. The new value will never be
null. Other than that, the precise value is undefined.
Ignores static fields and fields that can't be modified reflectively.
@param prefabValues If the field is of a type contained within
prefabValues, the new value will be taken from it.
@param... | [
"Changes",
"the",
"field",
"s",
"value",
"to",
"something",
"else",
".",
"The",
"new",
"value",
"will",
"never",
"be",
"null",
".",
"Other",
"than",
"that",
"the",
"precise",
"value",
"is",
"undefined",
"."
] | train | https://github.com/jqno/equalsverifier/blob/25d73c9cb801c8b20b257d1d1283ac6e0585ef1d/src/main/java/nl/jqno/equalsverifier/internal/reflection/FieldAccessor.java#L198-L203 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.