repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 204 | func_name stringlengths 5 103 | whole_func_string stringlengths 87 3.44k | language stringclasses 1
value | func_code_string stringlengths 87 3.44k | func_code_tokens listlengths 21 714 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 482 | split_name stringclasses 1
value | func_code_url stringlengths 102 309 |
|---|---|---|---|---|---|---|---|---|---|---|
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/caching/provider/ConcurrentMapCache.java | ConcurrentMapCache.putIfPresent | @Override
public VALUE putIfPresent(KEY key, VALUE newValue) {
Assert.notNull(newValue, "Value is required");
if (key != null) {
AtomicReference<VALUE> oldValueRef = new AtomicReference<>(null);
return newValue.equals(this.map.computeIfPresent(key, (theKey, oldValue) -> {
oldValueRef.s... | java | @Override
public VALUE putIfPresent(KEY key, VALUE newValue) {
Assert.notNull(newValue, "Value is required");
if (key != null) {
AtomicReference<VALUE> oldValueRef = new AtomicReference<>(null);
return newValue.equals(this.map.computeIfPresent(key, (theKey, oldValue) -> {
oldValueRef.s... | [
"@",
"Override",
"public",
"VALUE",
"putIfPresent",
"(",
"KEY",
"key",
",",
"VALUE",
"newValue",
")",
"{",
"Assert",
".",
"notNull",
"(",
"newValue",
",",
"\"Value is required\"",
")",
";",
"if",
"(",
"key",
"!=",
"null",
")",
"{",
"AtomicReference",
"<",
... | Puts the {@link VALUE value} in this {@link Cache} mapped to the given {@link KEY key} iff an entry
with the given {@link KEY key} already exists in this {@link Cache}.
@param key {@link KEY key} used to map the {@link VALUE new value} in this {@link Cache}.
@param newValue {@link VALUE new value} replacing the existi... | [
"Puts",
"the",
"{",
"@link",
"VALUE",
"value",
"}",
"in",
"this",
"{",
"@link",
"Cache",
"}",
"mapped",
"to",
"the",
"given",
"{",
"@link",
"KEY",
"key",
"}",
"iff",
"an",
"entry",
"with",
"the",
"given",
"{",
"@link",
"KEY",
"key",
"}",
"already",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/caching/provider/ConcurrentMapCache.java#L206-L222 |
nulab/backlog4j | src/main/java/com/nulabinc/backlog4j/api/option/CreateIssueParams.java | CreateIssueParams.actualHours | public CreateIssueParams actualHours(BigDecimal actualHours) {
if (actualHours == null) {
parameters.add(new NameValuePair("actualHours", ""));
} else {
parameters.add(new NameValuePair("actualHours", actualHours.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString()));
}
... | java | public CreateIssueParams actualHours(BigDecimal actualHours) {
if (actualHours == null) {
parameters.add(new NameValuePair("actualHours", ""));
} else {
parameters.add(new NameValuePair("actualHours", actualHours.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString()));
}
... | [
"public",
"CreateIssueParams",
"actualHours",
"(",
"BigDecimal",
"actualHours",
")",
"{",
"if",
"(",
"actualHours",
"==",
"null",
")",
"{",
"parameters",
".",
"add",
"(",
"new",
"NameValuePair",
"(",
"\"actualHours\"",
",",
"\"\"",
")",
")",
";",
"}",
"else"... | Sets the issue actual hours.
@param actualHours the issue actual hours
@return CreateIssueParams instance | [
"Sets",
"the",
"issue",
"actual",
"hours",
"."
] | train | https://github.com/nulab/backlog4j/blob/862ae0586ad808b2ec413f665b8dfc0c9a107b4e/src/main/java/com/nulabinc/backlog4j/api/option/CreateIssueParams.java#L121-L128 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerHttpClient.java | CircuitBreakerHttpClient.newDecorator | public static Function<Client<HttpRequest, HttpResponse>, CircuitBreakerHttpClient>
newDecorator(CircuitBreakerMapping mapping, CircuitBreakerStrategy strategy) {
return delegate -> new CircuitBreakerHttpClient(delegate, mapping, strategy);
} | java | public static Function<Client<HttpRequest, HttpResponse>, CircuitBreakerHttpClient>
newDecorator(CircuitBreakerMapping mapping, CircuitBreakerStrategy strategy) {
return delegate -> new CircuitBreakerHttpClient(delegate, mapping, strategy);
} | [
"public",
"static",
"Function",
"<",
"Client",
"<",
"HttpRequest",
",",
"HttpResponse",
">",
",",
"CircuitBreakerHttpClient",
">",
"newDecorator",
"(",
"CircuitBreakerMapping",
"mapping",
",",
"CircuitBreakerStrategy",
"strategy",
")",
"{",
"return",
"delegate",
"->",... | Creates a new decorator with the specified {@link CircuitBreakerMapping} and
{@link CircuitBreakerStrategy}.
<p>Since {@link CircuitBreaker} is a unit of failure detection, don't reuse the same instance for
unrelated services. | [
"Creates",
"a",
"new",
"decorator",
"with",
"the",
"specified",
"{",
"@link",
"CircuitBreakerMapping",
"}",
"and",
"{",
"@link",
"CircuitBreakerStrategy",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerHttpClient.java#L53-L56 |
brettonw/Bag | src/main/java/com/brettonw/bag/Bag.java | Bag.getInteger | public Integer getInteger (String key, Supplier<Integer> notFound) {
return getParsed (key, Integer::new, notFound);
} | java | public Integer getInteger (String key, Supplier<Integer> notFound) {
return getParsed (key, Integer::new, notFound);
} | [
"public",
"Integer",
"getInteger",
"(",
"String",
"key",
",",
"Supplier",
"<",
"Integer",
">",
"notFound",
")",
"{",
"return",
"getParsed",
"(",
"key",
",",
"Integer",
"::",
"new",
",",
"notFound",
")",
";",
"}"
] | Retrieve a mapped element and return it as an Integer.
@param key A string value used to index the element.
@param notFound A function to create a new Integer if the requested key was not found
@return The element as an Integer, or notFound if the element is not found. | [
"Retrieve",
"a",
"mapped",
"element",
"and",
"return",
"it",
"as",
"an",
"Integer",
"."
] | train | https://github.com/brettonw/Bag/blob/25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56/src/main/java/com/brettonw/bag/Bag.java#L208-L210 |
cerner/beadledom | jackson/src/main/java/com/cerner/beadledom/jackson/filter/FieldFilter.java | FieldFilter.writeJson | public void writeJson(JsonParser parser, JsonGenerator jgen) throws IOException {
checkNotNull(parser, "JsonParser cannot be null for writeJson.");
checkNotNull(jgen, "JsonGenerator cannot be null for writeJson.");
JsonToken curToken = parser.nextToken();
while (curToken != null) {
curToken = proc... | java | public void writeJson(JsonParser parser, JsonGenerator jgen) throws IOException {
checkNotNull(parser, "JsonParser cannot be null for writeJson.");
checkNotNull(jgen, "JsonGenerator cannot be null for writeJson.");
JsonToken curToken = parser.nextToken();
while (curToken != null) {
curToken = proc... | [
"public",
"void",
"writeJson",
"(",
"JsonParser",
"parser",
",",
"JsonGenerator",
"jgen",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"parser",
",",
"\"JsonParser cannot be null for writeJson.\"",
")",
";",
"checkNotNull",
"(",
"jgen",
",",
"\"JsonGenerato... | Writes the json from the parser onto the generator, using the filters to only write the objects
specified.
@param parser JsonParser that is created from a Jackson utility (i.e. ObjectMapper)
@param jgen JsonGenerator that is used for writing json onto an underlying stream
@throws JsonGenerationException exception if J... | [
"Writes",
"the",
"json",
"from",
"the",
"parser",
"onto",
"the",
"generator",
"using",
"the",
"filters",
"to",
"only",
"write",
"the",
"objects",
"specified",
"."
] | train | https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/jackson/src/main/java/com/cerner/beadledom/jackson/filter/FieldFilter.java#L145-L153 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildFieldSerializationOverview | public void buildFieldSerializationOverview(TypeElement typeElement, Content classContentTree) {
if (utils.definesSerializableFields(typeElement)) {
VariableElement ve = utils.serializableFields(typeElement).first();
// Check to see if there are inline comments, tags or deprecation
... | java | public void buildFieldSerializationOverview(TypeElement typeElement, Content classContentTree) {
if (utils.definesSerializableFields(typeElement)) {
VariableElement ve = utils.serializableFields(typeElement).first();
// Check to see if there are inline comments, tags or deprecation
... | [
"public",
"void",
"buildFieldSerializationOverview",
"(",
"TypeElement",
"typeElement",
",",
"Content",
"classContentTree",
")",
"{",
"if",
"(",
"utils",
".",
"definesSerializableFields",
"(",
"typeElement",
")",
")",
"{",
"VariableElement",
"ve",
"=",
"utils",
".",... | Build the serialization overview for the given class.
@param typeElement the class to print the overview for.
@param classContentTree content tree to which the documentation will be added | [
"Build",
"the",
"serialization",
"overview",
"for",
"the",
"given",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java#L398-L417 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/CellPosition.java | CellPosition.of | public static CellPosition of(final Point point) {
ArgUtils.notNull(point, "point");
return of(point.y, point.x);
} | java | public static CellPosition of(final Point point) {
ArgUtils.notNull(point, "point");
return of(point.y, point.x);
} | [
"public",
"static",
"CellPosition",
"of",
"(",
"final",
"Point",
"point",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"point",
",",
"\"point\"",
")",
";",
"return",
"of",
"(",
"point",
".",
"y",
",",
"point",
".",
"x",
")",
";",
"}"
] | CellAddressのインスタンスを作成する。
@param point セルの座標
@return {@link CellPosition}のインスタンス
@throws IllegalArgumentException {@literal point == null.} | [
"CellAddressのインスタンスを作成する。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/CellPosition.java#L134-L137 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ObjectUtility.java | ObjectUtility.checkAllMethodReturnTrue | public static boolean checkAllMethodReturnTrue(final Object instance, final List<Method> methods) {
boolean res = true;
if (!methods.isEmpty()) {
for (final Method method : methods) {
Object returnValue;
try {
returnValue = method.i... | java | public static boolean checkAllMethodReturnTrue(final Object instance, final List<Method> methods) {
boolean res = true;
if (!methods.isEmpty()) {
for (final Method method : methods) {
Object returnValue;
try {
returnValue = method.i... | [
"public",
"static",
"boolean",
"checkAllMethodReturnTrue",
"(",
"final",
"Object",
"instance",
",",
"final",
"List",
"<",
"Method",
">",
"methods",
")",
"{",
"boolean",
"res",
"=",
"true",
";",
"if",
"(",
"!",
"methods",
".",
"isEmpty",
"(",
")",
")",
"{... | Check if all given methods return true or if the list is empty.
@param instance the context object
@param methods the list of method to check
@return true if all method return true or if the list is empty | [
"Check",
"if",
"all",
"given",
"methods",
"return",
"true",
"or",
"if",
"the",
"list",
"is",
"empty",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ObjectUtility.java#L95-L110 |
i-net-software/jlessc | src/com/inet/lib/less/ColorUtils.java | ColorUtils.rgb | static double rgb( int r, int g, int b ) {
return Double.longBitsToDouble( Expression.ALPHA_1 | (colorLargeDigit(r) << 32) | (colorLargeDigit(g) << 16) | colorLargeDigit(b) );
} | java | static double rgb( int r, int g, int b ) {
return Double.longBitsToDouble( Expression.ALPHA_1 | (colorLargeDigit(r) << 32) | (colorLargeDigit(g) << 16) | colorLargeDigit(b) );
} | [
"static",
"double",
"rgb",
"(",
"int",
"r",
",",
"int",
"g",
",",
"int",
"b",
")",
"{",
"return",
"Double",
".",
"longBitsToDouble",
"(",
"Expression",
".",
"ALPHA_1",
"|",
"(",
"colorLargeDigit",
"(",
"r",
")",
"<<",
"32",
")",
"|",
"(",
"colorLarge... | Create an color value.
@param r
red in range from 0 to 255
@param g
green in range from 0 to 255
@param b
blue in range from 0 to 255
@return color value as long | [
"Create",
"an",
"color",
"value",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/ColorUtils.java#L130-L132 |
derari/cthul | objects/src/main/java/org/cthul/objects/reflection/Signatures.java | Signatures.bestMatch | public static int bestMatch(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) throws AmbiguousSignatureMatchException {
return bestMatch(signatures, varArgs, new JavaSignatureComparator(argTypes));
} | java | public static int bestMatch(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) throws AmbiguousSignatureMatchException {
return bestMatch(signatures, varArgs, new JavaSignatureComparator(argTypes));
} | [
"public",
"static",
"int",
"bestMatch",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"[",
"]",
"signatures",
",",
"boolean",
"[",
"]",
"varArgs",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
")",
"throws",
"AmbiguousSignatureMatchException",
"{",
"return... | Selects the best match in signatures for the given argument types.
@param signatures
@param varArgs
@param argTypes
@return index of best signature, -1 if nothing matched
@throws AmbiguousSignatureMatchException if two signatures matched equally | [
"Selects",
"the",
"best",
"match",
"in",
"signatures",
"for",
"the",
"given",
"argument",
"types",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L421-L423 |
code4everything/util | src/main/java/com/zhazhapan/util/Checker.java | Checker.check | public static <T> T check(T value, T elseValue, boolean res) {
return res ? value : elseValue;
} | java | public static <T> T check(T value, T elseValue, boolean res) {
return res ? value : elseValue;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"check",
"(",
"T",
"value",
",",
"T",
"elseValue",
",",
"boolean",
"res",
")",
"{",
"return",
"res",
"?",
"value",
":",
"elseValue",
";",
"}"
] | 自定义检查
@param value res为true返回的值
@param elseValue res为false返回的值
@param res {@link Boolean}
@param <T> 值类型
@return 结果
@since 1.0.8 | [
"自定义检查"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Checker.java#L1420-L1422 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java | CommerceDiscountRelPersistenceImpl.removeByCD_CN | @Override
public void removeByCD_CN(long commerceDiscountId, long classNameId) {
for (CommerceDiscountRel commerceDiscountRel : findByCD_CN(
commerceDiscountId, classNameId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, null)) {
remove(commerceDiscountRel);
}
} | java | @Override
public void removeByCD_CN(long commerceDiscountId, long classNameId) {
for (CommerceDiscountRel commerceDiscountRel : findByCD_CN(
commerceDiscountId, classNameId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, null)) {
remove(commerceDiscountRel);
}
} | [
"@",
"Override",
"public",
"void",
"removeByCD_CN",
"(",
"long",
"commerceDiscountId",
",",
"long",
"classNameId",
")",
"{",
"for",
"(",
"CommerceDiscountRel",
"commerceDiscountRel",
":",
"findByCD_CN",
"(",
"commerceDiscountId",
",",
"classNameId",
",",
"QueryUtil",
... | Removes all the commerce discount rels where commerceDiscountId = ? and classNameId = ? from the database.
@param commerceDiscountId the commerce discount ID
@param classNameId the class name ID | [
"Removes",
"all",
"the",
"commerce",
"discount",
"rels",
"where",
"commerceDiscountId",
"=",
"?",
";",
"and",
"classNameId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java#L1108-L1115 |
EMCECS/nfs-client-java | src/main/java/com/emc/ecs/nfsclient/rpc/RpcWrapper.java | RpcWrapper.callRpcNaked | public void callRpcNaked(S request, T response, String ipAddress) throws RpcException {
Xdr xdr = new Xdr(_maximumRequestSize);
request.marshalling(xdr);
response.unmarshalling(callRpc(ipAddress, xdr, request.isUsePrivilegedPort()));
} | java | public void callRpcNaked(S request, T response, String ipAddress) throws RpcException {
Xdr xdr = new Xdr(_maximumRequestSize);
request.marshalling(xdr);
response.unmarshalling(callRpc(ipAddress, xdr, request.isUsePrivilegedPort()));
} | [
"public",
"void",
"callRpcNaked",
"(",
"S",
"request",
",",
"T",
"response",
",",
"String",
"ipAddress",
")",
"throws",
"RpcException",
"{",
"Xdr",
"xdr",
"=",
"new",
"Xdr",
"(",
"_maximumRequestSize",
")",
";",
"request",
".",
"marshalling",
"(",
"xdr",
"... | Make the call to a specified IP address.
@param request
The request to send.
@param response
A response to hold the returned data.
@param ipAddress
The IP address to use for communication.
@throws RpcException | [
"Make",
"the",
"call",
"to",
"a",
"specified",
"IP",
"address",
"."
] | train | https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/rpc/RpcWrapper.java#L204-L208 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/aggregate/CrossTab.java | CrossTab.tablePercents | public static Table tablePercents(Table table, CategoricalColumn<?> column1, CategoricalColumn<?> column2) {
Table xTabs = counts(table, column1, column2);
return tablePercents(xTabs);
} | java | public static Table tablePercents(Table table, CategoricalColumn<?> column1, CategoricalColumn<?> column2) {
Table xTabs = counts(table, column1, column2);
return tablePercents(xTabs);
} | [
"public",
"static",
"Table",
"tablePercents",
"(",
"Table",
"table",
",",
"CategoricalColumn",
"<",
"?",
">",
"column1",
",",
"CategoricalColumn",
"<",
"?",
">",
"column2",
")",
"{",
"Table",
"xTabs",
"=",
"counts",
"(",
"table",
",",
"column1",
",",
"colu... | Returns a table containing the table percents made from a source table, after first calculating the counts
cross-tabulated from the given columns | [
"Returns",
"a",
"table",
"containing",
"the",
"table",
"percents",
"made",
"from",
"a",
"source",
"table",
"after",
"first",
"calculating",
"the",
"counts",
"cross",
"-",
"tabulated",
"from",
"the",
"given",
"columns"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/aggregate/CrossTab.java#L278-L281 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/io/FileSupport.java | FileSupport.getFilesInDirectoryTree | public static ArrayList<File> getFilesInDirectoryTree(File file, String includeMask) {
return getContentsInDirectoryTree(file, includeMask, true, false);
} | java | public static ArrayList<File> getFilesInDirectoryTree(File file, String includeMask) {
return getContentsInDirectoryTree(file, includeMask, true, false);
} | [
"public",
"static",
"ArrayList",
"<",
"File",
">",
"getFilesInDirectoryTree",
"(",
"File",
"file",
",",
"String",
"includeMask",
")",
"{",
"return",
"getContentsInDirectoryTree",
"(",
"file",
",",
"includeMask",
",",
"true",
",",
"false",
")",
";",
"}"
] | Retrieves all files from a directory and its subdirectories
matching the given mask.
@param file directory
@param includeMask mask to match
@return a list containing the found files | [
"Retrieves",
"all",
"files",
"from",
"a",
"directory",
"and",
"its",
"subdirectories",
"matching",
"the",
"given",
"mask",
"."
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/io/FileSupport.java#L113-L115 |
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanEuclideanDistanceKNNQuery.java | LinearScanEuclideanDistanceKNNQuery.linearScan | private KNNHeap linearScan(Relation<? extends O> relation, DBIDIter iter, final O obj, KNNHeap heap) {
final SquaredEuclideanDistanceFunction squared = SquaredEuclideanDistanceFunction.STATIC;
double max = Double.POSITIVE_INFINITY;
while(iter.valid()) {
final double dist = squared.distance(obj, relati... | java | private KNNHeap linearScan(Relation<? extends O> relation, DBIDIter iter, final O obj, KNNHeap heap) {
final SquaredEuclideanDistanceFunction squared = SquaredEuclideanDistanceFunction.STATIC;
double max = Double.POSITIVE_INFINITY;
while(iter.valid()) {
final double dist = squared.distance(obj, relati... | [
"private",
"KNNHeap",
"linearScan",
"(",
"Relation",
"<",
"?",
"extends",
"O",
">",
"relation",
",",
"DBIDIter",
"iter",
",",
"final",
"O",
"obj",
",",
"KNNHeap",
"heap",
")",
"{",
"final",
"SquaredEuclideanDistanceFunction",
"squared",
"=",
"SquaredEuclideanDis... | Main loop of the linear scan.
@param relation Data relation
@param iter ID iterator
@param obj Query object
@param heap Output heap
@return Heap | [
"Main",
"loop",
"of",
"the",
"linear",
"scan",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanEuclideanDistanceKNNQuery.java#L84-L95 |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/InventoryResultEntity.java | InventoryResultEntity.withData | public InventoryResultEntity withData(java.util.Map<String, InventoryResultItem> data) {
setData(data);
return this;
} | java | public InventoryResultEntity withData(java.util.Map<String, InventoryResultItem> data) {
setData(data);
return this;
} | [
"public",
"InventoryResultEntity",
"withData",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"InventoryResultItem",
">",
"data",
")",
"{",
"setData",
"(",
"data",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The data section in the inventory result entity JSON.
</p>
@param data
The data section in the inventory result entity JSON.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"data",
"section",
"in",
"the",
"inventory",
"result",
"entity",
"JSON",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/InventoryResultEntity.java#L126-L129 |
JM-Lab/utils-elasticsearch | src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchIndex.java | JMElasticsearchIndex.sendDataAsync | public ActionFuture<IndexResponse> sendDataAsync(
String jsonSource, String index, String type, String id) {
return indexQueryAsync(buildIndexRequest(jsonSource, index, type, id));
} | java | public ActionFuture<IndexResponse> sendDataAsync(
String jsonSource, String index, String type, String id) {
return indexQueryAsync(buildIndexRequest(jsonSource, index, type, id));
} | [
"public",
"ActionFuture",
"<",
"IndexResponse",
">",
"sendDataAsync",
"(",
"String",
"jsonSource",
",",
"String",
"index",
",",
"String",
"type",
",",
"String",
"id",
")",
"{",
"return",
"indexQueryAsync",
"(",
"buildIndexRequest",
"(",
"jsonSource",
",",
"index... | Send data async action future.
@param jsonSource the json source
@param index the index
@param type the type
@param id the id
@return the action future | [
"Send",
"data",
"async",
"action",
"future",
"."
] | train | https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchIndex.java#L318-L321 |
m-m-m/util | value/src/main/java/net/sf/mmm/util/value/impl/DefaultComposedValueConverter.java | DefaultComposedValueConverter.addConverterComponent | public void addConverterComponent(ValueConverter<?, ?> converter) {
if (converter instanceof AbstractRecursiveValueConverter) {
((AbstractRecursiveValueConverter<?, ?>) converter).setComposedValueConverter(this);
}
if (converter instanceof AbstractComponent) {
((AbstractComponent) converter).in... | java | public void addConverterComponent(ValueConverter<?, ?> converter) {
if (converter instanceof AbstractRecursiveValueConverter) {
((AbstractRecursiveValueConverter<?, ?>) converter).setComposedValueConverter(this);
}
if (converter instanceof AbstractComponent) {
((AbstractComponent) converter).in... | [
"public",
"void",
"addConverterComponent",
"(",
"ValueConverter",
"<",
"?",
",",
"?",
">",
"converter",
")",
"{",
"if",
"(",
"converter",
"instanceof",
"AbstractRecursiveValueConverter",
")",
"{",
"(",
"(",
"AbstractRecursiveValueConverter",
"<",
"?",
",",
"?",
... | @see #addConverter(ValueConverter)
@param converter is the converter to add. | [
"@see",
"#addConverter",
"(",
"ValueConverter",
")"
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/value/src/main/java/net/sf/mmm/util/value/impl/DefaultComposedValueConverter.java#L58-L67 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/optional/Csv.java | Csv.toCsv | public static void toCsv(final HttpConfig delegate, final String contentType, final Character separator, final Character quote) {
delegate.context(contentType, Context.ID, new Context(separator, quote));
delegate.getRequest().encoder(contentType, Csv::encode);
delegate.getResponse().parser(conte... | java | public static void toCsv(final HttpConfig delegate, final String contentType, final Character separator, final Character quote) {
delegate.context(contentType, Context.ID, new Context(separator, quote));
delegate.getRequest().encoder(contentType, Csv::encode);
delegate.getResponse().parser(conte... | [
"public",
"static",
"void",
"toCsv",
"(",
"final",
"HttpConfig",
"delegate",
",",
"final",
"String",
"contentType",
",",
"final",
"Character",
"separator",
",",
"final",
"Character",
"quote",
")",
"{",
"delegate",
".",
"context",
"(",
"contentType",
",",
"Cont... | Used to configure the OpenCsv encoder/parser in the configuration context for the specified content type.
@param delegate the configuration object
@param contentType the content type to be registered
@param separator the CSV column separator character
@param quote the CSV quote character | [
"Used",
"to",
"configure",
"the",
"OpenCsv",
"encoder",
"/",
"parser",
"in",
"the",
"configuration",
"context",
"for",
"the",
"specified",
"content",
"type",
"."
] | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Csv.java#L142-L146 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getLastNDay | public static Date getLastNDay(Date d, int n, int unitType) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(unitType, -n);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
... | java | public static Date getLastNDay(Date d, int n, int unitType) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(unitType, -n);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
... | [
"public",
"static",
"Date",
"getLastNDay",
"(",
"Date",
"d",
",",
"int",
"n",
",",
"int",
"unitType",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"("... | Get date with n unitType before
@param d date
@param n number of units
@param unitType unit type : one of Calendar.DAY_OF_YEAR, Calendar.WEEK_OF_YEAR, Calendar.MONTH, Calendar.YEAR;
@return | [
"Get",
"date",
"with",
"n",
"unitType",
"before"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L755-L764 |
datacleaner/DataCleaner | engine/env/spark/src/main/java/org/datacleaner/spark/utils/HadoopUtils.java | HadoopUtils.getDirectoryIfExists | private static File getDirectoryIfExists(final File existingCandidate, final String path) {
if (existingCandidate != null) {
return existingCandidate;
}
if (!Strings.isNullOrEmpty(path)) {
final File directory = new File(path);
if (directory.exists() && direct... | java | private static File getDirectoryIfExists(final File existingCandidate, final String path) {
if (existingCandidate != null) {
return existingCandidate;
}
if (!Strings.isNullOrEmpty(path)) {
final File directory = new File(path);
if (directory.exists() && direct... | [
"private",
"static",
"File",
"getDirectoryIfExists",
"(",
"final",
"File",
"existingCandidate",
",",
"final",
"String",
"path",
")",
"{",
"if",
"(",
"existingCandidate",
"!=",
"null",
")",
"{",
"return",
"existingCandidate",
";",
"}",
"if",
"(",
"!",
"Strings"... | Gets a candidate directory based on a file path, if it exists, and if it
another candidate hasn't already been resolved.
@param existingCandidate
an existing candidate directory. If this is non-null, it will
be returned immediately.
@param path
the path of a directory
@return a candidate directory, or null if none was... | [
"Gets",
"a",
"candidate",
"directory",
"based",
"on",
"a",
"file",
"path",
"if",
"it",
"exists",
"and",
"if",
"it",
"another",
"candidate",
"hasn",
"t",
"already",
"been",
"resolved",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/env/spark/src/main/java/org/datacleaner/spark/utils/HadoopUtils.java#L53-L64 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.sameHqUpdateContSign | public JSONObject sameHqUpdateContSign(String contSign, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("cont_sign", contSign);
if (options != null) {
request.addBody(options);
}
request... | java | public JSONObject sameHqUpdateContSign(String contSign, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("cont_sign", contSign);
if (options != null) {
request.addBody(options);
}
request... | [
"public",
"JSONObject",
"sameHqUpdateContSign",
"(",
"String",
"contSign",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"re... | 相同图检索—更新接口
**更新图库中图片的摘要和分类信息(具体变量为brief、tags)**
@param contSign - 图片签名
@param options - 可选参数对象,key: value都为string类型
options - options列表:
brief 更新的摘要信息,最长256B。样例:{"name":"周杰伦", "id":"666"}
tags 1 - 65535范围内的整数,tag间以逗号分隔,最多2个tag。样例:"100,11" ;检索时可圈定分类维度进行检索
@return JSONObject | [
"相同图检索—更新接口",
"**",
"更新图库中图片的摘要和分类信息(具体变量为brief、tags)",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L259-L270 |
tvesalainen/lpg | src/main/java/org/vesalainen/parser/util/CharInput.java | CharInput.getString | @Override
public String getString(long start, int length)
{
if (length == 0)
{
return "";
}
if (array != null)
{
int ps = (int) (start % size);
int es = (int) ((start+length) % size);
if (ps < es)
{
... | java | @Override
public String getString(long start, int length)
{
if (length == 0)
{
return "";
}
if (array != null)
{
int ps = (int) (start % size);
int es = (int) ((start+length) % size);
if (ps < es)
{
... | [
"@",
"Override",
"public",
"String",
"getString",
"(",
"long",
"start",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"array",
"!=",
"null",
")",
"{",
"int",
"ps",
"=",
"(",
"int"... | Returns string from buffer
@param start Start of input
@param length Length of input
@return | [
"Returns",
"string",
"from",
"buffer"
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/parser/util/CharInput.java#L154-L186 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java | DatabasesInner.listPrincipalsAsync | public Observable<List<DatabasePrincipalInner>> listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) {
return listPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1<ServiceResponse<List<DatabasePrincipalInner>>, List<DatabasePrincipal... | java | public Observable<List<DatabasePrincipalInner>> listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) {
return listPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1<ServiceResponse<List<DatabasePrincipalInner>>, List<DatabasePrincipal... | [
"public",
"Observable",
"<",
"List",
"<",
"DatabasePrincipalInner",
">",
">",
"listPrincipalsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
")",
"{",
"return",
"listPrincipalsWithServiceResponseAsync",
"(",
"reso... | Returns a list of database principals of the given Kusto cluster and database.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName The name of the database in the Kusto cluster.
@throws IllegalArgumentException thro... | [
"Returns",
"a",
"list",
"of",
"database",
"principals",
"of",
"the",
"given",
"Kusto",
"cluster",
"and",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java#L974-L981 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/util/Matrix.java | Matrix.times | public Matrix times(final Matrix B)
{
final Matrix A = this;
if (A.m_columns != B.m_rows)
{
throw new GeometryException("Illegal matrix dimensions");
}
final Matrix C = new Matrix(A.m_rows, B.m_columns);
for (int i = 0; i < C.m_rows; i++)
... | java | public Matrix times(final Matrix B)
{
final Matrix A = this;
if (A.m_columns != B.m_rows)
{
throw new GeometryException("Illegal matrix dimensions");
}
final Matrix C = new Matrix(A.m_rows, B.m_columns);
for (int i = 0; i < C.m_rows; i++)
... | [
"public",
"Matrix",
"times",
"(",
"final",
"Matrix",
"B",
")",
"{",
"final",
"Matrix",
"A",
"=",
"this",
";",
"if",
"(",
"A",
".",
"m_columns",
"!=",
"B",
".",
"m_rows",
")",
"{",
"throw",
"new",
"GeometryException",
"(",
"\"Illegal matrix dimensions\"",
... | Returns C = A * B
@param B
@return new Matrix C
@throws GeometryException if the matrix dimensions don't match | [
"Returns",
"C",
"=",
"A",
"*",
"B"
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/util/Matrix.java#L217-L238 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqllocate | public static void sqllocate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
if (parsedArgs.size() == 2) {
appendCall(buf, "position(", " in ", ")", parsedArgs);
} else if (parsedArgs.size() == 3) {
String tmp = "position(" + parsedArgs.get(0) + " in substring(" + p... | java | public static void sqllocate(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
if (parsedArgs.size() == 2) {
appendCall(buf, "position(", " in ", ")", parsedArgs);
} else if (parsedArgs.size() == 3) {
String tmp = "position(" + parsedArgs.get(0) + " in substring(" + p... | [
"public",
"static",
"void",
"sqllocate",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"parsedArgs",
".",
"size",
"(",
")",
"==",
"2",
")",
"{",
"appendCall"... | locate translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"locate",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L224-L241 |
arquillian/arquillian-cube | kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java | KuberntesServiceUrlResourceProvider.getPort | private static int getPort(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Port) {
Port port = (Port) q;
if (port.value() > 0) {
return port.value();
}
}
}
... | java | private static int getPort(Service service, Annotation... qualifiers) {
for (Annotation q : qualifiers) {
if (q instanceof Port) {
Port port = (Port) q;
if (port.value() > 0) {
return port.value();
}
}
}
... | [
"private",
"static",
"int",
"getPort",
"(",
"Service",
"service",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"for",
"(",
"Annotation",
"q",
":",
"qualifiers",
")",
"{",
"if",
"(",
"q",
"instanceof",
"Port",
")",
"{",
"Port",
"port",
"=",
"(",
"P... | Find the the qualified container port of the target service
Uses java annotations first or returns the container port.
@param service
The target service.
@param qualifiers
The set of qualifiers.
@return Returns the resolved containerPort of '0' as a fallback. | [
"Find",
"the",
"the",
"qualified",
"container",
"port",
"of",
"the",
"target",
"service",
"Uses",
"java",
"annotations",
"first",
"or",
"returns",
"the",
"container",
"port",
"."
] | train | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/enricher/KuberntesServiceUrlResourceProvider.java#L128-L143 |
netty/netty | codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessageDecoder.java | HAProxyMessageDecoder.decodeLine | private ByteBuf decodeLine(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
final int eol = findEndOfLine(buffer);
if (!discarding) {
if (eol >= 0) {
final int length = eol - buffer.readerIndex();
if (length > V1_MAX_LENGTH) {
... | java | private ByteBuf decodeLine(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
final int eol = findEndOfLine(buffer);
if (!discarding) {
if (eol >= 0) {
final int length = eol - buffer.readerIndex();
if (length > V1_MAX_LENGTH) {
... | [
"private",
"ByteBuf",
"decodeLine",
"(",
"ChannelHandlerContext",
"ctx",
",",
"ByteBuf",
"buffer",
")",
"throws",
"Exception",
"{",
"final",
"int",
"eol",
"=",
"findEndOfLine",
"(",
"buffer",
")",
";",
"if",
"(",
"!",
"discarding",
")",
"{",
"if",
"(",
"eo... | Create a frame out of the {@link ByteBuf} and return it.
Based on code from {@link LineBasedFrameDecoder#decode(ChannelHandlerContext, ByteBuf)}.
@param ctx the {@link ChannelHandlerContext} which this {@link HAProxyMessageDecoder} belongs to
@param buffer the {@link ByteBuf} from which to read data
@return frame... | [
"Create",
"a",
"frame",
"out",
"of",
"the",
"{",
"@link",
"ByteBuf",
"}",
"and",
"return",
"it",
".",
"Based",
"on",
"code",
"from",
"{",
"@link",
"LineBasedFrameDecoder#decode",
"(",
"ChannelHandlerContext",
"ByteBuf",
")",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessageDecoder.java#L312-L347 |
hdecarne/java-default | src/main/java/de/carne/io/IOUtil.java | IOUtil.copyStream | public static long copyStream(File dst, InputStream src) throws IOException {
long copied;
try (FileOutputStream dstStream = new FileOutputStream(dst)) {
copied = copyStream(dstStream, src);
}
return copied;
} | java | public static long copyStream(File dst, InputStream src) throws IOException {
long copied;
try (FileOutputStream dstStream = new FileOutputStream(dst)) {
copied = copyStream(dstStream, src);
}
return copied;
} | [
"public",
"static",
"long",
"copyStream",
"(",
"File",
"dst",
",",
"InputStream",
"src",
")",
"throws",
"IOException",
"{",
"long",
"copied",
";",
"try",
"(",
"FileOutputStream",
"dstStream",
"=",
"new",
"FileOutputStream",
"(",
"dst",
")",
")",
"{",
"copied... | Copies all bytes from an {@linkplain InputStream} to a {@linkplain File}.
@param dst the {@linkplain File} to copy to.
@param src the {@linkplain InputStream} to copy from.
@return the number of copied bytes.
@throws IOException if an I/O error occurs. | [
"Copies",
"all",
"bytes",
"from",
"an",
"{",
"@linkplain",
"InputStream",
"}",
"to",
"a",
"{",
"@linkplain",
"File",
"}",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/io/IOUtil.java#L101-L108 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/Fourier.java | Fourier.inverseTransform | public static ColorImg inverseTransform(ColorImg target, ComplexImg fourier, int channel) {
Dimension dim = fourier.getDimension();
// if no target was specified create a new one
if(target == null) {
target = new ColorImg(dim, channel==ColorImg.channel_a);
}
// continue sanity checks
sanityCheckInverse_t... | java | public static ColorImg inverseTransform(ColorImg target, ComplexImg fourier, int channel) {
Dimension dim = fourier.getDimension();
// if no target was specified create a new one
if(target == null) {
target = new ColorImg(dim, channel==ColorImg.channel_a);
}
// continue sanity checks
sanityCheckInverse_t... | [
"public",
"static",
"ColorImg",
"inverseTransform",
"(",
"ColorImg",
"target",
",",
"ComplexImg",
"fourier",
",",
"int",
"channel",
")",
"{",
"Dimension",
"dim",
"=",
"fourier",
".",
"getDimension",
"(",
")",
";",
"// if no target was specified create a new one",
"i... | Executes the inverse Fourier transforms on the specified {@link ComplexImg} that corresponds
to a specific channel of a {@link ColorImg} defined by the channel argument.
The resulting transform will be stored in the specified channel of the specified target.
If target is null a new ColorImg will be created and returned... | [
"Executes",
"the",
"inverse",
"Fourier",
"transforms",
"on",
"the",
"specified",
"{",
"@link",
"ComplexImg",
"}",
"that",
"corresponds",
"to",
"a",
"specific",
"channel",
"of",
"a",
"{",
"@link",
"ColorImg",
"}",
"defined",
"by",
"the",
"channel",
"argument",
... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/Fourier.java#L139-L161 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTupleCollections.java | DoubleTupleCollections.getSize | private static int getSize(Tuple t, Iterable<? extends Tuple> tuples)
{
if (t != null)
{
return t.getSize();
}
Iterator<? extends Tuple> iterator = tuples.iterator();
if (iterator.hasNext())
{
Tuple first = iterator.next();
... | java | private static int getSize(Tuple t, Iterable<? extends Tuple> tuples)
{
if (t != null)
{
return t.getSize();
}
Iterator<? extends Tuple> iterator = tuples.iterator();
if (iterator.hasNext())
{
Tuple first = iterator.next();
... | [
"private",
"static",
"int",
"getSize",
"(",
"Tuple",
"t",
",",
"Iterable",
"<",
"?",
"extends",
"Tuple",
">",
"tuples",
")",
"{",
"if",
"(",
"t",
"!=",
"null",
")",
"{",
"return",
"t",
".",
"getSize",
"(",
")",
";",
"}",
"Iterator",
"<",
"?",
"ex... | Returns the size of the given tuple. If the given tuple is
<code>null</code>, then the size of the first tuple of the
given sequence is returned. If this first tuple is <code>null</code>,
or the given sequence is empty, then -1 is returned.
@param t The tuple
@param tuples The tuples
@return The size | [
"Returns",
"the",
"size",
"of",
"the",
"given",
"tuple",
".",
"If",
"the",
"given",
"tuple",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"then",
"the",
"size",
"of",
"the",
"first",
"tuple",
"of",
"the",
"given",
"sequence",
"is",
"returned",
".",
... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTupleCollections.java#L290-L306 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java | FastAdapter.onBindViewHolder | @Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List<Object> payloads) {
//we do not want the binding to happen twice (the legacyBindViewMode
if (!mLegacyBindViewMode) {
if (mVerbose)
Log.v(TAG, "onBindViewHolder: " + position + "/" + ... | java | @Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List<Object> payloads) {
//we do not want the binding to happen twice (the legacyBindViewMode
if (!mLegacyBindViewMode) {
if (mVerbose)
Log.v(TAG, "onBindViewHolder: " + position + "/" + ... | [
"@",
"Override",
"public",
"void",
"onBindViewHolder",
"(",
"RecyclerView",
".",
"ViewHolder",
"holder",
",",
"int",
"position",
",",
"List",
"<",
"Object",
">",
"payloads",
")",
"{",
"//we do not want the binding to happen twice (the legacyBindViewMode",
"if",
"(",
"... | Binds the data to the created ViewHolder and sets the listeners to the holder.itemView
@param holder the viewHolder we bind the data on
@param position the global position
@param payloads the payloads for the bindViewHolder event containing data which allows to improve view animating | [
"Binds",
"the",
"data",
"to",
"the",
"created",
"ViewHolder",
"and",
"sets",
"the",
"listeners",
"to",
"the",
"holder",
".",
"itemView"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L733-L745 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/bind/annotation/AbstractAnnotatedArgumentBinder.java | AbstractAnnotatedArgumentBinder.doBind | @SuppressWarnings("unchecked")
protected BindingResult<T> doBind(
ArgumentConversionContext<T> context,
ConvertibleValues<?> values,
String annotationValue) {
return doConvert(doResolve(context, values, annotationValue), context);
} | java | @SuppressWarnings("unchecked")
protected BindingResult<T> doBind(
ArgumentConversionContext<T> context,
ConvertibleValues<?> values,
String annotationValue) {
return doConvert(doResolve(context, values, annotationValue), context);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"BindingResult",
"<",
"T",
">",
"doBind",
"(",
"ArgumentConversionContext",
"<",
"T",
">",
"context",
",",
"ConvertibleValues",
"<",
"?",
">",
"values",
",",
"String",
"annotationValue",
")",
"{",
... | Do binding.
@param context context
@param values values
@param annotationValue annotationValue
@return result | [
"Do",
"binding",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/bind/annotation/AbstractAnnotatedArgumentBinder.java#L60-L67 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/GuiStandardUtils.java | GuiStandardUtils.createDebugBorder | public static void createDebugBorder(JComponent c, Color color) {
if (color == null) {
color = Color.BLACK;
}
c.setBorder(BorderFactory.createLineBorder(color));
} | java | public static void createDebugBorder(JComponent c, Color color) {
if (color == null) {
color = Color.BLACK;
}
c.setBorder(BorderFactory.createLineBorder(color));
} | [
"public",
"static",
"void",
"createDebugBorder",
"(",
"JComponent",
"c",
",",
"Color",
"color",
")",
"{",
"if",
"(",
"color",
"==",
"null",
")",
"{",
"color",
"=",
"Color",
".",
"BLACK",
";",
"}",
"c",
".",
"setBorder",
"(",
"BorderFactory",
".",
"crea... | Useful debug function to place a colored, line border around a component
for layout management debugging.
@param c
the component
@param color
the border color | [
"Useful",
"debug",
"function",
"to",
"place",
"a",
"colored",
"line",
"border",
"around",
"a",
"component",
"for",
"layout",
"management",
"debugging",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/GuiStandardUtils.java#L289-L294 |
zaproxy/zaproxy | src/org/apache/commons/httpclient/URI.java | URI.getRawCurrentHierPath | protected char[] getRawCurrentHierPath(char[] path) throws URIException {
if (_is_opaque_part) {
throw new URIException(URIException.PARSING, "no hierarchy level");
}
if (path == null) {
throw new URIException(URIException.PARSING, "empty path");
}
String... | java | protected char[] getRawCurrentHierPath(char[] path) throws URIException {
if (_is_opaque_part) {
throw new URIException(URIException.PARSING, "no hierarchy level");
}
if (path == null) {
throw new URIException(URIException.PARSING, "empty path");
}
String... | [
"protected",
"char",
"[",
"]",
"getRawCurrentHierPath",
"(",
"char",
"[",
"]",
"path",
")",
"throws",
"URIException",
"{",
"if",
"(",
"_is_opaque_part",
")",
"{",
"throw",
"new",
"URIException",
"(",
"URIException",
".",
"PARSING",
",",
"\"no hierarchy level\"",... | Get the raw-escaped current hierarchy level in the given path.
If the last namespace is a collection, the slash mark ('/') should be
ended with at the last character of the path string.
@param path the path
@return the current hierarchy level
@throws URIException no hierarchy level | [
"Get",
"the",
"raw",
"-",
"escaped",
"current",
"hierarchy",
"level",
"in",
"the",
"given",
"path",
".",
"If",
"the",
"last",
"namespace",
"is",
"a",
"collection",
"the",
"slash",
"mark",
"(",
"/",
")",
"should",
"be",
"ended",
"with",
"at",
"the",
"la... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/URI.java#L2995-L3013 |
grpc/grpc-java | netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java | NettyChannelBuilder.enableKeepAlive | @Deprecated
public final NettyChannelBuilder enableKeepAlive(boolean enable, long keepAliveTime,
TimeUnit delayUnit, long keepAliveTimeout, TimeUnit timeoutUnit) {
if (enable) {
return keepAliveTime(keepAliveTime, delayUnit)
.keepAliveTimeout(keepAliveTimeout, timeoutUnit);
}
return ... | java | @Deprecated
public final NettyChannelBuilder enableKeepAlive(boolean enable, long keepAliveTime,
TimeUnit delayUnit, long keepAliveTimeout, TimeUnit timeoutUnit) {
if (enable) {
return keepAliveTime(keepAliveTime, delayUnit)
.keepAliveTimeout(keepAliveTimeout, timeoutUnit);
}
return ... | [
"@",
"Deprecated",
"public",
"final",
"NettyChannelBuilder",
"enableKeepAlive",
"(",
"boolean",
"enable",
",",
"long",
"keepAliveTime",
",",
"TimeUnit",
"delayUnit",
",",
"long",
"keepAliveTimeout",
",",
"TimeUnit",
"timeoutUnit",
")",
"{",
"if",
"(",
"enable",
")... | Enable keepalive with custom delay and timeout.
@deprecated Please use {@link #keepAliveTime} and {@link #keepAliveTimeout} instead | [
"Enable",
"keepalive",
"with",
"custom",
"delay",
"and",
"timeout",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java#L339-L347 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java | ProxyDataSourceBuilder.logSlowQueryByJUL | public ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit) {
return logSlowQueryByJUL(thresholdTime, timeUnit, null, null);
} | java | public ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit) {
return logSlowQueryByJUL(thresholdTime, timeUnit, null, null);
} | [
"public",
"ProxyDataSourceBuilder",
"logSlowQueryByJUL",
"(",
"long",
"thresholdTime",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"logSlowQueryByJUL",
"(",
"thresholdTime",
",",
"timeUnit",
",",
"null",
",",
"null",
")",
";",
"}"
] | Register {@link JULSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@return builder
@since 1.4.1 | [
"Register",
"{",
"@link",
"JULSlowQueryListener",
"}",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L439-L441 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/MultiPathImpl.java | MultiPathImpl.closePathWithBezier | public void closePathWithBezier(Point2D controlPoint1, Point2D controlPoint2) {
_touch();
if (isEmptyImpl())
throw new GeometryException(
"Invalid call. This operation cannot be performed on an empty geometry.");
m_bPathStarted = false;
int pathIndex = m_paths.size() - 2;
byte pf = m_pathFlags.read(... | java | public void closePathWithBezier(Point2D controlPoint1, Point2D controlPoint2) {
_touch();
if (isEmptyImpl())
throw new GeometryException(
"Invalid call. This operation cannot be performed on an empty geometry.");
m_bPathStarted = false;
int pathIndex = m_paths.size() - 2;
byte pf = m_pathFlags.read(... | [
"public",
"void",
"closePathWithBezier",
"(",
"Point2D",
"controlPoint1",
",",
"Point2D",
"controlPoint2",
")",
"{",
"_touch",
"(",
")",
";",
"if",
"(",
"isEmptyImpl",
"(",
")",
")",
"throw",
"new",
"GeometryException",
"(",
"\"Invalid call. This operation cannot be... | Closes last path of the MultiPathImpl with the Bezier Segment.
The start point of the Bezier is the last point of the path and the last
point of the bezier is the first point of the path. | [
"Closes",
"last",
"path",
"of",
"the",
"MultiPathImpl",
"with",
"the",
"Bezier",
"Segment",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MultiPathImpl.java#L524-L564 |
MenoData/Time4J | base/src/main/java/net/time4j/DayPeriod.java | DayPeriod.of | public static DayPeriod of(Map<PlainTime, String> timeToLabels) {
if (timeToLabels.isEmpty()) {
throw new IllegalArgumentException("Label map is empty.");
}
SortedMap<PlainTime, String> map = new TreeMap<>(timeToLabels);
for (PlainTime key : timeToLabels.keySet()) {
... | java | public static DayPeriod of(Map<PlainTime, String> timeToLabels) {
if (timeToLabels.isEmpty()) {
throw new IllegalArgumentException("Label map is empty.");
}
SortedMap<PlainTime, String> map = new TreeMap<>(timeToLabels);
for (PlainTime key : timeToLabels.keySet()) {
... | [
"public",
"static",
"DayPeriod",
"of",
"(",
"Map",
"<",
"PlainTime",
",",
"String",
">",
"timeToLabels",
")",
"{",
"if",
"(",
"timeToLabels",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Label map is empty.\"",
")",
... | /*[deutsch]
<p>Erzeugt eine Instanz, die auf benutzerdefinierten Daten beruht. </p>
@param timeToLabels map containing the day-periods where the keys represent starting points
and the values represent the associated labels intended for representation
@return user-specific instance
@throws IllegalArgumentExcepti... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Erzeugt",
"eine",
"Instanz",
"die",
"auf",
"benutzerdefinierten",
"Daten",
"beruht",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/DayPeriod.java#L180-L199 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java | SparkUtils.writeStringToFile | public static void writeStringToFile(String path, String toWrite, JavaSparkContext sc) throws IOException {
writeStringToFile(path, toWrite, sc.sc());
} | java | public static void writeStringToFile(String path, String toWrite, JavaSparkContext sc) throws IOException {
writeStringToFile(path, toWrite, sc.sc());
} | [
"public",
"static",
"void",
"writeStringToFile",
"(",
"String",
"path",
",",
"String",
"toWrite",
",",
"JavaSparkContext",
"sc",
")",
"throws",
"IOException",
"{",
"writeStringToFile",
"(",
"path",
",",
"toWrite",
",",
"sc",
".",
"sc",
"(",
")",
")",
";",
... | Write a String to a file (on HDFS or local) in UTF-8 format
@param path Path to write to
@param toWrite String to write
@param sc Spark context | [
"Write",
"a",
"String",
"to",
"a",
"file",
"(",
"on",
"HDFS",
"or",
"local",
")",
"in",
"UTF",
"-",
"8",
"format"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/utils/SparkUtils.java#L74-L76 |
michel-kraemer/bson4jackson | src/main/java/de/undercouch/bson4jackson/io/DynamicOutputBuffer.java | DynamicOutputBuffer.putLong | public void putLong(int pos, long l) {
adaptSize(pos + 8);
ByteBuffer bb = getBuffer(pos);
int index = pos % _bufferSize;
if (bb.limit() - index >= 8) {
bb.putLong(index, l);
} else {
byte b0 = (byte)l;
byte b1 = (byte)(l >> 8);
byte b2 = (byte)(l >> 16);
byte b3 = (byte)(l >> 24);
byte b4 =... | java | public void putLong(int pos, long l) {
adaptSize(pos + 8);
ByteBuffer bb = getBuffer(pos);
int index = pos % _bufferSize;
if (bb.limit() - index >= 8) {
bb.putLong(index, l);
} else {
byte b0 = (byte)l;
byte b1 = (byte)(l >> 8);
byte b2 = (byte)(l >> 16);
byte b3 = (byte)(l >> 24);
byte b4 =... | [
"public",
"void",
"putLong",
"(",
"int",
"pos",
",",
"long",
"l",
")",
"{",
"adaptSize",
"(",
"pos",
"+",
"8",
")",
";",
"ByteBuffer",
"bb",
"=",
"getBuffer",
"(",
"pos",
")",
";",
"int",
"index",
"=",
"pos",
"%",
"_bufferSize",
";",
"if",
"(",
"... | Puts a 64-bit integer into the buffer at the given position. Does
not increase the write position.
@param pos the position where to put the integer
@param l the 64-bit integer to put | [
"Puts",
"a",
"64",
"-",
"bit",
"integer",
"into",
"the",
"buffer",
"at",
"the",
"given",
"position",
".",
"Does",
"not",
"increase",
"the",
"write",
"position",
"."
] | train | https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/io/DynamicOutputBuffer.java#L429-L451 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java | SDLoss.logLoss | public SDVariable logLoss(String name, @NonNull SDVariable label, @NonNull SDVariable predictions) {
return logLoss(name, label, predictions, null, LossReduce.MEAN_BY_NONZERO_WEIGHT_COUNT, LogLoss.DEFAULT_EPSILON);
} | java | public SDVariable logLoss(String name, @NonNull SDVariable label, @NonNull SDVariable predictions) {
return logLoss(name, label, predictions, null, LossReduce.MEAN_BY_NONZERO_WEIGHT_COUNT, LogLoss.DEFAULT_EPSILON);
} | [
"public",
"SDVariable",
"logLoss",
"(",
"String",
"name",
",",
"@",
"NonNull",
"SDVariable",
"label",
",",
"@",
"NonNull",
"SDVariable",
"predictions",
")",
"{",
"return",
"logLoss",
"(",
"name",
",",
"label",
",",
"predictions",
",",
"null",
",",
"LossReduc... | See {@link #logLoss(String, SDVariable, SDVariable, SDVariable, LossReduce, double)}. | [
"See",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java#L213-L215 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/PrincipalUserDto.java | PrincipalUserDto.transformToDto | public static PrincipalUserDto transformToDto(PrincipalUser user) {
if (user == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
PrincipalUserDto result = createDtoObject(PrincipalUserDto.class, user)... | java | public static PrincipalUserDto transformToDto(PrincipalUser user) {
if (user == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
PrincipalUserDto result = createDtoObject(PrincipalUserDto.class, user)... | [
"public",
"static",
"PrincipalUserDto",
"transformToDto",
"(",
"PrincipalUser",
"user",
")",
"{",
"if",
"(",
"user",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"Status",
".",
... | Converts a user entity to DTO.
@param user The entity to convert.
@return The DTO.
@throws WebApplicationException If an error occurs. | [
"Converts",
"a",
"user",
"entity",
"to",
"DTO",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/PrincipalUserDto.java#L74-L85 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/BackupDocumentWriter.java | BackupDocumentWriter.write | public void write( Document document ) {
assert document != null;
++count;
++totalCount;
if (count > maxDocumentsPerFile) {
// Close the stream (we'll open a new one later in the method) ...
close();
count = 1;
}
try {
if (s... | java | public void write( Document document ) {
assert document != null;
++count;
++totalCount;
if (count > maxDocumentsPerFile) {
// Close the stream (we'll open a new one later in the method) ...
close();
count = 1;
}
try {
if (s... | [
"public",
"void",
"write",
"(",
"Document",
"document",
")",
"{",
"assert",
"document",
"!=",
"null",
";",
"++",
"count",
";",
"++",
"totalCount",
";",
"if",
"(",
"count",
">",
"maxDocumentsPerFile",
")",
"{",
"// Close the stream (we'll open a new one later in th... | Append the supplied document to the files.
@param document the document to be written; may not be null | [
"Append",
"the",
"supplied",
"document",
"to",
"the",
"files",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/BackupDocumentWriter.java#L71-L98 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java | ContainerServicesInner.beginDelete | public void beginDelete(String resourceGroupName, String containerServiceName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, containerServiceName).toBlocking().single().body();
} | java | public void beginDelete(String resourceGroupName, String containerServiceName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, containerServiceName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerServiceName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"containerServiceName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")... | Deletes the specified container service.
Deletes the specified container service in the specified subscription and resource group. The operation does not delete other resources created as part of creating a container service, including storage accounts, VMs, and availability sets. All the other resources created with t... | [
"Deletes",
"the",
"specified",
"container",
"service",
".",
"Deletes",
"the",
"specified",
"container",
"service",
"in",
"the",
"specified",
"subscription",
"and",
"resource",
"group",
".",
"The",
"operation",
"does",
"not",
"delete",
"other",
"resources",
"create... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ContainerServicesInner.java#L564-L566 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.trimStart | @Nullable
@CheckReturnValue
public static String trimStart (@Nullable final String sSrc, final char cLead)
{
return startsWith (sSrc, cLead) ? sSrc.substring (1, sSrc.length ()) : sSrc;
} | java | @Nullable
@CheckReturnValue
public static String trimStart (@Nullable final String sSrc, final char cLead)
{
return startsWith (sSrc, cLead) ? sSrc.substring (1, sSrc.length ()) : sSrc;
} | [
"@",
"Nullable",
"@",
"CheckReturnValue",
"public",
"static",
"String",
"trimStart",
"(",
"@",
"Nullable",
"final",
"String",
"sSrc",
",",
"final",
"char",
"cLead",
")",
"{",
"return",
"startsWith",
"(",
"sSrc",
",",
"cLead",
")",
"?",
"sSrc",
".",
"substr... | Trim the passed lead from the source value. If the source value does not
start with the passed lead, nothing happens.
@param sSrc
The input source string
@param cLead
The char to be trimmed of the beginning
@return The trimmed string, or the original input string, if the lead was not
found
@see #trimEnd(String, String... | [
"Trim",
"the",
"passed",
"lead",
"from",
"the",
"source",
"value",
".",
"If",
"the",
"source",
"value",
"does",
"not",
"start",
"with",
"the",
"passed",
"lead",
"nothing",
"happens",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3322-L3327 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.objDoubleConsumer | public static <T> ObjDoubleConsumer<T> objDoubleConsumer(CheckedObjDoubleConsumer<T> consumer) {
return objDoubleConsumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION);
} | java | public static <T> ObjDoubleConsumer<T> objDoubleConsumer(CheckedObjDoubleConsumer<T> consumer) {
return objDoubleConsumer(consumer, THROWABLE_TO_RUNTIME_EXCEPTION);
} | [
"public",
"static",
"<",
"T",
">",
"ObjDoubleConsumer",
"<",
"T",
">",
"objDoubleConsumer",
"(",
"CheckedObjDoubleConsumer",
"<",
"T",
">",
"consumer",
")",
"{",
"return",
"objDoubleConsumer",
"(",
"consumer",
",",
"THROWABLE_TO_RUNTIME_EXCEPTION",
")",
";",
"}"
] | Wrap a {@link CheckedObjDoubleConsumer} in a {@link ObjDoubleConsumer}. | [
"Wrap",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L292-L294 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/ExecUtilities.java | ExecUtilities.runCommand | public static boolean runCommand(final Process p, final OutputStream output, final List<String> doNotPrintStrings) {
return runCommand(p, output, output, doNotPrintStrings);
} | java | public static boolean runCommand(final Process p, final OutputStream output, final List<String> doNotPrintStrings) {
return runCommand(p, output, output, doNotPrintStrings);
} | [
"public",
"static",
"boolean",
"runCommand",
"(",
"final",
"Process",
"p",
",",
"final",
"OutputStream",
"output",
",",
"final",
"List",
"<",
"String",
">",
"doNotPrintStrings",
")",
"{",
"return",
"runCommand",
"(",
"p",
",",
"output",
",",
"output",
",",
... | Run a Process, and read the various streams so there is not a buffer
overrun.
@param p The Process to be executed
@param output The Stream to receive the Process' output stream
@param doNotPrintStrings A collection of strings that should not be
dumped to std.out
@return true if the Process r... | [
"Run",
"a",
"Process",
"and",
"read",
"the",
"various",
"streams",
"so",
"there",
"is",
"not",
"a",
"buffer",
"overrun",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/ExecUtilities.java#L62-L64 |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/api/support/DefaultPageMounter.java | DefaultPageMounter.addMountPoint | @Override
public void addMountPoint(String path, Class<? extends Page> pageClass) {
LOGGER.debug("Adding mount point for path {} = {}", path, pageClass.getName());
mountPoints.add(new DefaultMountPointInfo(path, pageClass));
} | java | @Override
public void addMountPoint(String path, Class<? extends Page> pageClass) {
LOGGER.debug("Adding mount point for path {} = {}", path, pageClass.getName());
mountPoints.add(new DefaultMountPointInfo(path, pageClass));
} | [
"@",
"Override",
"public",
"void",
"addMountPoint",
"(",
"String",
"path",
",",
"Class",
"<",
"?",
"extends",
"Page",
">",
"pageClass",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Adding mount point for path {} = {}\"",
",",
"path",
",",
"pageClass",
".",
"getNa... | {@inheritDoc}
A convenience method that uses a default coding strategy. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/api/support/DefaultPageMounter.java#L136-L140 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.safeInvoke | private Object safeInvoke(Method method, Object object, Object... arguments) {
try {
return method.invoke(object, arguments);
} catch ( IllegalAccessException e ) {
throw new DynamoDBMappingException("Couldn't invoke " + method, e);
} catch ( IllegalArgumentException e ) ... | java | private Object safeInvoke(Method method, Object object, Object... arguments) {
try {
return method.invoke(object, arguments);
} catch ( IllegalAccessException e ) {
throw new DynamoDBMappingException("Couldn't invoke " + method, e);
} catch ( IllegalArgumentException e ) ... | [
"private",
"Object",
"safeInvoke",
"(",
"Method",
"method",
",",
"Object",
"object",
",",
"Object",
"...",
"arguments",
")",
"{",
"try",
"{",
"return",
"method",
".",
"invoke",
"(",
"object",
",",
"arguments",
")",
";",
"}",
"catch",
"(",
"IllegalAccessExc... | Swallows the checked exceptions around Method.invoke and repackages them
as {@link DynamoDBMappingException} | [
"Swallows",
"the",
"checked",
"exceptions",
"around",
"Method",
".",
"invoke",
"and",
"repackages",
"them",
"as",
"{"
] | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L968-L978 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java | MapWithProtoValuesSubject.usingDoubleToleranceForFieldDescriptorsForValues | public MapWithProtoValuesFluentAssertion<M> usingDoubleToleranceForFieldDescriptorsForValues(
double tolerance, Iterable<FieldDescriptor> fieldDescriptors) {
return usingConfig(config.usingDoubleToleranceForFieldDescriptors(tolerance, fieldDescriptors));
} | java | public MapWithProtoValuesFluentAssertion<M> usingDoubleToleranceForFieldDescriptorsForValues(
double tolerance, Iterable<FieldDescriptor> fieldDescriptors) {
return usingConfig(config.usingDoubleToleranceForFieldDescriptors(tolerance, fieldDescriptors));
} | [
"public",
"MapWithProtoValuesFluentAssertion",
"<",
"M",
">",
"usingDoubleToleranceForFieldDescriptorsForValues",
"(",
"double",
"tolerance",
",",
"Iterable",
"<",
"FieldDescriptor",
">",
"fieldDescriptors",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"usingDou... | Compares double fields with these explicitly specified fields using the provided absolute
tolerance.
@param tolerance A finite, non-negative tolerance. | [
"Compares",
"double",
"fields",
"with",
"these",
"explicitly",
"specified",
"fields",
"using",
"the",
"provided",
"absolute",
"tolerance",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java#L552-L555 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java | ResultIterator.onCheckRelation | private void onCheckRelation()
{
try
{
results = populateEntities(entityMetadata, client);
if (entityMetadata.isRelationViaJoinTable()
|| (entityMetadata.getRelationNames() != null && !(entityMetadata.getRelationNames().isEmpty())))
{
... | java | private void onCheckRelation()
{
try
{
results = populateEntities(entityMetadata, client);
if (entityMetadata.isRelationViaJoinTable()
|| (entityMetadata.getRelationNames() != null && !(entityMetadata.getRelationNames().isEmpty())))
{
... | [
"private",
"void",
"onCheckRelation",
"(",
")",
"{",
"try",
"{",
"results",
"=",
"populateEntities",
"(",
"entityMetadata",
",",
"client",
")",
";",
"if",
"(",
"entityMetadata",
".",
"isRelationViaJoinTable",
"(",
")",
"||",
"(",
"entityMetadata",
".",
"getRel... | on check relation event, invokes populate entities and set relational
entities, in case relations are present. | [
"on",
"check",
"relation",
"event",
"invokes",
"populate",
"entities",
"and",
"set",
"relational",
"entities",
"in",
"case",
"relations",
"are",
"present",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/ResultIterator.java#L238-L254 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/util/SparseDoubleArray.java | SparseDoubleArray.dividePrimitive | public double dividePrimitive(int index, double value) {
if (index < 0 || index >= maxLength)
throw new ArrayIndexOutOfBoundsException(
"invalid index: " + index);
int pos = Arrays.binarySearch(indices, index);
// The divide operation is dividin... | java | public double dividePrimitive(int index, double value) {
if (index < 0 || index >= maxLength)
throw new ArrayIndexOutOfBoundsException(
"invalid index: " + index);
int pos = Arrays.binarySearch(indices, index);
// The divide operation is dividin... | [
"public",
"double",
"dividePrimitive",
"(",
"int",
"index",
",",
"double",
"value",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"maxLength",
")",
"throw",
"new",
"ArrayIndexOutOfBoundsException",
"(",
"\"invalid index: \"",
"+",
"index",
")",
... | Divides the specified value to the index by the provided value and stores
the result at the index (just as {@code array[index] /= value})
@param index the position in the array
@param value the value by which the value at the index will be divided
@return the new value stored at the index | [
"Divides",
"the",
"specified",
"value",
"to",
"the",
"index",
"by",
"the",
"provided",
"value",
"and",
"stores",
"the",
"result",
"at",
"the",
"index",
"(",
"just",
"as",
"{",
"@code",
"array",
"[",
"index",
"]",
"/",
"=",
"value",
"}",
")"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/SparseDoubleArray.java#L252-L290 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java | MemberSummaryBuilder.buildEnumConstantsSummary | public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS];
VisibleMemberMap visibleMemberMap =
visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS];
addSummary(... | java | public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS];
VisibleMemberMap visibleMemberMap =
visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS];
addSummary(... | [
"public",
"void",
"buildEnumConstantsSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"memberSummaryTree",
")",
"{",
"MemberSummaryWriter",
"writer",
"=",
"memberSummaryWriters",
"[",
"VisibleMemberMap",
".",
"ENUM_CONSTANTS",
"]",
";",
"VisibleMemberMap",
"visibleMember... | Build the summary for the enum constants.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added | [
"Build",
"the",
"summary",
"for",
"the",
"enum",
"constants",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java#L208-L214 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_filer_filerId_GET | public OvhFiler serviceName_datacenter_datacenterId_filer_filerId_GET(String serviceName, Long datacenterId, Long filerId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/filer/{filerId}";
StringBuilder sb = path(qPath, serviceName, datacenterId, filerId);
String resp ... | java | public OvhFiler serviceName_datacenter_datacenterId_filer_filerId_GET(String serviceName, Long datacenterId, Long filerId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/filer/{filerId}";
StringBuilder sb = path(qPath, serviceName, datacenterId, filerId);
String resp ... | [
"public",
"OvhFiler",
"serviceName_datacenter_datacenterId_filer_filerId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"filerId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/datacenter/{datacenterId... | Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/filer/{filerId}
@param serviceName [required] Domain of the service
@param datacenterId [required]
@param filerId [required] Filer Id | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2253-L2258 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java | ZooKeeperMasterModel.rolloutOptionsWithFallback | static RolloutOptions rolloutOptionsWithFallback(final RolloutOptions options, final Job job) {
return options.withFallback(
job.getRolloutOptions() == null
? RolloutOptions.getDefault()
: job.getRolloutOptions().withFallback(RolloutOptions.getDefault()));
} | java | static RolloutOptions rolloutOptionsWithFallback(final RolloutOptions options, final Job job) {
return options.withFallback(
job.getRolloutOptions() == null
? RolloutOptions.getDefault()
: job.getRolloutOptions().withFallback(RolloutOptions.getDefault()));
} | [
"static",
"RolloutOptions",
"rolloutOptionsWithFallback",
"(",
"final",
"RolloutOptions",
"options",
",",
"final",
"Job",
"job",
")",
"{",
"return",
"options",
".",
"withFallback",
"(",
"job",
".",
"getRolloutOptions",
"(",
")",
"==",
"null",
"?",
"RolloutOptions"... | Returns a {@link RolloutOptions} instance that will replace null attributes in options with
values from two tiers of fallbacks. First fallback to job then
{@link RolloutOptions#getDefault()}. | [
"Returns",
"a",
"{"
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java#L625-L630 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.setup | public void setup(String host, String path, Map<String, Object> params) {
this.host = host;
this.path = path;
this.params = params;
if (Integer.valueOf(3).equals(params.get("objectEncoding"))) {
if (log.isDebugEnabled()) {
log.debug("Setting object encod... | java | public void setup(String host, String path, Map<String, Object> params) {
this.host = host;
this.path = path;
this.params = params;
if (Integer.valueOf(3).equals(params.get("objectEncoding"))) {
if (log.isDebugEnabled()) {
log.debug("Setting object encod... | [
"public",
"void",
"setup",
"(",
"String",
"host",
",",
"String",
"path",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"{",
"this",
".",
"host",
"=",
"host",
";",
"this",
".",
"path",
"=",
"path",
";",
"this",
".",
"params",
"=",
... | Initialize connection.
@param host
Connection host
@param path
Connection path
@param params
Params passed from client | [
"Initialize",
"connection",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L574-L584 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Table.java | Table.getNextConstraintIndex | int getNextConstraintIndex(int from, int type) {
for (int i = from, size = constraintList.length; i < size; i++) {
Constraint c = constraintList[i];
if (c.getConstraintType() == type) {
return i;
}
}
return -1;
} | java | int getNextConstraintIndex(int from, int type) {
for (int i = from, size = constraintList.length; i < size; i++) {
Constraint c = constraintList[i];
if (c.getConstraintType() == type) {
return i;
}
}
return -1;
} | [
"int",
"getNextConstraintIndex",
"(",
"int",
"from",
",",
"int",
"type",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"from",
",",
"size",
"=",
"constraintList",
".",
"length",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"Constraint",
"c",
"=",
"con... | Returns the next constraint of a given type
@param from
@param type | [
"Returns",
"the",
"next",
"constraint",
"of",
"a",
"given",
"type"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Table.java#L896-L907 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/taglib/el/EvalHelper.java | EvalHelper.evalString | public static String evalString(String propertyName, String propertyValue, Tag tag, PageContext pageContext) throws JspException{
return (String) ExpressionEvaluatorManager.evaluate(propertyName,
propertyValue, String.class, tag, pageContext);
} | java | public static String evalString(String propertyName, String propertyValue, Tag tag, PageContext pageContext) throws JspException{
return (String) ExpressionEvaluatorManager.evaluate(propertyName,
propertyValue, String.class, tag, pageContext);
} | [
"public",
"static",
"String",
"evalString",
"(",
"String",
"propertyName",
",",
"String",
"propertyValue",
",",
"Tag",
"tag",
",",
"PageContext",
"pageContext",
")",
"throws",
"JspException",
"{",
"return",
"(",
"String",
")",
"ExpressionEvaluatorManager",
".",
"e... | Evaluate the string EL expression passed as parameter
@param propertyName the property name
@param propertyValue the property value
@param tag the tag
@param pageContext the page context
@return the value corresponding to the EL expression passed as parameter
@throws JspException if an exception occurs | [
"Evaluate",
"the",
"string",
"EL",
"expression",
"passed",
"as",
"parameter"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/taglib/el/EvalHelper.java#L39-L43 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.addEntries | public static void addEntries(File zip, ZipEntrySource[] entries, File destZip) {
if (log.isDebugEnabled()) {
log.debug("Copying '" + zip + "' to '" + destZip + "' and adding " + Arrays.asList(entries) + ".");
}
OutputStream destOut = null;
try {
destOut = new BufferedOutputStream(new FileO... | java | public static void addEntries(File zip, ZipEntrySource[] entries, File destZip) {
if (log.isDebugEnabled()) {
log.debug("Copying '" + zip + "' to '" + destZip + "' and adding " + Arrays.asList(entries) + ".");
}
OutputStream destOut = null;
try {
destOut = new BufferedOutputStream(new FileO... | [
"public",
"static",
"void",
"addEntries",
"(",
"File",
"zip",
",",
"ZipEntrySource",
"[",
"]",
"entries",
",",
"File",
"destZip",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Copying '\"",
"+",
"zi... | Copies an existing ZIP file and appends it with new entries.
@param zip
an existing ZIP file (only read).
@param entries
new ZIP entries appended.
@param destZip
new ZIP file created. | [
"Copies",
"an",
"existing",
"ZIP",
"file",
"and",
"appends",
"it",
"with",
"new",
"entries",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2164-L2180 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/util/Utils.java | Utils.parseInt | public static int parseInt(String val, int defValue){
if(TextUtils.isEmpty(val)) return defValue;
try{
return Integer.parseInt(val);
}catch (NumberFormatException e){
return defValue;
}
} | java | public static int parseInt(String val, int defValue){
if(TextUtils.isEmpty(val)) return defValue;
try{
return Integer.parseInt(val);
}catch (NumberFormatException e){
return defValue;
}
} | [
"public",
"static",
"int",
"parseInt",
"(",
"String",
"val",
",",
"int",
"defValue",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"val",
")",
")",
"return",
"defValue",
";",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"val",
")",
... | Parse a int from a String in a safe manner.
@param val the string to parse
@param defValue the default value to return if parsing fails
@return the parsed int, or default value | [
"Parse",
"a",
"int",
"from",
"a",
"String",
"in",
"a",
"safe",
"manner",
"."
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/Utils.java#L262-L269 |
khipu/lib-java | src/main/java/com/khipu/lib/java/Khipu.java | Khipu.getPaymentButton | public static String getPaymentButton(int receiverId, String secret, String email, String bankId, String subject, String body, int amount, Date expiresDate, String notifyUrl, String returnUrl, String cancelUrl, String pictureUrl, String custom, String transactionId, String button) {
StringBuilder builder = new String... | java | public static String getPaymentButton(int receiverId, String secret, String email, String bankId, String subject, String body, int amount, Date expiresDate, String notifyUrl, String returnUrl, String cancelUrl, String pictureUrl, String custom, String transactionId, String button) {
StringBuilder builder = new String... | [
"public",
"static",
"String",
"getPaymentButton",
"(",
"int",
"receiverId",
",",
"String",
"secret",
",",
"String",
"email",
",",
"String",
"bankId",
",",
"String",
"subject",
",",
"String",
"body",
",",
"int",
"amount",
",",
"Date",
"expiresDate",
",",
"Str... | Entrega un String que contiene un botón de pago que dirije a khipu.
@param receiverId id de cobrador
@param secret llave de cobrador
@param email correo del pagador. Este correo aparecerá pre-configurado en
la página de pago (opcional).
@param bankId el identificador del banco para hacer el pago.
@p... | [
"Entrega",
"un",
"String",
"que",
"contiene",
"un",
"botón",
"de",
"pago",
"que",
"dirije",
"a",
"khipu",
"."
] | train | https://github.com/khipu/lib-java/blob/7a56476a60c6f5012e13f342c81b5ef9dc2328e6/src/main/java/com/khipu/lib/java/Khipu.java#L214-L234 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutMethodResponseRequest.java | PutMethodResponseRequest.withResponseModels | public PutMethodResponseRequest withResponseModels(java.util.Map<String, String> responseModels) {
setResponseModels(responseModels);
return this;
} | java | public PutMethodResponseRequest withResponseModels(java.util.Map<String, String> responseModels) {
setResponseModels(responseModels);
return this;
} | [
"public",
"PutMethodResponseRequest",
"withResponseModels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseModels",
")",
"{",
"setResponseModels",
"(",
"responseModels",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Specifies the <a>Model</a> resources used for the response's content type. Response models are represented as a
key/value map, with a content type as the key and a <a>Model</a> name as the value.
</p>
@param responseModels
Specifies the <a>Model</a> resources used for the response's content type. Response models a... | [
"<p",
">",
"Specifies",
"the",
"<a",
">",
"Model<",
"/",
"a",
">",
"resources",
"used",
"for",
"the",
"response",
"s",
"content",
"type",
".",
"Response",
"models",
"are",
"represented",
"as",
"a",
"key",
"/",
"value",
"map",
"with",
"a",
"content",
"t... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutMethodResponseRequest.java#L387-L390 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java | UnicodeSet.spanBack | public int spanBack(CharSequence s, SpanCondition spanCondition) {
return spanBack(s, s.length(), spanCondition);
} | java | public int spanBack(CharSequence s, SpanCondition spanCondition) {
return spanBack(s, s.length(), spanCondition);
} | [
"public",
"int",
"spanBack",
"(",
"CharSequence",
"s",
",",
"SpanCondition",
"spanCondition",
")",
"{",
"return",
"spanBack",
"(",
"s",
",",
"s",
".",
"length",
"(",
")",
",",
"spanCondition",
")",
";",
"}"
] | Span a string backwards (from the end) using this UnicodeSet.
<p>To replace, count elements, or delete spans, see {@link android.icu.text.UnicodeSetSpanner UnicodeSetSpanner}.
@param s The string to be spanned
@param spanCondition The span condition
@return The string index which starts the span (i.e. inclusive). | [
"Span",
"a",
"string",
"backwards",
"(",
"from",
"the",
"end",
")",
"using",
"this",
"UnicodeSet",
".",
"<p",
">",
"To",
"replace",
"count",
"elements",
"or",
"delete",
"spans",
"see",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java#L4061-L4063 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/zone/Ser.java | Ser.writeOffset | static void writeOffset(ZoneOffset offset, DataOutput out) throws IOException {
final int offsetSecs = offset.getTotalSeconds();
int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127; // compress to -72 to +72
out.writeByte(offsetByte);
if (offsetByte == 127) {
out... | java | static void writeOffset(ZoneOffset offset, DataOutput out) throws IOException {
final int offsetSecs = offset.getTotalSeconds();
int offsetByte = offsetSecs % 900 == 0 ? offsetSecs / 900 : 127; // compress to -72 to +72
out.writeByte(offsetByte);
if (offsetByte == 127) {
out... | [
"static",
"void",
"writeOffset",
"(",
"ZoneOffset",
"offset",
",",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"final",
"int",
"offsetSecs",
"=",
"offset",
".",
"getTotalSeconds",
"(",
")",
";",
"int",
"offsetByte",
"=",
"offsetSecs",
"%",
"900",
... | Writes the state to the stream.
@param offset the offset, not null
@param out the output stream, not null
@throws IOException if an error occurs | [
"Writes",
"the",
"state",
"to",
"the",
"stream",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/zone/Ser.java#L221-L228 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/ConvexPolygon.java | ConvexPolygon.distanceFromLine | public static double distanceFromLine(double x0, double y0, double x1, double y1, double x2, double y2)
{
double dx = x2-x1;
if (dx == 0.0)
{
return Math.abs(x1-x0);
}
double dy = y2-y1;
if (dy == 0.0)
{
return Math.abs(y1-y0)... | java | public static double distanceFromLine(double x0, double y0, double x1, double y1, double x2, double y2)
{
double dx = x2-x1;
if (dx == 0.0)
{
return Math.abs(x1-x0);
}
double dy = y2-y1;
if (dy == 0.0)
{
return Math.abs(y1-y0)... | [
"public",
"static",
"double",
"distanceFromLine",
"(",
"double",
"x0",
",",
"double",
"y0",
",",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"double",
"dx",
"=",
"x2",
"-",
"x1",
";",
"if",
"(",
"dx",
"=... | Returns distance from point (x0, y0) to line that goes through points
(x1, y1) and (x2, y2)
@param x0
@param y0
@param x1
@param y1
@param x2
@param y2
@return | [
"Returns",
"distance",
"from",
"point",
"(",
"x0",
"y0",
")",
"to",
"line",
"that",
"goes",
"through",
"points",
"(",
"x1",
"y1",
")",
"and",
"(",
"x2",
"y2",
")"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/ConvexPolygon.java#L127-L140 |
katjahahn/PortEx | src/main/java/com/github/katjahahn/tools/visualizer/Visualizer.java | Visualizer.writeImage | public void writeImage(File input, File output, String formatName)
throws IOException {
BufferedImage image = createImage(input);
ImageIO.write(image, formatName, output);
} | java | public void writeImage(File input, File output, String formatName)
throws IOException {
BufferedImage image = createImage(input);
ImageIO.write(image, formatName, output);
} | [
"public",
"void",
"writeImage",
"(",
"File",
"input",
",",
"File",
"output",
",",
"String",
"formatName",
")",
"throws",
"IOException",
"{",
"BufferedImage",
"image",
"=",
"createImage",
"(",
"input",
")",
";",
"ImageIO",
".",
"write",
"(",
"image",
",",
"... | Writes an image to the output file that displays the structure of the PE
file.
@param input
the PE file to create an image from
@param output
the file to write the image to
@param formatName
the format name for the output image
@throws IOException
if sections can not be read | [
"Writes",
"an",
"image",
"to",
"the",
"output",
"file",
"that",
"displays",
"the",
"structure",
"of",
"the",
"PE",
"file",
"."
] | train | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/tools/visualizer/Visualizer.java#L339-L343 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java | LabsInner.update | public LabInner update(String resourceGroupName, String labAccountName, String labName, LabFragment lab) {
return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, lab).toBlocking().single().body();
} | java | public LabInner update(String resourceGroupName, String labAccountName, String labName, LabFragment lab) {
return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, lab).toBlocking().single().body();
} | [
"public",
"LabInner",
"update",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"LabFragment",
"lab",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"labAccountName",
",",
"labNa... | Modify properties of labs.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param lab Represents a lab.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request ... | [
"Modify",
"properties",
"of",
"labs",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java#L835-L837 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java | TaskOperations.createTask | public void createTask(String jobId, TaskAddParameter taskToAdd) throws BatchErrorException, IOException {
createTask(jobId, taskToAdd, null);
} | java | public void createTask(String jobId, TaskAddParameter taskToAdd) throws BatchErrorException, IOException {
createTask(jobId, taskToAdd, null);
} | [
"public",
"void",
"createTask",
"(",
"String",
"jobId",
",",
"TaskAddParameter",
"taskToAdd",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"createTask",
"(",
"jobId",
",",
"taskToAdd",
",",
"null",
")",
";",
"}"
] | Adds a single task to a job.
@param jobId
The ID of the job to which to add the task.
@param taskToAdd
The {@link TaskAddParameter task} to add.
@throws BatchErrorException
Exception thrown when an error response is received from the
Batch service.
@throws IOException
Exception thrown when there is an error in
seriali... | [
"Adds",
"a",
"single",
"task",
"to",
"a",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java#L94-L96 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CciConnCodeGen.java | CciConnCodeGen.writeMetaData | private void writeMetaData(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent,
" * Gets the information on the underlying EIS instance represented through an active connection.\n");
writeWithIndent(out, indent,... | java | private void writeMetaData(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent,
" * Gets the information on the underlying EIS instance represented through an active connection.\n");
writeWithIndent(out, indent,... | [
"private",
"void",
"writeMetaData",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",
"inden... | Output MetaData method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"MetaData",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CciConnCodeGen.java#L202-L221 |
jirkapinkas/jsitemapgenerator | src/main/java/cz/jiripinkas/jsitemapgenerator/AbstractGenerator.java | AbstractGenerator.addPages | public <T> I addPages(Collection<T> webPages, Function<T, WebPage> mapper) {
for (T element : webPages) {
addPage(mapper.apply(element));
}
return getThis();
} | java | public <T> I addPages(Collection<T> webPages, Function<T, WebPage> mapper) {
for (T element : webPages) {
addPage(mapper.apply(element));
}
return getThis();
} | [
"public",
"<",
"T",
">",
"I",
"addPages",
"(",
"Collection",
"<",
"T",
">",
"webPages",
",",
"Function",
"<",
"T",
",",
"WebPage",
">",
"mapper",
")",
"{",
"for",
"(",
"T",
"element",
":",
"webPages",
")",
"{",
"addPage",
"(",
"mapper",
".",
"apply... | Add collection of pages to sitemap
@param <T> This is the type parameter
@param webPages Collection of pages
@param mapper Mapper function which transforms some object to WebPage
@return this | [
"Add",
"collection",
"of",
"pages",
"to",
"sitemap"
] | train | https://github.com/jirkapinkas/jsitemapgenerator/blob/42e1f57bd936e21fe9df642e722726e71f667442/src/main/java/cz/jiripinkas/jsitemapgenerator/AbstractGenerator.java#L136-L141 |
YahooArchive/samoa | samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java | AMRulesAggregatorProcessor.newResultContentEvent | private ResultContentEvent newResultContentEvent(double[] prediction, InstanceContentEvent inEvent){
ResultContentEvent rce = new ResultContentEvent(inEvent.getInstanceIndex(), inEvent.getInstance(), inEvent.getClassId(), prediction, inEvent.isLastEvent());
rce.setClassifierIndex(this.processorId);
rce.setEvaluat... | java | private ResultContentEvent newResultContentEvent(double[] prediction, InstanceContentEvent inEvent){
ResultContentEvent rce = new ResultContentEvent(inEvent.getInstanceIndex(), inEvent.getInstance(), inEvent.getClassId(), prediction, inEvent.isLastEvent());
rce.setClassifierIndex(this.processorId);
rce.setEvaluat... | [
"private",
"ResultContentEvent",
"newResultContentEvent",
"(",
"double",
"[",
"]",
"prediction",
",",
"InstanceContentEvent",
"inEvent",
")",
"{",
"ResultContentEvent",
"rce",
"=",
"new",
"ResultContentEvent",
"(",
"inEvent",
".",
"getInstanceIndex",
"(",
")",
",",
... | Helper method to generate new ResultContentEvent based on an instance and
its prediction result.
@param prediction The predicted class label from the decision tree model.
@param inEvent The associated instance content event
@return ResultContentEvent to be sent into Evaluator PI or other destination PI. | [
"Helper",
"method",
"to",
"generate",
"new",
"ResultContentEvent",
"based",
"on",
"an",
"instance",
"and",
"its",
"prediction",
"result",
"."
] | train | https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java#L219-L224 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AbstractAlpineQueryManager.java | AbstractAlpineQueryManager.getObjectById | public <T> T getObjectById(Class<T> clazz, Object id) {
return pm.getObjectById(clazz, id);
} | java | public <T> T getObjectById(Class<T> clazz, Object id) {
return pm.getObjectById(clazz, id);
} | [
"public",
"<",
"T",
">",
"T",
"getObjectById",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Object",
"id",
")",
"{",
"return",
"pm",
".",
"getObjectById",
"(",
"clazz",
",",
"id",
")",
";",
"}"
] | Retrieves an object by its ID.
@param <T> A type parameter. This type will be returned
@param clazz the persistence class to retrive the ID for
@param id the object id to retrieve
@return an object of the specified type
@since 1.0.0 | [
"Retrieves",
"an",
"object",
"by",
"its",
"ID",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AbstractAlpineQueryManager.java#L503-L505 |
AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Beacon.java | Beacon.writeToParcel | @Deprecated
public void writeToParcel(Parcel out, int flags) {
out.writeInt(mIdentifiers.size());
for (Identifier identifier: mIdentifiers) {
out.writeString(identifier == null ? null : identifier.toString());
}
out.writeDouble(getDistance());
out.writeInt(mRssi);... | java | @Deprecated
public void writeToParcel(Parcel out, int flags) {
out.writeInt(mIdentifiers.size());
for (Identifier identifier: mIdentifiers) {
out.writeString(identifier == null ? null : identifier.toString());
}
out.writeDouble(getDistance());
out.writeInt(mRssi);... | [
"@",
"Deprecated",
"public",
"void",
"writeToParcel",
"(",
"Parcel",
"out",
",",
"int",
"flags",
")",
"{",
"out",
".",
"writeInt",
"(",
"mIdentifiers",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Identifier",
"identifier",
":",
"mIdentifiers",
")",
"{"... | Required for making object Parcelable. If you override this class, you must override this
method if you add any additional fields. | [
"Required",
"for",
"making",
"object",
"Parcelable",
".",
"If",
"you",
"override",
"this",
"class",
"you",
"must",
"override",
"this",
"method",
"if",
"you",
"add",
"any",
"additional",
"fields",
"."
] | train | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Beacon.java#L612-L639 |
danidemi/jlubricant | jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java | DatasourceTemplate.queryForObject | public <T> T queryForObject(String sql, RowMapper<T> rowMapper) throws SQLException {
return (T) query(sql, rowMapper);
} | java | public <T> T queryForObject(String sql, RowMapper<T> rowMapper) throws SQLException {
return (T) query(sql, rowMapper);
} | [
"public",
"<",
"T",
">",
"T",
"queryForObject",
"(",
"String",
"sql",
",",
"RowMapper",
"<",
"T",
">",
"rowMapper",
")",
"throws",
"SQLException",
"{",
"return",
"(",
"T",
")",
"query",
"(",
"sql",
",",
"rowMapper",
")",
";",
"}"
] | Execute a query that return a single result obtained allowing the current row to be mapped through
the provided {@link RowMapper}.
@throws SQLException | [
"Execute",
"a",
"query",
"that",
"return",
"a",
"single",
"result",
"obtained",
"allowing",
"the",
"current",
"row",
"to",
"be",
"mapped",
"through",
"the",
"provided",
"{"
] | train | https://github.com/danidemi/jlubricant/blob/a9937c141c69ec34b768bd603b8093e496329b3a/jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java#L80-L82 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java | CommerceNotificationTemplatePersistenceImpl.findAll | @Override
public List<CommerceNotificationTemplate> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceNotificationTemplate> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationTemplate",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce notification templates.
@return the commerce notification templates | [
"Returns",
"all",
"the",
"commerce",
"notification",
"templates",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplatePersistenceImpl.java#L5161-L5164 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/ItemRule.java | ItemRule.addValue | public void addValue(Token[] tokens) {
if (type == null) {
type = ItemType.LIST;
}
if (!isListableType()) {
throw new IllegalArgumentException("The type of this item must be 'array', 'list' or 'set'");
}
if (tokensList == null) {
tokensList = n... | java | public void addValue(Token[] tokens) {
if (type == null) {
type = ItemType.LIST;
}
if (!isListableType()) {
throw new IllegalArgumentException("The type of this item must be 'array', 'list' or 'set'");
}
if (tokensList == null) {
tokensList = n... | [
"public",
"void",
"addValue",
"(",
"Token",
"[",
"]",
"tokens",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"ItemType",
".",
"LIST",
";",
"}",
"if",
"(",
"!",
"isListableType",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgum... | Adds the specified value to this List type item.
@param tokens an array of tokens | [
"Adds",
"the",
"specified",
"value",
"to",
"this",
"List",
"type",
"item",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/ItemRule.java#L324-L335 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.decodeFileToFile | public static void decodeFileToFile (@Nonnull final String aInFile, @Nonnull final File aOutFile) throws IOException
{
final byte [] decoded = decodeFromFile (aInFile);
try (final OutputStream out = FileHelper.getBufferedOutputStream (aOutFile))
{
out.write (decoded);
}
} | java | public static void decodeFileToFile (@Nonnull final String aInFile, @Nonnull final File aOutFile) throws IOException
{
final byte [] decoded = decodeFromFile (aInFile);
try (final OutputStream out = FileHelper.getBufferedOutputStream (aOutFile))
{
out.write (decoded);
}
} | [
"public",
"static",
"void",
"decodeFileToFile",
"(",
"@",
"Nonnull",
"final",
"String",
"aInFile",
",",
"@",
"Nonnull",
"final",
"File",
"aOutFile",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"decoded",
"=",
"decodeFromFile",
"(",
"aInFile",... | Reads <code>infile</code> and decodes it to <code>outfile</code>.
@param aInFile
Input file
@param aOutFile
Output file
@throws IOException
if there is an error
@since 2.2 | [
"Reads",
"<code",
">",
"infile<",
"/",
"code",
">",
"and",
"decodes",
"it",
"to",
"<code",
">",
"outfile<",
"/",
"code",
">",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L2519-L2526 |
nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/GraphEditorWindow.java | GraphEditorWindow.registerValue | public void registerValue(LinearInterpolator value, String name) {
// add to properties combobox
properties.addItem(name);
// add to value map
values.put(name, value);
// set as current interpolator
panel.setInterpolator(value);
// enable all input fields
enableControls();
} | java | public void registerValue(LinearInterpolator value, String name) {
// add to properties combobox
properties.addItem(name);
// add to value map
values.put(name, value);
// set as current interpolator
panel.setInterpolator(value);
// enable all input fields
enableControls();
} | [
"public",
"void",
"registerValue",
"(",
"LinearInterpolator",
"value",
",",
"String",
"name",
")",
"{",
"// add to properties combobox\r",
"properties",
".",
"addItem",
"(",
"name",
")",
";",
"// add to value map\r",
"values",
".",
"put",
"(",
"name",
",",
"value"... | Register a configurable value with the graph panel
@param value The value to be registered
@param name The name to display for this value | [
"Register",
"a",
"configurable",
"value",
"with",
"the",
"graph",
"panel"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/GraphEditorWindow.java#L260-L272 |
Alluxio/alluxio | underfs/cos/src/main/java/alluxio/underfs/cos/COSUnderFileSystem.java | COSUnderFileSystem.createInstance | public static COSUnderFileSystem createInstance(AlluxioURI uri, UnderFileSystemConfiguration conf,
AlluxioConfiguration alluxioConf)
throws Exception {
String bucketName = UnderFileSystemUtils.getBucketName(uri);
Preconditions.checkArgument(conf.isSet(PropertyKey.COS_ACCESS_KEY),
"Property %... | java | public static COSUnderFileSystem createInstance(AlluxioURI uri, UnderFileSystemConfiguration conf,
AlluxioConfiguration alluxioConf)
throws Exception {
String bucketName = UnderFileSystemUtils.getBucketName(uri);
Preconditions.checkArgument(conf.isSet(PropertyKey.COS_ACCESS_KEY),
"Property %... | [
"public",
"static",
"COSUnderFileSystem",
"createInstance",
"(",
"AlluxioURI",
"uri",
",",
"UnderFileSystemConfiguration",
"conf",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"throws",
"Exception",
"{",
"String",
"bucketName",
"=",
"UnderFileSystemUtils",
".",
"getBu... | Constructs a new instance of {@link COSUnderFileSystem}.
@param uri the {@link AlluxioURI} for this UFS
@param conf the configuration for this UFS
@param alluxioConf Alluxio configuration
@return the created {@link COSUnderFileSystem} instance | [
"Constructs",
"a",
"new",
"instance",
"of",
"{",
"@link",
"COSUnderFileSystem",
"}",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/cos/src/main/java/alluxio/underfs/cos/COSUnderFileSystem.java#L75-L97 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.QuasiEuclidean | public static double QuasiEuclidean(IntPoint p, IntPoint q) {
return QuasiEuclidean(p.x, p.y, q.x, q.y);
} | java | public static double QuasiEuclidean(IntPoint p, IntPoint q) {
return QuasiEuclidean(p.x, p.y, q.x, q.y);
} | [
"public",
"static",
"double",
"QuasiEuclidean",
"(",
"IntPoint",
"p",
",",
"IntPoint",
"q",
")",
"{",
"return",
"QuasiEuclidean",
"(",
"p",
".",
"x",
",",
"p",
".",
"y",
",",
"q",
".",
"x",
",",
"q",
".",
"y",
")",
";",
"}"
] | Gets the Quasi-Euclidean distance between two points.
@param p IntPoint with X and Y axis coordinates.
@param q IntPoint with X and Y axis coordinates.
@return The Quasi Euclidean distance between p and q. | [
"Gets",
"the",
"Quasi",
"-",
"Euclidean",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L790-L792 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java | ProjectTreeController.addViews | private void addViews(MpxjTreeNode parentNode, ProjectFile file)
{
for (View view : file.getViews())
{
final View v = view;
MpxjTreeNode childNode = new MpxjTreeNode(view)
{
@Override public String toString()
{
return v.getName();
... | java | private void addViews(MpxjTreeNode parentNode, ProjectFile file)
{
for (View view : file.getViews())
{
final View v = view;
MpxjTreeNode childNode = new MpxjTreeNode(view)
{
@Override public String toString()
{
return v.getName();
... | [
"private",
"void",
"addViews",
"(",
"MpxjTreeNode",
"parentNode",
",",
"ProjectFile",
"file",
")",
"{",
"for",
"(",
"View",
"view",
":",
"file",
".",
"getViews",
"(",
")",
")",
"{",
"final",
"View",
"v",
"=",
"view",
";",
"MpxjTreeNode",
"childNode",
"="... | Add views to the tree.
@param parentNode parent tree node
@param file views container | [
"Add",
"views",
"to",
"the",
"tree",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java#L398-L412 |
structurizr/java | structurizr-core/src/com/structurizr/model/Model.java | Model.addDeploymentNode | @Nonnull
public DeploymentNode addDeploymentNode(@Nullable String environment, @Nonnull String name, @Nullable String description, @Nullable String technology) {
return addDeploymentNode(environment, name, description, technology, 1);
} | java | @Nonnull
public DeploymentNode addDeploymentNode(@Nullable String environment, @Nonnull String name, @Nullable String description, @Nullable String technology) {
return addDeploymentNode(environment, name, description, technology, 1);
} | [
"@",
"Nonnull",
"public",
"DeploymentNode",
"addDeploymentNode",
"(",
"@",
"Nullable",
"String",
"environment",
",",
"@",
"Nonnull",
"String",
"name",
",",
"@",
"Nullable",
"String",
"description",
",",
"@",
"Nullable",
"String",
"technology",
")",
"{",
"return"... | Adds a top-level deployment node to this model.
@param environment the name of the deployment environment
@param name the name of the deployment node
@param description the description of the deployment node
@param technology the technology associated with the deployment node
@return a DeploymentNode i... | [
"Adds",
"a",
"top",
"-",
"level",
"deployment",
"node",
"to",
"this",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Model.java#L573-L576 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReferenceUtil.java | ReferenceUtil.create | public static <T> Reference<T> create(ReferenceType type, T referent) {
return create(type, referent, null);
} | java | public static <T> Reference<T> create(ReferenceType type, T referent) {
return create(type, referent, null);
} | [
"public",
"static",
"<",
"T",
">",
"Reference",
"<",
"T",
">",
"create",
"(",
"ReferenceType",
"type",
",",
"T",
"referent",
")",
"{",
"return",
"create",
"(",
"type",
",",
"referent",
",",
"null",
")",
";",
"}"
] | 获得引用
@param <T> 被引用对象类型
@param type 引用类型枚举
@param referent 被引用对象
@return {@link Reference} | [
"获得引用"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReferenceUtil.java#L31-L33 |
jbundle/jbundle | app/program/screen/src/main/java/org/jbundle/app/program/screen/LayoutGridScreen.java | LayoutGridScreen.doCommand | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
if (strCommand.equalsIgnoreCase(MenuConstants.FORMDETAIL))
return (this.onForm(null, ScreenConstants.DETAIL_MODE, true, iCommandOptions, null) != null);
else if (strCommand.equalsIgnoreCase(MenuC... | java | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
if (strCommand.equalsIgnoreCase(MenuConstants.FORMDETAIL))
return (this.onForm(null, ScreenConstants.DETAIL_MODE, true, iCommandOptions, null) != null);
else if (strCommand.equalsIgnoreCase(MenuC... | [
"public",
"boolean",
"doCommand",
"(",
"String",
"strCommand",
",",
"ScreenField",
"sourceSField",
",",
"int",
"iCommandOptions",
")",
"{",
"if",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"MenuConstants",
".",
"FORMDETAIL",
")",
")",
"return",
"(",
"this"... | Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't process, pass to parent (with me as the source).
<br />Note: Never pass to a parent or child that matches t... | [
"Process",
"the",
"command",
".",
"<br",
"/",
">",
"Step",
"1",
"-",
"Process",
"the",
"command",
"if",
"possible",
"and",
"return",
"true",
"if",
"processed",
".",
"<br",
"/",
">",
"Step",
"2",
"-",
"If",
"I",
"can",
"t",
"process",
"pass",
"to",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/screen/src/main/java/org/jbundle/app/program/screen/LayoutGridScreen.java#L122-L133 |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/compiler/Compiler.java | Compiler.determineQualifiedName | private String determineQualifiedName(String name, CompilationUnit from) {
if (from != null) {
// Determine qualified name as being relative to "from"
String fromName = from.getName();
int index = fromName.lastIndexOf('.');
if (index >= 0) {
Strin... | java | private String determineQualifiedName(String name, CompilationUnit from) {
if (from != null) {
// Determine qualified name as being relative to "from"
String fromName = from.getName();
int index = fromName.lastIndexOf('.');
if (index >= 0) {
Strin... | [
"private",
"String",
"determineQualifiedName",
"(",
"String",
"name",
",",
"CompilationUnit",
"from",
")",
"{",
"if",
"(",
"from",
"!=",
"null",
")",
"{",
"// Determine qualified name as being relative to \"from\"",
"String",
"fromName",
"=",
"from",
".",
"getName",
... | Given a name, as requested by the given CompilationUnit, return a
fully qualified name or null if the name could not be found.
@param name requested name
@param from optional CompilationUnit | [
"Given",
"a",
"name",
"as",
"requested",
"by",
"the",
"given",
"CompilationUnit",
"return",
"a",
"fully",
"qualified",
"name",
"or",
"null",
"if",
"the",
"name",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/compiler/Compiler.java#L793-L812 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getUsersBatch | private String getUsersBatch(List<User> users, URIBuilder url, OAuthClientRequest bearerRequest,
OneloginOAuthJSONResourceResponse oAuthResponse) {
if (oAuthResponse.getResponseCode() == 200) {
JSONObject[] dataArray = oAuthResponse.getDataArray();
if (dataArray != null && dataArray.length > 0) {
for (JS... | java | private String getUsersBatch(List<User> users, URIBuilder url, OAuthClientRequest bearerRequest,
OneloginOAuthJSONResourceResponse oAuthResponse) {
if (oAuthResponse.getResponseCode() == 200) {
JSONObject[] dataArray = oAuthResponse.getDataArray();
if (dataArray != null && dataArray.length > 0) {
for (JS... | [
"private",
"String",
"getUsersBatch",
"(",
"List",
"<",
"User",
">",
"users",
",",
"URIBuilder",
"url",
",",
"OAuthClientRequest",
"bearerRequest",
",",
"OneloginOAuthJSONResourceResponse",
"oAuthResponse",
")",
"{",
"if",
"(",
"oAuthResponse",
".",
"getResponseCode",... | Get a batch of Users.
@param users
@param url
@param bearerRequest
@param oAuthResponse
@return The Batch reference
@see com.onelogin.sdk.model.User
@see <a target="_blank" href="https://developers.onelogin.com/api-docs/1/users/get-users">Get Users documentation</a> | [
"Get",
"a",
"batch",
"of",
"Users",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L418-L434 |
michel-kraemer/citeproc-java | citeproc-java/src/main/java/de/undercouch/citeproc/CSL.java | CSL.registerCitationItems | public void registerCitationItems(String... ids) {
try {
runner.callMethod(engine, "updateItems", new Object[] { ids });
} catch (ScriptRunnerException e) {
throw new IllegalArgumentException("Could not update items", e);
}
} | java | public void registerCitationItems(String... ids) {
try {
runner.callMethod(engine, "updateItems", new Object[] { ids });
} catch (ScriptRunnerException e) {
throw new IllegalArgumentException("Could not update items", e);
}
} | [
"public",
"void",
"registerCitationItems",
"(",
"String",
"...",
"ids",
")",
"{",
"try",
"{",
"runner",
".",
"callMethod",
"(",
"engine",
",",
"\"updateItems\"",
",",
"new",
"Object",
"[",
"]",
"{",
"ids",
"}",
")",
";",
"}",
"catch",
"(",
"ScriptRunnerE... | Introduces the given citation IDs to the processor. The processor will
call {@link ItemDataProvider#retrieveItem(String)} for each ID to get
the respective citation item. The retrieved items will be added to the
bibliography, so you don't have to call {@link #makeCitation(String...)}
for each of them anymore.
@param id... | [
"Introduces",
"the",
"given",
"citation",
"IDs",
"to",
"the",
"processor",
".",
"The",
"processor",
"will",
"call",
"{"
] | train | https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/CSL.java#L611-L617 |
groovy/groovy-core | src/main/org/codehaus/groovy/ast/ClassNode.java | ClassNode.hasPossibleMethod | public boolean hasPossibleMethod(String name, Expression arguments) {
int count = 0;
if (arguments instanceof TupleExpression) {
TupleExpression tuple = (TupleExpression) arguments;
// TODO this won't strictly be true when using list expansion in argument calls
count... | java | public boolean hasPossibleMethod(String name, Expression arguments) {
int count = 0;
if (arguments instanceof TupleExpression) {
TupleExpression tuple = (TupleExpression) arguments;
// TODO this won't strictly be true when using list expansion in argument calls
count... | [
"public",
"boolean",
"hasPossibleMethod",
"(",
"String",
"name",
",",
"Expression",
"arguments",
")",
"{",
"int",
"count",
"=",
"0",
";",
"if",
"(",
"arguments",
"instanceof",
"TupleExpression",
")",
"{",
"TupleExpression",
"tuple",
"=",
"(",
"TupleExpression",
... | Returns true if the given method has a possibly matching instance method with the given name and arguments.
@param name the name of the method of interest
@param arguments the arguments to match against
@return true if a matching method was found | [
"Returns",
"true",
"if",
"the",
"given",
"method",
"has",
"a",
"possibly",
"matching",
"instance",
"method",
"with",
"the",
"given",
"name",
"and",
"arguments",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/ast/ClassNode.java#L1221-L1240 |
WASdev/standards.jsr352.jbatch | com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java | JDBCPersistenceManagerImpl.createIfNotExists | private void createIfNotExists(String tableName, String createTableStatement) throws SQLException {
logger.entering(CLASSNAME, "createIfNotExists", new Object[] {tableName, createTableStatement});
Connection conn = getConnection();
DatabaseMetaData dbmd = conn.getMetaData();
ResultSet rs = dbmd.getTables(... | java | private void createIfNotExists(String tableName, String createTableStatement) throws SQLException {
logger.entering(CLASSNAME, "createIfNotExists", new Object[] {tableName, createTableStatement});
Connection conn = getConnection();
DatabaseMetaData dbmd = conn.getMetaData();
ResultSet rs = dbmd.getTables(... | [
"private",
"void",
"createIfNotExists",
"(",
"String",
"tableName",
",",
"String",
"createTableStatement",
")",
"throws",
"SQLException",
"{",
"logger",
".",
"entering",
"(",
"CLASSNAME",
",",
"\"createIfNotExists\"",
",",
"new",
"Object",
"[",
"]",
"{",
"tableNam... | Creates tableName using the createTableStatement DDL.
@param tableName
@param createTableStatement
@throws SQLException | [
"Creates",
"tableName",
"using",
"the",
"createTableStatement",
"DDL",
"."
] | train | https://github.com/WASdev/standards.jsr352.jbatch/blob/e267e79dccd4f0bd4bf9c2abc41a8a47b65be28f/com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java#L238-L253 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java | SuspiciousComparatorReturnValues.visitCode | @Override
public void visitCode(Code obj) {
if (getMethod().isSynthetic()) {
return;
}
String methodName = getMethodName();
String methodSig = getMethodSig();
if (methodName.equals(methodInfo.methodName) && methodSig.endsWith(methodInfo.signatureEnding)
... | java | @Override
public void visitCode(Code obj) {
if (getMethod().isSynthetic()) {
return;
}
String methodName = getMethodName();
String methodSig = getMethodSig();
if (methodName.equals(methodInfo.methodName) && methodSig.endsWith(methodInfo.signatureEnding)
... | [
"@",
"Override",
"public",
"void",
"visitCode",
"(",
"Code",
"obj",
")",
"{",
"if",
"(",
"getMethod",
"(",
")",
".",
"isSynthetic",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"methodName",
"=",
"getMethodName",
"(",
")",
";",
"String",
"methodSi... | implements the visitor to check to see what Const were returned from a comparator. If no Const were returned it can't determine anything, however if only
Const were returned, it looks to see if negative positive and zero was returned. It also looks to see if a non zero value is returned unconditionally.
While it is pos... | [
"implements",
"the",
"visitor",
"to",
"check",
"to",
"see",
"what",
"Const",
"were",
"returned",
"from",
"a",
"comparator",
".",
"If",
"no",
"Const",
"were",
"returned",
"it",
"can",
"t",
"determine",
"anything",
"however",
"if",
"only",
"Const",
"were",
"... | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SuspiciousComparatorReturnValues.java#L119-L150 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java | MapIterate.injectIntoIf | public static <IV, K, V> IV injectIntoIf(
IV initialValue,
Map<K, V> map,
final Predicate<? super V> predicate,
final Function2<? super IV, ? super V, ? extends IV> function)
{
Function2<IV, ? super V, IV> ifFunction = new Function2<IV, V, IV>()
{
... | java | public static <IV, K, V> IV injectIntoIf(
IV initialValue,
Map<K, V> map,
final Predicate<? super V> predicate,
final Function2<? super IV, ? super V, ? extends IV> function)
{
Function2<IV, ? super V, IV> ifFunction = new Function2<IV, V, IV>()
{
... | [
"public",
"static",
"<",
"IV",
",",
"K",
",",
"V",
">",
"IV",
"injectIntoIf",
"(",
"IV",
"initialValue",
",",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"Predicate",
"<",
"?",
"super",
"V",
">",
"predicate",
",",
"final",
"Function2",
"<"... | Same as {@link #injectInto(Object, Map, Function2)}, but only applies the value to the function
if the predicate returns true for the value.
@see #injectInto(Object, Map, Function2) | [
"Same",
"as",
"{",
"@link",
"#injectInto",
"(",
"Object",
"Map",
"Function2",
")",
"}",
"but",
"only",
"applies",
"the",
"value",
"to",
"the",
"function",
"if",
"the",
"predicate",
"returns",
"true",
"for",
"the",
"value",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java#L929-L947 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addPrebuilt | public List<PrebuiltEntityExtractor> addPrebuilt(UUID appId, String versionId, List<String> prebuiltExtractorNames) {
return addPrebuiltWithServiceResponseAsync(appId, versionId, prebuiltExtractorNames).toBlocking().single().body();
} | java | public List<PrebuiltEntityExtractor> addPrebuilt(UUID appId, String versionId, List<String> prebuiltExtractorNames) {
return addPrebuiltWithServiceResponseAsync(appId, versionId, prebuiltExtractorNames).toBlocking().single().body();
} | [
"public",
"List",
"<",
"PrebuiltEntityExtractor",
">",
"addPrebuilt",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"List",
"<",
"String",
">",
"prebuiltExtractorNames",
")",
"{",
"return",
"addPrebuiltWithServiceResponseAsync",
"(",
"appId",
",",
"versionI... | Adds a list of prebuilt entity extractors to the application.
@param appId The application ID.
@param versionId The version ID.
@param prebuiltExtractorNames An array of prebuilt entity extractor names.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if t... | [
"Adds",
"a",
"list",
"of",
"prebuilt",
"entity",
"extractors",
"to",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2090-L2092 |
banq/jdonframework | src/main/java/com/jdon/container/pico/JdonPicoContainer.java | JdonPicoContainer.registerComponentImplementation | public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException {
return registerComponentImplementation(componentKey, componentImplementation, (Parameter[]) null);
} | java | public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException {
return registerComponentImplementation(componentKey, componentImplementation, (Parameter[]) null);
} | [
"public",
"ComponentAdapter",
"registerComponentImplementation",
"(",
"Object",
"componentKey",
",",
"Class",
"componentImplementation",
")",
"throws",
"PicoRegistrationException",
"{",
"return",
"registerComponentImplementation",
"(",
"componentKey",
",",
"componentImplementatio... | {@inheritDoc} The returned ComponentAdapter will be instantiated by the
{@link ComponentAdapterFactory} passed to the container's constructor. | [
"{"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/container/pico/JdonPicoContainer.java#L258-L260 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java | VirtualNetworkGatewayConnectionsInner.getSharedKey | public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) {
return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body();
} | java | public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) {
return getSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().body();
} | [
"public",
"ConnectionSharedKeyInner",
"getSharedKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayConnectionName",
")",
"{",
"return",
"getSharedKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayConnectionName",
")",
"... | The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayConnectionName The virtual network gateway connectio... | [
"The",
"Get",
"VirtualNetworkGatewayConnectionSharedKey",
"operation",
"retrieves",
"information",
"about",
"the",
"specified",
"virtual",
"network",
"gateway",
"connection",
"shared",
"key",
"through",
"Network",
"resource",
"provider",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkGatewayConnectionsInner.java#L1025-L1027 |
cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java | GasteigerPEPEPartialCharges.setAntiFlags | private IAtomContainer setAntiFlags(IAtomContainer container, IAtomContainer ac, int number, boolean b) {
IBond bond = ac.getBond(number);
if (!container.contains(bond)) {
bond.setFlag(CDKConstants.REACTIVE_CENTER, b);
bond.getBegin().setFlag(CDKConstants.REACTIVE_CENTER, b);
... | java | private IAtomContainer setAntiFlags(IAtomContainer container, IAtomContainer ac, int number, boolean b) {
IBond bond = ac.getBond(number);
if (!container.contains(bond)) {
bond.setFlag(CDKConstants.REACTIVE_CENTER, b);
bond.getBegin().setFlag(CDKConstants.REACTIVE_CENTER, b);
... | [
"private",
"IAtomContainer",
"setAntiFlags",
"(",
"IAtomContainer",
"container",
",",
"IAtomContainer",
"ac",
",",
"int",
"number",
",",
"boolean",
"b",
")",
"{",
"IBond",
"bond",
"=",
"ac",
".",
"getBond",
"(",
"number",
")",
";",
"if",
"(",
"!",
"contain... | Set the Flags to atoms and bonds which are not contained
in an atomContainer.
@param container Container with the flags
@param ac Container to put the flags
@param b True, if the the flag is true
@return Container with added flags | [
"Set",
"the",
"Flags",
"to",
"atoms",
"and",
"bonds",
"which",
"are",
"not",
"contained",
"in",
"an",
"atomContainer",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java#L497-L506 |
GerdHolz/TOVAL | src/de/invation/code/toval/graphic/renderer/DefaultTableHeaderCellRenderer.java | DefaultTableHeaderCellRenderer.getIcon | @SuppressWarnings("incomplete-switch")
protected Icon getIcon(JTable table, int column) {
SortKey sortKey = getSortKey(table, column);
if (sortKey != null && table.convertColumnIndexToView(sortKey.getColumn()) == column) {
switch (sortKey.getSortOrder()) {
case ASCENDING:
return UIManage... | java | @SuppressWarnings("incomplete-switch")
protected Icon getIcon(JTable table, int column) {
SortKey sortKey = getSortKey(table, column);
if (sortKey != null && table.convertColumnIndexToView(sortKey.getColumn()) == column) {
switch (sortKey.getSortOrder()) {
case ASCENDING:
return UIManage... | [
"@",
"SuppressWarnings",
"(",
"\"incomplete-switch\"",
")",
"protected",
"Icon",
"getIcon",
"(",
"JTable",
"table",
",",
"int",
"column",
")",
"{",
"SortKey",
"sortKey",
"=",
"getSortKey",
"(",
"table",
",",
"column",
")",
";",
"if",
"(",
"sortKey",
"!=",
... | Overloaded to return an icon suitable to the primary sorted column, or null if
the column is not the primary sort key.
@param table the <code>JTable</code>.
@param column the column index.
@return the sort icon, or null if the column is unsorted. | [
"Overloaded",
"to",
"return",
"an",
"icon",
"suitable",
"to",
"the",
"primary",
"sorted",
"column",
"or",
"null",
"if",
"the",
"column",
"is",
"not",
"the",
"primary",
"sort",
"key",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/renderer/DefaultTableHeaderCellRenderer.java#L80-L92 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/lineage/LineageInfo.java | LineageInfo.putDestination | public void putDestination(List<Descriptor> descriptors, int branchId, State state) {
if (!hasLineageInfo(state)) {
log.warn("State has no lineage info but branch " + branchId + " puts {} descriptors", descriptors.size());
return;
}
log.info(String.format("Put destination %s for branch %d", De... | java | public void putDestination(List<Descriptor> descriptors, int branchId, State state) {
if (!hasLineageInfo(state)) {
log.warn("State has no lineage info but branch " + branchId + " puts {} descriptors", descriptors.size());
return;
}
log.info(String.format("Put destination %s for branch %d", De... | [
"public",
"void",
"putDestination",
"(",
"List",
"<",
"Descriptor",
">",
"descriptors",
",",
"int",
"branchId",
",",
"State",
"state",
")",
"{",
"if",
"(",
"!",
"hasLineageInfo",
"(",
"state",
")",
")",
"{",
"log",
".",
"warn",
"(",
"\"State has no lineage... | Put data {@link Descriptor}s of a destination dataset to a state
@param descriptors It can be a single item list which just has the dataset descriptor or a list
of dataset partition descriptors | [
"Put",
"data",
"{",
"@link",
"Descriptor",
"}",
"s",
"of",
"a",
"destination",
"dataset",
"to",
"a",
"state"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/lineage/LineageInfo.java#L144-L173 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hllmap/CouponHashMap.java | CouponHashMap.findKey | @Override
int findKey(final byte[] key) {
final long[] hash = MurmurHash3.hash(key, SEED);
int entryIndex = getIndex(hash[0], tableEntries_);
int firstDeletedIndex = -1;
final int loopIndex = entryIndex;
do {
if (curCountsArr_[entryIndex] == 0) {
return firstDeletedIndex == -1 ? ~ent... | java | @Override
int findKey(final byte[] key) {
final long[] hash = MurmurHash3.hash(key, SEED);
int entryIndex = getIndex(hash[0], tableEntries_);
int firstDeletedIndex = -1;
final int loopIndex = entryIndex;
do {
if (curCountsArr_[entryIndex] == 0) {
return firstDeletedIndex == -1 ? ~ent... | [
"@",
"Override",
"int",
"findKey",
"(",
"final",
"byte",
"[",
"]",
"key",
")",
"{",
"final",
"long",
"[",
"]",
"hash",
"=",
"MurmurHash3",
".",
"hash",
"(",
"key",
",",
"SEED",
")",
";",
"int",
"entryIndex",
"=",
"getIndex",
"(",
"hash",
"[",
"0",
... | Returns entryIndex if the given key is found. If not found, returns one's complement index
of an empty slot for insertion, which may be over a deleted key.
@param key the given key
@return the entryIndex | [
"Returns",
"entryIndex",
"if",
"the",
"given",
"key",
"is",
"found",
".",
"If",
"not",
"found",
"returns",
"one",
"s",
"complement",
"index",
"of",
"an",
"empty",
"slot",
"for",
"insertion",
"which",
"may",
"be",
"over",
"a",
"deleted",
"key",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hllmap/CouponHashMap.java#L139-L159 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.