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 |
|---|---|---|---|---|---|---|---|---|---|---|
super-csv/super-csv | super-csv/src/main/java/org/supercsv/io/CsvBeanReader.java | CsvBeanReader.readIntoBean | private <T> T readIntoBean(final T bean, final String[] nameMapping, final CellProcessor[] processors)
throws IOException {
"""
Reads a row of a CSV file and populates the bean, using the supplied name mapping to map column values to the
appropriate fields. If processors are supplied then they are used, otherwi... | java | private <T> T readIntoBean(final T bean, final String[] nameMapping, final CellProcessor[] processors)
throws IOException {
if( readRow() ) {
if( nameMapping.length != length() ) {
throw new IllegalArgumentException(String.format(
"the nameMapping array and the number of columns read "
+ "shoul... | [
"private",
"<",
"T",
">",
"T",
"readIntoBean",
"(",
"final",
"T",
"bean",
",",
"final",
"String",
"[",
"]",
"nameMapping",
",",
"final",
"CellProcessor",
"[",
"]",
"processors",
")",
"throws",
"IOException",
"{",
"if",
"(",
"readRow",
"(",
")",
")",
"{... | Reads a row of a CSV file and populates the bean, using the supplied name mapping to map column values to the
appropriate fields. If processors are supplied then they are used, otherwise the raw String values will be used.
@param bean
the bean to populate
@param nameMapping
the name mapping array
@param processors
the... | [
"Reads",
"a",
"row",
"of",
"a",
"CSV",
"file",
"and",
"populates",
"the",
"bean",
"using",
"the",
"supplied",
"name",
"mapping",
"to",
"map",
"column",
"values",
"to",
"the",
"appropriate",
"fields",
".",
"If",
"processors",
"are",
"supplied",
"then",
"the... | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/io/CsvBeanReader.java#L259-L281 |
hibernate/hibernate-metamodelgen | src/main/java/org/hibernate/jpamodelgen/xml/XmlMetaEntity.java | XmlMetaEntity.getType | private String getType(String propertyName, String explicitTargetEntity, ElementKind expectedElementKind) {
"""
Returns the entity type for a property.
@param propertyName The property name
@param explicitTargetEntity The explicitly specified target entity type or {@code null}.
@param expectedElementKind Dete... | java | private String getType(String propertyName, String explicitTargetEntity, ElementKind expectedElementKind) {
for ( Element elem : element.getEnclosedElements() ) {
if ( !expectedElementKind.equals( elem.getKind() ) ) {
continue;
}
TypeMirror mirror;
String name = elem.getSimpleName().toString();
if... | [
"private",
"String",
"getType",
"(",
"String",
"propertyName",
",",
"String",
"explicitTargetEntity",
",",
"ElementKind",
"expectedElementKind",
")",
"{",
"for",
"(",
"Element",
"elem",
":",
"element",
".",
"getEnclosedElements",
"(",
")",
")",
"{",
"if",
"(",
... | Returns the entity type for a property.
@param propertyName The property name
@param explicitTargetEntity The explicitly specified target entity type or {@code null}.
@param expectedElementKind Determines property vs field access type
@return The entity type for this property or {@code null} if the property with the... | [
"Returns",
"the",
"entity",
"type",
"for",
"a",
"property",
"."
] | train | https://github.com/hibernate/hibernate-metamodelgen/blob/2c87b262bc03b1a5a541789fc00c54e0531a36b2/src/main/java/org/hibernate/jpamodelgen/xml/XmlMetaEntity.java#L301-L368 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/math/Permutation.java | Permutation.createForNElements | public static Permutation createForNElements(final int numElements, final Random rng) {
"""
Creates a random permutation of n elements using the supplied random number generator. Note
that for all but small numbers of elements most possible permutations will not be sampled by
this because the random generator's... | java | public static Permutation createForNElements(final int numElements, final Random rng) {
final int[] permutation = IntUtils.arange(numElements);
IntUtils.shuffle(permutation, checkNotNull(rng));
return new Permutation(permutation);
} | [
"public",
"static",
"Permutation",
"createForNElements",
"(",
"final",
"int",
"numElements",
",",
"final",
"Random",
"rng",
")",
"{",
"final",
"int",
"[",
"]",
"permutation",
"=",
"IntUtils",
".",
"arange",
"(",
"numElements",
")",
";",
"IntUtils",
".",
"shu... | Creates a random permutation of n elements using the supplied random number generator. Note
that for all but small numbers of elements most possible permutations will not be sampled by
this because the random generator's space is much smaller than the number of possible
permutations. | [
"Creates",
"a",
"random",
"permutation",
"of",
"n",
"elements",
"using",
"the",
"supplied",
"random",
"number",
"generator",
".",
"Note",
"that",
"for",
"all",
"but",
"small",
"numbers",
"of",
"elements",
"most",
"possible",
"permutations",
"will",
"not",
"be"... | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/math/Permutation.java#L44-L48 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy1st | public static <T1, T2, T3> TriPredicate<T1, T2, T3> spy1st(TriPredicate<T1, T2, T3> predicate, Box<T1> param1) {
"""
Proxies a ternary predicate spying for first parameter.
@param <T1> the predicate first parameter type
@param <T2> the predicate second parameter type
@param <T3> the predicate third parameter ... | java | public static <T1, T2, T3> TriPredicate<T1, T2, T3> spy1st(TriPredicate<T1, T2, T3> predicate, Box<T1> param1) {
return spy(predicate, Box.<Boolean>empty(), param1, Box.<T2>empty(), Box.<T3>empty());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"TriPredicate",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"spy1st",
"(",
"TriPredicate",
"<",
"T1",
",",
"T2",
",",
"T3",
">",
"predicate",
",",
"Box",
"<",
"T1",
">",
"param1",
")",
"{",
"r... | Proxies a ternary predicate spying for first parameter.
@param <T1> the predicate first parameter type
@param <T2> the predicate second parameter type
@param <T3> the predicate third parameter type
@param predicate the predicate that will be spied
@param param1 a box that will be containing the first spied parameter
@... | [
"Proxies",
"a",
"ternary",
"predicate",
"spying",
"for",
"first",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L415-L417 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java | TileBoundingBoxUtils.getWebMercatorBoundingBox | public static BoundingBox getWebMercatorBoundingBox(TileGrid tileGrid,
int zoom) {
"""
Get the Web Mercator tile bounding box from the Google Maps API tile grid
and zoom level
@param tileGrid
tile grid
@param zoom
zoom level
@return bounding box
"""
double tileSize = tileSizeWithZoom(zoom);
do... | java | public static BoundingBox getWebMercatorBoundingBox(TileGrid tileGrid,
int zoom) {
double tileSize = tileSizeWithZoom(zoom);
double minLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ (tileGrid.getMinX() * tileSize);
double maxLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)... | [
"public",
"static",
"BoundingBox",
"getWebMercatorBoundingBox",
"(",
"TileGrid",
"tileGrid",
",",
"int",
"zoom",
")",
"{",
"double",
"tileSize",
"=",
"tileSizeWithZoom",
"(",
"zoom",
")",
";",
"double",
"minLon",
"=",
"(",
"-",
"1",
"*",
"ProjectionConstants",
... | Get the Web Mercator tile bounding box from the Google Maps API tile grid
and zoom level
@param tileGrid
tile grid
@param zoom
zoom level
@return bounding box | [
"Get",
"the",
"Web",
"Mercator",
"tile",
"bounding",
"box",
"from",
"the",
"Google",
"Maps",
"API",
"tile",
"grid",
"and",
"zoom",
"level"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L375-L392 |
apache/flink | flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/util/WebLogDataGenerator.java | WebLogDataGenerator.genDocs | private static void genDocs(int noDocs, String[] filterKeyWords, String[] words, String path) {
"""
Generates the files for the documents relation. The entries apply the
following format: <br />
<code>URL | Content</code>
@param noDocs
Number of entries for the documents relation
@param filterKeyWords
A li... | java | private static void genDocs(int noDocs, String[] filterKeyWords, String[] words, String path) {
Random rand = new Random(Calendar.getInstance().getTimeInMillis());
try (BufferedWriter fw = new BufferedWriter(new FileWriter(path))) {
for (int i = 0; i < noDocs; i++) {
int wordsInDoc = rand.nextInt(40) + 10... | [
"private",
"static",
"void",
"genDocs",
"(",
"int",
"noDocs",
",",
"String",
"[",
"]",
"filterKeyWords",
",",
"String",
"[",
"]",
"words",
",",
"String",
"path",
")",
"{",
"Random",
"rand",
"=",
"new",
"Random",
"(",
"Calendar",
".",
"getInstance",
"(",
... | Generates the files for the documents relation. The entries apply the
following format: <br />
<code>URL | Content</code>
@param noDocs
Number of entries for the documents relation
@param filterKeyWords
A list of keywords that should be contained
@param words
A list of words to fill the entries
@param path
Output path... | [
"Generates",
"the",
"files",
"for",
"the",
"documents",
"relation",
".",
"The",
"entries",
"apply",
"the",
"following",
"format",
":",
"<br",
"/",
">",
"<code",
">",
"URL",
"|",
"Content<",
"/",
"code",
">"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/util/WebLogDataGenerator.java#L98-L124 |
restfb/restfb | src/main/java/com/restfb/util/UrlUtils.java | UrlUtils.urlDecode | public static String urlDecode(String string) {
"""
URL-decodes a string.
<p>
Assumes {@code string} is in {@link StandardCharsets#UTF_8} format.
@param string
The string to URL-decode.
@return The URL-decoded version of the input string, or {@code null} if {@code string} is {@code null}.
@throws IllegalSt... | java | public static String urlDecode(String string) {
if (string == null) {
return null;
}
try {
return decode(string, StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("Platform doesn't support " + StandardCharsets.UTF_8.name(), e);
... | [
"public",
"static",
"String",
"urlDecode",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"decode",
"(",
"string",
",",
"StandardCharsets",
".",
"UTF_8",
".",
"name",
"(... | URL-decodes a string.
<p>
Assumes {@code string} is in {@link StandardCharsets#UTF_8} format.
@param string
The string to URL-decode.
@return The URL-decoded version of the input string, or {@code null} if {@code string} is {@code null}.
@throws IllegalStateException
If unable to URL-decode because the JVM doesn't sup... | [
"URL",
"-",
"decodes",
"a",
"string",
".",
"<p",
">",
"Assumes",
"{",
"@code",
"string",
"}",
"is",
"in",
"{",
"@link",
"StandardCharsets#UTF_8",
"}",
"format",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/util/UrlUtils.java#L83-L92 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java | Messager.getText | String getText(String key, Object... args) {
"""
get and format message string from resource
@param key selects message from resource
@param args arguments for the message
"""
return messages.getLocalizedString(locale, key, args);
} | java | String getText(String key, Object... args) {
return messages.getLocalizedString(locale, key, args);
} | [
"String",
"getText",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"messages",
".",
"getLocalizedString",
"(",
"locale",
",",
"key",
",",
"args",
")",
";",
"}"
] | get and format message string from resource
@param key selects message from resource
@param args arguments for the message | [
"get",
"and",
"format",
"message",
"string",
"from",
"resource"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/Messager.java#L140-L142 |
lucee/Lucee | core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java | VariableInterpreter.getVariableReference | public static VariableReference getVariableReference(PageContext pc, String var) throws PageException {
"""
return a variable reference by string syntax ("scopename.key.key" -> "url.name") a variable
reference, references to variable, to modifed it, with global effect.
@param pc
@param var variable name to ge... | java | public static VariableReference getVariableReference(PageContext pc, String var) throws PageException {
StringList list = parse(pc, new ParserString(var), false);
if (list == null) throw new InterpreterException("invalid variable declaration [" + var + "]");
if (list.size() == 1) {
return new VariableReference... | [
"public",
"static",
"VariableReference",
"getVariableReference",
"(",
"PageContext",
"pc",
",",
"String",
"var",
")",
"throws",
"PageException",
"{",
"StringList",
"list",
"=",
"parse",
"(",
"pc",
",",
"new",
"ParserString",
"(",
"var",
")",
",",
"false",
")",... | return a variable reference by string syntax ("scopename.key.key" -> "url.name") a variable
reference, references to variable, to modifed it, with global effect.
@param pc
@param var variable name to get
@return variable as Reference
@throws PageException | [
"return",
"a",
"variable",
"reference",
"by",
"string",
"syntax",
"(",
"scopename",
".",
"key",
".",
"key",
"-",
">",
"url",
".",
"name",
")",
"a",
"variable",
"reference",
"references",
"to",
"variable",
"to",
"modifed",
"it",
"with",
"global",
"effect",
... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java#L291-L315 |
Danny02/JOpenCTM | src/main/java/darwin/jopenctm/compression/MG1Encoder.java | MG1Encoder.rearrangeTriangles | public void rearrangeTriangles(int[] indices) {
"""
Re-arrange all triangles for optimal compression.
@param indices index data to reorder in place
"""
assert indices.length % 3 == 0;
// Step 1: Make sure that the first index of each triangle is the smallest
// one (rotate triangle n... | java | public void rearrangeTriangles(int[] indices) {
assert indices.length % 3 == 0;
// Step 1: Make sure that the first index of each triangle is the smallest
// one (rotate triangle nodes if necessary)
for (int off = 0; off < indices.length; off += 3) {
if ((indices[off + 1] < i... | [
"public",
"void",
"rearrangeTriangles",
"(",
"int",
"[",
"]",
"indices",
")",
"{",
"assert",
"indices",
".",
"length",
"%",
"3",
"==",
"0",
";",
"// Step 1: Make sure that the first index of each triangle is the smallest",
"// one (rotate triangle nodes if necessary)",
"for... | Re-arrange all triangles for optimal compression.
@param indices index data to reorder in place | [
"Re",
"-",
"arrange",
"all",
"triangles",
"for",
"optimal",
"compression",
"."
] | train | https://github.com/Danny02/JOpenCTM/blob/c55a2a2d166a55979190f1bb08214fc84c93008f/src/main/java/darwin/jopenctm/compression/MG1Encoder.java#L60-L91 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_coupon_DELETE | public void cart_cartId_coupon_DELETE(String cartId, String coupon) throws IOException {
"""
Delete a coupon from cart
REST: DELETE /order/cart/{cartId}/coupon
@param cartId [required] Cart identifier
@param coupon [required] Coupon identifier
"""
String qPath = "/order/cart/{cartId}/coupon";
StringBu... | java | public void cart_cartId_coupon_DELETE(String cartId, String coupon) throws IOException {
String qPath = "/order/cart/{cartId}/coupon";
StringBuilder sb = path(qPath, cartId);
query(sb, "coupon", coupon);
execN(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"cart_cartId_coupon_DELETE",
"(",
"String",
"cartId",
",",
"String",
"coupon",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/coupon\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"cartId",
")"... | Delete a coupon from cart
REST: DELETE /order/cart/{cartId}/coupon
@param cartId [required] Cart identifier
@param coupon [required] Coupon identifier | [
"Delete",
"a",
"coupon",
"from",
"cart"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L10018-L10023 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java | LinkFactoryImpl.getClassToolTip | private String getClassToolTip(TypeElement typeElement, boolean isTypeLink) {
"""
Given a class, return the appropriate tool tip.
@param typeElement the class to get the tool tip for.
@return the tool tip for the appropriate class.
"""
Configuration configuration = m_writer.configuration;
U... | java | private String getClassToolTip(TypeElement typeElement, boolean isTypeLink) {
Configuration configuration = m_writer.configuration;
Utils utils = configuration.utils;
if (isTypeLink) {
return configuration.getText("doclet.Href_Type_Param_Title",
utils.getSimpleNam... | [
"private",
"String",
"getClassToolTip",
"(",
"TypeElement",
"typeElement",
",",
"boolean",
"isTypeLink",
")",
"{",
"Configuration",
"configuration",
"=",
"m_writer",
".",
"configuration",
";",
"Utils",
"utils",
"=",
"configuration",
".",
"utils",
";",
"if",
"(",
... | Given a class, return the appropriate tool tip.
@param typeElement the class to get the tool tip for.
@return the tool tip for the appropriate class. | [
"Given",
"a",
"class",
"return",
"the",
"appropriate",
"tool",
"tip",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java#L200-L219 |
JOML-CI/JOML | src/org/joml/Matrix3x2d.java | Matrix3x2d.transformPosition | public Vector2d transformPosition(double x, double y, Vector2d dest) {
"""
Transform/multiply the given 2D-vector <code>(x, y)</code>, as if it was a 3D-vector with z=1, by
this matrix and store the result in <code>dest</code>.
<p>
The given 2D-vector is treated as a 3D-vector with its z-component being 1.0, so... | java | public Vector2d transformPosition(double x, double y, Vector2d dest) {
return dest.set(m00 * x + m10 * y + m20, m01 * x + m11 * y + m21);
} | [
"public",
"Vector2d",
"transformPosition",
"(",
"double",
"x",
",",
"double",
"y",
",",
"Vector2d",
"dest",
")",
"{",
"return",
"dest",
".",
"set",
"(",
"m00",
"*",
"x",
"+",
"m10",
"*",
"y",
"+",
"m20",
",",
"m01",
"*",
"x",
"+",
"m11",
"*",
"y"... | Transform/multiply the given 2D-vector <code>(x, y)</code>, as if it was a 3D-vector with z=1, by
this matrix and store the result in <code>dest</code>.
<p>
The given 2D-vector is treated as a 3D-vector with its z-component being 1.0, so it
will represent a position/location in 2D-space rather than a direction.
<p>
In ... | [
"Transform",
"/",
"multiply",
"the",
"given",
"2D",
"-",
"vector",
"<code",
">",
"(",
"x",
"y",
")",
"<",
"/",
"code",
">",
"as",
"if",
"it",
"was",
"a",
"3D",
"-",
"vector",
"with",
"z",
"=",
"1",
"by",
"this",
"matrix",
"and",
"store",
"the",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2d.java#L1766-L1768 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/processors/OcelotProcessor.java | OcelotProcessor.writeJsFileToJsDir | void writeJsFileToJsDir(TypeElement element, ElementVisitor visitor, String packagePath, String fn, String dir) {
"""
generate js service in packagePath.fn in classes directory/packagePath
@param element
@param visitor
@param packagePath
@param fn
"""
if (null != dir) {
try (Writer w = fws.getFile... | java | void writeJsFileToJsDir(TypeElement element, ElementVisitor visitor, String packagePath, String fn, String dir) {
if (null != dir) {
try (Writer w = fws.getFileObjectWriter(dir + File.separatorChar + "srvs", packagePath + "." + fn)) {
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " javascript gen... | [
"void",
"writeJsFileToJsDir",
"(",
"TypeElement",
"element",
",",
"ElementVisitor",
"visitor",
",",
"String",
"packagePath",
",",
"String",
"fn",
",",
"String",
"dir",
")",
"{",
"if",
"(",
"null",
"!=",
"dir",
")",
"{",
"try",
"(",
"Writer",
"w",
"=",
"f... | generate js service in packagePath.fn in classes directory/packagePath
@param element
@param visitor
@param packagePath
@param fn | [
"generate",
"js",
"service",
"in",
"packagePath",
".",
"fn",
"in",
"classes",
"directory",
"/",
"packagePath"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/processors/OcelotProcessor.java#L234-L243 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/config/resilience/DefaultResilienceStrategyProviderConfiguration.java | DefaultResilienceStrategyProviderConfiguration.setDefaultResilienceStrategy | @SuppressWarnings("rawtypes")
public DefaultResilienceStrategyProviderConfiguration setDefaultResilienceStrategy(Class<? extends ResilienceStrategy> clazz, Object... arguments) {
"""
Sets the default {@link ResilienceStrategy} class and associated constructor arguments to be used for caches without
a loader-wri... | java | @SuppressWarnings("rawtypes")
public DefaultResilienceStrategyProviderConfiguration setDefaultResilienceStrategy(Class<? extends ResilienceStrategy> clazz, Object... arguments) {
this.defaultRegularConfiguration = new DefaultResilienceStrategyConfiguration(clazz, arguments);
return this;
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"DefaultResilienceStrategyProviderConfiguration",
"setDefaultResilienceStrategy",
"(",
"Class",
"<",
"?",
"extends",
"ResilienceStrategy",
">",
"clazz",
",",
"Object",
"...",
"arguments",
")",
"{",
"this",
"."... | Sets the default {@link ResilienceStrategy} class and associated constructor arguments to be used for caches without
a loader-writer.
<p>
The provided class must have a constructor compatible with the supplied arguments followed by the cache's
{@code RecoveryStore}.
@param clazz the resilience strategy class
@param ar... | [
"Sets",
"the",
"default",
"{",
"@link",
"ResilienceStrategy",
"}",
"class",
"and",
"associated",
"constructor",
"arguments",
"to",
"be",
"used",
"for",
"caches",
"without",
"a",
"loader",
"-",
"writer",
".",
"<p",
">",
"The",
"provided",
"class",
"must",
"ha... | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/config/resilience/DefaultResilienceStrategyProviderConfiguration.java#L78-L82 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/model/Counter.java | Counter.getCounterRequestByName | public CounterRequest getCounterRequestByName(String requestName, boolean saveRequestIfAbsent) {
"""
Retourne l'objet {@link CounterRequest} correspondant au nom sans agrégation en paramètre.
@param requestName Nom de la requête sans agrégation par requestTransformPattern
@param saveRequestIfAbsent true except f... | java | public CounterRequest getCounterRequestByName(String requestName, boolean saveRequestIfAbsent) {
// l'instance de CounterRequest retournée est clonée
// (nécessaire pour protéger la synchronisation interne du counter),
// son état peut donc être lu sans synchronisation
// mais toute modification de cet état... | [
"public",
"CounterRequest",
"getCounterRequestByName",
"(",
"String",
"requestName",
",",
"boolean",
"saveRequestIfAbsent",
")",
"{",
"// l'instance de CounterRequest retournée est clonée\r",
"// (nécessaire pour protéger la synchronisation interne du counter),\r",
"// son état peut donc ê... | Retourne l'objet {@link CounterRequest} correspondant au nom sans agrégation en paramètre.
@param requestName Nom de la requête sans agrégation par requestTransformPattern
@param saveRequestIfAbsent true except for current requests because the requestName may not be yet bestMatchingPattern
@return CounterRequest | [
"Retourne",
"l",
"objet",
"{"
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/model/Counter.java#L745-L756 |
grpc/grpc-java | netty/src/main/java/io/grpc/netty/GrpcSslContexts.java | GrpcSslContexts.forServer | public static SslContextBuilder forServer(
InputStream keyCertChain, InputStream key, String keyPassword) {
"""
Creates a SslContextBuilder with ciphers and APN appropriate for gRPC.
@see SslContextBuilder#forServer(InputStream, InputStream, String)
@see #configure(SslContextBuilder)
"""
return c... | java | public static SslContextBuilder forServer(
InputStream keyCertChain, InputStream key, String keyPassword) {
return configure(SslContextBuilder.forServer(keyCertChain, key, keyPassword));
} | [
"public",
"static",
"SslContextBuilder",
"forServer",
"(",
"InputStream",
"keyCertChain",
",",
"InputStream",
"key",
",",
"String",
"keyPassword",
")",
"{",
"return",
"configure",
"(",
"SslContextBuilder",
".",
"forServer",
"(",
"keyCertChain",
",",
"key",
",",
"k... | Creates a SslContextBuilder with ciphers and APN appropriate for gRPC.
@see SslContextBuilder#forServer(InputStream, InputStream, String)
@see #configure(SslContextBuilder) | [
"Creates",
"a",
"SslContextBuilder",
"with",
"ciphers",
"and",
"APN",
"appropriate",
"for",
"gRPC",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/netty/src/main/java/io/grpc/netty/GrpcSslContexts.java#L160-L163 |
aerogear/aerogear-unifiedpush-server | common/src/main/java/org/jboss/aerogear/unifiedpush/system/ConfigurationUtils.java | ConfigurationUtils.tryGetGlobalIntegerProperty | public static Integer tryGetGlobalIntegerProperty(String key, Integer defaultValue) {
"""
Get a global integer property. This method will first try to get the value from an
environment variable and if that does not exist it will look up a system property.
@param key Name of the variable
@param defaultValue Retu... | java | public static Integer tryGetGlobalIntegerProperty(String key, Integer defaultValue) {
try {
String value = System.getenv(formatEnvironmentVariable(key));
if (value == null) {
return tryGetIntegerProperty(key, defaultValue);
} else {
return Inte... | [
"public",
"static",
"Integer",
"tryGetGlobalIntegerProperty",
"(",
"String",
"key",
",",
"Integer",
"defaultValue",
")",
"{",
"try",
"{",
"String",
"value",
"=",
"System",
".",
"getenv",
"(",
"formatEnvironmentVariable",
"(",
"key",
")",
")",
";",
"if",
"(",
... | Get a global integer property. This method will first try to get the value from an
environment variable and if that does not exist it will look up a system property.
@param key Name of the variable
@param defaultValue Returned if neither env var nor system property are defined
@return String the value of the Environmen... | [
"Get",
"a",
"global",
"integer",
"property",
".",
"This",
"method",
"will",
"first",
"try",
"to",
"get",
"the",
"value",
"from",
"an",
"environment",
"variable",
"and",
"if",
"that",
"does",
"not",
"exist",
"it",
"will",
"look",
"up",
"a",
"system",
"pro... | train | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/common/src/main/java/org/jboss/aerogear/unifiedpush/system/ConfigurationUtils.java#L111-L123 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseUnsignedIntObj | @Nullable
public static Long parseUnsignedIntObj (@Nullable final String sStr) {
"""
Parse the given {@link String} as unsigned {@link Integer} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The string to parse. May be <code>null</code>.
@return <code>null</code> if the string does not represent a valid v... | java | @Nullable
public static Long parseUnsignedIntObj (@Nullable final String sStr)
{
return parseUnsignedIntObj (sStr, DEFAULT_RADIX, null);
} | [
"@",
"Nullable",
"public",
"static",
"Long",
"parseUnsignedIntObj",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
")",
"{",
"return",
"parseUnsignedIntObj",
"(",
"sStr",
",",
"DEFAULT_RADIX",
",",
"null",
")",
";",
"}"
] | Parse the given {@link String} as unsigned {@link Integer} with radix
{@value #DEFAULT_RADIX}.
@param sStr
The string to parse. May be <code>null</code>.
@return <code>null</code> if the string does not represent a valid value.
@since 9.0.0 | [
"Parse",
"the",
"given",
"{",
"@link",
"String",
"}",
"as",
"unsigned",
"{",
"@link",
"Integer",
"}",
"with",
"radix",
"{",
"@value",
"#DEFAULT_RADIX",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L910-L914 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java | ElementFilter.modulesIn | public static List<ModuleElement>
modulesIn(Iterable<? extends Element> elements) {
"""
Returns a list of modules in {@code elements}.
@return a list of modules in {@code elements}
@param elements the elements to filter
@since 9
@spec JPMS
"""
return listFilter(elements, MODULE_KIND, Mo... | java | public static List<ModuleElement>
modulesIn(Iterable<? extends Element> elements) {
return listFilter(elements, MODULE_KIND, ModuleElement.class);
} | [
"public",
"static",
"List",
"<",
"ModuleElement",
">",
"modulesIn",
"(",
"Iterable",
"<",
"?",
"extends",
"Element",
">",
"elements",
")",
"{",
"return",
"listFilter",
"(",
"elements",
",",
"MODULE_KIND",
",",
"ModuleElement",
".",
"class",
")",
";",
"}"
] | Returns a list of modules in {@code elements}.
@return a list of modules in {@code elements}
@param elements the elements to filter
@since 9
@spec JPMS | [
"Returns",
"a",
"list",
"of",
"modules",
"in",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L194-L197 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/GeometryDeserializer.java | GeometryDeserializer.asPoint | private Point asPoint(List coords, CrsId crsId) throws IOException {
"""
Parses the JSON as a point geometry.
@param coords the coordinates (a list with an x and y value)
@param crsId
@return An instance of point
@throws IOException if the given json does not correspond to a point or can not be parsed to a... | java | private Point asPoint(List coords, CrsId crsId) throws IOException {
if (coords != null && coords.size() >= 2) {
ArrayList<List> coordinates = new ArrayList<List>();
coordinates.add(coords);
return new Point(getPointSequence(coordinates, crsId));
} else {
... | [
"private",
"Point",
"asPoint",
"(",
"List",
"coords",
",",
"CrsId",
"crsId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"coords",
"!=",
"null",
"&&",
"coords",
".",
"size",
"(",
")",
">=",
"2",
")",
"{",
"ArrayList",
"<",
"List",
">",
"coordinates",... | Parses the JSON as a point geometry.
@param coords the coordinates (a list with an x and y value)
@param crsId
@return An instance of point
@throws IOException if the given json does not correspond to a point or can not be parsed to a point. | [
"Parses",
"the",
"JSON",
"as",
"a",
"point",
"geometry",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/GeometryDeserializer.java#L283-L291 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/DatasetFilterUtils.java | DatasetFilterUtils.survived | public static boolean survived(String topic, List<Pattern> blacklist, List<Pattern> whitelist) {
"""
A topic survives if (1) it doesn't match the blacklist, and
(2) either whitelist is empty, or it matches the whitelist.
Whitelist and blacklist use regex patterns (NOT glob patterns).
"""
if (stringInPatt... | java | public static boolean survived(String topic, List<Pattern> blacklist, List<Pattern> whitelist) {
if (stringInPatterns(topic, blacklist)) {
return false;
}
return (whitelist.isEmpty() || stringInPatterns(topic, whitelist));
} | [
"public",
"static",
"boolean",
"survived",
"(",
"String",
"topic",
",",
"List",
"<",
"Pattern",
">",
"blacklist",
",",
"List",
"<",
"Pattern",
">",
"whitelist",
")",
"{",
"if",
"(",
"stringInPatterns",
"(",
"topic",
",",
"blacklist",
")",
")",
"{",
"retu... | A topic survives if (1) it doesn't match the blacklist, and
(2) either whitelist is empty, or it matches the whitelist.
Whitelist and blacklist use regex patterns (NOT glob patterns). | [
"A",
"topic",
"survives",
"if",
"(",
"1",
")",
"it",
"doesn",
"t",
"match",
"the",
"blacklist",
"and",
"(",
"2",
")",
"either",
"whitelist",
"is",
"empty",
"or",
"it",
"matches",
"the",
"whitelist",
".",
"Whitelist",
"and",
"blacklist",
"use",
"regex",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/DatasetFilterUtils.java#L82-L87 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java | ComponentHandler.getFacetName | protected final String getFacetName(FaceletContext ctx, UIComponent parent) {
"""
Return the Facet name we are scoped in, otherwise null
@param ctx
@return
"""
// TODO: REFACTOR - "facelets.FACET_NAME" should be a constant somewhere, used to be in FacetHandler
// from real ... | java | protected final String getFacetName(FaceletContext ctx, UIComponent parent)
{
// TODO: REFACTOR - "facelets.FACET_NAME" should be a constant somewhere, used to be in FacetHandler
// from real Facelets
return (String) parent.getAttributes().get("facelets.FACET_NAME");
} | [
"protected",
"final",
"String",
"getFacetName",
"(",
"FaceletContext",
"ctx",
",",
"UIComponent",
"parent",
")",
"{",
"// TODO: REFACTOR - \"facelets.FACET_NAME\" should be a constant somewhere, used to be in FacetHandler",
"// from real Facelets",
"return",
"(",
"St... | Return the Facet name we are scoped in, otherwise null
@param ctx
@return | [
"Return",
"the",
"Facet",
"name",
"we",
"are",
"scoped",
"in",
"otherwise",
"null"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java#L198-L203 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsFieldsetFormFieldPanel.java | CmsFieldsetFormFieldPanel.addGroupFieldSet | public void addGroupFieldSet(String group, CmsFieldSet fieldSet) {
"""
Adds a group specific field set.<p>
@param group the group id
@param fieldSet the field set
"""
// can't add a group field set twice
if (!m_groupFieldSets.containsKey(group)) {
m_groupFieldSets.put(group... | java | public void addGroupFieldSet(String group, CmsFieldSet fieldSet) {
// can't add a group field set twice
if (!m_groupFieldSets.containsKey(group)) {
m_groupFieldSets.put(group, fieldSet);
m_panel.add(fieldSet);
}
} | [
"public",
"void",
"addGroupFieldSet",
"(",
"String",
"group",
",",
"CmsFieldSet",
"fieldSet",
")",
"{",
"// can't add a group field set twice\r",
"if",
"(",
"!",
"m_groupFieldSets",
".",
"containsKey",
"(",
"group",
")",
")",
"{",
"m_groupFieldSets",
".",
"put",
"... | Adds a group specific field set.<p>
@param group the group id
@param fieldSet the field set | [
"Adds",
"a",
"group",
"specific",
"field",
"set",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsFieldsetFormFieldPanel.java#L94-L101 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkmax/MkMaxTreeNode.java | MkMaxTreeNode.integrityCheckParameters | @Override
protected void integrityCheckParameters(MkMaxEntry parentEntry, MkMaxTreeNode<O> parent, int index, AbstractMTree<O, MkMaxTreeNode<O>, MkMaxEntry, ?> mTree) {
"""
Calls the super method and tests if the k-nearest neighbor distance of this
node is correctly set.
"""
super.integrityCheckParamete... | java | @Override
protected void integrityCheckParameters(MkMaxEntry parentEntry, MkMaxTreeNode<O> parent, int index, AbstractMTree<O, MkMaxTreeNode<O>, MkMaxEntry, ?> mTree) {
super.integrityCheckParameters(parentEntry, parent, index, mTree);
// test if knn distance is correctly set
MkMaxEntry entry = parent.get... | [
"@",
"Override",
"protected",
"void",
"integrityCheckParameters",
"(",
"MkMaxEntry",
"parentEntry",
",",
"MkMaxTreeNode",
"<",
"O",
">",
"parent",
",",
"int",
"index",
",",
"AbstractMTree",
"<",
"O",
",",
"MkMaxTreeNode",
"<",
"O",
">",
",",
"MkMaxEntry",
",",... | Calls the super method and tests if the k-nearest neighbor distance of this
node is correctly set. | [
"Calls",
"the",
"super",
"method",
"and",
"tests",
"if",
"the",
"k",
"-",
"nearest",
"neighbor",
"distance",
"of",
"this",
"node",
"is",
"correctly",
"set",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkmax/MkMaxTreeNode.java#L93-L102 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java | AbstractAttributeDefinitionBuilder.setCapabilityReference | @Deprecated
public BUILDER setCapabilityReference(String referencedCapability, String dependentCapability, boolean dynamicDependent) {
"""
Records that this attribute's value represents a reference to an instance of a
{@link org.jboss.as.controller.capability.RuntimeCapability#isDynamicallyNamed() dynamic cap... | java | @Deprecated
public BUILDER setCapabilityReference(String referencedCapability, String dependentCapability, boolean dynamicDependent) {
//noinspection deprecation
referenceRecorder = new CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder(referencedCapability, dependentCapability, dynamicD... | [
"@",
"Deprecated",
"public",
"BUILDER",
"setCapabilityReference",
"(",
"String",
"referencedCapability",
",",
"String",
"dependentCapability",
",",
"boolean",
"dynamicDependent",
")",
"{",
"//noinspection deprecation",
"referenceRecorder",
"=",
"new",
"CapabilityReferenceReco... | Records that this attribute's value represents a reference to an instance of a
{@link org.jboss.as.controller.capability.RuntimeCapability#isDynamicallyNamed() dynamic capability}.
<p>
This method is a convenience method equivalent to calling
{@link #setCapabilityReference(CapabilityReferenceRecorder)}
passing in a {@l... | [
"Records",
"that",
"this",
"attribute",
"s",
"value",
"represents",
"a",
"reference",
"to",
"an",
"instance",
"of",
"a",
"{",
"@link",
"org",
".",
"jboss",
".",
"as",
".",
"controller",
".",
"capability",
".",
"RuntimeCapability#isDynamicallyNamed",
"()",
"dyn... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAttributeDefinitionBuilder.java#L958-L963 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_arp_ipBlocked_GET | public OvhArpBlockedIp ip_arp_ipBlocked_GET(String ip, String ipBlocked) throws IOException {
"""
Get this object properties
REST: GET /ip/{ip}/arp/{ipBlocked}
@param ip [required]
@param ipBlocked [required] your IP
"""
String qPath = "/ip/{ip}/arp/{ipBlocked}";
StringBuilder sb = path(qPath, ip, ipB... | java | public OvhArpBlockedIp ip_arp_ipBlocked_GET(String ip, String ipBlocked) throws IOException {
String qPath = "/ip/{ip}/arp/{ipBlocked}";
StringBuilder sb = path(qPath, ip, ipBlocked);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhArpBlockedIp.class);
} | [
"public",
"OvhArpBlockedIp",
"ip_arp_ipBlocked_GET",
"(",
"String",
"ip",
",",
"String",
"ipBlocked",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/arp/{ipBlocked}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
",",
... | Get this object properties
REST: GET /ip/{ip}/arp/{ipBlocked}
@param ip [required]
@param ipBlocked [required] your IP | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L272-L277 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java | ParameterTool.getBoolean | public boolean getBoolean(String key, boolean defaultValue) {
"""
Returns the Boolean value for the given key. If the key does not exists it will return the default value given.
The method returns whether the string of the value is "true" ignoring cases.
"""
addToDefaults(key, Boolean.toString(defaultValue)... | java | public boolean getBoolean(String key, boolean defaultValue) {
addToDefaults(key, Boolean.toString(defaultValue));
String value = get(key);
if (value == null) {
return defaultValue;
} else {
return Boolean.valueOf(value);
}
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"addToDefaults",
"(",
"key",
",",
"Boolean",
".",
"toString",
"(",
"defaultValue",
")",
")",
";",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if"... | Returns the Boolean value for the given key. If the key does not exists it will return the default value given.
The method returns whether the string of the value is "true" ignoring cases. | [
"Returns",
"the",
"Boolean",
"value",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exists",
"it",
"will",
"return",
"the",
"default",
"value",
"given",
".",
"The",
"method",
"returns",
"whether",
"the",
"string",
"of",
"the",
"v... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L397-L405 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/PullFileLoader.java | PullFileLoader.loadPullFile | public Config loadPullFile(Path path, Config sysProps, boolean loadGlobalProperties) throws IOException {
"""
Load a single pull file.
@param path The {@link Path} to the pull file to load, full path
@param sysProps A {@link Config} used as fallback.
@param loadGlobalProperties if true, will also load at most o... | java | public Config loadPullFile(Path path, Config sysProps, boolean loadGlobalProperties) throws IOException {
Config fallback = loadGlobalProperties ? loadAncestorGlobalConfigs(path, sysProps) : sysProps;
if (this.javaPropsPullFileFilter.accept(path)) {
return loadJavaPropsWithFallback(path, fallback).resolv... | [
"public",
"Config",
"loadPullFile",
"(",
"Path",
"path",
",",
"Config",
"sysProps",
",",
"boolean",
"loadGlobalProperties",
")",
"throws",
"IOException",
"{",
"Config",
"fallback",
"=",
"loadGlobalProperties",
"?",
"loadAncestorGlobalConfigs",
"(",
"path",
",",
"sys... | Load a single pull file.
@param path The {@link Path} to the pull file to load, full path
@param sysProps A {@link Config} used as fallback.
@param loadGlobalProperties if true, will also load at most one *.properties file per directory from the
{@link #rootDirectory} to the pull file {@link Path}.
@return The loaded {... | [
"Load",
"a",
"single",
"pull",
"file",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/PullFileLoader.java#L140-L150 |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/config/Configs.java | Configs.isSelfConfig | public static boolean isSelfConfig(String configAbsoluteClassPath, String keyPrefix, IConfigKey key) {
"""
Get self config boolean value. Config key include prefix.
Example:<br>
If key.getKeyString() is "test", <br>
isSelfConfig("/self.properties", "1.", key); will return "1.test" config value in "/self.propert... | java | public static boolean isSelfConfig(String configAbsoluteClassPath, String keyPrefix, IConfigKey key) {
OneProperties configs = otherConfigs.get(configAbsoluteClassPath);
if (configs == null) {
addSelfConfigs(configAbsoluteClassPath, null);
configs = otherConfigs.get(configAbs... | [
"public",
"static",
"boolean",
"isSelfConfig",
"(",
"String",
"configAbsoluteClassPath",
",",
"String",
"keyPrefix",
",",
"IConfigKey",
"key",
")",
"{",
"OneProperties",
"configs",
"=",
"otherConfigs",
".",
"get",
"(",
"configAbsoluteClassPath",
")",
";",
"if",
"(... | Get self config boolean value. Config key include prefix.
Example:<br>
If key.getKeyString() is "test", <br>
isSelfConfig("/self.properties", "1.", key); will return "1.test" config value in "/self.properties".
@param configAbsoluteClassPath config path.
@param keyPrefix config key prefix
@param key ... | [
"Get",
"self",
"config",
"boolean",
"value",
".",
"Config",
"key",
"include",
"prefix",
".",
"Example",
":",
"<br",
">",
"If",
"key",
".",
"getKeyString",
"()",
"is",
"test",
"<br",
">",
"isSelfConfig",
"(",
"/",
"self",
".",
"properties",
"1",
".",
"k... | train | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/Configs.java#L273-L283 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TextBuilder.java | TextBuilder.styledLink | public TextBuilder styledLink(final String text, final TextStyle ts, final File file) {
"""
Create a styled link in the current paragraph.
@param text the text
@param ts the style
@param file the destination
@return this for fluent style
"""
this.curParagraphBuilder.styledLink(text, ts, file);
... | java | public TextBuilder styledLink(final String text, final TextStyle ts, final File file) {
this.curParagraphBuilder.styledLink(text, ts, file);
return this;
} | [
"public",
"TextBuilder",
"styledLink",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
",",
"final",
"File",
"file",
")",
"{",
"this",
".",
"curParagraphBuilder",
".",
"styledLink",
"(",
"text",
",",
"ts",
",",
"file",
")",
";",
"return",
... | Create a styled link in the current paragraph.
@param text the text
@param ts the style
@param file the destination
@return this for fluent style | [
"Create",
"a",
"styled",
"link",
"in",
"the",
"current",
"paragraph",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TextBuilder.java#L153-L156 |
knightliao/disconf | disconf-core/src/main/java/com/baidu/disconf/core/common/zookeeper/ZookeeperMgr.java | ZookeeperMgr.writePersistentUrl | public void writePersistentUrl(String url, String value) throws Exception {
"""
@return List<String>
@Description: 写持久化结点, 没有则新建, 存在则进行更新
@author liaoqiqi
@date 2013-6-14
"""
store.write(url, value);
} | java | public void writePersistentUrl(String url, String value) throws Exception {
store.write(url, value);
} | [
"public",
"void",
"writePersistentUrl",
"(",
"String",
"url",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"store",
".",
"write",
"(",
"url",
",",
"value",
")",
";",
"}"
] | @return List<String>
@Description: 写持久化结点, 没有则新建, 存在则进行更新
@author liaoqiqi
@date 2013-6-14 | [
"@return",
"List<String",
">"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-core/src/main/java/com/baidu/disconf/core/common/zookeeper/ZookeeperMgr.java#L163-L166 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java | ZKPaths.fixForNamespace | public static String fixForNamespace(String namespace, String path) {
"""
Apply the namespace to the given path
@param namespace namespace (can be null)
@param path path
@return adjusted path
"""
return fixForNamespace(namespace, path, false);
} | java | public static String fixForNamespace(String namespace, String path)
{
return fixForNamespace(namespace, path, false);
} | [
"public",
"static",
"String",
"fixForNamespace",
"(",
"String",
"namespace",
",",
"String",
"path",
")",
"{",
"return",
"fixForNamespace",
"(",
"namespace",
",",
"path",
",",
"false",
")",
";",
"}"
] | Apply the namespace to the given path
@param namespace namespace (can be null)
@param path path
@return adjusted path | [
"Apply",
"the",
"namespace",
"to",
"the",
"given",
"path"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java#L89-L92 |
kiegroup/drools | kie-pmml/src/main/java/org/kie/pmml/pmml_4_2/PMML4Compiler.java | PMML4Compiler.loadModel | public PMML loadModel(String model, InputStream source) {
"""
Imports a PMML source file, returning a Java descriptor
@param model the PMML package name (classes derived from a specific schema)
@param source the name of the PMML resource storing the predictive model
@return the Java Descriptor of the PMML resou... | java | public PMML loadModel(String model, InputStream source) {
try {
if (schema == null) {
visitorBuildResults.add(new PMMLWarning(ResourceFactory.newInputStreamResource(source), "Could not validate PMML document, schema not available"));
}
final JAXBContext jc;
... | [
"public",
"PMML",
"loadModel",
"(",
"String",
"model",
",",
"InputStream",
"source",
")",
"{",
"try",
"{",
"if",
"(",
"schema",
"==",
"null",
")",
"{",
"visitorBuildResults",
".",
"add",
"(",
"new",
"PMMLWarning",
"(",
"ResourceFactory",
".",
"newInputStream... | Imports a PMML source file, returning a Java descriptor
@param model the PMML package name (classes derived from a specific schema)
@param source the name of the PMML resource storing the predictive model
@return the Java Descriptor of the PMML resource | [
"Imports",
"a",
"PMML",
"source",
"file",
"returning",
"a",
"Java",
"descriptor"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-pmml/src/main/java/org/kie/pmml/pmml_4_2/PMML4Compiler.java#L750-L784 |
cache2k/cache2k | cache2k-jcache/src/main/java/org/cache2k/jcache/provider/event/AsyncDispatcher.java | AsyncDispatcher.runAllListenersInParallel | void runAllListenersInParallel(final EntryEvent<K, V> _event, List<Listener<K, V>> _listeners) {
"""
Pass on runnables to the executor for all listeners. After each event is handled
within the listener we check whether the event is processed by all listeners, by
decrementing a countdown. In case the event is pro... | java | void runAllListenersInParallel(final EntryEvent<K, V> _event, List<Listener<K, V>> _listeners) {
final AtomicInteger _countDown = new AtomicInteger(_listeners.size());
for (final Listener<K,V> l : _listeners) {
Runnable r = new Runnable() {
@Override
public void run() {
try {
... | [
"void",
"runAllListenersInParallel",
"(",
"final",
"EntryEvent",
"<",
"K",
",",
"V",
">",
"_event",
",",
"List",
"<",
"Listener",
"<",
"K",
",",
"V",
">",
">",
"_listeners",
")",
"{",
"final",
"AtomicInteger",
"_countDown",
"=",
"new",
"AtomicInteger",
"("... | Pass on runnables to the executor for all listeners. After each event is handled
within the listener we check whether the event is processed by all listeners, by
decrementing a countdown. In case the event is processed completely, we check whether
more is queued up for this key meanwhile. | [
"Pass",
"on",
"runnables",
"to",
"the",
"executor",
"for",
"all",
"listeners",
".",
"After",
"each",
"event",
"is",
"handled",
"within",
"the",
"listener",
"we",
"check",
"whether",
"the",
"event",
"is",
"processed",
"by",
"all",
"listeners",
"by",
"decremen... | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-jcache/src/main/java/org/cache2k/jcache/provider/event/AsyncDispatcher.java#L146-L165 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlMNStatement.java | SqlMNStatement.appendListOfColumns | protected List appendListOfColumns(String[] columns, StringBuffer stmt) {
"""
Appends to the statement a comma separated list of column names.
@param columns defines the columns to be selected (for reports)
@return list of column names
"""
ArrayList columnList = new ArrayList();
for (in... | java | protected List appendListOfColumns(String[] columns, StringBuffer stmt)
{
ArrayList columnList = new ArrayList();
for (int i = 0; i < columns.length; i++)
{
if (i > 0)
{
stmt.append(",");
}
stmt.append(columns[i]);
... | [
"protected",
"List",
"appendListOfColumns",
"(",
"String",
"[",
"]",
"columns",
",",
"StringBuffer",
"stmt",
")",
"{",
"ArrayList",
"columnList",
"=",
"new",
"ArrayList",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"columns",
".",
"... | Appends to the statement a comma separated list of column names.
@param columns defines the columns to be selected (for reports)
@return list of column names | [
"Appends",
"to",
"the",
"statement",
"a",
"comma",
"separated",
"list",
"of",
"column",
"names",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlMNStatement.java#L108-L123 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java | CoverageDataCore.getValue | public Double getValue(GriddedTile griddedTile, float pixelValue) {
"""
Get the coverage data value for the pixel value
@param griddedTile
gridded tile
@param pixelValue
pixel value
@return coverage data value
"""
Double value = null;
if (!isDataNull(pixelValue)) {
value = pixelValueToValue(grid... | java | public Double getValue(GriddedTile griddedTile, float pixelValue) {
Double value = null;
if (!isDataNull(pixelValue)) {
value = pixelValueToValue(griddedTile, new Double(pixelValue));
}
return value;
} | [
"public",
"Double",
"getValue",
"(",
"GriddedTile",
"griddedTile",
",",
"float",
"pixelValue",
")",
"{",
"Double",
"value",
"=",
"null",
";",
"if",
"(",
"!",
"isDataNull",
"(",
"pixelValue",
")",
")",
"{",
"value",
"=",
"pixelValueToValue",
"(",
"griddedTile... | Get the coverage data value for the pixel value
@param griddedTile
gridded tile
@param pixelValue
pixel value
@return coverage data value | [
"Get",
"the",
"coverage",
"data",
"value",
"for",
"the",
"pixel",
"value"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1630-L1638 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.appendOrderByClause | protected void appendOrderByClause(List orderByFields, List selectedFields, StringBuffer buf) {
"""
Appends the ORDER BY clause for the Query.
<br>
If the orderByField is found in the list of selected fields it's index is added.
Otherwise it's name is added.
@param orderByFields
@param selectedFields the name... | java | protected void appendOrderByClause(List orderByFields, List selectedFields, StringBuffer buf)
{
if (orderByFields == null || orderByFields.size() == 0)
{
return;
}
buf.append(" ORDER BY ");
for (int i = 0; i < orderByFields.size(); i++)
... | [
"protected",
"void",
"appendOrderByClause",
"(",
"List",
"orderByFields",
",",
"List",
"selectedFields",
",",
"StringBuffer",
"buf",
")",
"{",
"if",
"(",
"orderByFields",
"==",
"null",
"||",
"orderByFields",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"retur... | Appends the ORDER BY clause for the Query.
<br>
If the orderByField is found in the list of selected fields it's index is added.
Otherwise it's name is added.
@param orderByFields
@param selectedFields the names of the fields in the SELECT clause
@param buf | [
"Appends",
"the",
"ORDER",
"BY",
"clause",
"for",
"the",
"Query",
".",
"<br",
">",
"If",
"the",
"orderByField",
"is",
"found",
"in",
"the",
"list",
"of",
"selected",
"fields",
"it",
"s",
"index",
"is",
"added",
".",
"Otherwise",
"it",
"s",
"name",
"is"... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L1480-L1513 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/locator/TokenMetadata.java | TokenMetadata.updateHostId | public void updateHostId(UUID hostId, InetAddress endpoint) {
"""
Store an end-point to host ID mapping. Each ID must be unique, and
cannot be changed after the fact.
@param hostId
@param endpoint
"""
assert hostId != null;
assert endpoint != null;
lock.writeLock().lock();
... | java | public void updateHostId(UUID hostId, InetAddress endpoint)
{
assert hostId != null;
assert endpoint != null;
lock.writeLock().lock();
try
{
InetAddress storedEp = endpointToHostIdMap.inverse().get(hostId);
if (storedEp != null)
{
... | [
"public",
"void",
"updateHostId",
"(",
"UUID",
"hostId",
",",
"InetAddress",
"endpoint",
")",
"{",
"assert",
"hostId",
"!=",
"null",
";",
"assert",
"endpoint",
"!=",
"null",
";",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{... | Store an end-point to host ID mapping. Each ID must be unique, and
cannot be changed after the fact.
@param hostId
@param endpoint | [
"Store",
"an",
"end",
"-",
"point",
"to",
"host",
"ID",
"mapping",
".",
"Each",
"ID",
"must",
"be",
"unique",
"and",
"cannot",
"be",
"changed",
"after",
"the",
"fact",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L220-L251 |
twilio/twilio-java | src/main/java/com/twilio/rest/ipmessaging/v2/service/UserReader.java | UserReader.previousPage | @Override
public Page<User> previousPage(final Page<User> page,
final TwilioRestClient client) {
"""
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page
"""
... | java | @Override
public Page<User> previousPage(final Page<User> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.IPMESSAGING.toString(),
client.getRegio... | [
"@",
"Override",
"public",
"Page",
"<",
"User",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"User",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
",",
"p... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/ipmessaging/v2/service/UserReader.java#L110-L121 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java | ZooKeeperMasterModel.getJob | @Override
public Job getJob(final JobId id) {
"""
Returns the job configuration for the job specified by {@code id} as a
{@link Job} object. A return value of null indicates the job doesn't exist.
"""
log.debug("getting job: {}", id);
final ZooKeeperClient client = provider.get("getJobId");
retu... | java | @Override
public Job getJob(final JobId id) {
log.debug("getting job: {}", id);
final ZooKeeperClient client = provider.get("getJobId");
return getJob(client, id);
} | [
"@",
"Override",
"public",
"Job",
"getJob",
"(",
"final",
"JobId",
"id",
")",
"{",
"log",
".",
"debug",
"(",
"\"getting job: {}\"",
",",
"id",
")",
";",
"final",
"ZooKeeperClient",
"client",
"=",
"provider",
".",
"get",
"(",
"\"getJobId\"",
")",
";",
"re... | Returns the job configuration for the job specified by {@code id} as a
{@link Job} object. A return value of null indicates the job doesn't exist. | [
"Returns",
"the",
"job",
"configuration",
"for",
"the",
"job",
"specified",
"by",
"{"
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java#L1334-L1339 |
structurizr/java | structurizr-core/src/com/structurizr/model/StaticStructureElement.java | StaticStructureElement.delivers | @Nullable
public Relationship delivers(@Nonnull Person destination, String description) {
"""
Adds a unidirectional relationship between this element and a person.
@param destination the target of the relationship
@param description a description of the relationship (e.g. "sends e-mail to")
@return the re... | java | @Nullable
public Relationship delivers(@Nonnull Person destination, String description) {
return delivers(destination, description, null);
} | [
"@",
"Nullable",
"public",
"Relationship",
"delivers",
"(",
"@",
"Nonnull",
"Person",
"destination",
",",
"String",
"description",
")",
"{",
"return",
"delivers",
"(",
"destination",
",",
"description",
",",
"null",
")",
";",
"}"
] | Adds a unidirectional relationship between this element and a person.
@param destination the target of the relationship
@param description a description of the relationship (e.g. "sends e-mail to")
@return the relationship that has just been created and added to the model | [
"Adds",
"a",
"unidirectional",
"relationship",
"between",
"this",
"element",
"and",
"a",
"person",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/StaticStructureElement.java#L139-L142 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Geometry.java | Geometry.drawArcJoinedLines | public static final void drawArcJoinedLines(final PathPartList list, final Point2DArray points, final double radius) {
"""
This will build a PathPartList of lines and arcs from the Point2DArray.
The radius is the size of the arc for the line joins.
For each join the radius is capped at 1/2 the length of the smal... | java | public static final void drawArcJoinedLines(final PathPartList list, final Point2DArray points, final double radius)
{
final int size = points.size();
Point2D p0 = points.get(0);
Point2D p2 = points.get(1);
Point2D p0new = null;
Point2D plast = points.get(size -... | [
"public",
"static",
"final",
"void",
"drawArcJoinedLines",
"(",
"final",
"PathPartList",
"list",
",",
"final",
"Point2DArray",
"points",
",",
"final",
"double",
"radius",
")",
"{",
"final",
"int",
"size",
"=",
"points",
".",
"size",
"(",
")",
";",
"Point2D",... | This will build a PathPartList of lines and arcs from the Point2DArray.
The radius is the size of the arc for the line joins.
For each join the radius is capped at 1/2 the length of the smallest line in the three points
Collinear points are detected and handled as a straight line
If p0 and plast are the same it will cl... | [
"This",
"will",
"build",
"a",
"PathPartList",
"of",
"lines",
"and",
"arcs",
"from",
"the",
"Point2DArray",
".",
"The",
"radius",
"is",
"the",
"size",
"of",
"the",
"arc",
"for",
"the",
"line",
"joins",
".",
"For",
"each",
"join",
"the",
"radius",
"is",
... | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Geometry.java#L667-L725 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.getAccessControlList | public CmsAccessControlList getAccessControlList(String resourceName, boolean inheritedOnly) throws CmsException {
"""
Returns the access control list (summarized access control entries) of a given resource.<p>
If <code>inheritedOnly</code> is set, only inherited access control entries are returned.<p>
@para... | java | public CmsAccessControlList getAccessControlList(String resourceName, boolean inheritedOnly) throws CmsException {
CmsResource res = readResource(resourceName, CmsResourceFilter.ALL);
return m_securityManager.getAccessControlList(m_context, res, inheritedOnly);
} | [
"public",
"CmsAccessControlList",
"getAccessControlList",
"(",
"String",
"resourceName",
",",
"boolean",
"inheritedOnly",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"res",
"=",
"readResource",
"(",
"resourceName",
",",
"CmsResourceFilter",
".",
"ALL",
")",
";"... | Returns the access control list (summarized access control entries) of a given resource.<p>
If <code>inheritedOnly</code> is set, only inherited access control entries are returned.<p>
@param resourceName the name of the resource
@param inheritedOnly if set, the non-inherited entries are skipped
@return the access c... | [
"Returns",
"the",
"access",
"control",
"list",
"(",
"summarized",
"access",
"control",
"entries",
")",
"of",
"a",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1291-L1295 |
grails/grails-core | grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java | DataBindingUtils.bindObjectToDomainInstance | public static BindingResult bindObjectToDomainInstance(PersistentEntity entity, Object object, Object source) {
"""
Binds the given source object to the given target object performing type conversion if necessary
@param entity The PersistentEntity instance
@param object The object to bind to
@param source The... | java | public static BindingResult bindObjectToDomainInstance(PersistentEntity entity, Object object, Object source) {
return bindObjectToDomainInstance(entity, object, source, getBindingIncludeList(object), Collections.emptyList(), null);
} | [
"public",
"static",
"BindingResult",
"bindObjectToDomainInstance",
"(",
"PersistentEntity",
"entity",
",",
"Object",
"object",
",",
"Object",
"source",
")",
"{",
"return",
"bindObjectToDomainInstance",
"(",
"entity",
",",
"object",
",",
"source",
",",
"getBindingInclu... | Binds the given source object to the given target object performing type conversion if necessary
@param entity The PersistentEntity instance
@param object The object to bind to
@param source The source object
@see org.grails.datastore.mapping.model.PersistentEntity
@return A BindingResult if there were errors or nul... | [
"Binds",
"the",
"given",
"source",
"object",
"to",
"the",
"given",
"target",
"object",
"performing",
"type",
"conversion",
"if",
"necessary"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java#L150-L152 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/UploadCallable.java | UploadCallable.uploadInParts | private UploadResult uploadInParts() throws Exception {
"""
Uploads the request in multiple chunks, submitting each upload chunk task
to the thread pool and recording its corresponding Future object, as well
as the multipart upload id.
"""
boolean isUsingEncryption = s3 instanceof AmazonS3Encryption;... | java | private UploadResult uploadInParts() throws Exception {
boolean isUsingEncryption = s3 instanceof AmazonS3Encryption;
long optimalPartSize = getOptimalPartSize(isUsingEncryption);
try {
if (multipartUploadId == null) {
multipartUploadId = initiateMultipartUpload(orig... | [
"private",
"UploadResult",
"uploadInParts",
"(",
")",
"throws",
"Exception",
"{",
"boolean",
"isUsingEncryption",
"=",
"s3",
"instanceof",
"AmazonS3Encryption",
";",
"long",
"optimalPartSize",
"=",
"getOptimalPartSize",
"(",
"isUsingEncryption",
")",
";",
"try",
"{",
... | Uploads the request in multiple chunks, submitting each upload chunk task
to the thread pool and recording its corresponding Future object, as well
as the multipart upload id. | [
"Uploads",
"the",
"request",
"in",
"multiple",
"chunks",
"submitting",
"each",
"upload",
"chunk",
"task",
"to",
"the",
"thread",
"pool",
"and",
"recording",
"its",
"corresponding",
"Future",
"object",
"as",
"well",
"as",
"the",
"multipart",
"upload",
"id",
"."... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/internal/UploadCallable.java#L172-L202 |
apereo/cas | api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/support/CasConfigurationJasyptCipherExecutor.java | CasConfigurationJasyptCipherExecutor.getJasyptParamFromEnv | private static String getJasyptParamFromEnv(final Environment environment, final JasyptEncryptionParameters param) {
"""
Gets jasypt param from env.
@param environment the environment
@param param the param
@return the jasypt param from env
"""
return environment.getProperty(param.getPropert... | java | private static String getJasyptParamFromEnv(final Environment environment, final JasyptEncryptionParameters param) {
return environment.getProperty(param.getPropertyName(), param.getDefaultValue());
} | [
"private",
"static",
"String",
"getJasyptParamFromEnv",
"(",
"final",
"Environment",
"environment",
",",
"final",
"JasyptEncryptionParameters",
"param",
")",
"{",
"return",
"environment",
".",
"getProperty",
"(",
"param",
".",
"getPropertyName",
"(",
")",
",",
"para... | Gets jasypt param from env.
@param environment the environment
@param param the param
@return the jasypt param from env | [
"Gets",
"jasypt",
"param",
"from",
"env",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/support/CasConfigurationJasyptCipherExecutor.java#L59-L61 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java | AbstractAnnotationMetadataBuilder.addMutatedMetadata | @Internal
public static void addMutatedMetadata(Object element, AnnotationMetadata metadata) {
"""
Used to store metadata mutations at compilation time. Not for public consumption.
@param element The element
@param metadata The metadata
"""
if (element != null && metadata != null) {
... | java | @Internal
public static void addMutatedMetadata(Object element, AnnotationMetadata metadata) {
if (element != null && metadata != null) {
MUTATED_ANNOTATION_METADATA.put(element, metadata);
}
} | [
"@",
"Internal",
"public",
"static",
"void",
"addMutatedMetadata",
"(",
"Object",
"element",
",",
"AnnotationMetadata",
"metadata",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
"&&",
"metadata",
"!=",
"null",
")",
"{",
"MUTATED_ANNOTATION_METADATA",
".",
"put",... | Used to store metadata mutations at compilation time. Not for public consumption.
@param element The element
@param metadata The metadata | [
"Used",
"to",
"store",
"metadata",
"mutations",
"at",
"compilation",
"time",
".",
"Not",
"for",
"public",
"consumption",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java#L804-L809 |
ysc/HtmlExtractor | html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java | ExtractFunctionExecutor.executeDeleteChild | public static String executeDeleteChild(String text, Document doc, CssPath cssPath, String parseExpression) {
"""
删除子CSS路径的内容 使用方法:deleteChild(div.ep-source)
括号内的参数为相对CSS路径的子路径,从CSS路径匹配的文本中删除子路径匹配的文本
@param text CSS路径抽取出来的文本
@param doc 根文档
@param cssPath CSS路径对象
@param parseExpression 抽取函数
@return 抽取函数处理之后... | java | public static String executeDeleteChild(String text, Document doc, CssPath cssPath, String parseExpression) {
LOGGER.debug("deleteChild抽取函数之前:" + text);
String parameter = parseExpression.replace("deleteChild(", "");
parameter = parameter.substring(0, parameter.length() - 1);
Elements el... | [
"public",
"static",
"String",
"executeDeleteChild",
"(",
"String",
"text",
",",
"Document",
"doc",
",",
"CssPath",
"cssPath",
",",
"String",
"parseExpression",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"deleteChild抽取函数之前:\" + text);",
"",
"",
"",
"",
"String",
... | 删除子CSS路径的内容 使用方法:deleteChild(div.ep-source)
括号内的参数为相对CSS路径的子路径,从CSS路径匹配的文本中删除子路径匹配的文本
@param text CSS路径抽取出来的文本
@param doc 根文档
@param cssPath CSS路径对象
@param parseExpression 抽取函数
@return 抽取函数处理之后的文本 | [
"删除子CSS路径的内容",
"使用方法:deleteChild",
"(",
"div",
".",
"ep",
"-",
"source",
")",
"括号内的参数为相对CSS路径的子路径,从CSS路径匹配的文本中删除子路径匹配的文本"
] | train | https://github.com/ysc/HtmlExtractor/blob/5378bc5f94138562c55506cf81de1ffe72ab701e/html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java#L114-L128 |
alibaba/Tangram-Android | tangram/src/main/java/com/tmall/wireless/tangram/BaseTangramEngine.java | BaseTangramEngine.registerCell | public <V extends View> void registerCell(String type, @NonNull Class<V> viewClz) {
"""
register cell after engine has been created
@param type
@param viewClz
@param <V>
"""
BaseCellBinderResolver baseCellBinderResolver = getService(BaseCellBinderResolver.class);
MVHelper mMVHelper = getServ... | java | public <V extends View> void registerCell(String type, @NonNull Class<V> viewClz) {
BaseCellBinderResolver baseCellBinderResolver = getService(BaseCellBinderResolver.class);
MVHelper mMVHelper = getService(MVHelper.class);
if (baseCellBinderResolver != null && mMVHelper != null && mMVHelper.reso... | [
"public",
"<",
"V",
"extends",
"View",
">",
"void",
"registerCell",
"(",
"String",
"type",
",",
"@",
"NonNull",
"Class",
"<",
"V",
">",
"viewClz",
")",
"{",
"BaseCellBinderResolver",
"baseCellBinderResolver",
"=",
"getService",
"(",
"BaseCellBinderResolver",
"."... | register cell after engine has been created
@param type
@param viewClz
@param <V> | [
"register",
"cell",
"after",
"engine",
"has",
"been",
"created"
] | train | https://github.com/alibaba/Tangram-Android/blob/caa57f54e009c8dacd34a2322d5761956ebed321/tangram/src/main/java/com/tmall/wireless/tangram/BaseTangramEngine.java#L282-L290 |
fuzzylite/jfuzzylite | jfuzzylite/src/main/java/com/fuzzylite/imex/FldExporter.java | FldExporter.toFile | public void toFile(File file, Engine engine, int values, ScopeOfValues scope) throws IOException {
"""
Saves the engine as a FuzzyLite Dataset into the specified file
@param file is file to save the dataset into
@param engine is the engine to export
@param values is the number of values to export
@param scop... | java | public void toFile(File file, Engine engine, int values, ScopeOfValues scope) throws IOException {
toFile(file, engine, values, scope, engine.getInputVariables());
} | [
"public",
"void",
"toFile",
"(",
"File",
"file",
",",
"Engine",
"engine",
",",
"int",
"values",
",",
"ScopeOfValues",
"scope",
")",
"throws",
"IOException",
"{",
"toFile",
"(",
"file",
",",
"engine",
",",
"values",
",",
"scope",
",",
"engine",
".",
"getI... | Saves the engine as a FuzzyLite Dataset into the specified file
@param file is file to save the dataset into
@param engine is the engine to export
@param values is the number of values to export
@param scope indicates the scope of the values
@throws IOException if any error occurs upon writing to the file | [
"Saves",
"the",
"engine",
"as",
"a",
"FuzzyLite",
"Dataset",
"into",
"the",
"specified",
"file"
] | train | https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/imex/FldExporter.java#L296-L298 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/QueryResponseDeserializer.java | QueryResponseDeserializer.registerModulesForCustomFieldDef | private void registerModulesForCustomFieldDef(ObjectMapper objectMapper) {
"""
Method to add custom deserializer for CustomFieldDefinition
@param objectMapper the Jackson object mapper
"""
SimpleModule simpleModule = new SimpleModule("CustomFieldDefinition", new Version(1, 0, 0, null));
simpleModule.add... | java | private void registerModulesForCustomFieldDef(ObjectMapper objectMapper) {
SimpleModule simpleModule = new SimpleModule("CustomFieldDefinition", new Version(1, 0, 0, null));
simpleModule.addDeserializer(CustomFieldDefinition.class, new CustomFieldDefinitionDeserializer());
objectMapper.registerModule(simpleModule... | [
"private",
"void",
"registerModulesForCustomFieldDef",
"(",
"ObjectMapper",
"objectMapper",
")",
"{",
"SimpleModule",
"simpleModule",
"=",
"new",
"SimpleModule",
"(",
"\"CustomFieldDefinition\"",
",",
"new",
"Version",
"(",
"1",
",",
"0",
",",
"0",
",",
"null",
")... | Method to add custom deserializer for CustomFieldDefinition
@param objectMapper the Jackson object mapper | [
"Method",
"to",
"add",
"custom",
"deserializer",
"for",
"CustomFieldDefinition"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/QueryResponseDeserializer.java#L156-L160 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/DataTracker.java | DataTracker.getMemtableFor | public Memtable getMemtableFor(OpOrder.Group opGroup, ReplayPosition replayPosition) {
"""
get the Memtable that the ordered writeOp should be directed to
"""
// since any new memtables appended to the list after we fetch it will be for operations started
// after us, we can safely assume that ... | java | public Memtable getMemtableFor(OpOrder.Group opGroup, ReplayPosition replayPosition)
{
// since any new memtables appended to the list after we fetch it will be for operations started
// after us, we can safely assume that we will always find the memtable that 'accepts' us;
// if the barrier... | [
"public",
"Memtable",
"getMemtableFor",
"(",
"OpOrder",
".",
"Group",
"opGroup",
",",
"ReplayPosition",
"replayPosition",
")",
"{",
"// since any new memtables appended to the list after we fetch it will be for operations started",
"// after us, we can safely assume that we will always f... | get the Memtable that the ordered writeOp should be directed to | [
"get",
"the",
"Memtable",
"that",
"the",
"ordered",
"writeOp",
"should",
"be",
"directed",
"to"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/DataTracker.java#L60-L75 |
icode/ameba | src/main/java/ameba/core/Requests.java | Requests.readEntity | public static <T> T readEntity(Class<T> rawType, PropertiesDelegate propertiesDelegate) {
"""
<p>readEntity.</p>
@param rawType a {@link java.lang.Class} object.
@param propertiesDelegate a {@link org.glassfish.jersey.internal.PropertiesDelegate} object.
@param <T> a T object.
@retu... | java | public static <T> T readEntity(Class<T> rawType, PropertiesDelegate propertiesDelegate) {
return getRequest().readEntity(rawType, propertiesDelegate);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"readEntity",
"(",
"Class",
"<",
"T",
">",
"rawType",
",",
"PropertiesDelegate",
"propertiesDelegate",
")",
"{",
"return",
"getRequest",
"(",
")",
".",
"readEntity",
"(",
"rawType",
",",
"propertiesDelegate",
")",
";",... | <p>readEntity.</p>
@param rawType a {@link java.lang.Class} object.
@param propertiesDelegate a {@link org.glassfish.jersey.internal.PropertiesDelegate} object.
@param <T> a T object.
@return a T object. | [
"<p",
">",
"readEntity",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/core/Requests.java#L416-L418 |
Appendium/objectlabkit | datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/ExcelDateUtil.java | ExcelDateUtil.getJavaDate | public static Date getJavaDate(final double excelDate, final boolean use1904windowing) {
"""
Given an Excel date with either 1900 or 1904 date windowing, converts it
to a java.util.Date.
NOTE: If the default <code>TimeZone</code> in Java uses Daylight Saving
Time then the conversion back to an Excel date may ... | java | public static Date getJavaDate(final double excelDate, final boolean use1904windowing) {
final Calendar cal = getJavaCalendar(excelDate, use1904windowing);
return cal == null ? null : cal.getTime();
} | [
"public",
"static",
"Date",
"getJavaDate",
"(",
"final",
"double",
"excelDate",
",",
"final",
"boolean",
"use1904windowing",
")",
"{",
"final",
"Calendar",
"cal",
"=",
"getJavaCalendar",
"(",
"excelDate",
",",
"use1904windowing",
")",
";",
"return",
"cal",
"==",... | Given an Excel date with either 1900 or 1904 date windowing, converts it
to a java.util.Date.
NOTE: If the default <code>TimeZone</code> in Java uses Daylight Saving
Time then the conversion back to an Excel date may not give the same
value, that is the comparison <CODE>excelDate ==
getExcelDate(getJavaDate(excelDate,... | [
"Given",
"an",
"Excel",
"date",
"with",
"either",
"1900",
"or",
"1904",
"date",
"windowing",
"converts",
"it",
"to",
"a",
"java",
".",
"util",
".",
"Date",
"."
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/ExcelDateUtil.java#L150-L153 |
pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.generateStreamCut | public CompletableFuture<StreamCutRecord> generateStreamCut(final String scope, final String stream, final StreamCutRecord previous,
final OperationContext contextOpt, String delegationToken) {
"""
Generate a new stream cut.
@param scope scope... | java | public CompletableFuture<StreamCutRecord> generateStreamCut(final String scope, final String stream, final StreamCutRecord previous,
final OperationContext contextOpt, String delegationToken) {
final OperationContext context = contextOpt == null ? ... | [
"public",
"CompletableFuture",
"<",
"StreamCutRecord",
">",
"generateStreamCut",
"(",
"final",
"String",
"scope",
",",
"final",
"String",
"stream",
",",
"final",
"StreamCutRecord",
"previous",
",",
"final",
"OperationContext",
"contextOpt",
",",
"String",
"delegationT... | Generate a new stream cut.
@param scope scope.
@param stream stream name.
@param contextOpt optional context
@param delegationToken token to be sent to segmentstore.
@param previous previous stream cut record
@return streamCut. | [
"Generate",
"a",
"new",
"stream",
"cut",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L336-L353 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OIndexMVRBTreeAbstract.java | OIndexMVRBTreeAbstract.getValuesBetween | public Collection<OIdentifiable> getValuesBetween(final Object iRangeFrom, final Object iRangeTo) {
"""
Returns a set of records with key between the range passed as parameter. Range bounds are included.
<p/>
In case of {@link com.orientechnologies.common.collection.OCompositeKey}s partial keys can be used as va... | java | public Collection<OIdentifiable> getValuesBetween(final Object iRangeFrom, final Object iRangeTo) {
return getValuesBetween(iRangeFrom, true, iRangeTo, true);
} | [
"public",
"Collection",
"<",
"OIdentifiable",
">",
"getValuesBetween",
"(",
"final",
"Object",
"iRangeFrom",
",",
"final",
"Object",
"iRangeTo",
")",
"{",
"return",
"getValuesBetween",
"(",
"iRangeFrom",
",",
"true",
",",
"iRangeTo",
",",
"true",
")",
";",
"}"... | Returns a set of records with key between the range passed as parameter. Range bounds are included.
<p/>
In case of {@link com.orientechnologies.common.collection.OCompositeKey}s partial keys can be used as values boundaries.
@param iRangeFrom
Starting range
@param iRangeTo
Ending range
@return a set of records with k... | [
"Returns",
"a",
"set",
"of",
"records",
"with",
"key",
"between",
"the",
"range",
"passed",
"as",
"parameter",
".",
"Range",
"bounds",
"are",
"included",
".",
"<p",
"/",
">",
"In",
"case",
"of",
"{",
"@link",
"com",
".",
"orientechnologies",
".",
"common... | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexMVRBTreeAbstract.java#L273-L275 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.uploadFile | public ApiSuccessResponse uploadFile(String id, UploadData uploadData) throws ApiException {
"""
Share a document
Share a document with participants
@param id The ID of the chat interaction. (required)
@param uploadData Request parameters. (optional)
@return ApiSuccessResponse
@throws ApiException If fail to ... | java | public ApiSuccessResponse uploadFile(String id, UploadData uploadData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = uploadFileWithHttpInfo(id, uploadData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"uploadFile",
"(",
"String",
"id",
",",
"UploadData",
"uploadData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"uploadFileWithHttpInfo",
"(",
"id",
",",
"uploadData",
")",
";",
"r... | Share a document
Share a document with participants
@param id The ID of the chat interaction. (required)
@param uploadData Request parameters. (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Share",
"a",
"document",
"Share",
"a",
"document",
"with",
"participants"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L2334-L2337 |
ModeShape/modeshape | modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnectionFactory.java | JcrManagedConnectionFactory.createManagedConnection | @Override
public ManagedConnection createManagedConnection( Subject subject,
ConnectionRequestInfo cxRequestInfo ) throws ResourceException {
"""
Creates a new physical connection to the underlying EIS resource manager.
@param subject Caller's security i... | java | @Override
public ManagedConnection createManagedConnection( Subject subject,
ConnectionRequestInfo cxRequestInfo ) throws ResourceException {
return new JcrManagedConnection(this, (JcrConnectionRequestInfo)cxRequestInfo);
} | [
"@",
"Override",
"public",
"ManagedConnection",
"createManagedConnection",
"(",
"Subject",
"subject",
",",
"ConnectionRequestInfo",
"cxRequestInfo",
")",
"throws",
"ResourceException",
"{",
"return",
"new",
"JcrManagedConnection",
"(",
"this",
",",
"(",
"JcrConnectionRequ... | Creates a new physical connection to the underlying EIS resource manager.
@param subject Caller's security information
@param cxRequestInfo Additional resource adapter specific connection request information
@throws ResourceException generic exception
@return ManagedConnection instance | [
"Creates",
"a",
"new",
"physical",
"connection",
"to",
"the",
"underlying",
"EIS",
"resource",
"manager",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrManagedConnectionFactory.java#L178-L182 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java | NNStorage.writeTransactionIdFile | void writeTransactionIdFile(StorageDirectory sd, long txid) throws IOException {
"""
Write last checkpoint time into a separate file.
@param sd
@throws IOException
"""
if (txid < -1) {
// -1 is valid when formatting
throw new IOException("Bad txid: " + txid);
}
File txIdFile = getSt... | java | void writeTransactionIdFile(StorageDirectory sd, long txid) throws IOException {
if (txid < -1) {
// -1 is valid when formatting
throw new IOException("Bad txid: " + txid);
}
File txIdFile = getStorageFile(sd, NameNodeFile.SEEN_TXID);
OutputStream fos = new AtomicFileOutputStream(txIdFile);
... | [
"void",
"writeTransactionIdFile",
"(",
"StorageDirectory",
"sd",
",",
"long",
"txid",
")",
"throws",
"IOException",
"{",
"if",
"(",
"txid",
"<",
"-",
"1",
")",
"{",
"// -1 is valid when formatting",
"throw",
"new",
"IOException",
"(",
"\"Bad txid: \"",
"+",
"txi... | Write last checkpoint time into a separate file.
@param sd
@throws IOException | [
"Write",
"last",
"checkpoint",
"time",
"into",
"a",
"separate",
"file",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java#L466-L481 |
wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/gui/OperationDialog.java | OperationDialog.setValue | public void setValue(String propName, Object value) {
"""
Set the value of the underlying component. Note that this will
not work for ListEditor components. Also, note that for a JComboBox,
The value object must have the same identity as an object in the drop-down.
@param propName The DMR property name to s... | java | public void setValue(String propName, Object value) {
for (RequestProp prop : props) {
if (prop.getName().equals(propName)) {
JComponent valComp = prop.getValueComponent();
if (valComp instanceof JTextComponent) {
((JTextComponent)valComp).setText(... | [
"public",
"void",
"setValue",
"(",
"String",
"propName",
",",
"Object",
"value",
")",
"{",
"for",
"(",
"RequestProp",
"prop",
":",
"props",
")",
"{",
"if",
"(",
"prop",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"propName",
")",
")",
"{",
"JCompon... | Set the value of the underlying component. Note that this will
not work for ListEditor components. Also, note that for a JComboBox,
The value object must have the same identity as an object in the drop-down.
@param propName The DMR property name to set.
@param value The value. | [
"Set",
"the",
"value",
"of",
"the",
"underlying",
"component",
".",
"Note",
"that",
"this",
"will",
"not",
"work",
"for",
"ListEditor",
"components",
".",
"Also",
"note",
"that",
"for",
"a",
"JComboBox",
"The",
"value",
"object",
"must",
"have",
"the",
"sa... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/gui/OperationDialog.java#L120-L136 |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java | ActionListener.bindActionListeners | public static void bindActionListeners(IActionTarget target, List<ActionListener> actionListeners) {
"""
Binds the action listeners to the specified target.
@param target The target to be bound to the created listeners.
@param actionListeners The action listeners to be bound.
"""
if (actionListener... | java | public static void bindActionListeners(IActionTarget target, List<ActionListener> actionListeners) {
if (actionListeners != null) {
for (ActionListener actionListener : actionListeners) {
actionListener.bind(target);
}
}
} | [
"public",
"static",
"void",
"bindActionListeners",
"(",
"IActionTarget",
"target",
",",
"List",
"<",
"ActionListener",
">",
"actionListeners",
")",
"{",
"if",
"(",
"actionListeners",
"!=",
"null",
")",
"{",
"for",
"(",
"ActionListener",
"actionListener",
":",
"a... | Binds the action listeners to the specified target.
@param target The target to be bound to the created listeners.
@param actionListeners The action listeners to be bound. | [
"Binds",
"the",
"action",
"listeners",
"to",
"the",
"specified",
"target",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java#L57-L63 |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teatools/TeaToolsUtils.java | TeaToolsUtils.createContextClass | public Class<?> createContextClass(ClassLoader loader,
ContextClassEntry[] contextClasses)
throws Exception {
"""
Merges several classes together, producing a new class that has all
of the methods of the combined classes. All methods in the combined
class delegat... | java | public Class<?> createContextClass(ClassLoader loader,
ContextClassEntry[] contextClasses)
throws Exception {
Object[] ret = loadContextClasses(loader, contextClasses);
Class<?>[] classes = (Class[]) ret[0];
String[] prefixNames = (String[]) ret[... | [
"public",
"Class",
"<",
"?",
">",
"createContextClass",
"(",
"ClassLoader",
"loader",
",",
"ContextClassEntry",
"[",
"]",
"contextClasses",
")",
"throws",
"Exception",
"{",
"Object",
"[",
"]",
"ret",
"=",
"loadContextClasses",
"(",
"loader",
",",
"contextClasses... | Merges several classes together, producing a new class that has all
of the methods of the combined classes. All methods in the combined
class delegate to instances of the source classes. If multiple classes
implement the same method, the first one provided is used.
The merged class implements all of the interfaces pro... | [
"Merges",
"several",
"classes",
"together",
"producing",
"a",
"new",
"class",
"that",
"has",
"all",
"of",
"the",
"methods",
"of",
"the",
"combined",
"classes",
".",
"All",
"methods",
"in",
"the",
"combined",
"class",
"delegate",
"to",
"instances",
"of",
"the... | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teatools/TeaToolsUtils.java#L786-L795 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java | AlignerHelper.setScorePoint | public static Last setScorePoint(int x, int y, int gep, int sub, int[][][] scores) {
"""
Calculates the optimal alignment score for the given sequence positions and a linear gap penalty
@param x position in query
@param y position in target
@param gep gap extension penalty
@param sub compound match score
@par... | java | public static Last setScorePoint(int x, int y, int gep, int sub, int[][][] scores) {
int d = scores[x - 1][y][0] + gep;
int i = scores[x][y - 1][0] + gep;
int s = scores[x - 1][y - 1][0] + sub;
if (d >= s && d >= i) {
scores[x][y][0] = d;
return Last.DELETION;
} else if (s >= i) {
scores[x][y][0] = s... | [
"public",
"static",
"Last",
"setScorePoint",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"gep",
",",
"int",
"sub",
",",
"int",
"[",
"]",
"[",
"]",
"[",
"]",
"scores",
")",
"{",
"int",
"d",
"=",
"scores",
"[",
"x",
"-",
"1",
"]",
"[",
"y",
... | Calculates the optimal alignment score for the given sequence positions and a linear gap penalty
@param x position in query
@param y position in target
@param gep gap extension penalty
@param sub compound match score
@param scores dynamic programming score matrix to fill at the given position
@return traceback directio... | [
"Calculates",
"the",
"optimal",
"alignment",
"score",
"for",
"the",
"given",
"sequence",
"positions",
"and",
"a",
"linear",
"gap",
"penalty"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/routines/AlignerHelper.java#L357-L371 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/OrmElf.java | OrmElf.resultSetToObject | public static <T> T resultSetToObject(ResultSet resultSet, T target) throws SQLException {
"""
Get an object from the specified ResultSet. ResultSet.next() is <i>NOT</i> called,
this should be done by the caller. <b>The ResultSet is not closed as a result of this
method.</b>
@param resultSet a {@link Result... | java | public static <T> T resultSetToObject(ResultSet resultSet, T target) throws SQLException
{
return OrmReader.resultSetToObject(resultSet, target);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"resultSetToObject",
"(",
"ResultSet",
"resultSet",
",",
"T",
"target",
")",
"throws",
"SQLException",
"{",
"return",
"OrmReader",
".",
"resultSetToObject",
"(",
"resultSet",
",",
"target",
")",
";",
"}"
] | Get an object from the specified ResultSet. ResultSet.next() is <i>NOT</i> called,
this should be done by the caller. <b>The ResultSet is not closed as a result of this
method.</b>
@param resultSet a {@link ResultSet}
@param target the target object to set values on
@param <T> the class template
@return the populate... | [
"Get",
"an",
"object",
"from",
"the",
"specified",
"ResultSet",
".",
"ResultSet",
".",
"next",
"()",
"is",
"<i",
">",
"NOT<",
"/",
"i",
">",
"called",
"this",
"should",
"be",
"done",
"by",
"the",
"caller",
".",
"<b",
">",
"The",
"ResultSet",
"is",
"n... | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/OrmElf.java#L168-L171 |
groovy/groovy-core | src/main/groovy/lang/IntRange.java | IntRange.subListBorders | public RangeInfo subListBorders(int size) {
"""
A method for determining from and to information when using this IntRange to index an aggregate object of the specified size.
Normally only used internally within Groovy but useful if adding range indexing support for your own aggregates.
@param size the size of ... | java | public RangeInfo subListBorders(int size) {
if (inclusive == null) throw new IllegalStateException("Should not call subListBorders on a non-inclusive aware IntRange");
int tempFrom = from;
if (tempFrom < 0) {
tempFrom += size;
}
int tempTo = to;
if (tempTo < 0... | [
"public",
"RangeInfo",
"subListBorders",
"(",
"int",
"size",
")",
"{",
"if",
"(",
"inclusive",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"Should not call subListBorders on a non-inclusive aware IntRange\"",
")",
";",
"int",
"tempFrom",
"=",
"f... | A method for determining from and to information when using this IntRange to index an aggregate object of the specified size.
Normally only used internally within Groovy but useful if adding range indexing support for your own aggregates.
@param size the size of the aggregate being indexed
@return the calculated range... | [
"A",
"method",
"for",
"determining",
"from",
"and",
"to",
"information",
"when",
"using",
"this",
"IntRange",
"to",
"index",
"an",
"aggregate",
"object",
"of",
"the",
"specified",
"size",
".",
"Normally",
"only",
"used",
"internally",
"within",
"Groovy",
"but"... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/IntRange.java#L197-L211 |
avarabyeu/restendpoint | src/main/java/com/github/avarabyeu/restendpoint/http/RestEndpoints.java | RestEndpoints.forInterface | public static <T> T forInterface(@Nonnull Class<T> clazz, RestEndpoint endpoint) {
"""
Creates interface implementation (via proxy) of provided class using RestEndpoint as rest client
<b>Only interfaces are supported!</b>
@param clazz - interface to be proxied
@param endpoint - RestEndpoint to be used as r... | java | public static <T> T forInterface(@Nonnull Class<T> clazz, RestEndpoint endpoint) {
return Reflection.newProxy(clazz, new RestEndpointInvocationHandler(clazz, endpoint));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"forInterface",
"(",
"@",
"Nonnull",
"Class",
"<",
"T",
">",
"clazz",
",",
"RestEndpoint",
"endpoint",
")",
"{",
"return",
"Reflection",
".",
"newProxy",
"(",
"clazz",
",",
"new",
"RestEndpointInvocationHandler",
"(",
... | Creates interface implementation (via proxy) of provided class using RestEndpoint as rest client
<b>Only interfaces are supported!</b>
@param clazz - interface to be proxied
@param endpoint - RestEndpoint to be used as rest client
@param <T> - Type of interface to be proxied
@return interface implementation (e... | [
"Creates",
"interface",
"implementation",
"(",
"via",
"proxy",
")",
"of",
"provided",
"class",
"using",
"RestEndpoint",
"as",
"rest",
"client",
"<b",
">",
"Only",
"interfaces",
"are",
"supported!<",
"/",
"b",
">"
] | train | https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/http/RestEndpoints.java#L93-L95 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Table.java | Table.setSettings | public void setSettings(final String viewId, final String item, final String value) {
"""
Set one of the settings
@param viewId the id of the view
@param item the item name
@param value the item value
"""
this.builder.setSettings(viewId, item, value);
} | java | public void setSettings(final String viewId, final String item, final String value) {
this.builder.setSettings(viewId, item, value);
} | [
"public",
"void",
"setSettings",
"(",
"final",
"String",
"viewId",
",",
"final",
"String",
"item",
",",
"final",
"String",
"value",
")",
"{",
"this",
".",
"builder",
".",
"setSettings",
"(",
"viewId",
",",
"item",
",",
"value",
")",
";",
"}"
] | Set one of the settings
@param viewId the id of the view
@param item the item name
@param value the item value | [
"Set",
"one",
"of",
"the",
"settings"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Table.java#L304-L306 |
morfologik/morfologik-stemming | morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/FSABuilder.java | FSABuilder.freezeState | private int freezeState(final int activePathIndex) {
"""
Freeze a state: try to find an equivalent state in the interned states
dictionary first, if found, return it, otherwise, serialize the mutable
state at <code>activePathIndex</code> and return it.
"""
final int start = activePath[activePathIndex];
... | java | private int freezeState(final int activePathIndex) {
final int start = activePath[activePathIndex];
final int end = nextArcOffset[activePathIndex];
final int len = end - start;
// Set the last arc flag on the current active path's state.
serialized[end - ARC_SIZE + FLAGS_OFFSET] |= BIT_ARC_LAST;
... | [
"private",
"int",
"freezeState",
"(",
"final",
"int",
"activePathIndex",
")",
"{",
"final",
"int",
"start",
"=",
"activePath",
"[",
"activePathIndex",
"]",
";",
"final",
"int",
"end",
"=",
"nextArcOffset",
"[",
"activePathIndex",
"]",
";",
"final",
"int",
"l... | Freeze a state: try to find an equivalent state in the interned states
dictionary first, if found, return it, otherwise, serialize the mutable
state at <code>activePathIndex</code> and return it. | [
"Freeze",
"a",
"state",
":",
"try",
"to",
"find",
"an",
"equivalent",
"state",
"in",
"the",
"interned",
"states",
"dictionary",
"first",
"if",
"found",
"return",
"it",
"otherwise",
"serialize",
"the",
"mutable",
"state",
"at",
"<code",
">",
"activePathIndex<",... | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/FSABuilder.java#L337-L361 |
molgenis/molgenis | molgenis-core-ui/src/main/java/org/molgenis/core/ui/style/Style.java | Style.createLocal | public static Style createLocal(String location) {
"""
Create new style. The name of the style is based off of the location string, the optional
'boostrap-' prefix and '.min' and '.css' affixes are removed from the name.
"""
String name = location.replaceFirst("bootstrap-", "");
name = name.replaceFir... | java | public static Style createLocal(String location) {
String name = location.replaceFirst("bootstrap-", "");
name = name.replaceFirst(".min", "");
name = name.replaceFirst(".css", "");
return new AutoValue_Style(name, false, location);
} | [
"public",
"static",
"Style",
"createLocal",
"(",
"String",
"location",
")",
"{",
"String",
"name",
"=",
"location",
".",
"replaceFirst",
"(",
"\"bootstrap-\"",
",",
"\"\"",
")",
";",
"name",
"=",
"name",
".",
"replaceFirst",
"(",
"\".min\"",
",",
"\"\"",
"... | Create new style. The name of the style is based off of the location string, the optional
'boostrap-' prefix and '.min' and '.css' affixes are removed from the name. | [
"Create",
"new",
"style",
".",
"The",
"name",
"of",
"the",
"style",
"is",
"based",
"off",
"of",
"the",
"location",
"string",
"the",
"optional",
"boostrap",
"-",
"prefix",
"and",
".",
"min",
"and",
".",
"css",
"affixes",
"are",
"removed",
"from",
"the",
... | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-core-ui/src/main/java/org/molgenis/core/ui/style/Style.java#L21-L26 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java | IPAddress.matchesWithMask | public boolean matchesWithMask(IPAddress other, IPAddress mask) {
"""
Applies the mask to this address and then compares values with the given address
@param mask
@param other
@return
"""
return getSection().matchesWithMask(other.getSection(), mask.getSection());
} | java | public boolean matchesWithMask(IPAddress other, IPAddress mask) {
return getSection().matchesWithMask(other.getSection(), mask.getSection());
} | [
"public",
"boolean",
"matchesWithMask",
"(",
"IPAddress",
"other",
",",
"IPAddress",
"mask",
")",
"{",
"return",
"getSection",
"(",
")",
".",
"matchesWithMask",
"(",
"other",
".",
"getSection",
"(",
")",
",",
"mask",
".",
"getSection",
"(",
")",
")",
";",
... | Applies the mask to this address and then compares values with the given address
@param mask
@param other
@return | [
"Applies",
"the",
"mask",
"to",
"this",
"address",
"and",
"then",
"compares",
"values",
"with",
"the",
"given",
"address"
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java#L592-L594 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java | SvgGraphicsContext.drawRectangle | public void drawRectangle(Object parent, String name, Bbox rectangle, ShapeStyle style) {
"""
Draw a rectangle onto the <code>GraphicsContext</code>.
@param parent
parent group object
@param name
The rectangle's name.
@param rectangle
The rectangle to be drawn. The bounding box's origin, is the rectangle's... | java | public void drawRectangle(Object parent, String name, Bbox rectangle, ShapeStyle style) {
if (isAttached()) {
Element element = helper.createOrUpdateElement(parent, name, "rect", style);
Dom.setElementAttribute(element, "x", Double.toString(rectangle.getX()));
Dom.setElementAttribute(element, "y", Double.toS... | [
"public",
"void",
"drawRectangle",
"(",
"Object",
"parent",
",",
"String",
"name",
",",
"Bbox",
"rectangle",
",",
"ShapeStyle",
"style",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"Element",
"element",
"=",
"helper",
".",
"createOrUpdateElement",... | Draw a rectangle onto the <code>GraphicsContext</code>.
@param parent
parent group object
@param name
The rectangle's name.
@param rectangle
The rectangle to be drawn. The bounding box's origin, is the rectangle's upper left corner on the
screen.
@param style
The styling object for the rectangle. | [
"Draw",
"a",
"rectangle",
"onto",
"the",
"<code",
">",
"GraphicsContext<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L339-L347 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java | ArrayDeque.doubleCapacity | private void doubleCapacity() {
"""
Doubles the capacity of this deque. Call only when full, i.e.,
when head and tail have wrapped around to become equal.
"""
assert head == tail;
int p = head;
int n = elements.length;
int r = n - p; // number of elements to the right of p
... | java | private void doubleCapacity() {
assert head == tail;
int p = head;
int n = elements.length;
int r = n - p; // number of elements to the right of p
int newCapacity = n << 1;
if (newCapacity < 0)
throw new IllegalStateException("Sorry, deque too big");
O... | [
"private",
"void",
"doubleCapacity",
"(",
")",
"{",
"assert",
"head",
"==",
"tail",
";",
"int",
"p",
"=",
"head",
";",
"int",
"n",
"=",
"elements",
".",
"length",
";",
"int",
"r",
"=",
"n",
"-",
"p",
";",
"// number of elements to the right of p",
"int",... | Doubles the capacity of this deque. Call only when full, i.e.,
when head and tail have wrapped around to become equal. | [
"Doubles",
"the",
"capacity",
"of",
"this",
"deque",
".",
"Call",
"only",
"when",
"full",
"i",
".",
"e",
".",
"when",
"head",
"and",
"tail",
"have",
"wrapped",
"around",
"to",
"become",
"equal",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java#L151-L165 |
zaproxy/zaproxy | src/org/parosproxy/paros/view/View.java | View.showSessionDialog | public void showSessionDialog(Session session, String panel, boolean recreateUISharedContexts, Runnable postInitRunnable) {
"""
Shows the session properties dialog. If a panel is specified, the dialog
is opened showing that panel. If {@code recreateUISharedContexts} is
{@code true}, any old UI shared contexts ar... | java | public void showSessionDialog(Session session, String panel, boolean recreateUISharedContexts, Runnable postInitRunnable) {
if (sessionDialog == null) {
this.getSessionDialog();
}
if (recreateUISharedContexts) {
sessionDialog.recreateUISharedContexts(session);
}
... | [
"public",
"void",
"showSessionDialog",
"(",
"Session",
"session",
",",
"String",
"panel",
",",
"boolean",
"recreateUISharedContexts",
",",
"Runnable",
"postInitRunnable",
")",
"{",
"if",
"(",
"sessionDialog",
"==",
"null",
")",
"{",
"this",
".",
"getSessionDialog"... | Shows the session properties dialog. If a panel is specified, the dialog
is opened showing that panel. If {@code recreateUISharedContexts} is
{@code true}, any old UI shared contexts are discarded and new ones are
created as copies of the contexts. If a {@code postInitRunnable} is
provided, its {@link Runnable#run} met... | [
"Shows",
"the",
"session",
"properties",
"dialog",
".",
"If",
"a",
"panel",
"is",
"specified",
"the",
"dialog",
"is",
"opened",
"showing",
"that",
"panel",
".",
"If",
"{",
"@code",
"recreateUISharedContexts",
"}",
"is",
"{",
"@code",
"true",
"}",
"any",
"o... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/View.java#L697-L713 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/tools/RuleMatchAsXmlSerializer.java | RuleMatchAsXmlSerializer.getXmlStart | public String getXmlStart(Language lang, Language motherTongue) {
"""
Get the string to begin the XML. After this, use {@link #ruleMatchesToXmlSnippet} and then {@link #getXmlEnd()}
or better, simply use {@link #ruleMatchesToXml}.
"""
StringBuilder xml = new StringBuilder(CAPACITY);
xml.append("<?xml ... | java | public String getXmlStart(Language lang, Language motherTongue) {
StringBuilder xml = new StringBuilder(CAPACITY);
xml.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
.append("<!-- THIS OUTPUT IS DEPRECATED, PLEASE SEE http://wiki.languagetool.org/http-server FOR A BETTER APPROACH -->\n")
... | [
"public",
"String",
"getXmlStart",
"(",
"Language",
"lang",
",",
"Language",
"motherTongue",
")",
"{",
"StringBuilder",
"xml",
"=",
"new",
"StringBuilder",
"(",
"CAPACITY",
")",
";",
"xml",
".",
"append",
"(",
"\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\"... | Get the string to begin the XML. After this, use {@link #ruleMatchesToXmlSnippet} and then {@link #getXmlEnd()}
or better, simply use {@link #ruleMatchesToXml}. | [
"Get",
"the",
"string",
"to",
"begin",
"the",
"XML",
".",
"After",
"this",
"use",
"{"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/tools/RuleMatchAsXmlSerializer.java#L47-L71 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.subscription_subscriptionType_PUT | public void subscription_subscriptionType_PUT(String subscriptionType, OvhSubscription body) throws IOException {
"""
Alter this object properties
REST: PUT /me/subscription/{subscriptionType}
@param body [required] New object properties
@param subscriptionType [required] The type of subscription
"""
St... | java | public void subscription_subscriptionType_PUT(String subscriptionType, OvhSubscription body) throws IOException {
String qPath = "/me/subscription/{subscriptionType}";
StringBuilder sb = path(qPath, subscriptionType);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"subscription_subscriptionType_PUT",
"(",
"String",
"subscriptionType",
",",
"OvhSubscription",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/subscription/{subscriptionType}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
... | Alter this object properties
REST: PUT /me/subscription/{subscriptionType}
@param body [required] New object properties
@param subscriptionType [required] The type of subscription | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2626-L2630 |
apache/groovy | src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java | FileSystemCompiler.commandLineCompileWithErrorHandling | public static void commandLineCompileWithErrorHandling(String[] args, boolean lookupUnnamedFiles) {
"""
Primary entry point for compiling from the command line
(using the groovyc script).
<p>
If calling inside a process and you don't want the JVM to exit on an
error call commandLineCompile(String[]), which thi... | java | public static void commandLineCompileWithErrorHandling(String[] args, boolean lookupUnnamedFiles) {
try {
commandLineCompile(args, lookupUnnamedFiles);
} catch (Throwable e) {
new ErrorReporter(e, displayStackTraceOnError).write(System.err);
System.exit(1);
}
... | [
"public",
"static",
"void",
"commandLineCompileWithErrorHandling",
"(",
"String",
"[",
"]",
"args",
",",
"boolean",
"lookupUnnamedFiles",
")",
"{",
"try",
"{",
"commandLineCompile",
"(",
"args",
",",
"lookupUnnamedFiles",
")",
";",
"}",
"catch",
"(",
"Throwable",
... | Primary entry point for compiling from the command line
(using the groovyc script).
<p>
If calling inside a process and you don't want the JVM to exit on an
error call commandLineCompile(String[]), which this method simply wraps
@param args command line arguments
@param lookupUnnamedFiles do a lookup for... | [
"Primary",
"entry",
"point",
"for",
"compiling",
"from",
"the",
"command",
"line",
"(",
"using",
"the",
"groovyc",
"script",
")",
".",
"<p",
">",
"If",
"calling",
"inside",
"a",
"process",
"and",
"you",
"don",
"t",
"want",
"the",
"JVM",
"to",
"exit",
"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java#L201-L208 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java | IdentityHashMap.removeMapping | private boolean removeMapping(Object key, Object value) {
"""
Removes the specified key-value mapping from the map if it is present.
@param key possible key
@param value possible value
@return <code>true</code> if and only if the specified key-value
mapping was in the map
"""
Object k = ma... | java | private boolean removeMapping(Object key, Object value) {
Object k = maskNull(key);
Object[] tab = table;
int len = tab.length;
int i = hash(k, len);
while (true) {
Object item = tab[i];
if (item == k) {
if (tab[i + 1] != value)
... | [
"private",
"boolean",
"removeMapping",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"Object",
"k",
"=",
"maskNull",
"(",
"key",
")",
";",
"Object",
"[",
"]",
"tab",
"=",
"table",
";",
"int",
"len",
"=",
"tab",
".",
"length",
";",
"int",
... | Removes the specified key-value mapping from the map if it is present.
@param key possible key
@param value possible value
@return <code>true</code> if and only if the specified key-value
mapping was in the map | [
"Removes",
"the",
"specified",
"key",
"-",
"value",
"mapping",
"from",
"the",
"map",
"if",
"it",
"is",
"present",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java#L556-L578 |
Impetus/Kundera | src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java | KuduDBClient.addPredicatesToScannerBuilder | private void addPredicatesToScannerBuilder(KuduScannerBuilder scannerBuilder, EmbeddableType embeddable,
Field[] fields, MetamodelImpl metaModel, Object key) {
"""
Adds the predicates to scanner builder.
@param scannerBuilder
the scanner builder
@param embeddable
the embeddable
@param fields
th... | java | private void addPredicatesToScannerBuilder(KuduScannerBuilder scannerBuilder, EmbeddableType embeddable,
Field[] fields, MetamodelImpl metaModel, Object key)
{
for (Field f : fields)
{
if (!ReflectUtils.isTransientOrStatic(f))
{
Object value = Prop... | [
"private",
"void",
"addPredicatesToScannerBuilder",
"(",
"KuduScannerBuilder",
"scannerBuilder",
",",
"EmbeddableType",
"embeddable",
",",
"Field",
"[",
"]",
"fields",
",",
"MetamodelImpl",
"metaModel",
",",
"Object",
"key",
")",
"{",
"for",
"(",
"Field",
"f",
":"... | Adds the predicates to scanner builder.
@param scannerBuilder
the scanner builder
@param embeddable
the embeddable
@param fields
the fields
@param metaModel
the meta model
@param key
the key | [
"Adds",
"the",
"predicates",
"to",
"scanner",
"builder",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java#L245-L272 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/tuple/Pair.java | Pair.compareTo | @Override
public int compareTo(final Pair<L, R> other) {
"""
<p>Compares the pair based on the left element followed by the right element.
The types must be {@code Comparable}.</p>
@param other the other pair, not null
@return negative if this is less, zero if equal, positive if greater
"""
ret... | java | @Override
public int compareTo(final Pair<L, R> other) {
return new CompareToBuilder().append(getLeft(), other.getLeft())
.append(getRight(), other.getRight()).toComparison();
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"final",
"Pair",
"<",
"L",
",",
"R",
">",
"other",
")",
"{",
"return",
"new",
"CompareToBuilder",
"(",
")",
".",
"append",
"(",
"getLeft",
"(",
")",
",",
"other",
".",
"getLeft",
"(",
")",
")",
".... | <p>Compares the pair based on the left element followed by the right element.
The types must be {@code Comparable}.</p>
@param other the other pair, not null
@return negative if this is less, zero if equal, positive if greater | [
"<p",
">",
"Compares",
"the",
"pair",
"based",
"on",
"the",
"left",
"element",
"followed",
"by",
"the",
"right",
"element",
".",
"The",
"types",
"must",
"be",
"{",
"@code",
"Comparable",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/tuple/Pair.java#L117-L121 |
code4everything/util | src/main/java/com/zhazhapan/util/FileExecutor.java | FileExecutor.watchFile | public static void watchFile(String file, SimpleHutoolWatcher watcher, boolean shouldFirstExecute) {
"""
监听文件
@param file 待监听的文件
@param watcher {@link SimpleHutoolWatcher}
@param shouldFirstExecute 第一次是否执行 {@link SimpleHutoolWatcher#doSomething()}
@since 1.1.1
"""
if (shouldFirstExecute) {
... | java | public static void watchFile(String file, SimpleHutoolWatcher watcher, boolean shouldFirstExecute) {
if (shouldFirstExecute) {
watcher.doSomething();
}
SimpleWatcher simpleWatcher = new SimpleWatcher() {
@Override
public void onModify(WatchEvent<?> event, Path... | [
"public",
"static",
"void",
"watchFile",
"(",
"String",
"file",
",",
"SimpleHutoolWatcher",
"watcher",
",",
"boolean",
"shouldFirstExecute",
")",
"{",
"if",
"(",
"shouldFirstExecute",
")",
"{",
"watcher",
".",
"doSomething",
"(",
")",
";",
"}",
"SimpleWatcher",
... | 监听文件
@param file 待监听的文件
@param watcher {@link SimpleHutoolWatcher}
@param shouldFirstExecute 第一次是否执行 {@link SimpleHutoolWatcher#doSomething()}
@since 1.1.1 | [
"监听文件"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/FileExecutor.java#L51-L65 |
baratine/baratine | framework/src/main/java/com/caucho/v5/reflect/ReflectUtil.java | ReflectUtil.isMatch | public static boolean isMatch(Method javaMethod,
String name, Class<?> []param) {
"""
Tests if an annotated method matches a name and parameter types.
"""
if (! javaMethod.getName().equals(name))
return false;
Class<?> []mparam = javaMethod.getParameterTypes();
... | java | public static boolean isMatch(Method javaMethod,
String name, Class<?> []param)
{
if (! javaMethod.getName().equals(name))
return false;
Class<?> []mparam = javaMethod.getParameterTypes();
return isMatch(mparam, param);
} | [
"public",
"static",
"boolean",
"isMatch",
"(",
"Method",
"javaMethod",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"param",
")",
"{",
"if",
"(",
"!",
"javaMethod",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"name",
")",
")",
"r... | Tests if an annotated method matches a name and parameter types. | [
"Tests",
"if",
"an",
"annotated",
"method",
"matches",
"a",
"name",
"and",
"parameter",
"types",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/reflect/ReflectUtil.java#L144-L153 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java | ClassBuilder.getInstance | public static ClassBuilder getInstance(Context context,
TypeElement typeElement, ClassWriter writer) {
"""
Constructs a new ClassBuilder.
@param context the build context
@param typeElement the class being documented.
@param writer the doclet specific writer.
@return the new ClassBuilder
"""... | java | public static ClassBuilder getInstance(Context context,
TypeElement typeElement, ClassWriter writer) {
return new ClassBuilder(context, typeElement, writer);
} | [
"public",
"static",
"ClassBuilder",
"getInstance",
"(",
"Context",
"context",
",",
"TypeElement",
"typeElement",
",",
"ClassWriter",
"writer",
")",
"{",
"return",
"new",
"ClassBuilder",
"(",
"context",
",",
"typeElement",
",",
"writer",
")",
";",
"}"
] | Constructs a new ClassBuilder.
@param context the build context
@param typeElement the class being documented.
@param writer the doclet specific writer.
@return the new ClassBuilder | [
"Constructs",
"a",
"new",
"ClassBuilder",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java#L115-L118 |
threerings/playn | html/src/playn/html/HtmlGraphics.java | HtmlGraphics.registerFontMetrics | public void registerFontMetrics(String name, Font.Style style, float size, float lineHeight) {
"""
Registers metrics for the specified font in the specified style and size. This overrides the
default font metrics calculation (which is hacky and inaccurate). If you want to ensure
somewhat consistent font layout a... | java | public void registerFontMetrics(String name, Font.Style style, float size, float lineHeight) {
HtmlFont font = new HtmlFont(this, name, style, size);
HtmlFontMetrics metrics = getFontMetrics(font); // get emwidth via default measurement
fontMetrics.put(font, new HtmlFontMetrics(font, lineHeight, metrics.emw... | [
"public",
"void",
"registerFontMetrics",
"(",
"String",
"name",
",",
"Font",
".",
"Style",
"style",
",",
"float",
"size",
",",
"float",
"lineHeight",
")",
"{",
"HtmlFont",
"font",
"=",
"new",
"HtmlFont",
"(",
"this",
",",
"name",
",",
"style",
",",
"size... | Registers metrics for the specified font in the specified style and size. This overrides the
default font metrics calculation (which is hacky and inaccurate). If you want to ensure
somewhat consistent font layout across browsers, you should register font metrics for every
combination of font, style and size that you us... | [
"Registers",
"metrics",
"for",
"the",
"specified",
"font",
"in",
"the",
"specified",
"style",
"and",
"size",
".",
"This",
"overrides",
"the",
"default",
"font",
"metrics",
"calculation",
"(",
"which",
"is",
"hacky",
"and",
"inaccurate",
")",
".",
"If",
"you"... | train | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/html/src/playn/html/HtmlGraphics.java#L96-L100 |
morfologik/morfologik-stemming | morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/CFSA2Serializer.java | CFSA2Serializer.computeFirstStates | private int[] computeFirstStates(IntIntHashMap inlinkCount, int maxStates, int minInlinkCount) {
"""
Compute the set of states that should be linearized first to minimize other
states goto length.
"""
Comparator<IntIntHolder> comparator = new Comparator<FSAUtils.IntIntHolder>() {
public int compar... | java | private int[] computeFirstStates(IntIntHashMap inlinkCount, int maxStates, int minInlinkCount) {
Comparator<IntIntHolder> comparator = new Comparator<FSAUtils.IntIntHolder>() {
public int compare(IntIntHolder o1, IntIntHolder o2) {
int v = o1.a - o2.a;
return v == 0 ? (o1.b - o2.b) : v;
... | [
"private",
"int",
"[",
"]",
"computeFirstStates",
"(",
"IntIntHashMap",
"inlinkCount",
",",
"int",
"maxStates",
",",
"int",
"minInlinkCount",
")",
"{",
"Comparator",
"<",
"IntIntHolder",
">",
"comparator",
"=",
"new",
"Comparator",
"<",
"FSAUtils",
".",
"IntIntH... | Compute the set of states that should be linearized first to minimize other
states goto length. | [
"Compute",
"the",
"set",
"of",
"states",
"that",
"should",
"be",
"linearized",
"first",
"to",
"minimize",
"other",
"states",
"goto",
"length",
"."
] | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-fsa-builders/src/main/java/morfologik/fsa/builders/CFSA2Serializer.java#L335-L366 |
KyoriPowered/text | api/src/main/java/net/kyori/text/ScoreComponent.java | ScoreComponent.of | public static ScoreComponent of(final @NonNull String name, final @NonNull String objective) {
"""
Creates a score component with a name and objective.
@param name the score name
@param objective the score objective
@return the score component
"""
return of(name, objective, null);
} | java | public static ScoreComponent of(final @NonNull String name, final @NonNull String objective) {
return of(name, objective, null);
} | [
"public",
"static",
"ScoreComponent",
"of",
"(",
"final",
"@",
"NonNull",
"String",
"name",
",",
"final",
"@",
"NonNull",
"String",
"objective",
")",
"{",
"return",
"of",
"(",
"name",
",",
"objective",
",",
"null",
")",
";",
"}"
] | Creates a score component with a name and objective.
@param name the score name
@param objective the score objective
@return the score component | [
"Creates",
"a",
"score",
"component",
"with",
"a",
"name",
"and",
"objective",
"."
] | train | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/ScoreComponent.java#L84-L86 |
oboehm/jfachwert | src/main/java/de/jfachwert/pruefung/LengthValidator.java | LengthValidator.verify | public static String verify(String value, int min, int max) {
"""
Verifziert die Laenge des uebergebenen Wertes. Im Gegensatz zur
{@link #validate(String, int, int)}-Methode wird herbei eine
{@link IllegalArgumentException} geworfen.
@param value zu pruefender Wert
@param min geforderte Minimal-Laenge
@pa... | java | public static String verify(String value, int min, int max) {
try {
return validate(value, min, max);
} catch (IllegalArgumentException ex) {
throw new LocalizedIllegalArgumentException(ex);
}
} | [
"public",
"static",
"String",
"verify",
"(",
"String",
"value",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"try",
"{",
"return",
"validate",
"(",
"value",
",",
"min",
",",
"max",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"ex",
")",
... | Verifziert die Laenge des uebergebenen Wertes. Im Gegensatz zur
{@link #validate(String, int, int)}-Methode wird herbei eine
{@link IllegalArgumentException} geworfen.
@param value zu pruefender Wert
@param min geforderte Minimal-Laenge
@param max Maximal-Laenge
@return der gepruefte Wert (zur evtl. Weiterverarbei... | [
"Verifziert",
"die",
"Laenge",
"des",
"uebergebenen",
"Wertes",
".",
"Im",
"Gegensatz",
"zur",
"{",
"@link",
"#validate",
"(",
"String",
"int",
"int",
")",
"}",
"-",
"Methode",
"wird",
"herbei",
"eine",
"{",
"@link",
"IllegalArgumentException",
"}",
"geworfen"... | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/pruefung/LengthValidator.java#L126-L132 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.checkDeclare | public static BufferedImage checkDeclare( int width , int height , BufferedImage image , int type ) {
"""
If the provided image does not have the same shape and same type a new one is declared and returned.
"""
if( image == null )
return new BufferedImage(width,height,type);
if( image.getType() != type ... | java | public static BufferedImage checkDeclare( int width , int height , BufferedImage image , int type ) {
if( image == null )
return new BufferedImage(width,height,type);
if( image.getType() != type )
return new BufferedImage(width,height,type);
if( image.getWidth() != width || image.getHeight() != height )
... | [
"public",
"static",
"BufferedImage",
"checkDeclare",
"(",
"int",
"width",
",",
"int",
"height",
",",
"BufferedImage",
"image",
",",
"int",
"type",
")",
"{",
"if",
"(",
"image",
"==",
"null",
")",
"return",
"new",
"BufferedImage",
"(",
"width",
",",
"height... | If the provided image does not have the same shape and same type a new one is declared and returned. | [
"If",
"the",
"provided",
"image",
"does",
"not",
"have",
"the",
"same",
"shape",
"and",
"same",
"type",
"a",
"new",
"one",
"is",
"declared",
"and",
"returned",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L43-L51 |
JCTools/JCTools | jctools-core/src/main/java/org/jctools/queues/MpscArrayQueue.java | MpscArrayQueue.offerIfBelowThreshold | public boolean offerIfBelowThreshold(final E e, int threshold) {
"""
{@link #offer}} if {@link #size()} is less than threshold.
@param e the object to offer onto the queue, not null
@param threshold the maximum allowable size
@return true if the offer is successful, false if queue size exceeds thresho... | java | public boolean offerIfBelowThreshold(final E e, int threshold)
{
if (null == e)
{
throw new NullPointerException();
}
final long mask = this.mask;
final long capacity = mask + 1;
long producerLimit = lvProducerLimit(); // LoadLoad
long pIndex;
... | [
"public",
"boolean",
"offerIfBelowThreshold",
"(",
"final",
"E",
"e",
",",
"int",
"threshold",
")",
"{",
"if",
"(",
"null",
"==",
"e",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"final",
"long",
"mask",
"=",
"this",
".",
"mas... | {@link #offer}} if {@link #size()} is less than threshold.
@param e the object to offer onto the queue, not null
@param threshold the maximum allowable size
@return true if the offer is successful, false if queue size exceeds threshold
@since 1.0.1 | [
"{",
"@link",
"#offer",
"}}",
"if",
"{",
"@link",
"#size",
"()",
"}",
"is",
"less",
"than",
"threshold",
"."
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-core/src/main/java/org/jctools/queues/MpscArrayQueue.java#L174-L218 |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/asserts/SeLionAsserts.java | SeLionAsserts.assertNotEquals | public static void assertNotEquals(Object actual, Object expected, String msg) {
"""
assertNotEquals method is used to assert based on actual and expected values and provide a Pass result for a
mismatch.
@param actual
- Actual value obtained from executing a test
@param expected
- Expected value for the tes... | java | public static void assertNotEquals(Object actual, Object expected, String msg) {
hardAssert.assertNotEquals(actual, expected, msg);
} | [
"public",
"static",
"void",
"assertNotEquals",
"(",
"Object",
"actual",
",",
"Object",
"expected",
",",
"String",
"msg",
")",
"{",
"hardAssert",
".",
"assertNotEquals",
"(",
"actual",
",",
"expected",
",",
"msg",
")",
";",
"}"
] | assertNotEquals method is used to assert based on actual and expected values and provide a Pass result for a
mismatch.
@param actual
- Actual value obtained from executing a test
@param expected
- Expected value for the test to pass. <br>
@param msg
- A descriptive text narrating a validation being done Sample Usage<b... | [
"assertNotEquals",
"method",
"is",
"used",
"to",
"assert",
"based",
"on",
"actual",
"and",
"expected",
"values",
"and",
"provide",
"a",
"Pass",
"result",
"for",
"a",
"mismatch",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/asserts/SeLionAsserts.java#L112-L114 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/SandboxStyleStructureProvider.java | SandboxStyleStructureProvider.getAllPDBIDs | public List<String> getAllPDBIDs() throws IOException {
"""
Returns a list of all PDB IDs that are available in this installation
@return a list of PDB IDs
"""
File f = new File(path);
if ( ! f.isDirectory())
throw new IOException("Path " + path + " is not a directory!");
String[] dirName = f.lis... | java | public List<String> getAllPDBIDs() throws IOException{
File f = new File(path);
if ( ! f.isDirectory())
throw new IOException("Path " + path + " is not a directory!");
String[] dirName = f.list();
List<String>pdbIds = new ArrayList<String>();
for (String dir : dirName) {
File d2= new File(f,dir);
... | [
"public",
"List",
"<",
"String",
">",
"getAllPDBIDs",
"(",
")",
"throws",
"IOException",
"{",
"File",
"f",
"=",
"new",
"File",
"(",
"path",
")",
";",
"if",
"(",
"!",
"f",
".",
"isDirectory",
"(",
")",
")",
"throw",
"new",
"IOException",
"(",
"\"Path ... | Returns a list of all PDB IDs that are available in this installation
@return a list of PDB IDs | [
"Returns",
"a",
"list",
"of",
"all",
"PDB",
"IDs",
"that",
"are",
"available",
"in",
"this",
"installation"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SandboxStyleStructureProvider.java#L182-L205 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/InventoryNavigator.java | InventoryNavigator.searchManagedEntities | public ManagedEntity[] searchManagedEntities(boolean recurse) throws InvalidProperty, RuntimeFault, RemoteException {
"""
Retrieve container contents from specified parent recursively if requested.
@param recurse retrieve contents recursively from the root down
@throws RemoteException
@throws RuntimeFault
@t... | java | public ManagedEntity[] searchManagedEntities(boolean recurse) throws InvalidProperty, RuntimeFault, RemoteException {
String[][] typeinfo = new String[][]{new String[]{"ManagedEntity",}};
return searchManagedEntities(typeinfo, recurse);
} | [
"public",
"ManagedEntity",
"[",
"]",
"searchManagedEntities",
"(",
"boolean",
"recurse",
")",
"throws",
"InvalidProperty",
",",
"RuntimeFault",
",",
"RemoteException",
"{",
"String",
"[",
"]",
"[",
"]",
"typeinfo",
"=",
"new",
"String",
"[",
"]",
"[",
"]",
"... | Retrieve container contents from specified parent recursively if requested.
@param recurse retrieve contents recursively from the root down
@throws RemoteException
@throws RuntimeFault
@throws InvalidProperty | [
"Retrieve",
"container",
"contents",
"from",
"specified",
"parent",
"recursively",
"if",
"requested",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/InventoryNavigator.java#L28-L31 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.longMin | public static <Key, Value> Aggregation<Key, Long, Long> longMin() {
"""
Returns an aggregation to find the long minimum of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT MIN(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the minimum... | java | public static <Key, Value> Aggregation<Key, Long, Long> longMin() {
return new AggregationAdapter(new LongMinAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"Long",
",",
"Long",
">",
"longMin",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"LongMinAggregation",
"<",
"Key",
",",
"Value",
">",
"(",
")",
")"... | Returns an aggregation to find the long minimum of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT MIN(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the minimum value over all supplied values | [
"Returns",
"an",
"aggregation",
"to",
"find",
"the",
"long",
"minimum",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELECT",
"MIN",
"(",
"value",
")",
"FROM",
"x<",
"/",
"pre... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L174-L176 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java | RingBuffer.tryPublishEvents | public <A> boolean tryPublishEvents(EventTranslatorOneArg<E, A> translator, int batchStartsAt, int batchSize, A[] arg0) {
"""
Allows one user supplied argument.
@param translator The user specified translation for each event
@param batchStartsAt The first element of the array which is within the batch.
@param... | java | public <A> boolean tryPublishEvents(EventTranslatorOneArg<E, A> translator, int batchStartsAt, int batchSize, A[] arg0) {
checkBounds(arg0, batchStartsAt, batchSize);
try {
final long finalSequence = sequencer.tryNext(batchSize);
translateAndPublishBatch(translator, arg0, batchSt... | [
"public",
"<",
"A",
">",
"boolean",
"tryPublishEvents",
"(",
"EventTranslatorOneArg",
"<",
"E",
",",
"A",
">",
"translator",
",",
"int",
"batchStartsAt",
",",
"int",
"batchSize",
",",
"A",
"[",
"]",
"arg0",
")",
"{",
"checkBounds",
"(",
"arg0",
",",
"bat... | Allows one user supplied argument.
@param translator The user specified translation for each event
@param batchStartsAt The first element of the array which is within the batch.
@param batchSize The actual size of the batch
@param arg0 An array of user supplied arguments, one element per event.
@return true if the val... | [
"Allows",
"one",
"user",
"supplied",
"argument",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/utils/disruptor/RingBuffer.java#L612-L621 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/ReflectionUtil.java | ReflectionUtil.classHasAnnotation | public static boolean classHasAnnotation(Class clazz, Class<? extends Annotation> annotation) {
"""
Returns true if that class or any of its supertypes has the annotation
@param clazz The class that needs the annotation
@param annotation The annotation to look for
@return true if and only if the class or... | java | public static boolean classHasAnnotation(Class clazz, Class<? extends Annotation> annotation) {
try {
Set<Class> hierarchy = ReflectionUtil.flattenHierarchy(clazz);
for (Class c : hierarchy) {
if (c.isAnnotationPresent(annotation)) return true;
}
} catch (Throwable t) {
t.printStackTrace();
}
re... | [
"public",
"static",
"boolean",
"classHasAnnotation",
"(",
"Class",
"clazz",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"try",
"{",
"Set",
"<",
"Class",
">",
"hierarchy",
"=",
"ReflectionUtil",
".",
"flattenHierarchy",
"(",
... | Returns true if that class or any of its supertypes has the annotation
@param clazz The class that needs the annotation
@param annotation The annotation to look for
@return true if and only if the class or any of its supertypes has the annotation | [
"Returns",
"true",
"if",
"that",
"class",
"or",
"any",
"of",
"its",
"supertypes",
"has",
"the",
"annotation"
] | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/ReflectionUtil.java#L125-L135 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kraken/query/WatchQuery.java | WatchQuery.fillKey | @Override
public void fillKey(RowCursor cursor, Object []args) {
"""
/*
@Override
public void unwatch(DatabaseWatch watch, Object... args)
{
TableKelp tableKelp = _table.getTableKelp();
RowCursor minCursor = tableKelp.cursor();
RowCursor maxCursor = tableKelp.cursor();
minCursor.clear();
maxCursor.se... | java | @Override
public void fillKey(RowCursor cursor, Object []args)
{
_whereKraken.fillMinCursor(cursor, args);
} | [
"@",
"Override",
"public",
"void",
"fillKey",
"(",
"RowCursor",
"cursor",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"_whereKraken",
".",
"fillMinCursor",
"(",
"cursor",
",",
"args",
")",
";",
"}"
] | /*
@Override
public void unwatch(DatabaseWatch watch, Object... args)
{
TableKelp tableKelp = _table.getTableKelp();
RowCursor minCursor = tableKelp.cursor();
RowCursor maxCursor = tableKelp.cursor();
minCursor.clear();
maxCursor.setKeyMax();
_whereKraken.fillMinCursor(minCursor, args);
_whereKraken.fillMaxCursor(mi... | [
"/",
"*",
"@Override",
"public",
"void",
"unwatch",
"(",
"DatabaseWatch",
"watch",
"Object",
"...",
"args",
")",
"{",
"TableKelp",
"tableKelp",
"=",
"_table",
".",
"getTableKelp",
"()",
";"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kraken/query/WatchQuery.java#L145-L149 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/UtilDenoiseWavelet.java | UtilDenoiseWavelet.estimateNoiseStdDev | public static float estimateNoiseStdDev(GrayF32 subband , float storage[] ) {
"""
<p>
Robust median estimator of the noise standard deviation. Typically applied to the HH<sub>1</sub> subband.
</p>
<p>
σ = Median(|Y<sub>ij</sub>|)/0.6745<br>
where σ is the estimated noise standard deviation, and... | java | public static float estimateNoiseStdDev(GrayF32 subband , float storage[] ) {
storage = subbandAbsVal(subband, storage );
int N = subband.width*subband.height;
return QuickSelect.select(storage, N / 2, N)/0.6745f;
} | [
"public",
"static",
"float",
"estimateNoiseStdDev",
"(",
"GrayF32",
"subband",
",",
"float",
"storage",
"[",
"]",
")",
"{",
"storage",
"=",
"subbandAbsVal",
"(",
"subband",
",",
"storage",
")",
";",
"int",
"N",
"=",
"subband",
".",
"width",
"*",
"subband",... | <p>
Robust median estimator of the noise standard deviation. Typically applied to the HH<sub>1</sub> subband.
</p>
<p>
σ = Median(|Y<sub>ij</sub>|)/0.6745<br>
where σ is the estimated noise standard deviation, and Median(|Y<sub>ij</sub>|)
is the median absolute value of all the pixels in the subband.
</p>... | [
"<p",
">",
"Robust",
"median",
"estimator",
"of",
"the",
"noise",
"standard",
"deviation",
".",
"Typically",
"applied",
"to",
"the",
"HH<sub",
">",
"1<",
"/",
"sub",
">",
"subband",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/denoise/wavelet/UtilDenoiseWavelet.java#L53-L59 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyHunting_serviceName_timeConditions_conditions_conditionId_GET | public OvhEasyHuntingTimeConditions billingAccount_easyHunting_serviceName_timeConditions_conditions_conditionId_GET(String billingAccount, String serviceName, Long conditionId) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions/con... | java | public OvhEasyHuntingTimeConditions billingAccount_easyHunting_serviceName_timeConditions_conditions_conditionId_GET(String billingAccount, String serviceName, Long conditionId) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions/conditions/{conditionId}";
Strin... | [
"public",
"OvhEasyHuntingTimeConditions",
"billingAccount_easyHunting_serviceName_timeConditions_conditions_conditionId_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"conditionId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\... | Get this object properties
REST: GET /telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions/conditions/{conditionId}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param conditionId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3325-L3330 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.beginUpdateByIdAsync | public Observable<GenericResourceInner> beginUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
"""
Updates a resource by ID.
@param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resou... | java | public Observable<GenericResourceInner> beginUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
return beginUpdateByIdWithServiceResponseAsync(resourceId, apiVersion, parameters).map(new Func1<ServiceResponse<GenericResourceInner>, GenericResourceInner>() {
@Ove... | [
"public",
"Observable",
"<",
"GenericResourceInner",
">",
"beginUpdateByIdAsync",
"(",
"String",
"resourceId",
",",
"String",
"apiVersion",
",",
"GenericResourceInner",
"parameters",
")",
"{",
"return",
"beginUpdateByIdWithServiceResponseAsync",
"(",
"resourceId",
",",
"a... | Updates a resource by ID.
@param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
@param apiVersion The API version to use for the op... | [
"Updates",
"a",
"resource",
"by",
"ID",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L2329-L2336 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/GetStageResult.java | GetStageResult.withVariables | public GetStageResult withVariables(java.util.Map<String, String> variables) {
"""
<p>
A map that defines the stage variables for a <a>Stage</a> resource. Variable names can have alphanumeric and
underscore characters, and the values must match <code>[A-Za-z0-9-._~:/?#&=,]+</code>.
</p>
@param variables
... | java | public GetStageResult withVariables(java.util.Map<String, String> variables) {
setVariables(variables);
return this;
} | [
"public",
"GetStageResult",
"withVariables",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"variables",
")",
"{",
"setVariables",
"(",
"variables",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map that defines the stage variables for a <a>Stage</a> resource. Variable names can have alphanumeric and
underscore characters, and the values must match <code>[A-Za-z0-9-._~:/?#&=,]+</code>.
</p>
@param variables
A map that defines the stage variables for a <a>Stage</a> resource. Variable names can have a... | [
"<p",
">",
"A",
"map",
"that",
"defines",
"the",
"stage",
"variables",
"for",
"a",
"<a",
">",
"Stage<",
"/",
"a",
">",
"resource",
".",
"Variable",
"names",
"can",
"have",
"alphanumeric",
"and",
"underscore",
"characters",
"and",
"the",
"values",
"must",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/GetStageResult.java#L583-L586 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.