repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Double> getAt(double[] array, Range range) {
"""
Support the subscript operator with a range for a double array
@param array a double array
@param range a range indicating the indices for the items to retrieve
@return list of the retrieved doubles
@since ... | java | @SuppressWarnings("unchecked")
public static List<Double> getAt(double[] array, Range range) {
return primitiveArrayGet(array, range);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Double",
">",
"getAt",
"(",
"double",
"[",
"]",
"array",
",",
"Range",
"range",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"range",
")",
";",
"}"
] | Support the subscript operator with a range for a double array
@param array a double array
@param range a range indicating the indices for the items to retrieve
@return list of the retrieved doubles
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"a",
"range",
"for",
"a",
"double",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13688-L13691 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.replaceWhere | public SDVariable replaceWhere(SDVariable update, SDVariable from, Condition condition) {
"""
Element-wise replace where condition:<br>
out[i] = from[i] if condition(update[i]) is satisfied, or<br>
out[i] = update[i] if condition(update[i]) is NOT satisfied
@param update Source array
@param from Repl... | java | public SDVariable replaceWhere(SDVariable update, SDVariable from, Condition condition) {
return replaceWhere(null, update, from, condition);
} | [
"public",
"SDVariable",
"replaceWhere",
"(",
"SDVariable",
"update",
",",
"SDVariable",
"from",
",",
"Condition",
"condition",
")",
"{",
"return",
"replaceWhere",
"(",
"null",
",",
"update",
",",
"from",
",",
"condition",
")",
";",
"}"
] | Element-wise replace where condition:<br>
out[i] = from[i] if condition(update[i]) is satisfied, or<br>
out[i] = update[i] if condition(update[i]) is NOT satisfied
@param update Source array
@param from Replacement values array (used conditionally). Must be same shape as 'update' array
@param condition Conditi... | [
"Element",
"-",
"wise",
"replace",
"where",
"condition",
":",
"<br",
">",
"out",
"[",
"i",
"]",
"=",
"from",
"[",
"i",
"]",
"if",
"condition",
"(",
"update",
"[",
"i",
"]",
")",
"is",
"satisfied",
"or<br",
">",
"out",
"[",
"i",
"]",
"=",
"update"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L1702-L1704 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/GosuStringUtil.java | GosuStringUtil.containsIgnoreCase | public static boolean containsIgnoreCase(String str, String searchStr) {
"""
<p>Checks if String contains a search String irrespective of case,
handling <code>null</code>. This method uses
{@link #contains(String, String)}.</p>
<p>A <code>null</code> String will return <code>false</code>.</p>
<pre>
GosuSt... | java | public static boolean containsIgnoreCase(String str, String searchStr) {
if (str == null || searchStr == null) {
return false;
}
return contains(str.toUpperCase(), searchStr.toUpperCase());
} | [
"public",
"static",
"boolean",
"containsIgnoreCase",
"(",
"String",
"str",
",",
"String",
"searchStr",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"searchStr",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"contains",
"(",
"str",
"."... | <p>Checks if String contains a search String irrespective of case,
handling <code>null</code>. This method uses
{@link #contains(String, String)}.</p>
<p>A <code>null</code> String will return <code>false</code>.</p>
<pre>
GosuStringUtil.contains(null, *) = false
GosuStringUtil.contains(*, null) = false
GosuStringUti... | [
"<p",
">",
"Checks",
"if",
"String",
"contains",
"a",
"search",
"String",
"irrespective",
"of",
"case",
"handling",
"<code",
">",
"null<",
"/",
"code",
">",
".",
"This",
"method",
"uses",
"{",
"@link",
"#contains",
"(",
"String",
"String",
")",
"}",
".",... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L1036-L1041 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.writeToList | public static void writeToList(CodedOutputStream out, int order, FieldType type, List list) throws IOException {
"""
Write to list.
@param out the out
@param order the order
@param type the type
@param list the list
@throws IOException Signals that an I/O exception has occurred.
"""
writeToList... | java | public static void writeToList(CodedOutputStream out, int order, FieldType type, List list) throws IOException {
writeToList(out, order, type, list, false);
} | [
"public",
"static",
"void",
"writeToList",
"(",
"CodedOutputStream",
"out",
",",
"int",
"order",
",",
"FieldType",
"type",
",",
"List",
"list",
")",
"throws",
"IOException",
"{",
"writeToList",
"(",
"out",
",",
"order",
",",
"type",
",",
"list",
",",
"fals... | Write to list.
@param out the out
@param order the order
@param type the type
@param list the list
@throws IOException Signals that an I/O exception has occurred. | [
"Write",
"to",
"list",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L686-L688 |
phax/ph-poi | src/main/java/com/helger/poi/excel/WorkbookCreationHelper.java | WorkbookCreationHelper.addMergeRegion | public int addMergeRegion (@Nonnegative final int nFirstRow,
@Nonnegative final int nLastRow,
@Nonnegative final int nFirstCol,
@Nonnegative final int nLastCol) {
"""
Adds a merged region of cells (hence those cells form one)
... | java | public int addMergeRegion (@Nonnegative final int nFirstRow,
@Nonnegative final int nLastRow,
@Nonnegative final int nFirstCol,
@Nonnegative final int nLastCol)
{
return m_aLastSheet.addMergedRegion (new CellRangeAddress (nFirs... | [
"public",
"int",
"addMergeRegion",
"(",
"@",
"Nonnegative",
"final",
"int",
"nFirstRow",
",",
"@",
"Nonnegative",
"final",
"int",
"nLastRow",
",",
"@",
"Nonnegative",
"final",
"int",
"nFirstCol",
",",
"@",
"Nonnegative",
"final",
"int",
"nLastCol",
")",
"{",
... | Adds a merged region of cells (hence those cells form one)
@param nFirstRow
Index of first row
@param nLastRow
Index of last row (inclusive), must be equal to or larger than
{@code nFirstRow}
@param nFirstCol
Index of first column
@param nLastCol
Index of last column (inclusive), must be equal to or larger than
{@code... | [
"Adds",
"a",
"merged",
"region",
"of",
"cells",
"(",
"hence",
"those",
"cells",
"form",
"one",
")"
] | train | https://github.com/phax/ph-poi/blob/908c5dd434739e6989cf88e55bea48f2f18c6996/src/main/java/com/helger/poi/excel/WorkbookCreationHelper.java#L461-L467 |
google/j2objc | jre_emul/android/platform/libcore/xml/src/main/java/org/kxml2/io/KXmlParser.java | KXmlParser.readQuotedId | private String readQuotedId(boolean returnText) throws IOException, XmlPullParserException {
"""
Reads a quoted string, performing no entity escaping of the contents.
"""
int quote = peekCharacter();
char[] delimiter;
if (quote == '"') {
delimiter = DOUBLE_QUOTE;
} e... | java | private String readQuotedId(boolean returnText) throws IOException, XmlPullParserException {
int quote = peekCharacter();
char[] delimiter;
if (quote == '"') {
delimiter = DOUBLE_QUOTE;
} else if (quote == '\'') {
delimiter = SINGLE_QUOTE;
} else {
... | [
"private",
"String",
"readQuotedId",
"(",
"boolean",
"returnText",
")",
"throws",
"IOException",
",",
"XmlPullParserException",
"{",
"int",
"quote",
"=",
"peekCharacter",
"(",
")",
";",
"char",
"[",
"]",
"delimiter",
";",
"if",
"(",
"quote",
"==",
"'",
"'",
... | Reads a quoted string, performing no entity escaping of the contents. | [
"Reads",
"a",
"quoted",
"string",
"performing",
"no",
"entity",
"escaping",
"of",
"the",
"contents",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/xml/src/main/java/org/kxml2/io/KXmlParser.java#L663-L675 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.scalarProduct | public static final double scalarProduct(Atom a, Atom b) {
"""
Scalar product (dot product).
@param a
an Atom object
@param b
an Atom object
@return a double
"""
return a.getX() * b.getX() + a.getY() * b.getY() + a.getZ() * b.getZ();
} | java | public static final double scalarProduct(Atom a, Atom b) {
return a.getX() * b.getX() + a.getY() * b.getY() + a.getZ() * b.getZ();
} | [
"public",
"static",
"final",
"double",
"scalarProduct",
"(",
"Atom",
"a",
",",
"Atom",
"b",
")",
"{",
"return",
"a",
".",
"getX",
"(",
")",
"*",
"b",
".",
"getX",
"(",
")",
"+",
"a",
".",
"getY",
"(",
")",
"*",
"b",
".",
"getY",
"(",
")",
"+"... | Scalar product (dot product).
@param a
an Atom object
@param b
an Atom object
@return a double | [
"Scalar",
"product",
"(",
"dot",
"product",
")",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L170-L172 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.syncVirtualNetworkInfoAsync | public Observable<Void> syncVirtualNetworkInfoAsync(String resourceGroupName, String name) {
"""
Resume an App Service Environment.
Resume an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws Il... | java | public Observable<Void> syncVirtualNetworkInfoAsync(String resourceGroupName, String name) {
return syncVirtualNetworkInfoWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"syncVirtualNetworkInfoAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"syncVirtualNetworkInfoWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"map",
"(",
"new"... | Resume an App Service Environment.
Resume an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object ... | [
"Resume",
"an",
"App",
"Service",
"Environment",
".",
"Resume",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceEnvironmentsInner.java#L5032-L5039 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/extension/std/XCostExtension.java | XCostExtension.assignDrivers | public void assignDrivers(XTrace trace, Map<String, String> drivers) {
"""
Assigns (to the given trace) multiple cost drivers given their keys. Note
that as a side effect this method creates attributes when it does not
find an attribute with the proper key.
@see #assignAmounts(XTrace, Map)
@param trace
Tr... | java | public void assignDrivers(XTrace trace, Map<String, String> drivers) {
XCostDriver.instance().assignValues(trace, drivers);
} | [
"public",
"void",
"assignDrivers",
"(",
"XTrace",
"trace",
",",
"Map",
"<",
"String",
",",
"String",
">",
"drivers",
")",
"{",
"XCostDriver",
".",
"instance",
"(",
")",
".",
"assignValues",
"(",
"trace",
",",
"drivers",
")",
";",
"}"
] | Assigns (to the given trace) multiple cost drivers given their keys. Note
that as a side effect this method creates attributes when it does not
find an attribute with the proper key.
@see #assignAmounts(XTrace, Map)
@param trace
Trace to assign the cost drivers to.
@param drivers
Mapping from keys to cost drivers whi... | [
"Assigns",
"(",
"to",
"the",
"given",
"trace",
")",
"multiple",
"cost",
"drivers",
"given",
"their",
"keys",
".",
"Note",
"that",
"as",
"a",
"side",
"effect",
"this",
"method",
"creates",
"attributes",
"when",
"it",
"does",
"not",
"find",
"an",
"attribute"... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L806-L808 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java | DwgUtil.getRawShort | public static Vector getRawShort(int[] data, int offset) throws Exception {
"""
Read a short value from a group of unsigned bytes
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is fo... | java | public static Vector getRawShort(int[] data, int offset) throws Exception {
byte[] bytes = (byte[])getBits(data, 16, offset);
ByteBuffer bb = ByteBuffer.wrap(bytes);
bb.order(ByteOrder.LITTLE_ENDIAN);
int val = bb.getShort();
Vector v = new Vector();
v.add(new Integer(offset+16));
v.add(new Integer(val));... | [
"public",
"static",
"Vector",
"getRawShort",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"(",
"byte",
"[",
"]",
")",
"getBits",
"(",
"data",
",",
"16",
",",
"offset",
")",
";"... | Read a short value from a group of unsigned bytes
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines.
@return Vector This vect... | [
"Read",
"a",
"short",
"value",
"from",
"a",
"group",
"of",
"unsigned",
"bytes"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java#L335-L344 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java | MapFixture.sizeOfIn | public int sizeOfIn(String expr, Map<String, Object> map) {
"""
Determines size of either (Map or Collection) value in the map.
@param expr expression indicating which (possibly nested) value in the map to determine size of.
@param map map to find value in.
@return size of value.
@throws SlimFixtureException i... | java | public int sizeOfIn(String expr, Map<String, Object> map) {
return getMapHelper().sizeOfIn(expr, map);
} | [
"public",
"int",
"sizeOfIn",
"(",
"String",
"expr",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"return",
"getMapHelper",
"(",
")",
".",
"sizeOfIn",
"(",
"expr",
",",
"map",
")",
";",
"}"
] | Determines size of either (Map or Collection) value in the map.
@param expr expression indicating which (possibly nested) value in the map to determine size of.
@param map map to find value in.
@return size of value.
@throws SlimFixtureException if the value found is not a Map or Collection. | [
"Determines",
"size",
"of",
"either",
"(",
"Map",
"or",
"Collection",
")",
"value",
"in",
"the",
"map",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java#L158-L160 |
realexpayments/rxp-hpp-java | src/main/java/com/realexpayments/hpp/sdk/RealexHpp.java | RealexHpp.responseToJson | public String responseToJson(HppResponse hppResponse) {
"""
<p>
Method produces JSON from <code>HppResponse</code> object.
Carries out the following actions:
<ul>
<li>Generates security hash</li>
<li>Base64 encodes inputs</li>
<li>Serialises response object to JSON</li>
</ul>
</p>
@param hppResponse
@r... | java | public String responseToJson(HppResponse hppResponse) {
LOGGER.info("Converting HppResponse to JSON.");
String json = null;
//generate hash
LOGGER.debug("Generating hash.");
hppResponse.hash(secret);
//encode
LOGGER.debug("Encoding object.");
try {
hppResponse = hppResponse.encode(ENCODING_CHARS... | [
"public",
"String",
"responseToJson",
"(",
"HppResponse",
"hppResponse",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"Converting HppResponse to JSON.\"",
")",
";",
"String",
"json",
"=",
"null",
";",
"//generate hash",
"LOGGER",
".",
"debug",
"(",
"\"Generating hash.\""... | <p>
Method produces JSON from <code>HppResponse</code> object.
Carries out the following actions:
<ul>
<li>Generates security hash</li>
<li>Base64 encodes inputs</li>
<li>Serialises response object to JSON</li>
</ul>
</p>
@param hppResponse
@return String | [
"<p",
">",
"Method",
"produces",
"JSON",
"from",
"<code",
">",
"HppResponse<",
"/",
"code",
">",
"object",
".",
"Carries",
"out",
"the",
"following",
"actions",
":",
"<ul",
">",
"<li",
">",
"Generates",
"security",
"hash<",
"/",
"li",
">",
"<li",
">",
... | train | https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/RealexHpp.java#L204-L228 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableImport.java | SSTableImport.stringAsType | private static ByteBuffer stringAsType(String content, AbstractType<?> type) {
"""
Convert a string to bytes (ByteBuffer) according to type
@param content string to convert
@param type type to use for conversion
@return byte buffer representation of the given string
"""
try
{
ret... | java | private static ByteBuffer stringAsType(String content, AbstractType<?> type)
{
try
{
return type.fromString(content);
}
catch (MarshalException e)
{
throw new RuntimeException(e.getMessage());
}
} | [
"private",
"static",
"ByteBuffer",
"stringAsType",
"(",
"String",
"content",
",",
"AbstractType",
"<",
"?",
">",
"type",
")",
"{",
"try",
"{",
"return",
"type",
".",
"fromString",
"(",
"content",
")",
";",
"}",
"catch",
"(",
"MarshalException",
"e",
")",
... | Convert a string to bytes (ByteBuffer) according to type
@param content string to convert
@param type type to use for conversion
@return byte buffer representation of the given string | [
"Convert",
"a",
"string",
"to",
"bytes",
"(",
"ByteBuffer",
")",
"according",
"to",
"type"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableImport.java#L546-L556 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/validators/AbstractValidator.java | AbstractValidator.setIcon | public final void setIcon(@NonNull final Context context, @DrawableRes final int resourceId) {
"""
Sets the icon, which should be shown, if the validation fails.
@param context
The context, which should be used to retrieve the icon, as an instance of the class
{@link Context}. The context may not be null
@pa... | java | public final void setIcon(@NonNull final Context context, @DrawableRes final int resourceId) {
Condition.INSTANCE.ensureNotNull(context, "The context may not be null");
this.icon = ContextCompat.getDrawable(context, resourceId);
} | [
"public",
"final",
"void",
"setIcon",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"DrawableRes",
"final",
"int",
"resourceId",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"context",
",",
"\"The context may not be null\"",
... | Sets the icon, which should be shown, if the validation fails.
@param context
The context, which should be used to retrieve the icon, as an instance of the class
{@link Context}. The context may not be null
@param resourceId
The resource ID of the drawable resource, which contains the icon, which should be
set, as an ... | [
"Sets",
"the",
"icon",
"which",
"should",
"be",
"shown",
"if",
"the",
"validation",
"fails",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/validators/AbstractValidator.java#L126-L129 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.download | public <T extends IEntity> InputStream download(T entity) throws FMSException {
"""
Method to find the record for the given id for the corresponding entity
@param entity
@return returns the entity
@throws FMSException
"""
IntuitMessage intuitMessage = prepareDownload(entity);
//execute i... | java | public <T extends IEntity> InputStream download(T entity) throws FMSException {
IntuitMessage intuitMessage = prepareDownload(entity);
//execute interceptors
executeInterceptors(intuitMessage);
String response = intuitMessage.getResponseElements().getDecompressedData();
if (re... | [
"public",
"<",
"T",
"extends",
"IEntity",
">",
"InputStream",
"download",
"(",
"T",
"entity",
")",
"throws",
"FMSException",
"{",
"IntuitMessage",
"intuitMessage",
"=",
"prepareDownload",
"(",
"entity",
")",
";",
"//execute interceptors",
"executeInterceptors",
"(",... | Method to find the record for the given id for the corresponding entity
@param entity
@return returns the entity
@throws FMSException | [
"Method",
"to",
"find",
"the",
"record",
"for",
"the",
"given",
"id",
"for",
"the",
"corresponding",
"entity"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L508-L526 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/CardAPI.java | CardAPI.codeDecrypt | public static CodeDecryptResult codeDecrypt(String accessToken, CodeDecrypt codeDecrypt) {
"""
Code解码<br>
1.只能解码本公众号卡券获取的加密code。 <br>
2.开发者若从url上获取到加密code,请注意先进行urldecode,否则报错。<br>
3.encrypt_code是卡券的code码经过加密处理得到的加密code码,与code一一对应。<br>
4.开发者只能解密本公众号的加密code,否则报错。
@param accessToken accessToken
@param codeDecr... | java | public static CodeDecryptResult codeDecrypt(String accessToken, CodeDecrypt codeDecrypt) {
return codeDecrypt(accessToken, JsonUtil.toJSONString(codeDecrypt));
} | [
"public",
"static",
"CodeDecryptResult",
"codeDecrypt",
"(",
"String",
"accessToken",
",",
"CodeDecrypt",
"codeDecrypt",
")",
"{",
"return",
"codeDecrypt",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"codeDecrypt",
")",
")",
";",
"}"
] | Code解码<br>
1.只能解码本公众号卡券获取的加密code。 <br>
2.开发者若从url上获取到加密code,请注意先进行urldecode,否则报错。<br>
3.encrypt_code是卡券的code码经过加密处理得到的加密code码,与code一一对应。<br>
4.开发者只能解密本公众号的加密code,否则报错。
@param accessToken accessToken
@param codeDecrypt codeDecrypt
@return result | [
"Code解码<br",
">",
"1",
".",
"只能解码本公众号卡券获取的加密code。",
"<br",
">",
"2",
".",
"开发者若从url上获取到加密code",
"请注意先进行urldecode,否则报错。<br",
">",
"3",
".",
"encrypt_code是卡券的code码经过加密处理得到的加密code码,与code一一对应。<br",
">",
"4",
".",
"开发者只能解密本公众号的加密code,否则报错。"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/CardAPI.java#L163-L165 |
dvasilen/Hive-XML-SerDe | src/main/java/com/ibm/spss/hive/serde2/xml/processor/java/JavaXmlProcessor.java | JavaXmlProcessor.getObjectValue | private Object getObjectValue(Node node, String fieldName) {
"""
Returns the object value for the given field name and node
@param node
the node
@param fieldName
the field name
@return the object value for the given field name and node
"""
// we have to take into account the fact that fieldName ... | java | private Object getObjectValue(Node node, String fieldName) {
// we have to take into account the fact that fieldName will be in the lower case
if (node != null) {
String name = node.getLocalName();
switch (node.getNodeType()) {
case Node.ATTRIBUTE_NODE:
... | [
"private",
"Object",
"getObjectValue",
"(",
"Node",
"node",
",",
"String",
"fieldName",
")",
"{",
"// we have to take into account the fact that fieldName will be in the lower case",
"if",
"(",
"node",
"!=",
"null",
")",
"{",
"String",
"name",
"=",
"node",
".",
"getLo... | Returns the object value for the given field name and node
@param node
the node
@param fieldName
the field name
@return the object value for the given field name and node | [
"Returns",
"the",
"object",
"value",
"for",
"the",
"given",
"field",
"name",
"and",
"node"
] | train | https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/processor/java/JavaXmlProcessor.java#L168-L194 |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java | Ginv.divideRowBy | public static void divideRowBy(Matrix matrix, long aRow, long fromCol, double value) {
"""
Divide the row from this column position by this value
@param matrix
the matrix to modify
@param aRow
the row to process
@param fromCol
starting from column
@param value
the value to divide
"""
long cols = ma... | java | public static void divideRowBy(Matrix matrix, long aRow, long fromCol, double value) {
long cols = matrix.getColumnCount();
for (long col = fromCol; col < cols; col++) {
matrix.setAsDouble(matrix.getAsDouble(aRow, col) / value, aRow, col);
}
} | [
"public",
"static",
"void",
"divideRowBy",
"(",
"Matrix",
"matrix",
",",
"long",
"aRow",
",",
"long",
"fromCol",
",",
"double",
"value",
")",
"{",
"long",
"cols",
"=",
"matrix",
".",
"getColumnCount",
"(",
")",
";",
"for",
"(",
"long",
"col",
"=",
"fro... | Divide the row from this column position by this value
@param matrix
the matrix to modify
@param aRow
the row to process
@param fromCol
starting from column
@param value
the value to divide | [
"Divide",
"the",
"row",
"from",
"this",
"column",
"position",
"by",
"this",
"value"
] | train | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java#L674-L679 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/forms/layout/LayoutMap.java | LayoutMap.columnPut | public String columnPut(String key, String value) {
"""
Associates the specified column String with the specified key in this map. If the map
previously contained a mapping for this key, the old value is replaced by the specified
value. The value set in this map overrides an association - if any - in the chain o... | java | public String columnPut(String key, String value) {
checkNotNull(value, "The column expression value must not be null.");
String resolvedKey = resolveColumnKey(key);
columnMapCache.clear();
return columnMap.put(
resolvedKey,
value.toLowerCase(Locale.ENGLIS... | [
"public",
"String",
"columnPut",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"checkNotNull",
"(",
"value",
",",
"\"The column expression value must not be null.\"",
")",
";",
"String",
"resolvedKey",
"=",
"resolveColumnKey",
"(",
"key",
")",
";",
"colu... | Associates the specified column String with the specified key in this map. If the map
previously contained a mapping for this key, the old value is replaced by the specified
value. The value set in this map overrides an association - if any - in the chain of parent
LayoutMaps.<p>
The {@code value} must not be {@code n... | [
"Associates",
"the",
"specified",
"column",
"String",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
".",
"If",
"the",
"map",
"previously",
"contained",
"a",
"mapping",
"for",
"this",
"key",
"the",
"old",
"value",
"is",
"replaced",
"by",
"the",
"s... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/LayoutMap.java#L279-L286 |
pmwmedia/tinylog | tinylog-impl/src/main/java/org/tinylog/writers/RollingFileWriter.java | RollingFileWriter.canBeContinued | private static boolean canBeContinued(final byte[] data, final List<Policy> policies) {
"""
Checks if a new log entry can be still written to the current log file.
@param data
Log entry
@param policies
Policies that should be applied
@return {@code true} if the current log file can be continued, {@code fals... | java | private static boolean canBeContinued(final byte[] data, final List<Policy> policies) {
boolean result = true;
for (Policy policy : policies) {
result &= policy.continueCurrentFile(data);
}
return result;
} | [
"private",
"static",
"boolean",
"canBeContinued",
"(",
"final",
"byte",
"[",
"]",
"data",
",",
"final",
"List",
"<",
"Policy",
">",
"policies",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"for",
"(",
"Policy",
"policy",
":",
"policies",
")",
"{",
... | Checks if a new log entry can be still written to the current log file.
@param data
Log entry
@param policies
Policies that should be applied
@return {@code true} if the current log file can be continued, {@code false} if a new log file should be started | [
"Checks",
"if",
"a",
"new",
"log",
"entry",
"can",
"be",
"still",
"written",
"to",
"the",
"current",
"log",
"file",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-impl/src/main/java/org/tinylog/writers/RollingFileWriter.java#L223-L229 |
facebook/fresco | samples/zoomable/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java | DefaultZoomableController.zoomToPoint | public void zoomToPoint(float scale, PointF imagePoint, PointF viewPoint) {
"""
Zooms to the desired scale and positions the image so that the given image point corresponds
to the given view point.
@param scale desired scale, will be limited to {min, max} scale factor
@param imagePoint 2D point in image's rel... | java | public void zoomToPoint(float scale, PointF imagePoint, PointF viewPoint) {
FLog.v(TAG, "zoomToPoint");
calculateZoomToPointTransform(mActiveTransform, scale, imagePoint, viewPoint, LIMIT_ALL);
onTransformChanged();
} | [
"public",
"void",
"zoomToPoint",
"(",
"float",
"scale",
",",
"PointF",
"imagePoint",
",",
"PointF",
"viewPoint",
")",
"{",
"FLog",
".",
"v",
"(",
"TAG",
",",
"\"zoomToPoint\"",
")",
";",
"calculateZoomToPointTransform",
"(",
"mActiveTransform",
",",
"scale",
"... | Zooms to the desired scale and positions the image so that the given image point corresponds
to the given view point.
@param scale desired scale, will be limited to {min, max} scale factor
@param imagePoint 2D point in image's relative coordinate system (i.e. 0 <= x, y <= 1)
@param viewPoint 2D point in view's absolut... | [
"Zooms",
"to",
"the",
"desired",
"scale",
"and",
"positions",
"the",
"image",
"so",
"that",
"the",
"given",
"image",
"point",
"corresponds",
"to",
"the",
"given",
"view",
"point",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/samples/zoomable/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java#L347-L351 |
zaproxy/zaproxy | src/org/zaproxy/zap/spider/SpiderController.java | SpiderController.addSeed | protected void addSeed(URI uri, String method) {
"""
Adds a new seed, if it wasn't already processed.
@param uri the uri
@param method the http method used for fetching the resource
"""
// Check if the uri was processed already
String visitedURI;
try {
visitedURI = URLCanonicalizer.buildCleanedPar... | java | protected void addSeed(URI uri, String method) {
// Check if the uri was processed already
String visitedURI;
try {
visitedURI = URLCanonicalizer.buildCleanedParametersURIRepresentation(uri, spider.getSpiderParam()
.getHandleParameters(), spider.getSpiderParam().isHandleODataParametersVisited());
} catc... | [
"protected",
"void",
"addSeed",
"(",
"URI",
"uri",
",",
"String",
"method",
")",
"{",
"// Check if the uri was processed already",
"String",
"visitedURI",
";",
"try",
"{",
"visitedURI",
"=",
"URLCanonicalizer",
".",
"buildCleanedParametersURIRepresentation",
"(",
"uri",... | Adds a new seed, if it wasn't already processed.
@param uri the uri
@param method the http method used for fetching the resource | [
"Adds",
"a",
"new",
"seed",
"if",
"it",
"wasn",
"t",
"already",
"processed",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderController.java#L163-L185 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.getDepIdsByRangeDisk | @Override
public Set getDepIdsByRangeDisk(int index, int length) {
"""
Returns a set of dependency IDs based on the range and size.
WARNING: If index = 1 or -1, the set might contain "DISKCACHE_MORE" to indicate there are more dep ids on the disk cache.
The caller need to remove DISKCACHE_MORE" from the set ... | java | @Override
public Set getDepIdsByRangeDisk(int index, int length) {
final String methodName = "getDepIdsByRangeDisk()";
Set ids = new HashSet();
if (this.swapToDisk) {
// TODO write code to support getDepIdsByRangeDisk function
if (tc.isDebugEnabled()) {
... | [
"@",
"Override",
"public",
"Set",
"getDepIdsByRangeDisk",
"(",
"int",
"index",
",",
"int",
"length",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"getDepIdsByRangeDisk()\"",
";",
"Set",
"ids",
"=",
"new",
"HashSet",
"(",
")",
";",
"if",
"(",
"this",
"... | Returns a set of dependency IDs based on the range and size.
WARNING: If index = 1 or -1, the set might contain "DISKCACHE_MORE" to indicate there are more dep ids on the disk cache.
The caller need to remove DISKCACHE_MORE" from the set before it is being used.
The "DISKCACHE_MORE" key is defined as HTODDynacache.DISK... | [
"Returns",
"a",
"set",
"of",
"dependency",
"IDs",
"based",
"on",
"the",
"range",
"and",
"size",
".",
"WARNING",
":",
"If",
"index",
"=",
"1",
"or",
"-",
"1",
"the",
"set",
"might",
"contain",
"DISKCACHE_MORE",
"to",
"indicate",
"there",
"are",
"more",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L1015-L1034 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/Table.java | Table.setConfigItem | public void setConfigItem(final String name, final String type, final String value) {
"""
Set a config item
@param name the item name
@param type the item type
@param value the item value
"""
this.builder.setConfigItem(name, type, value);
} | java | public void setConfigItem(final String name, final String type, final String value) {
this.builder.setConfigItem(name, type, value);
} | [
"public",
"void",
"setConfigItem",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"type",
",",
"final",
"String",
"value",
")",
"{",
"this",
".",
"builder",
".",
"setConfigItem",
"(",
"name",
",",
"type",
",",
"value",
")",
";",
"}"
] | Set a config item
@param name the item name
@param type the item type
@param value the item value | [
"Set",
"a",
"config",
"item"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/Table.java#L293-L295 |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/traverson/Traverson.java | Traverson.startWith | public Traverson startWith(final HalRepresentation resource) {
"""
Start traversal at the given HAL resource.
<p>
It is expected, that the HalRepresentation has an absolute 'self' link, or that all links to other
resources are absolute links. If this is not assured, {@link #startWith(URL, HalRepresentation)} ... | java | public Traverson startWith(final HalRepresentation resource) {
this.startWith = null;
this.lastResult = singletonList(requireNonNull(resource));
Optional<Link> self = resource.getLinks().getLinkBy("self");
if (self.isPresent()) {
this.contextUrl = linkToUrl(self.get());
... | [
"public",
"Traverson",
"startWith",
"(",
"final",
"HalRepresentation",
"resource",
")",
"{",
"this",
".",
"startWith",
"=",
"null",
";",
"this",
".",
"lastResult",
"=",
"singletonList",
"(",
"requireNonNull",
"(",
"resource",
")",
")",
";",
"Optional",
"<",
... | Start traversal at the given HAL resource.
<p>
It is expected, that the HalRepresentation has an absolute 'self' link, or that all links to other
resources are absolute links. If this is not assured, {@link #startWith(URL, HalRepresentation)} must
be used, so relative links can be resolved.
</p>
@param resource the i... | [
"Start",
"traversal",
"at",
"the",
"given",
"HAL",
"resource",
"."
] | train | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/traverson/Traverson.java#L301-L316 |
aws/aws-sdk-java | aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java | StepFunctionBuilder.lte | public static NumericLessThanOrEqualCondition.Builder lte(String variable, long expectedValue) {
"""
Binary condition for Numeric less than or equal to comparison. Supports both integral and floating point numeric types.
@param variable The JSONPath expression that determines which piece of the input docum... | java | public static NumericLessThanOrEqualCondition.Builder lte(String variable, long expectedValue) {
return NumericLessThanOrEqualCondition.builder().variable(variable).expectedValue(expectedValue);
} | [
"public",
"static",
"NumericLessThanOrEqualCondition",
".",
"Builder",
"lte",
"(",
"String",
"variable",
",",
"long",
"expectedValue",
")",
"{",
"return",
"NumericLessThanOrEqualCondition",
".",
"builder",
"(",
")",
".",
"variable",
"(",
"variable",
")",
".",
"exp... | Binary condition for Numeric less than or equal to comparison. Supports both integral and floating point numeric types.
@param variable The JSONPath expression that determines which piece of the input document is used for the comparison.
@param expectedValue The expected value for this condition.
@see <a href="ht... | [
"Binary",
"condition",
"for",
"Numeric",
"less",
"than",
"or",
"equal",
"to",
"comparison",
".",
"Supports",
"both",
"integral",
"and",
"floating",
"point",
"numeric",
"types",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java#L428-L430 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java | GPXTablesFactory.createTrackPointsTable | public static PreparedStatement createTrackPointsTable(Connection connection, String trackPointsTableName,boolean isH2) throws SQLException {
"""
Create the track points table to store the track waypoints
@param connection
@param trackPointsTableName
@param isH2 set true if it's an H2 database
@return
@thro... | java | public static PreparedStatement createTrackPointsTable(Connection connection, String trackPointsTableName,boolean isH2) throws SQLException {
try (Statement stmt = connection.createStatement()) {
StringBuilder sb = new StringBuilder("CREATE TABLE ");
sb.append(trackPointsTableName).appen... | [
"public",
"static",
"PreparedStatement",
"createTrackPointsTable",
"(",
"Connection",
"connection",
",",
"String",
"trackPointsTableName",
",",
"boolean",
"isH2",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"Statement",
"stmt",
"=",
"connection",
".",
"createState... | Create the track points table to store the track waypoints
@param connection
@param trackPointsTableName
@param isH2 set true if it's an H2 database
@return
@throws SQLException | [
"Create",
"the",
"track",
"points",
"table",
"to",
"store",
"the",
"track",
"waypoints"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXTablesFactory.java#L277-L320 |
milaboratory/milib | src/main/java/com/milaboratory/core/sequence/AminoAcidSequence.java | AminoAcidSequence.getTriplet | public static int getTriplet(NucleotideSequence nSequence, int tripletStart) {
"""
Extracts {@literal int} representation of triplet starting from specified position (see implementation for
details).
@param nSequence nucleotide sequence
@param tripletStart position of first nucleotide of triplet
@return {... | java | public static int getTriplet(NucleotideSequence nSequence, int tripletStart) {
int triplet = (nSequence.codeAt(tripletStart) << 4) |
(nSequence.codeAt(tripletStart + 1) << 2) |
nSequence.codeAt(tripletStart + 2);
return triplet;
} | [
"public",
"static",
"int",
"getTriplet",
"(",
"NucleotideSequence",
"nSequence",
",",
"int",
"tripletStart",
")",
"{",
"int",
"triplet",
"=",
"(",
"nSequence",
".",
"codeAt",
"(",
"tripletStart",
")",
"<<",
"4",
")",
"|",
"(",
"nSequence",
".",
"codeAt",
"... | Extracts {@literal int} representation of triplet starting from specified position (see implementation for
details).
@param nSequence nucleotide sequence
@param tripletStart position of first nucleotide of triplet
@return {@literal int} representation of triplet | [
"Extracts",
"{",
"@literal",
"int",
"}",
"representation",
"of",
"triplet",
"starting",
"from",
"specified",
"position",
"(",
"see",
"implementation",
"for",
"details",
")",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/sequence/AminoAcidSequence.java#L109-L114 |
duracloud/duracloud | s3storageprovider/src/main/java/org/duracloud/s3task/streaminghls/BaseHlsTaskRunner.java | BaseHlsTaskRunner.checkThatStreamingServiceIsEnabled | protected void checkThatStreamingServiceIsEnabled(String spaceId, String taskName) {
"""
Determines if a streaming distribution exists for a given space
@throws UnsupportedTaskException if no distribution exists
"""
// Verify that streaming is enabled
Map<String, String> spaceProperties = s3... | java | protected void checkThatStreamingServiceIsEnabled(String spaceId, String taskName) {
// Verify that streaming is enabled
Map<String, String> spaceProperties = s3Provider.getSpaceProperties(spaceId);
if (!spaceProperties.containsKey(HLS_STREAMING_HOST_PROP)) {
throw new UnsupportedTas... | [
"protected",
"void",
"checkThatStreamingServiceIsEnabled",
"(",
"String",
"spaceId",
",",
"String",
"taskName",
")",
"{",
"// Verify that streaming is enabled",
"Map",
"<",
"String",
",",
"String",
">",
"spaceProperties",
"=",
"s3Provider",
".",
"getSpaceProperties",
"(... | Determines if a streaming distribution exists for a given space
@throws UnsupportedTaskException if no distribution exists | [
"Determines",
"if",
"a",
"streaming",
"distribution",
"exists",
"for",
"a",
"given",
"space"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/s3storageprovider/src/main/java/org/duracloud/s3task/streaminghls/BaseHlsTaskRunner.java#L181-L192 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.loadBitmap | public static Bitmap loadBitmap(String fileName, int minW, int minH) throws ImageLoadException {
"""
Loading bitmap with scaling
@param fileName Image file name
@param minW minimal width
@param minH minimal height
@return loaded bitmap (always not null)
@throws ImageLoadException if it is unable to ... | java | public static Bitmap loadBitmap(String fileName, int minW, int minH) throws ImageLoadException {
return loadBitmapOptimized(new FileSource(fileName), minW, minH);
} | [
"public",
"static",
"Bitmap",
"loadBitmap",
"(",
"String",
"fileName",
",",
"int",
"minW",
",",
"int",
"minH",
")",
"throws",
"ImageLoadException",
"{",
"return",
"loadBitmapOptimized",
"(",
"new",
"FileSource",
"(",
"fileName",
")",
",",
"minW",
",",
"minH",
... | Loading bitmap with scaling
@param fileName Image file name
@param minW minimal width
@param minH minimal height
@return loaded bitmap (always not null)
@throws ImageLoadException if it is unable to load file | [
"Loading",
"bitmap",
"with",
"scaling"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L85-L87 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.doLike | private ZealotKhala doLike(String prefix, String field, Object value, boolean match, boolean positive) {
"""
执行生成like模糊查询SQL片段的方法.
@param prefix 前缀
@param field 数据库字段
@param value 值
@param match 是否匹配
@param positive true则表示是like,否则是not like
@return ZealotKhala实例的当前实例
"""
if (match) {
... | java | private ZealotKhala doLike(String prefix, String field, Object value, boolean match, boolean positive) {
if (match) {
String suffix = positive ? ZealotConst.LIKE_KEY : ZealotConst.NOT_LIKE_KEY;
SqlInfoBuilder.newInstace(this.source.setPrefix(prefix).setSuffix(suffix)).buildLikeSql(field,... | [
"private",
"ZealotKhala",
"doLike",
"(",
"String",
"prefix",
",",
"String",
"field",
",",
"Object",
"value",
",",
"boolean",
"match",
",",
"boolean",
"positive",
")",
"{",
"if",
"(",
"match",
")",
"{",
"String",
"suffix",
"=",
"positive",
"?",
"ZealotConst... | 执行生成like模糊查询SQL片段的方法.
@param prefix 前缀
@param field 数据库字段
@param value 值
@param match 是否匹配
@param positive true则表示是like,否则是not like
@return ZealotKhala实例的当前实例 | [
"执行生成like模糊查询SQL片段的方法",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L392-L399 |
iobeam/iobeam-client-java | src/main/java/com/iobeam/api/client/Iobeam.java | Iobeam.addDataMapToSeries | @Deprecated
public boolean addDataMapToSeries(String[] seriesNames, DataPoint[] points) {
"""
Adds a list of data points to a list of series in the data store. This is essentially a 'zip'
operation on the points and series names, where the first point is put in the first series,
the second point in the secon... | java | @Deprecated
public boolean addDataMapToSeries(String[] seriesNames, DataPoint[] points) {
if (seriesNames == null || points == null || points.length != seriesNames.length) {
return false;
}
synchronized (dataStoreLock) {
for (int i = 0; i < seriesNames.length; i++) {... | [
"@",
"Deprecated",
"public",
"boolean",
"addDataMapToSeries",
"(",
"String",
"[",
"]",
"seriesNames",
",",
"DataPoint",
"[",
"]",
"points",
")",
"{",
"if",
"(",
"seriesNames",
"==",
"null",
"||",
"points",
"==",
"null",
"||",
"points",
".",
"length",
"!=",... | Adds a list of data points to a list of series in the data store. This is essentially a 'zip'
operation on the points and series names, where the first point is put in the first series,
the second point in the second series, etc. Both lists MUST be the same size.
@param points List of DataPoints to be added
@para... | [
"Adds",
"a",
"list",
"of",
"data",
"points",
"to",
"a",
"list",
"of",
"series",
"in",
"the",
"data",
"store",
".",
"This",
"is",
"essentially",
"a",
"zip",
"operation",
"on",
"the",
"points",
"and",
"series",
"names",
"where",
"the",
"first",
"point",
... | train | https://github.com/iobeam/iobeam-client-java/blob/06e7aeb2a313503392358a3671de7d28628d0e33/src/main/java/com/iobeam/api/client/Iobeam.java#L771-L783 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/internal/api/HttpApiUtil.java | HttpApiUtil.throwResponse | public static <T> T throwResponse(RequestContext ctx, HttpStatus status, String message) {
"""
Throws a newly created {@link HttpResponseException} with the specified {@link HttpStatus} and
{@code message}.
"""
throw HttpResponseException.of(newResponse(ctx, status, message));
} | java | public static <T> T throwResponse(RequestContext ctx, HttpStatus status, String message) {
throw HttpResponseException.of(newResponse(ctx, status, message));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"throwResponse",
"(",
"RequestContext",
"ctx",
",",
"HttpStatus",
"status",
",",
"String",
"message",
")",
"{",
"throw",
"HttpResponseException",
".",
"of",
"(",
"newResponse",
"(",
"ctx",
",",
"status",
",",
"message"... | Throws a newly created {@link HttpResponseException} with the specified {@link HttpStatus} and
{@code message}. | [
"Throws",
"a",
"newly",
"created",
"{"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/api/HttpApiUtil.java#L70-L72 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java | DockerAssemblyManager.getAssemblyFiles | public AssemblyFiles getAssemblyFiles(String name, BuildImageConfiguration buildConfig, MojoParameters mojoParams, Logger log)
throws InvalidAssemblerConfigurationException, ArchiveCreationException, AssemblyFormattingException, MojoExecutionException {
"""
Extract all files with a tracking archiver. T... | java | public AssemblyFiles getAssemblyFiles(String name, BuildImageConfiguration buildConfig, MojoParameters mojoParams, Logger log)
throws InvalidAssemblerConfigurationException, ArchiveCreationException, AssemblyFormattingException, MojoExecutionException {
BuildDirs buildDirs = createBuildDirs(name, m... | [
"public",
"AssemblyFiles",
"getAssemblyFiles",
"(",
"String",
"name",
",",
"BuildImageConfiguration",
"buildConfig",
",",
"MojoParameters",
"mojoParams",
",",
"Logger",
"log",
")",
"throws",
"InvalidAssemblerConfigurationException",
",",
"ArchiveCreationException",
",",
"As... | Extract all files with a tracking archiver. These can be used to track changes in the filesystem and triggering
a rebuild of the image if needed ('docker:watch') | [
"Extract",
"all",
"files",
"with",
"a",
"tracking",
"archiver",
".",
"These",
"can",
"be",
"used",
"to",
"track",
"changes",
"in",
"the",
"filesystem",
"and",
"triggering",
"a",
"rebuild",
"of",
"the",
"image",
"if",
"needed",
"(",
"docker",
":",
"watch",
... | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java#L240-L259 |
LearnLib/learnlib | algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java | ObservationTree.addTrace | public void addTrace(final S state, final ADTNode<S, I, O> adtNode) {
"""
See {@link #addState(Object, Word, Object)}. Convenience method that stores all information that the traces of
the given {@link ADTNode} holds.
@param state
the hypothesis state for which information should be stored
@param adtNode
th... | java | public void addTrace(final S state, final ADTNode<S, I, O> adtNode) {
final FastMealyState<O> internalState = this.nodeToObservationMap.get(state);
ADTNode<S, I, O> adsIter = adtNode;
while (adsIter != null) {
final Pair<Word<I>, Word<O>> trace = ADTUtil.buildTraceForNode(adsIter)... | [
"public",
"void",
"addTrace",
"(",
"final",
"S",
"state",
",",
"final",
"ADTNode",
"<",
"S",
",",
"I",
",",
"O",
">",
"adtNode",
")",
"{",
"final",
"FastMealyState",
"<",
"O",
">",
"internalState",
"=",
"this",
".",
"nodeToObservationMap",
".",
"get",
... | See {@link #addState(Object, Word, Object)}. Convenience method that stores all information that the traces of
the given {@link ADTNode} holds.
@param state
the hypothesis state for which information should be stored
@param adtNode
the {@link ADTNode} whose traces should be stored | [
"See",
"{",
"@link",
"#addState",
"(",
"Object",
"Word",
"Object",
")",
"}",
".",
"Convenience",
"method",
"that",
"stores",
"all",
"information",
"that",
"the",
"traces",
"of",
"the",
"given",
"{",
"@link",
"ADTNode",
"}",
"holds",
"."
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/model/ObservationTree.java#L155-L167 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/TemplatesApi.java | TemplatesApi.getPages | public PageImages getPages(String accountId, String templateId, String documentId) throws ApiException {
"""
Returns document page image(s) based on input.
@param accountId The external account number (int) or account ID Guid. (required)
@param templateId The ID of the template being accessed. (required)
@par... | java | public PageImages getPages(String accountId, String templateId, String documentId) throws ApiException {
return getPages(accountId, templateId, documentId, null);
} | [
"public",
"PageImages",
"getPages",
"(",
"String",
"accountId",
",",
"String",
"templateId",
",",
"String",
"documentId",
")",
"throws",
"ApiException",
"{",
"return",
"getPages",
"(",
"accountId",
",",
"templateId",
",",
"documentId",
",",
"null",
")",
";",
"... | Returns document page image(s) based on input.
@param accountId The external account number (int) or account ID Guid. (required)
@param templateId The ID of the template being accessed. (required)
@param documentId The ID of the document being accessed. (required)
@return PageImages | [
"Returns",
"document",
"page",
"image",
"(",
"s",
")",
"based",
"on",
"input",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/TemplatesApi.java#L1787-L1789 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/utils/AnnotationUtils.java | AnnotationUtils.getClassAnnotation | @Deprecated
public static <A> A getClassAnnotation(Object object, Class<A> annotationClass) {
"""
Searches for a class annotation. All inheritance tree is analysed.
@deprecated As of 3.1, replaced by {@link #getAnnotation(Object,Class)}
"""
return (A) getAnnotation(object, (Class<? extends Annotation... | java | @Deprecated
public static <A> A getClassAnnotation(Object object, Class<A> annotationClass) {
return (A) getAnnotation(object, (Class<? extends Annotation>) annotationClass);
} | [
"@",
"Deprecated",
"public",
"static",
"<",
"A",
">",
"A",
"getClassAnnotation",
"(",
"Object",
"object",
",",
"Class",
"<",
"A",
">",
"annotationClass",
")",
"{",
"return",
"(",
"A",
")",
"getAnnotation",
"(",
"object",
",",
"(",
"Class",
"<",
"?",
"e... | Searches for a class annotation. All inheritance tree is analysed.
@deprecated As of 3.1, replaced by {@link #getAnnotation(Object,Class)} | [
"Searches",
"for",
"a",
"class",
"annotation",
".",
"All",
"inheritance",
"tree",
"is",
"analysed",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/utils/AnnotationUtils.java#L67-L70 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java | DocumentSubscriptions.getSubscriptionWorker | public <T> SubscriptionWorker<T> getSubscriptionWorker(Class<T> clazz, SubscriptionWorkerOptions options) {
"""
It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch sizes... | java | public <T> SubscriptionWorker<T> getSubscriptionWorker(Class<T> clazz, SubscriptionWorkerOptions options) {
return getSubscriptionWorker(clazz, options, null);
} | [
"public",
"<",
"T",
">",
"SubscriptionWorker",
"<",
"T",
">",
"getSubscriptionWorker",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"SubscriptionWorkerOptions",
"options",
")",
"{",
"return",
"getSubscriptionWorker",
"(",
"clazz",
",",
"options",
",",
"null",
")... | It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client
needs to acknowledge that batch has been processed. The acknowledgment is ... | [
"It",
"opens",
"a",
"subscription",
"and",
"starts",
"pulling",
"documents",
"since",
"a",
"last",
"processed",
"document",
"for",
"that",
"subscription",
".",
"The",
"connection",
"options",
"determine",
"client",
"and",
"server",
"cooperation",
"rules",
"like",
... | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L209-L211 |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/output/AbstractOutputWriter.java | AbstractOutputWriter.getIntSetting | protected int getIntSetting(String name, int defaultValue) throws IllegalArgumentException {
"""
Convert value of this setting to a Java <b>int</b>.
If the property is not found, the <code>defaultValue</code> is returned. If the property is not an int, an exception is thrown.
@param name name of the ... | java | protected int getIntSetting(String name, int defaultValue) throws IllegalArgumentException {
if (settings.containsKey(name)) {
String value = settings.get(name).toString();
try {
return Integer.parseInt(value);
} catch (Exception e) {
throw ne... | [
"protected",
"int",
"getIntSetting",
"(",
"String",
"name",
",",
"int",
"defaultValue",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"settings",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"String",
"value",
"=",
"settings",
".",
"get",
"("... | Convert value of this setting to a Java <b>int</b>.
If the property is not found, the <code>defaultValue</code> is returned. If the property is not an int, an exception is thrown.
@param name name of the property
@param defaultValue default value if the property is not defined.
@return int value of the proper... | [
"Convert",
"value",
"of",
"this",
"setting",
"to",
"a",
"Java",
"<b",
">",
"int<",
"/",
"b",
">",
"."
] | train | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/AbstractOutputWriter.java#L107-L119 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.integerMax | public static <Key, Value> Aggregation<Key, Integer, Integer> integerMax() {
"""
Returns an aggregation to find the integer maximum of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT MAX(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return... | java | public static <Key, Value> Aggregation<Key, Integer, Integer> integerMax() {
return new AggregationAdapter(new IntegerMaxAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"Integer",
",",
"Integer",
">",
"integerMax",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"IntegerMaxAggregation",
"<",
"Key",
",",
"Value",
">",
"(",
... | Returns an aggregation to find the integer maximum of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT MAX(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the maximum value over all supplied values | [
"Returns",
"an",
"aggregation",
"to",
"find",
"the",
"integer",
"maximum",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELECT",
"MAX",
"(",
"value",
")",
"FROM",
"x<",
"/",
"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L138-L140 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/serializer/ParameterSerializer.java | ParameterSerializer.parseArrayCollection | @SuppressWarnings("rawtypes")
protected ISFSArray parseArrayCollection(GetterMethodCover method,
Collection collection) {
"""
Serialize collection of array to a SFSArray
@param method structure of getter method
@param collection collection of objects
@return the SFSArray
"""
ISFSAr... | java | @SuppressWarnings("rawtypes")
protected ISFSArray parseArrayCollection(GetterMethodCover method,
Collection collection) {
ISFSArray result = new SFSArray();
SFSDataType dataType = ParamTypeParser
.getParamType(method.getGenericType());
Class<?> type = method.getGe... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"protected",
"ISFSArray",
"parseArrayCollection",
"(",
"GetterMethodCover",
"method",
",",
"Collection",
"collection",
")",
"{",
"ISFSArray",
"result",
"=",
"new",
"SFSArray",
"(",
")",
";",
"SFSDataType",
"dataType... | Serialize collection of array to a SFSArray
@param method structure of getter method
@param collection collection of objects
@return the SFSArray | [
"Serialize",
"collection",
"of",
"array",
"to",
"a",
"SFSArray"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/serializer/ParameterSerializer.java#L368-L392 |
dropwizard/metrics | metrics-healthchecks/src/main/java/com/codahale/metrics/health/HealthCheckRegistry.java | HealthCheckRegistry.runHealthChecks | public SortedMap<String, HealthCheck.Result> runHealthChecks(ExecutorService executor) {
"""
Runs the registered health checks in parallel and returns a map of the results.
@param executor object to launch and track health checks progress
@return a map of the health check results
"""
return runHeal... | java | public SortedMap<String, HealthCheck.Result> runHealthChecks(ExecutorService executor) {
return runHealthChecks(executor, HealthCheckFilter.ALL);
} | [
"public",
"SortedMap",
"<",
"String",
",",
"HealthCheck",
".",
"Result",
">",
"runHealthChecks",
"(",
"ExecutorService",
"executor",
")",
"{",
"return",
"runHealthChecks",
"(",
"executor",
",",
"HealthCheckFilter",
".",
"ALL",
")",
";",
"}"
] | Runs the registered health checks in parallel and returns a map of the results.
@param executor object to launch and track health checks progress
@return a map of the health check results | [
"Runs",
"the",
"registered",
"health",
"checks",
"in",
"parallel",
"and",
"returns",
"a",
"map",
"of",
"the",
"results",
"."
] | train | https://github.com/dropwizard/metrics/blob/3c6105a0b9b4416c59e16b6b841b123052d6f57d/metrics-healthchecks/src/main/java/com/codahale/metrics/health/HealthCheckRegistry.java#L197-L199 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldInfo.java | FieldInfo.setData | public int setData(Object vpData, boolean bDisplayOption, int iMoveMode) {
"""
Move the physical binary data to this field.
(Must be the same physical type... setText makes sure of that)
After seting the data, I call the doRecordChange() method of the record if I changed.
@param vpData The data to set the field... | java | public int setData(Object vpData, boolean bDisplayOption, int iMoveMode)
{
boolean bModified = true;
if ((m_data == vpData) || ((m_data != null) && (m_data.equals(vpData))))
bModified = false;
m_data = vpData; // Set the data
if (bDisplayOption)
this.displa... | [
"public",
"int",
"setData",
"(",
"Object",
"vpData",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"boolean",
"bModified",
"=",
"true",
";",
"if",
"(",
"(",
"m_data",
"==",
"vpData",
")",
"||",
"(",
"(",
"m_data",
"!=",
"null",
"... | Move the physical binary data to this field.
(Must be the same physical type... setText makes sure of that)
After seting the data, I call the doRecordChange() method of the record if I changed.
@param vpData The data to set the field to.
@param bDisplayOption Display the data on the screen if true (call displayField())... | [
"Move",
"the",
"physical",
"binary",
"data",
"to",
"this",
"field",
".",
"(",
"Must",
"be",
"the",
"same",
"physical",
"type",
"...",
"setText",
"makes",
"sure",
"of",
"that",
")",
"After",
"seting",
"the",
"data",
"I",
"call",
"the",
"doRecordChange",
"... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldInfo.java#L244-L264 |
JDBDT/jdbdt | src/main/java/org/jdbdt/JDBDT.java | JDBDT.assertEquals | public static void assertEquals(DataSet expected, DataSet actual) throws DBAssertionError {
"""
Assert that two data sets are equivalent.
<p>
Note that the executed data set comparison is insensitive
to the order of rows in both data sets.
</p>
@param expected Expected data.
@param actual Actual data.
@... | java | public static void assertEquals(DataSet expected, DataSet actual) throws DBAssertionError {
DBAssert.dataSetAssertion(CallInfo.create(), expected, actual);
} | [
"public",
"static",
"void",
"assertEquals",
"(",
"DataSet",
"expected",
",",
"DataSet",
"actual",
")",
"throws",
"DBAssertionError",
"{",
"DBAssert",
".",
"dataSetAssertion",
"(",
"CallInfo",
".",
"create",
"(",
")",
",",
"expected",
",",
"actual",
")",
";",
... | Assert that two data sets are equivalent.
<p>
Note that the executed data set comparison is insensitive
to the order of rows in both data sets.
</p>
@param expected Expected data.
@param actual Actual data.
@throws DBAssertionError if the assertion fails.
@see #assertEquals(String,DataSet,DataSet) | [
"Assert",
"that",
"two",
"data",
"sets",
"are",
"equivalent",
"."
] | train | https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/JDBDT.java#L350-L352 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Entity.java | Entity.setEntity_attributes | public void setEntity_attributes(int i, EntityAttribute v) {
"""
indexed setter for entity_attributes - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (Entity_Type.featOkTst && ((Entity_Type)jcasType).casFeat_entity_attributes == null)
... | java | public void setEntity_attributes(int i, EntityAttribute v) {
if (Entity_Type.featOkTst && ((Entity_Type)jcasType).casFeat_entity_attributes == null)
jcasType.jcas.throwFeatMissing("entity_attributes", "de.julielab.jules.types.ace.Entity");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(add... | [
"public",
"void",
"setEntity_attributes",
"(",
"int",
"i",
",",
"EntityAttribute",
"v",
")",
"{",
"if",
"(",
"Entity_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Entity_Type",
")",
"jcasType",
")",
".",
"casFeat_entity_attributes",
"==",
"null",
")",
"jcasType",
... | indexed setter for entity_attributes - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"entity_attributes",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Entity.java#L226-L230 |
liferay/com-liferay-commerce | commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java | CPDefinitionVirtualSettingPersistenceImpl.findByUUID_G | @Override
public CPDefinitionVirtualSetting findByUUID_G(String uuid, long groupId)
throws NoSuchCPDefinitionVirtualSettingException {
"""
Returns the cp definition virtual setting where uuid = ? and groupId = ? or throws a {@link NoSuchCPDefinitionVirtualSettingException} if it could not be found.
@... | java | @Override
public CPDefinitionVirtualSetting findByUUID_G(String uuid, long groupId)
throws NoSuchCPDefinitionVirtualSettingException {
CPDefinitionVirtualSetting cpDefinitionVirtualSetting = fetchByUUID_G(uuid,
groupId);
if (cpDefinitionVirtualSetting == null) {
StringBundler msg = new StringBundler(6);
... | [
"@",
"Override",
"public",
"CPDefinitionVirtualSetting",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchCPDefinitionVirtualSettingException",
"{",
"CPDefinitionVirtualSetting",
"cpDefinitionVirtualSetting",
"=",
"fetchByUUID_G",
"(",
"uui... | Returns the cp definition virtual setting where uuid = ? and groupId = ? or throws a {@link NoSuchCPDefinitionVirtualSettingException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp definition virtual setting
@throws NoSuchCPDefinitionVirtualSettingException ... | [
"Returns",
"the",
"cp",
"definition",
"virtual",
"setting",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPDefinitionVirtualSettingException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java#L675-L702 |
Blazebit/blaze-utils | blaze-ee-utils/src/main/java/com/blazebit/cdi/CdiUtils.java | CdiUtils.getBean | public static <T> T getBean(Class<T> clazz, Annotation... annotations) {
"""
Retrieves the bean for the given class from the bean manager available
via JNDI qualified with the given annotation(s).
@param <T> The type of the bean to look for
@param clazz The class of the bean to look ... | java | public static <T> T getBean(Class<T> clazz, Annotation... annotations) {
return getBean(getBeanManager(), clazz, annotations);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getBean",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Annotation",
"...",
"annotations",
")",
"{",
"return",
"getBean",
"(",
"getBeanManager",
"(",
")",
",",
"clazz",
",",
"annotations",
")",
";",
"}"
] | Retrieves the bean for the given class from the bean manager available
via JNDI qualified with the given annotation(s).
@param <T> The type of the bean to look for
@param clazz The class of the bean to look for
@param annotationClasses The qualifiers the bean for the given class must have
@re... | [
"Retrieves",
"the",
"bean",
"for",
"the",
"given",
"class",
"from",
"the",
"bean",
"manager",
"available",
"via",
"JNDI",
"qualified",
"with",
"the",
"given",
"annotation",
"(",
"s",
")",
"."
] | train | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-ee-utils/src/main/java/com/blazebit/cdi/CdiUtils.java#L93-L95 |
bwkimmel/java-util | src/main/java/ca/eandb/util/sql/DbUtil.java | DbUtil.queryBinary | public static byte[] queryBinary(DataSource ds, byte[] def, String query, Object... param) throws SQLException {
"""
Runs a SQL query that returns a single byte array value.
@param ds The <code>DataSource</code> against which to run the query.
@param def The default value to return if the query returns no result... | java | public static byte[] queryBinary(DataSource ds, byte[] def, String query, Object... param) throws SQLException {
Connection con = null;
try {
con = ds.getConnection();
return queryBinary(con, def, query, param);
} finally {
close(con);
}
} | [
"public",
"static",
"byte",
"[",
"]",
"queryBinary",
"(",
"DataSource",
"ds",
",",
"byte",
"[",
"]",
"def",
",",
"String",
"query",
",",
"Object",
"...",
"param",
")",
"throws",
"SQLException",
"{",
"Connection",
"con",
"=",
"null",
";",
"try",
"{",
"c... | Runs a SQL query that returns a single byte array value.
@param ds The <code>DataSource</code> against which to run the query.
@param def The default value to return if the query returns no results.
@param query The SQL query to run.
@param param The parameters to the SQL query.
@return The value returned by the query,... | [
"Runs",
"a",
"SQL",
"query",
"that",
"returns",
"a",
"single",
"byte",
"array",
"value",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/sql/DbUtil.java#L213-L221 |
HubSpot/Singularity | SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java | SingularityClient.getTaskState | public Optional<SingularityTaskState> getTaskState(String requestId, String runId) {
"""
Get the current state of a task by its run IDg
@param requestId
The request ID to search for the specified runId
@param runId
The run ID to search for
@return
A {@link SingularityTaskState} if the task was found amon... | java | public Optional<SingularityTaskState> getTaskState(String requestId, String runId) {
final Function<String, String> requestUri = (host) -> String.format(TRACK_BY_RUN_ID_FORMAT, getApiBase(host), requestId, runId);
return getSingle(requestUri, "track by task id", String.format("%s-%s", requestId, runId), Singula... | [
"public",
"Optional",
"<",
"SingularityTaskState",
">",
"getTaskState",
"(",
"String",
"requestId",
",",
"String",
"runId",
")",
"{",
"final",
"Function",
"<",
"String",
",",
"String",
">",
"requestUri",
"=",
"(",
"host",
")",
"-",
">",
"String",
".",
"for... | Get the current state of a task by its run IDg
@param requestId
The request ID to search for the specified runId
@param runId
The run ID to search for
@return
A {@link SingularityTaskState} if the task was found among pending, active or inactive tasks | [
"Get",
"the",
"current",
"state",
"of",
"a",
"task",
"by",
"its",
"run",
"IDg"
] | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java#L1577-L1580 |
ozimov/cirneco | hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/date/IsDateWithTime.java | IsDateWithTime.hasHourMinAndSec | public static Matcher<Date> hasHourMinAndSec(final int hour, final int minute, final int second) {
"""
Creates a matcher that matches when the examined {@linkplain Date} has the given values <code>hour</code> in a 24
hours clock period, <code>minute</code> and <code>sec</code>.
"""
return new IsDateWi... | java | public static Matcher<Date> hasHourMinAndSec(final int hour, final int minute, final int second) {
return new IsDateWithTime(hour, minute, second, null);
} | [
"public",
"static",
"Matcher",
"<",
"Date",
">",
"hasHourMinAndSec",
"(",
"final",
"int",
"hour",
",",
"final",
"int",
"minute",
",",
"final",
"int",
"second",
")",
"{",
"return",
"new",
"IsDateWithTime",
"(",
"hour",
",",
"minute",
",",
"second",
",",
"... | Creates a matcher that matches when the examined {@linkplain Date} has the given values <code>hour</code> in a 24
hours clock period, <code>minute</code> and <code>sec</code>. | [
"Creates",
"a",
"matcher",
"that",
"matches",
"when",
"the",
"examined",
"{"
] | train | https://github.com/ozimov/cirneco/blob/78ad782da0a2256634cfbebb2f97ed78c993b999/hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/date/IsDateWithTime.java#L108-L110 |
wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getDoubleWithDefault | @Override
public Double getDoubleWithDefault(final String key, Double defaultValue) {
"""
Get a Double property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value can... | java | @Override
public Double getDoubleWithDefault(final String key, Double defaultValue) {
return retrieve(new Callable<Double>() {
@Override
public Double call() throws Exception {
return configuration.getDouble(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"Double",
"getDoubleWithDefault",
"(",
"final",
"String",
"key",
",",
"Double",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"Double",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Double",
"call",... | Get a Double property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be found in
configuration.
@return the value of the key or the default value. | [
"Get",
"a",
"Double",
"property",
"or",
"a",
"default",
"value",
"when",
"property",
"cannot",
"be",
"found",
"in",
"any",
"configuration",
"file",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L193-L201 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/model/ModelHandler.java | ModelHandler.findModelIF | public Object findModelIF(Object keyValue, HttpServletRequest request) throws Exception {
"""
obtain a existed Model instance by his primtive key.
@param keyValue
primtive key
@param request
@return Model
@throws java.lang.Exception
"""
return findModelByKey((String) keyValue, request); // for old ... | java | public Object findModelIF(Object keyValue, HttpServletRequest request) throws Exception {
return findModelByKey((String) keyValue, request); // for old version
} | [
"public",
"Object",
"findModelIF",
"(",
"Object",
"keyValue",
",",
"HttpServletRequest",
"request",
")",
"throws",
"Exception",
"{",
"return",
"findModelByKey",
"(",
"(",
"String",
")",
"keyValue",
",",
"request",
")",
";",
"// for old version\r",
"}"
] | obtain a existed Model instance by his primtive key.
@param keyValue
primtive key
@param request
@return Model
@throws java.lang.Exception | [
"obtain",
"a",
"existed",
"Model",
"instance",
"by",
"his",
"primtive",
"key",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/model/ModelHandler.java#L126-L128 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java | Launcher.createMainMethodRunner | protected MainMethodRunner createMainMethodRunner(String mainClass, String[] args,
ClassLoader classLoader) {
"""
Create the {@code MainMethodRunner} used to launch the application.
@param mainClass the main class
@param args the incoming arguments
@param classLoader the classloader
@return the main method ... | java | protected MainMethodRunner createMainMethodRunner(String mainClass, String[] args,
ClassLoader classLoader) {
return new MainMethodRunner(mainClass, args);
} | [
"protected",
"MainMethodRunner",
"createMainMethodRunner",
"(",
"String",
"mainClass",
",",
"String",
"[",
"]",
"args",
",",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"new",
"MainMethodRunner",
"(",
"mainClass",
",",
"args",
")",
";",
"}"
] | Create the {@code MainMethodRunner} used to launch the application.
@param mainClass the main class
@param args the incoming arguments
@param classLoader the classloader
@return the main method runner | [
"Create",
"the",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java#L97-L100 |
talsma-ict/umldoclet | src/main/java/nl/talsmasoftware/umldoclet/javadoc/UMLFactory.java | UMLFactory.createType | private Type createType(Namespace containingPackage, TypeElement type) {
"""
Creates an 'empty' type (i.e. without any fields, constructors or methods)
@param containingPackage The containing package of the type (optional, will be obtained from typeElement if null).
@param type The type element to... | java | private Type createType(Namespace containingPackage, TypeElement type) {
requireNonNull(type, "Type element is <null>.");
if (containingPackage == null) containingPackage = packageOf(type);
return new Type(containingPackage, typeClassificationOf(type), TypeNameVisitor.INSTANCE.visit(type.asType(... | [
"private",
"Type",
"createType",
"(",
"Namespace",
"containingPackage",
",",
"TypeElement",
"type",
")",
"{",
"requireNonNull",
"(",
"type",
",",
"\"Type element is <null>.\"",
")",
";",
"if",
"(",
"containingPackage",
"==",
"null",
")",
"containingPackage",
"=",
... | Creates an 'empty' type (i.e. without any fields, constructors or methods)
@param containingPackage The containing package of the type (optional, will be obtained from typeElement if null).
@param type The type element to create a Type object for.
@return The empty Type object. | [
"Creates",
"an",
"empty",
"type",
"(",
"i",
".",
"e",
".",
"without",
"any",
"fields",
"constructors",
"or",
"methods",
")"
] | train | https://github.com/talsma-ict/umldoclet/blob/373b23f2646603fddca4a495e9eccbb4a4491fdf/src/main/java/nl/talsmasoftware/umldoclet/javadoc/UMLFactory.java#L306-L310 |
craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.shortToBytes | static public int shortToBytes(short s, byte[] buffer, int index) {
"""
This function converts a short into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param s The short to be converted.
@param buffer The byte array.
@param index The index in the array to b... | java | static public int shortToBytes(short s, byte[] buffer, int index) {
int length = 2;
for (int i = 0; i < length; i++) {
buffer[index + length - i - 1] = (byte) (s >> (i * 8));
}
return length;
} | [
"static",
"public",
"int",
"shortToBytes",
"(",
"short",
"s",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"2",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
... | This function converts a short into its corresponding byte format and inserts
it into the specified buffer at the specified index.
@param s The short to be converted.
@param buffer The byte array.
@param index The index in the array to begin inserting bytes.
@return The number of bytes inserted. | [
"This",
"function",
"converts",
"a",
"short",
"into",
"its",
"corresponding",
"byte",
"format",
"and",
"inserts",
"it",
"into",
"the",
"specified",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L128-L134 |
grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java | GroovyPagesUriSupport.getNoSuffixViewURI | public String getNoSuffixViewURI(String controllerName, String viewName) {
"""
Obtains a view URI of the given controller name and view name without the suffix
@param controllerName The name of the controller
@param viewName The name of the view
@return The view URI
"""
FastStringWriter buf = new Fa... | java | public String getNoSuffixViewURI(String controllerName, String viewName) {
FastStringWriter buf = new FastStringWriter();
return getViewURIInternal(controllerName, viewName, buf, false);
} | [
"public",
"String",
"getNoSuffixViewURI",
"(",
"String",
"controllerName",
",",
"String",
"viewName",
")",
"{",
"FastStringWriter",
"buf",
"=",
"new",
"FastStringWriter",
"(",
")",
";",
"return",
"getViewURIInternal",
"(",
"controllerName",
",",
"viewName",
",",
"... | Obtains a view URI of the given controller name and view name without the suffix
@param controllerName The name of the controller
@param viewName The name of the view
@return The view URI | [
"Obtains",
"a",
"view",
"URI",
"of",
"the",
"given",
"controller",
"name",
"and",
"view",
"name",
"without",
"the",
"suffix"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L209-L213 |
samskivert/samskivert | src/main/java/com/samskivert/util/HashIntSet.java | HashIntSet.getBucketCount | protected static int getBucketCount (int capacity, float loadFactor) {
"""
Computes the number of buckets needed to provide the given capacity with the specified load
factor.
"""
int size = (int)(capacity / loadFactor);
int highest = Integer.highestOneBit(size);
return Math.max((size =... | java | protected static int getBucketCount (int capacity, float loadFactor)
{
int size = (int)(capacity / loadFactor);
int highest = Integer.highestOneBit(size);
return Math.max((size == highest) ? highest : (highest << 1), MIN_BUCKET_COUNT);
} | [
"protected",
"static",
"int",
"getBucketCount",
"(",
"int",
"capacity",
",",
"float",
"loadFactor",
")",
"{",
"int",
"size",
"=",
"(",
"int",
")",
"(",
"capacity",
"/",
"loadFactor",
")",
";",
"int",
"highest",
"=",
"Integer",
".",
"highestOneBit",
"(",
... | Computes the number of buckets needed to provide the given capacity with the specified load
factor. | [
"Computes",
"the",
"number",
"of",
"buckets",
"needed",
"to",
"provide",
"the",
"given",
"capacity",
"with",
"the",
"specified",
"load",
"factor",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntSet.java#L414-L419 |
finmath/finmath-lib | src/main/java/net/finmath/functions/LinearAlgebra.java | LinearAlgebra.solveLinearEquationLeastSquare | public static double[] solveLinearEquationLeastSquare(double[][] matrix, double[] vector) {
"""
Find a solution of the linear equation A x = b in the least square sense where
<ul>
<li>A is an n x m - matrix given as double[n][m]</li>
<li>b is an m - vector given as double[m],</li>
<li>x is an n - vector given ... | java | public static double[] solveLinearEquationLeastSquare(double[][] matrix, double[] vector) {
// We use the linear algebra package apache commons math
DecompositionSolver solver = new SingularValueDecomposition(new Array2DRowRealMatrix(matrix, false)).getSolver();
return solver.solve(new ArrayRealVector(vector)).to... | [
"public",
"static",
"double",
"[",
"]",
"solveLinearEquationLeastSquare",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"double",
"[",
"]",
"vector",
")",
"{",
"// We use the linear algebra package apache commons math",
"DecompositionSolver",
"solver",
"=",
"new",... | Find a solution of the linear equation A x = b in the least square sense where
<ul>
<li>A is an n x m - matrix given as double[n][m]</li>
<li>b is an m - vector given as double[m],</li>
<li>x is an n - vector given as double[n],</li>
</ul>
@param matrix The matrix A (left hand side of the linear equation).
@param vect... | [
"Find",
"a",
"solution",
"of",
"the",
"linear",
"equation",
"A",
"x",
"=",
"b",
"in",
"the",
"least",
"square",
"sense",
"where",
"<ul",
">",
"<li",
">",
"A",
"is",
"an",
"n",
"x",
"m",
"-",
"matrix",
"given",
"as",
"double",
"[",
"n",
"]",
"[",
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/functions/LinearAlgebra.java#L321-L325 |
lightblueseas/vintage-time | src/main/java/de/alpharogroup/date/CalculateDateExtensions.java | CalculateDateExtensions.isValidDate | public static boolean isValidDate(final String date, final String format, final boolean lenient) {
"""
Checks if the Date is valid to convert.
@param date
The Date as String
@param format
The Format for the Date to parse
@param lenient
Specify whether or not date/time interpretation is to be lenient.
@ret... | java | public static boolean isValidDate(final String date, final String format, final boolean lenient)
{
boolean isValid = true;
if (date == null || format == null || format.length() <= 0)
{
return false;
}
try
{
final DateFormat df = new SimpleDateFormat(format);
df.setLenient(lenient);
df.parse(dat... | [
"public",
"static",
"boolean",
"isValidDate",
"(",
"final",
"String",
"date",
",",
"final",
"String",
"format",
",",
"final",
"boolean",
"lenient",
")",
"{",
"boolean",
"isValid",
"=",
"true",
";",
"if",
"(",
"date",
"==",
"null",
"||",
"format",
"==",
"... | Checks if the Date is valid to convert.
@param date
The Date as String
@param format
The Format for the Date to parse
@param lenient
Specify whether or not date/time interpretation is to be lenient.
@return True if the Date is valid otherwise false. | [
"Checks",
"if",
"the",
"Date",
"is",
"valid",
"to",
"convert",
"."
] | train | https://github.com/lightblueseas/vintage-time/blob/fbf201e679d9f9b92e7b5771f3eea1413cc2e113/src/main/java/de/alpharogroup/date/CalculateDateExtensions.java#L359-L377 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/CFFFontSubset.java | CFFFontSubset.BuildSubrUsed | protected void BuildSubrUsed(int Font,int FD,int SubrOffset,int[] SubrsOffsets,HashMap hSubr,ArrayList lSubr) {
"""
Function uses ReadAsubr on the glyph used to build the LSubr & Gsubr HashMap.
The HashMap (of the lsubr only) is then scanned recursively for Lsubr & Gsubrs
calls.
@param Font the font
@param FD ... | java | protected void BuildSubrUsed(int Font,int FD,int SubrOffset,int[] SubrsOffsets,HashMap hSubr,ArrayList lSubr)
{
// Calc the Bias for the subr index
int LBias = CalcBias(SubrOffset,Font);
// For each glyph used find its GID, start & end pos
for (int i=0;i<glyphsInList.size();i++)
{
int glyph = ((Intege... | [
"protected",
"void",
"BuildSubrUsed",
"(",
"int",
"Font",
",",
"int",
"FD",
",",
"int",
"SubrOffset",
",",
"int",
"[",
"]",
"SubrsOffsets",
",",
"HashMap",
"hSubr",
",",
"ArrayList",
"lSubr",
")",
"{",
"// Calc the Bias for the subr index",
"int",
"LBias",
"="... | Function uses ReadAsubr on the glyph used to build the LSubr & Gsubr HashMap.
The HashMap (of the lsubr only) is then scanned recursively for Lsubr & Gsubrs
calls.
@param Font the font
@param FD FD array processed. 0 indicates function was called by non CID font
@param SubrOffset the offset to the subr index to calc th... | [
"Function",
"uses",
"ReadAsubr",
"on",
"the",
"glyph",
"used",
"to",
"build",
"the",
"LSubr",
"&",
"Gsubr",
"HashMap",
".",
"The",
"HashMap",
"(",
"of",
"the",
"lsubr",
"only",
")",
"is",
"then",
"scanned",
"recursively",
"for",
"Lsubr",
"&",
"Gsubrs",
"... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/CFFFontSubset.java#L530-L574 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.beginRefreshMemberSchemaAsync | public Observable<Void> beginRefreshMemberSchemaAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
"""
Refreshes a sync member database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain t... | java | public Observable<Void> beginRefreshMemberSchemaAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
return beginRefreshMemberSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).map(new Func1... | [
"public",
"Observable",
"<",
"Void",
">",
"beginRefreshMemberSchemaAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"String",
"syncMemberName",
")",
"{",
"return",
"beginRefres... | Refreshes a sync member database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hos... | [
"Refreshes",
"a",
"sync",
"member",
"database",
"schema",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L1271-L1278 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlElFunctions.java | CpnlElFunctions.externalUrl | public static String externalUrl(SlingHttpServletRequest request, String path) {
"""
Builds an external (full qualified) URL for a repository path using the LinkUtil.getURL() method.
@param request the current request (domain host hint)
@param path the repository path
@return the URL built in the context o... | java | public static String externalUrl(SlingHttpServletRequest request, String path) {
return LinkUtil.getAbsoluteUrl(request, LinkUtil.getUrl(request, path));
} | [
"public",
"static",
"String",
"externalUrl",
"(",
"SlingHttpServletRequest",
"request",
",",
"String",
"path",
")",
"{",
"return",
"LinkUtil",
".",
"getAbsoluteUrl",
"(",
"request",
",",
"LinkUtil",
".",
"getUrl",
"(",
"request",
",",
"path",
")",
")",
";",
... | Builds an external (full qualified) URL for a repository path using the LinkUtil.getURL() method.
@param request the current request (domain host hint)
@param path the repository path
@return the URL built in the context of the requested domain host | [
"Builds",
"an",
"external",
"(",
"full",
"qualified",
")",
"URL",
"for",
"a",
"repository",
"path",
"using",
"the",
"LinkUtil",
".",
"getURL",
"()",
"method",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlElFunctions.java#L209-L211 |
alibaba/Tangram-Android | tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java | BusSupport.wrapEventHandler | public static EventHandlerWrapper wrapEventHandler(@NonNull String type, String producer, @NonNull Object subscriber,
String action) {
"""
See {@link EventHandlerWrapper}
@param type The event type subcriber is interested.
@param producer The event source id subscriber is interested.
@param subscrib... | java | public static EventHandlerWrapper wrapEventHandler(@NonNull String type, String producer, @NonNull Object subscriber,
String action) {
return new EventHandlerWrapper(type, producer, subscriber, action);
} | [
"public",
"static",
"EventHandlerWrapper",
"wrapEventHandler",
"(",
"@",
"NonNull",
"String",
"type",
",",
"String",
"producer",
",",
"@",
"NonNull",
"Object",
"subscriber",
",",
"String",
"action",
")",
"{",
"return",
"new",
"EventHandlerWrapper",
"(",
"type",
... | See {@link EventHandlerWrapper}
@param type The event type subcriber is interested.
@param producer The event source id subscriber is interested.
@param subscriber Original subscriber object.
@param action The name of callback method with parameter 'TangramOp1'. If empty, the subscribe must provide a handler method nam... | [
"See",
"{"
] | train | https://github.com/alibaba/Tangram-Android/blob/caa57f54e009c8dacd34a2322d5761956ebed321/tangram/src/main/java/com/tmall/wireless/tangram/eventbus/BusSupport.java#L168-L171 |
gallandarakhneorg/afc | maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java | AbstractArakhneMojo.createArtifact | public final Artifact createArtifact(String groupId, String artifactId, String version) {
"""
Create an Jar runtime artifact from the given values.
@param groupId group id.
@param artifactId artifact id.
@param version version number.
@return the artifact
"""
return createArtifact(groupId, artifactId, ... | java | public final Artifact createArtifact(String groupId, String artifactId, String version) {
return createArtifact(groupId, artifactId, version, "runtime", "jar"); //$NON-NLS-1$ //$NON-NLS-2$
} | [
"public",
"final",
"Artifact",
"createArtifact",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
")",
"{",
"return",
"createArtifact",
"(",
"groupId",
",",
"artifactId",
",",
"version",
",",
"\"runtime\"",
",",
"\"jar\"",
")",
... | Create an Jar runtime artifact from the given values.
@param groupId group id.
@param artifactId artifact id.
@param version version number.
@return the artifact | [
"Create",
"an",
"Jar",
"runtime",
"artifact",
"from",
"the",
"given",
"values",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/maven/maventools/src/main/java/org/arakhne/maven/AbstractArakhneMojo.java#L950-L952 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/FileLocator.java | FileLocator.matchFile | private static File matchFile(File dirPath, String regex) {
"""
Internal method: performs test common to matchFileInNamedPath(String, List)
and {@link #matchFileInFilePath(String, Collection)
@param dirPath
Directory to check for named file
@param name
The name of the file to find
@return The File object i... | java | private static File matchFile(File dirPath, String regex) {
if (dirPath != null && dirPath.isDirectory()) {
List<File> fileList = FileLocator.getMatchingFiles(dirPath, regex);
for (File currentFile : fileList) {
if (currentFile.exists())
return current... | [
"private",
"static",
"File",
"matchFile",
"(",
"File",
"dirPath",
",",
"String",
"regex",
")",
"{",
"if",
"(",
"dirPath",
"!=",
"null",
"&&",
"dirPath",
".",
"isDirectory",
"(",
")",
")",
"{",
"List",
"<",
"File",
">",
"fileList",
"=",
"FileLocator",
"... | Internal method: performs test common to matchFileInNamedPath(String, List)
and {@link #matchFileInFilePath(String, Collection)
@param dirPath
Directory to check for named file
@param name
The name of the file to find
@return The File object if the file is found;
null if the dirPath is null, does not exist, or is not ... | [
"Internal",
"method",
":",
"performs",
"test",
"common",
"to",
"matchFileInNamedPath",
"(",
"String",
"List",
")",
"and",
"{",
"@link",
"#matchFileInFilePath",
"(",
"String",
"Collection",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/FileLocator.java#L202-L211 |
google/gson | gson/src/main/java/com/google/gson/Gson.java | Gson.toJson | public void toJson(Object src, Type typeOfSrc, Appendable writer) throws JsonIOException {
"""
This method serializes the specified object, including those of generic types, into its
equivalent Json representation. This method must be used if the specified object is a generic
type. For non-generic objects, use {... | java | public void toJson(Object src, Type typeOfSrc, Appendable writer) throws JsonIOException {
try {
JsonWriter jsonWriter = newJsonWriter(Streams.writerForAppendable(writer));
toJson(src, typeOfSrc, jsonWriter);
} catch (IOException e) {
throw new JsonIOException(e);
}
} | [
"public",
"void",
"toJson",
"(",
"Object",
"src",
",",
"Type",
"typeOfSrc",
",",
"Appendable",
"writer",
")",
"throws",
"JsonIOException",
"{",
"try",
"{",
"JsonWriter",
"jsonWriter",
"=",
"newJsonWriter",
"(",
"Streams",
".",
"writerForAppendable",
"(",
"writer... | This method serializes the specified object, including those of generic types, into its
equivalent Json representation. This method must be used if the specified object is a generic
type. For non-generic objects, use {@link #toJson(Object, Appendable)} instead.
@param src the object for which JSON representation is to... | [
"This",
"method",
"serializes",
"the",
"specified",
"object",
"including",
"those",
"of",
"generic",
"types",
"into",
"its",
"equivalent",
"Json",
"representation",
".",
"This",
"method",
"must",
"be",
"used",
"if",
"the",
"specified",
"object",
"is",
"a",
"ge... | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/Gson.java#L680-L687 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java | GenericUtils.putByteArray | static public WsByteBuffer[] putByteArray(WsByteBuffer[] buffers, byte[] value, BNFHeadersImpl bnfObj) {
"""
Given a wsbb[], we're adding a byte[] value to the last buffer. If
that buffer fills up, then we will allocate a new one, expand the
wsbb[] and keep going until the entire byte[] is added.
<p>
Returns t... | java | static public WsByteBuffer[] putByteArray(WsByteBuffer[] buffers, byte[] value, BNFHeadersImpl bnfObj) {
// LIDB2356-41: byte[]/offset/length support
return putByteArray(buffers, value, 0, value.length, bnfObj);
} | [
"static",
"public",
"WsByteBuffer",
"[",
"]",
"putByteArray",
"(",
"WsByteBuffer",
"[",
"]",
"buffers",
",",
"byte",
"[",
"]",
"value",
",",
"BNFHeadersImpl",
"bnfObj",
")",
"{",
"// LIDB2356-41: byte[]/offset/length support",
"return",
"putByteArray",
"(",
"buffers... | Given a wsbb[], we're adding a byte[] value to the last buffer. If
that buffer fills up, then we will allocate a new one, expand the
wsbb[] and keep going until the entire byte[] is added.
<p>
Returns the new wsbb[] (expanded if needed).
@param buffers
@param value
@param bnfObj
@return WsByteBuffer[] | [
"Given",
"a",
"wsbb",
"[]",
"we",
"re",
"adding",
"a",
"byte",
"[]",
"value",
"to",
"the",
"last",
"buffer",
".",
"If",
"that",
"buffer",
"fills",
"up",
"then",
"we",
"will",
"allocate",
"a",
"new",
"one",
"expand",
"the",
"wsbb",
"[]",
"and",
"keep"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java#L149-L152 |
tvesalainen/util | util/src/main/java/org/vesalainen/ui/ScanlineFiller.java | ScanlineFiller.floodFill | public void floodFill(int xx, int yy, int replacement) {
"""
Fills area starting at xx,yy. Area must be surrounded with replacement
color.
@param xx
@param yy
@param replacement
"""
floodFill(xx, yy, (c)->c!=replacement, replacement);
} | java | public void floodFill(int xx, int yy, int replacement)
{
floodFill(xx, yy, (c)->c!=replacement, replacement);
} | [
"public",
"void",
"floodFill",
"(",
"int",
"xx",
",",
"int",
"yy",
",",
"int",
"replacement",
")",
"{",
"floodFill",
"(",
"xx",
",",
"yy",
",",
"(",
"c",
")",
"-",
"",
">",
"c",
"!=",
"replacement",
",",
"replacement",
")",
";",
"}"
] | Fills area starting at xx,yy. Area must be surrounded with replacement
color.
@param xx
@param yy
@param replacement | [
"Fills",
"area",
"starting",
"at",
"xx",
"yy",
".",
"Area",
"must",
"be",
"surrounded",
"with",
"replacement",
"color",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/ScanlineFiller.java#L63-L66 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/math/NumberUtils.java | NumberUtils.toShort | public static short toShort(final String str, final short defaultValue) {
"""
<p>Convert a <code>String</code> to an <code>short</code>, returning a
default value if the conversion fails.</p>
<p>If the string is <code>null</code>, the default value is returned.</p>
<pre>
NumberUtils.toShort(null, 1) = 1
N... | java | public static short toShort(final String str, final short defaultValue) {
if(str == null) {
return defaultValue;
}
try {
return Short.parseShort(str);
} catch (final NumberFormatException nfe) {
return defaultValue;
}
} | [
"public",
"static",
"short",
"toShort",
"(",
"final",
"String",
"str",
",",
"final",
"short",
"defaultValue",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"try",
"{",
"return",
"Short",
".",
"parseShort",
"(",
... | <p>Convert a <code>String</code> to an <code>short</code>, returning a
default value if the conversion fails.</p>
<p>If the string is <code>null</code>, the default value is returned.</p>
<pre>
NumberUtils.toShort(null, 1) = 1
NumberUtils.toShort("", 1) = 1
NumberUtils.toShort("1", 0) = 1
</pre>
@param str the s... | [
"<p",
">",
"Convert",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"to",
"an",
"<code",
">",
"short<",
"/",
"code",
">",
"returning",
"a",
"default",
"value",
"if",
"the",
"conversion",
"fails",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/math/NumberUtils.java#L372-L381 |
recommenders/rival | rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/MultipleStrategyRunnerInfile.java | MultipleStrategyRunnerInfile.getAllRecommendationFiles | public static void getAllRecommendationFiles(final Set<String> recommendationFiles, final File path, final String prefix, final String suffix) {
"""
Get all recommendation files.
@param recommendationFiles The recommendation files (what is this?)
@param path The path of the recommendation files.
@param prefix... | java | public static void getAllRecommendationFiles(final Set<String> recommendationFiles, final File path, final String prefix, final String suffix) {
if (path == null) {
return;
}
File[] files = path.listFiles();
if (files == null) {
return;
}
for (File... | [
"public",
"static",
"void",
"getAllRecommendationFiles",
"(",
"final",
"Set",
"<",
"String",
">",
"recommendationFiles",
",",
"final",
"File",
"path",
",",
"final",
"String",
"prefix",
",",
"final",
"String",
"suffix",
")",
"{",
"if",
"(",
"path",
"==",
"nul... | Get all recommendation files.
@param recommendationFiles The recommendation files (what is this?)
@param path The path of the recommendation files.
@param prefix The prefix of the recommendation files.
@param suffix The suffix of the recommendation files. | [
"Get",
"all",
"recommendation",
"files",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/strategy/MultipleStrategyRunnerInfile.java#L264-L279 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/topology/BaseTridentTopology.java | BaseTridentTopology.submitTopology | public void submitTopology(StormTopology topology, boolean isLocal) throws Exception {
"""
Topologyを実行する。
@param topology StormTopology
@param isLocal true:ローカルモード、false:分散モード
@throws Exception Topology実行失敗時
"""
if (isLocal)
{
// ローカル環境で実行
LocalCluster cluster = new... | java | public void submitTopology(StormTopology topology, boolean isLocal) throws Exception
{
if (isLocal)
{
// ローカル環境で実行
LocalCluster cluster = new LocalCluster();
cluster.submitTopology(this.topologyName, this.config, topology);
}
else
{
... | [
"public",
"void",
"submitTopology",
"(",
"StormTopology",
"topology",
",",
"boolean",
"isLocal",
")",
"throws",
"Exception",
"{",
"if",
"(",
"isLocal",
")",
"{",
"// ローカル環境で実行",
"LocalCluster",
"cluster",
"=",
"new",
"LocalCluster",
"(",
")",
";",
"cluster",
"... | Topologyを実行する。
@param topology StormTopology
@param isLocal true:ローカルモード、false:分散モード
@throws Exception Topology実行失敗時 | [
"Topologyを実行する。"
] | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/topology/BaseTridentTopology.java#L66-L87 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/view/ViewUtils.java | ViewUtils.sipToPixel | public static float sipToPixel(Resources resources, float sip) {
"""
Convert the sip to pixels, based on density scale.
@param resources application resources.
@param sip to be converted value.
@return converted value(px)
"""
float density = resources.getDisplayMetrics().scaledDensity;
retur... | java | public static float sipToPixel(Resources resources, float sip) {
float density = resources.getDisplayMetrics().scaledDensity;
return sip * density;
} | [
"public",
"static",
"float",
"sipToPixel",
"(",
"Resources",
"resources",
",",
"float",
"sip",
")",
"{",
"float",
"density",
"=",
"resources",
".",
"getDisplayMetrics",
"(",
")",
".",
"scaledDensity",
";",
"return",
"sip",
"*",
"density",
";",
"}"
] | Convert the sip to pixels, based on density scale.
@param resources application resources.
@param sip to be converted value.
@return converted value(px) | [
"Convert",
"the",
"sip",
"to",
"pixels",
"based",
"on",
"density",
"scale",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/view/ViewUtils.java#L97-L100 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/DeferredSound.java | DeferredSound.playAsSoundEffect | public int playAsSoundEffect(float pitch, float gain, boolean loop, float x, float y, float z) {
"""
Play this sound as a sound effect
@param pitch The pitch of the play back
@param gain The gain of the play back
@param loop True if we should loop
@param x The x position of the sound
@param y The y position... | java | public int playAsSoundEffect(float pitch, float gain, boolean loop, float x, float y, float z) {
checkTarget();
return target.playAsSoundEffect(pitch, gain, loop, x, y, z);
} | [
"public",
"int",
"playAsSoundEffect",
"(",
"float",
"pitch",
",",
"float",
"gain",
",",
"boolean",
"loop",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"checkTarget",
"(",
")",
";",
"return",
"target",
".",
"playAsSoundEffect",
"(",... | Play this sound as a sound effect
@param pitch The pitch of the play back
@param gain The gain of the play back
@param loop True if we should loop
@param x The x position of the sound
@param y The y position of the sound
@param z The z position of the sound | [
"Play",
"this",
"sound",
"as",
"a",
"sound",
"effect"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/DeferredSound.java#L144-L147 |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttproject/GanttProjectReader.java | GanttProjectReader.readTask | private void readTask(ChildTaskContainer mpxjParent, net.sf.mpxj.ganttproject.schema.Task gpTask) {
"""
Recursively read a task, and any sub tasks.
@param mpxjParent Parent for the MPXJ tasks
@param gpTask GanttProject task
"""
Task mpxjTask = mpxjParent.addTask();
mpxjTask.setUniqueID(Integer.... | java | private void readTask(ChildTaskContainer mpxjParent, net.sf.mpxj.ganttproject.schema.Task gpTask)
{
Task mpxjTask = mpxjParent.addTask();
mpxjTask.setUniqueID(Integer.valueOf(NumberHelper.getInt(gpTask.getId()) + 1));
mpxjTask.setName(gpTask.getName());
mpxjTask.setPercentageComplete(gpTask.g... | [
"private",
"void",
"readTask",
"(",
"ChildTaskContainer",
"mpxjParent",
",",
"net",
".",
"sf",
".",
"mpxj",
".",
"ganttproject",
".",
"schema",
".",
"Task",
"gpTask",
")",
"{",
"Task",
"mpxjTask",
"=",
"mpxjParent",
".",
"addTask",
"(",
")",
";",
"mpxjTask... | Recursively read a task, and any sub tasks.
@param mpxjParent Parent for the MPXJ tasks
@param gpTask GanttProject task | [
"Recursively",
"read",
"a",
"task",
"and",
"any",
"sub",
"tasks",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttproject/GanttProjectReader.java#L711-L754 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java | Tabs.setAjaxBeforeActivateEvent | public Tabs setAjaxBeforeActivateEvent(ITabsAjaxEvent beforeActivateEvent) {
"""
Sets the call-back for the AJAX beforeActivate event.
@param beforeActivateEvent
The ITabsAjaxEvent.
"""
this.ajaxEvents.put(TabEvent.beforeActivate, beforeActivateEvent);
setBeforeActivateEvent(new TabsAjaxBeforeActivateJ... | java | public Tabs setAjaxBeforeActivateEvent(ITabsAjaxEvent beforeActivateEvent)
{
this.ajaxEvents.put(TabEvent.beforeActivate, beforeActivateEvent);
setBeforeActivateEvent(new TabsAjaxBeforeActivateJsScopeUiEvent(this, TabEvent.beforeActivate, false));
return this;
} | [
"public",
"Tabs",
"setAjaxBeforeActivateEvent",
"(",
"ITabsAjaxEvent",
"beforeActivateEvent",
")",
"{",
"this",
".",
"ajaxEvents",
".",
"put",
"(",
"TabEvent",
".",
"beforeActivate",
",",
"beforeActivateEvent",
")",
";",
"setBeforeActivateEvent",
"(",
"new",
"TabsAjax... | Sets the call-back for the AJAX beforeActivate event.
@param beforeActivateEvent
The ITabsAjaxEvent. | [
"Sets",
"the",
"call",
"-",
"back",
"for",
"the",
"AJAX",
"beforeActivate",
"event",
"."
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/tabs/Tabs.java#L614-L619 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CfCodeGen.java | CfCodeGen.writeImport | @Override
public void writeImport(Definition def, Writer out) throws IOException {
"""
Output class import
@param def definition
@param out Writer
@throws IOException ioException
"""
out.write("package " + def.getRaPackage() + ";");
writeEol(out);
writeEol(out);
importLogging(d... | java | @Override
public void writeImport(Definition def, Writer out) throws IOException
{
out.write("package " + def.getRaPackage() + ";");
writeEol(out);
writeEol(out);
importLogging(def, out);
out.write("import javax.naming.NamingException;\n");
out.write("import javax.naming.Refer... | [
"@",
"Override",
"public",
"void",
"writeImport",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"\"package \"",
"+",
"def",
".",
"getRaPackage",
"(",
")",
"+",
"\";\"",
")",
";",
"writeEol",
... | Output class import
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"class",
"import"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/CfCodeGen.java#L97-L109 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/formatters/HexWriter.java | HexWriter.toHex | public static String toHex(byte[] data, int length) {
"""
Return length many bytes of the passed in byte array as a hex string.
@param data the bytes to be converted.
@param length the number of bytes in the data block to be converted.
@return a hex representation of length bytes of data.
"""
Stri... | java | public static String toHex(byte[] data, int length) {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i != length; i++) {
int v = data[i] & 0xff;
buffer.append(DIGITS.charAt(v >> 4));
buffer.append(DIGITS.charAt(v & 0xf));
}
return buffer.... | [
"public",
"static",
"String",
"toHex",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"length",
")",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"!=",
"length",
";",
"i",
"++",
... | Return length many bytes of the passed in byte array as a hex string.
@param data the bytes to be converted.
@param length the number of bytes in the data block to be converted.
@return a hex representation of length bytes of data. | [
"Return",
"length",
"many",
"bytes",
"of",
"the",
"passed",
"in",
"byte",
"array",
"as",
"a",
"hex",
"string",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/formatters/HexWriter.java#L40-L51 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/syslog_sslvpn.java | syslog_sslvpn.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
syslog_sslvpn_responses result = (syslog_sslvpn_responses) service.get_... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
syslog_sslvpn_responses result = (syslog_sslvpn_responses) service.get_payload_formatter().string_to_resource(syslog_sslvpn_responses.class, response);
if(result.errorcode != 0)
{
if (result.error... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"syslog_sslvpn_responses",
"result",
"=",
"(",
"syslog_sslvpn_responses",
")",
"service",
".",
"get_payload_fo... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/syslog_sslvpn.java#L1360-L1377 |
btrplace/scheduler | json/src/main/java/org/btrplace/json/model/view/network/NetworkConverter.java | NetworkConverter.routingFromJSON | public Routing routingFromJSON(Model mo, JSONObject o) throws JSONConverterException {
"""
Convert a JSON routing object into the corresponding java Routing implementation.
@param o the JSON object to convert
@throws JSONConverterException if the Routing implementation is not known
"""
String type... | java | public Routing routingFromJSON(Model mo, JSONObject o) throws JSONConverterException {
String type = requiredString(o, "type");
RoutingConverter<? extends Routing> c = json2java.get(type);
if (c == null) {
throw new JSONConverterException("No converter available for a routing of typ... | [
"public",
"Routing",
"routingFromJSON",
"(",
"Model",
"mo",
",",
"JSONObject",
"o",
")",
"throws",
"JSONConverterException",
"{",
"String",
"type",
"=",
"requiredString",
"(",
"o",
",",
"\"type\"",
")",
";",
"RoutingConverter",
"<",
"?",
"extends",
"Routing",
... | Convert a JSON routing object into the corresponding java Routing implementation.
@param o the JSON object to convert
@throws JSONConverterException if the Routing implementation is not known | [
"Convert",
"a",
"JSON",
"routing",
"object",
"into",
"the",
"corresponding",
"java",
"Routing",
"implementation",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/json/src/main/java/org/btrplace/json/model/view/network/NetworkConverter.java#L217-L225 |
aoindustries/ao-encoding | src/main/java/com/aoindustries/encoding/ChainWriter.java | ChainWriter.printDateTimeJS | @Deprecated
public ChainWriter printDateTimeJS(long date, Sequence sequence, Appendable scriptOut) throws IOException {
"""
Writes a JavaScript script tag that shows a date and time in the user's locale. Prints <code>&#160;</code>
if the date is <code>-1</code>.
Writes to the internal <code>PrintWriter</co... | java | @Deprecated
public ChainWriter printDateTimeJS(long date, Sequence sequence, Appendable scriptOut) throws IOException {
return writeDateTimeJavaScript(date==-1 ? null : new Date(date), sequence, scriptOut);
} | [
"@",
"Deprecated",
"public",
"ChainWriter",
"printDateTimeJS",
"(",
"long",
"date",
",",
"Sequence",
"sequence",
",",
"Appendable",
"scriptOut",
")",
"throws",
"IOException",
"{",
"return",
"writeDateTimeJavaScript",
"(",
"date",
"==",
"-",
"1",
"?",
"null",
":"... | Writes a JavaScript script tag that shows a date and time in the user's locale. Prints <code>&#160;</code>
if the date is <code>-1</code>.
Writes to the internal <code>PrintWriter</code>.
@deprecated
@see #writeDateTimeJavaScript(long) | [
"Writes",
"a",
"JavaScript",
"script",
"tag",
"that",
"shows",
"a",
"date",
"and",
"time",
"in",
"the",
"user",
"s",
"locale",
".",
"Prints",
"<code",
">",
"&",
";",
"#160",
";",
"<",
"/",
"code",
">",
"if",
"the",
"date",
"is",
"<code",
">",
"-... | train | https://github.com/aoindustries/ao-encoding/blob/54eeb8ff58ab7b44bb02549bbe2572625b449e4e/src/main/java/com/aoindustries/encoding/ChainWriter.java#L886-L889 |
bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StandardStashReader.java | StandardStashReader.getLockedView | public StashReader getLockedView() {
"""
Returns a new StashReader that is locked to the same stash time the instance is currently using. Future calls to
lock or unlock the stash time on this instance will not affect the returned instance.
"""
return new FixedStashReader(URI.create(String.format("s3:... | java | public StashReader getLockedView() {
return new FixedStashReader(URI.create(String.format("s3://%s/%s", _bucket, getRootPath())), _s3);
} | [
"public",
"StashReader",
"getLockedView",
"(",
")",
"{",
"return",
"new",
"FixedStashReader",
"(",
"URI",
".",
"create",
"(",
"String",
".",
"format",
"(",
"\"s3://%s/%s\"",
",",
"_bucket",
",",
"getRootPath",
"(",
")",
")",
")",
",",
"_s3",
")",
";",
"}... | Returns a new StashReader that is locked to the same stash time the instance is currently using. Future calls to
lock or unlock the stash time on this instance will not affect the returned instance. | [
"Returns",
"a",
"new",
"StashReader",
"that",
"is",
"locked",
"to",
"the",
"same",
"stash",
"time",
"the",
"instance",
"is",
"currently",
"using",
".",
"Future",
"calls",
"to",
"lock",
"or",
"unlock",
"the",
"stash",
"time",
"on",
"this",
"instance",
"will... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StandardStashReader.java#L194-L196 |
JoeKerouac/utils | src/main/java/com/joe/utils/secure/impl/AsymmetricCipher.java | AsymmetricCipher.buildInstance | public static CipherUtil buildInstance(String privateKey, String publicKey) {
"""
非对称加密构造器
@param privateKey PKCS8格式的私钥(BASE64 encode过的)
@param publicKey X509格式的公钥(BASE64 encode过的)
@return AsymmetricCipher
"""
return buildInstance(privateKey.getBytes(), publicKey.getBytes());
} | java | public static CipherUtil buildInstance(String privateKey, String publicKey) {
return buildInstance(privateKey.getBytes(), publicKey.getBytes());
} | [
"public",
"static",
"CipherUtil",
"buildInstance",
"(",
"String",
"privateKey",
",",
"String",
"publicKey",
")",
"{",
"return",
"buildInstance",
"(",
"privateKey",
".",
"getBytes",
"(",
")",
",",
"publicKey",
".",
"getBytes",
"(",
")",
")",
";",
"}"
] | 非对称加密构造器
@param privateKey PKCS8格式的私钥(BASE64 encode过的)
@param publicKey X509格式的公钥(BASE64 encode过的)
@return AsymmetricCipher | [
"非对称加密构造器"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/secure/impl/AsymmetricCipher.java#L43-L45 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java | AbstractRenderer.scoreByMediaType | protected int scoreByMediaType(List<MediaType> mediaTypes, MediaType requiredMediaType) {
"""
Computes a score by examining a list of media types (typically from the 'Accept' header) against
a required media type.
@param mediaTypes The list of media types to examine.
@param requiredMediaType The requir... | java | protected int scoreByMediaType(List<MediaType> mediaTypes, MediaType requiredMediaType) {
int score = MAXIMUM_HEADER_SCORE;
boolean match = false;
boolean matchWildCard = false;
for (MediaType mediaType : mediaTypes) {
if (mediaType.matches(requiredMediaType)) {
... | [
"protected",
"int",
"scoreByMediaType",
"(",
"List",
"<",
"MediaType",
">",
"mediaTypes",
",",
"MediaType",
"requiredMediaType",
")",
"{",
"int",
"score",
"=",
"MAXIMUM_HEADER_SCORE",
";",
"boolean",
"match",
"=",
"false",
";",
"boolean",
"matchWildCard",
"=",
"... | Computes a score by examining a list of media types (typically from the 'Accept' header) against
a required media type.
@param mediaTypes The list of media types to examine.
@param requiredMediaType The required media type.
@return A score that indicates if one of the media types in the list matches the require... | [
"Computes",
"a",
"score",
"by",
"examining",
"a",
"list",
"of",
"media",
"types",
"(",
"typically",
"from",
"the",
"Accept",
"header",
")",
"against",
"a",
"required",
"media",
"type",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/AbstractRenderer.java#L158-L175 |
Scalified/fab | fab/src/main/java/com/scalified/fab/TouchPoint.java | TouchPoint.isInsideCircle | boolean isInsideCircle(float centerPointX, float centerPointY, float radius) {
"""
Checks whether the touch point is inside the circle or not
@param centerPointX circle X-axis center coordinate
@param centerPointY circle Y-axis center coordinate
@param radius circle radius
@return true if touch point is in... | java | boolean isInsideCircle(float centerPointX, float centerPointY, float radius) {
double xValue = Math.pow((getX() - centerPointX), 2);
double yValue = Math.pow((getY() - centerPointY), 2);
double radiusValue = Math.pow(radius, 2);
boolean touchPointInsideCircle = xValue + yValue <= radiusValue;
LOGGER.trace("De... | [
"boolean",
"isInsideCircle",
"(",
"float",
"centerPointX",
",",
"float",
"centerPointY",
",",
"float",
"radius",
")",
"{",
"double",
"xValue",
"=",
"Math",
".",
"pow",
"(",
"(",
"getX",
"(",
")",
"-",
"centerPointX",
")",
",",
"2",
")",
";",
"double",
... | Checks whether the touch point is inside the circle or not
@param centerPointX circle X-axis center coordinate
@param centerPointY circle Y-axis center coordinate
@param radius circle radius
@return true if touch point is inside the circle, otherwise false | [
"Checks",
"whether",
"the",
"touch",
"point",
"is",
"inside",
"the",
"circle",
"or",
"not"
] | train | https://github.com/Scalified/fab/blob/0fc001e2f21223871d05d28b192a32ea70726884/fab/src/main/java/com/scalified/fab/TouchPoint.java#L170-L177 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.appendClause | protected void appendClause(StringBuffer clause, Criteria crit, StringBuffer stmt) {
"""
appends a WHERE/HAVING-clause to the Statement
@param clause
@param crit
@param stmt
"""
/**
* MBAIRD
* when generating the "WHERE/HAVING" clause we need to append the criteria for multi-map... | java | protected void appendClause(StringBuffer clause, Criteria crit, StringBuffer stmt)
{
/**
* MBAIRD
* when generating the "WHERE/HAVING" clause we need to append the criteria for multi-mapped
* tables. We only need to do this for the root classdescriptor and not for joined tabl... | [
"protected",
"void",
"appendClause",
"(",
"StringBuffer",
"clause",
",",
"Criteria",
"crit",
",",
"StringBuffer",
"stmt",
")",
"{",
"/**\r\n * MBAIRD\r\n * when generating the \"WHERE/HAVING\" clause we need to append the criteria for multi-mapped\r\n * tables. We... | appends a WHERE/HAVING-clause to the Statement
@param clause
@param crit
@param stmt | [
"appends",
"a",
"WHERE",
"/",
"HAVING",
"-",
"clause",
"to",
"the",
"Statement"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L581-L609 |
gliga/ekstazi | org.ekstazi.core/src/main/java/org/ekstazi/maven/AbstractMojoInterceptor.java | AbstractMojoInterceptor.invokeAndGetBoolean | protected static boolean invokeAndGetBoolean(String methodName, Object mojo) throws Exception {
"""
Gets boolean field value from the given mojo based on the given method
name.
@param methodName
Method name to be used to get the value
@param mojo
Mojo from which to extract the value
@return Boolean value b... | java | protected static boolean invokeAndGetBoolean(String methodName, Object mojo) throws Exception {
return (Boolean) invokeGetMethod(methodName, mojo);
} | [
"protected",
"static",
"boolean",
"invokeAndGetBoolean",
"(",
"String",
"methodName",
",",
"Object",
"mojo",
")",
"throws",
"Exception",
"{",
"return",
"(",
"Boolean",
")",
"invokeGetMethod",
"(",
"methodName",
",",
"mojo",
")",
";",
"}"
] | Gets boolean field value from the given mojo based on the given method
name.
@param methodName
Method name to be used to get the value
@param mojo
Mojo from which to extract the value
@return Boolean value by invoking method on Mojo
@throws Exception
If reflection invocation goes wrong | [
"Gets",
"boolean",
"field",
"value",
"from",
"the",
"given",
"mojo",
"based",
"on",
"the",
"given",
"method",
"name",
"."
] | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/maven/AbstractMojoInterceptor.java#L107-L109 |
cloudbees/bees-maven-components | src/main/java/com/cloudbees/sdk/maven/RepositoryService.java | RepositoryService.resolveDependencies | public DependencyResult resolveDependencies(GAV a, String scope) throws DependencyResolutionException {
"""
Resolves dependencies transitively from the given jar artifact, with the specified Maven scope
(compile, runtime, and so on.)
"""
DependencyFilter classpathFlter = DependencyFilterUtils.classpat... | java | public DependencyResult resolveDependencies(GAV a, String scope) throws DependencyResolutionException {
DependencyFilter classpathFlter = DependencyFilterUtils.classpathFilter(scope);
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot(new Dependency(new DefaultArtifact... | [
"public",
"DependencyResult",
"resolveDependencies",
"(",
"GAV",
"a",
",",
"String",
"scope",
")",
"throws",
"DependencyResolutionException",
"{",
"DependencyFilter",
"classpathFlter",
"=",
"DependencyFilterUtils",
".",
"classpathFilter",
"(",
"scope",
")",
";",
"Collec... | Resolves dependencies transitively from the given jar artifact, with the specified Maven scope
(compile, runtime, and so on.) | [
"Resolves",
"dependencies",
"transitively",
"from",
"the",
"given",
"jar",
"artifact",
"with",
"the",
"specified",
"Maven",
"scope",
"(",
"compile",
"runtime",
"and",
"so",
"on",
".",
")"
] | train | https://github.com/cloudbees/bees-maven-components/blob/b4410c4826c38a83c209286dad847f3bdfad682a/src/main/java/com/cloudbees/sdk/maven/RepositoryService.java#L181-L191 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/batchXML10/BatchXMLDescriptorImpl.java | BatchXMLDescriptorImpl.addNamespace | public BatchXMLDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>BatchXMLDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public BatchXMLDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"BatchXMLDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>BatchXMLDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/batchXML10/BatchXMLDescriptorImpl.java#L83-L87 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxrs.2.1.common/src/com/ibm/ws/jaxrs20/clientconfig/JAXRSClientConfigImpl.java | JAXRSClientConfigImpl.activate | @Activate
protected void activate(Map<String, Object> properties) {
"""
/*---------
@Reference(service = com.ibm.wsspi.classloading.ResourceProvider.class, target = "(resources=META-INF/services/javax.ws.rs.client.ClientBuilder)")
protected void setResourceProvider(com.ibm.wsspi.classloading.ResourceProvider... | java | @Activate
protected void activate(Map<String, Object> properties) {
if (properties == null)
return;
String uri = getURI(properties);
if (uri == null)
return;
uri = normalize(uri);
JAXRSClientConfigHolder.addConfig(this.toString(), uri, filterProps(prop... | [
"@",
"Activate",
"protected",
"void",
"activate",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"return",
";",
"String",
"uri",
"=",
"getURI",
"(",
"properties",
")",
";",
"if",
"(",
... | /*---------
@Reference(service = com.ibm.wsspi.classloading.ResourceProvider.class, target = "(resources=META-INF/services/javax.ws.rs.client.ClientBuilder)")
protected void setResourceProvider(com.ibm.wsspi.classloading.ResourceProvider rp) {
no-op
}
protected void unsetResourceProvider(com.ibm.wsspi.classloading.Res... | [
"/",
"*",
"---------",
"@Reference",
"(",
"service",
"=",
"com",
".",
"ibm",
".",
"wsspi",
".",
"classloading",
".",
"ResourceProvider",
".",
"class",
"target",
"=",
"(",
"resources",
"=",
"META",
"-",
"INF",
"/",
"services",
"/",
"javax",
".",
"ws",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.1.common/src/com/ibm/ws/jaxrs20/clientconfig/JAXRSClientConfigImpl.java#L201-L210 |
fernandospr/java-wns | src/main/java/ar/com/fernandospr/wns/WnsService.java | WnsService.pushBadge | public WnsNotificationResponse pushBadge(String channelUri, WnsNotificationRequestOptional optional, WnsBadge badge) throws WnsException {
"""
Pushes a badge to channelUri using optional headers
@param channelUri
@param optional
@param badge which should be built with {@link ar.com.fernandospr.wns.model.builder... | java | public WnsNotificationResponse pushBadge(String channelUri, WnsNotificationRequestOptional optional, WnsBadge badge) throws WnsException {
return this.client.push(xmlResourceBuilder, channelUri, badge, this.retryPolicy, optional);
} | [
"public",
"WnsNotificationResponse",
"pushBadge",
"(",
"String",
"channelUri",
",",
"WnsNotificationRequestOptional",
"optional",
",",
"WnsBadge",
"badge",
")",
"throws",
"WnsException",
"{",
"return",
"this",
".",
"client",
".",
"push",
"(",
"xmlResourceBuilder",
","... | Pushes a badge to channelUri using optional headers
@param channelUri
@param optional
@param badge which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsBadgeBuilder}
@return WnsNotificationResponse please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465... | [
"Pushes",
"a",
"badge",
"to",
"channelUri",
"using",
"optional",
"headers"
] | train | https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L180-L182 |
google/gson | proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java | ProtoTypeAdapter.getCustSerializedName | private String getCustSerializedName(FieldOptions options, String defaultName) {
"""
Retrieves the custom field name from the given options, and if not found, returns the specified
default name.
"""
for (Extension<FieldOptions, String> extension : serializedNameExtensions) {
if (options.hasExtension... | java | private String getCustSerializedName(FieldOptions options, String defaultName) {
for (Extension<FieldOptions, String> extension : serializedNameExtensions) {
if (options.hasExtension(extension)) {
return options.getExtension(extension);
}
}
return protoFormat.to(jsonFormat, defaultName);... | [
"private",
"String",
"getCustSerializedName",
"(",
"FieldOptions",
"options",
",",
"String",
"defaultName",
")",
"{",
"for",
"(",
"Extension",
"<",
"FieldOptions",
",",
"String",
">",
"extension",
":",
"serializedNameExtensions",
")",
"{",
"if",
"(",
"options",
... | Retrieves the custom field name from the given options, and if not found, returns the specified
default name. | [
"Retrieves",
"the",
"custom",
"field",
"name",
"from",
"the",
"given",
"options",
"and",
"if",
"not",
"found",
"returns",
"the",
"specified",
"default",
"name",
"."
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java#L333-L340 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/bufferprovider/LocalBufferPool.java | LocalBufferPool.recycleBuffer | private void recycleBuffer(MemorySegment buffer) {
"""
Returns a buffer to the buffer pool and notifies listeners about the availability of a new buffer.
@param buffer buffer to return to the buffer pool
"""
synchronized (this.buffers) {
if (this.isDestroyed) {
this.globalBufferPool.returnBuffer(bu... | java | private void recycleBuffer(MemorySegment buffer) {
synchronized (this.buffers) {
if (this.isDestroyed) {
this.globalBufferPool.returnBuffer(buffer);
this.numRequestedBuffers--;
} else {
// if the number of designated buffers changed in the meantime, make sure
// to return the buffer to the globa... | [
"private",
"void",
"recycleBuffer",
"(",
"MemorySegment",
"buffer",
")",
"{",
"synchronized",
"(",
"this",
".",
"buffers",
")",
"{",
"if",
"(",
"this",
".",
"isDestroyed",
")",
"{",
"this",
".",
"globalBufferPool",
".",
"returnBuffer",
"(",
"buffer",
")",
... | Returns a buffer to the buffer pool and notifies listeners about the availability of a new buffer.
@param buffer buffer to return to the buffer pool | [
"Returns",
"a",
"buffer",
"to",
"the",
"buffer",
"pool",
"and",
"notifies",
"listeners",
"about",
"the",
"availability",
"of",
"a",
"new",
"buffer",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/runtime/io/network/bufferprovider/LocalBufferPool.java#L291-L318 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Registry.java | Registry.setType | public void setType(String type) throws ApplicationException {
"""
set the value type string: return string values dWord: return DWord values key: return keys any:
return keys and values
@param type value to set
@throws ApplicationException
"""
type = type.toLowerCase().trim();
if (type.equals("string")... | java | public void setType(String type) throws ApplicationException {
type = type.toLowerCase().trim();
if (type.equals("string")) this.type = RegistryEntry.TYPE_STRING;
else if (type.equals("dword")) this.type = RegistryEntry.TYPE_DWORD;
else if (type.equals("key")) this.type = RegistryEntry.TYPE_KEY;
else if (type.equa... | [
"public",
"void",
"setType",
"(",
"String",
"type",
")",
"throws",
"ApplicationException",
"{",
"type",
"=",
"type",
".",
"toLowerCase",
"(",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"type",
".",
"equals",
"(",
"\"string\"",
")",
")",
"this",
".",
... | set the value type string: return string values dWord: return DWord values key: return keys any:
return keys and values
@param type value to set
@throws ApplicationException | [
"set",
"the",
"value",
"type",
"string",
":",
"return",
"string",
"values",
"dWord",
":",
"return",
"DWord",
"values",
"key",
":",
"return",
"keys",
"any",
":",
"return",
"keys",
"and",
"values"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Registry.java#L144-L151 |
Netflix/zuul | zuul-core/src/main/java/com/netflix/zuul/monitoring/TracerFactory.java | TracerFactory.instance | public static final TracerFactory instance() {
"""
Returns the singleton TracerFactory
@return a <code>TracerFactory</code> value
"""
if(INSTANCE == null) throw new IllegalStateException(String.format("%s not initialized", TracerFactory.class.getSimpleName()));
return INSTANCE;
} | java | public static final TracerFactory instance() {
if(INSTANCE == null) throw new IllegalStateException(String.format("%s not initialized", TracerFactory.class.getSimpleName()));
return INSTANCE;
} | [
"public",
"static",
"final",
"TracerFactory",
"instance",
"(",
")",
"{",
"if",
"(",
"INSTANCE",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"String",
".",
"format",
"(",
"\"%s not initialized\"",
",",
"TracerFactory",
".",
"class",
".",
"g... | Returns the singleton TracerFactory
@return a <code>TracerFactory</code> value | [
"Returns",
"the",
"singleton",
"TracerFactory"
] | train | https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/monitoring/TracerFactory.java#L43-L46 |
ben-manes/caffeine | jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java | CacheProxy.setAccessExpirationTime | protected final void setAccessExpirationTime(Expirable<?> expirable, long currentTimeMS) {
"""
Sets the access expiration time.
@param expirable the entry that was operated on
@param currentTimeMS the current time, or 0 if not read yet
"""
try {
Duration duration = expiry.getExpiryForAccess();
... | java | protected final void setAccessExpirationTime(Expirable<?> expirable, long currentTimeMS) {
try {
Duration duration = expiry.getExpiryForAccess();
if (duration == null) {
return;
} else if (duration.isZero()) {
expirable.setExpireTimeMS(0L);
} else if (duration.isEternal()) {
... | [
"protected",
"final",
"void",
"setAccessExpirationTime",
"(",
"Expirable",
"<",
"?",
">",
"expirable",
",",
"long",
"currentTimeMS",
")",
"{",
"try",
"{",
"Duration",
"duration",
"=",
"expiry",
".",
"getExpiryForAccess",
"(",
")",
";",
"if",
"(",
"duration",
... | Sets the access expiration time.
@param expirable the entry that was operated on
@param currentTimeMS the current time, or 0 if not read yet | [
"Sets",
"the",
"access",
"expiration",
"time",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java#L1115-L1134 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/ConditionalExpression.java | ConditionalExpression.getProcessor | private static Processor getProcessor(Opcode opcode) {
"""
Operator processor factory. Returned processor instance is a singleton, that is, reused on running virtual machine.
@param opcode return processor suitable for requested operator.
@return operator processor instance.
"""
switch (opcode) {
cas... | java | private static Processor getProcessor(Opcode opcode) {
switch (opcode) {
case NOT_EMPTY:
return NOT_EPMTY_PROCESSOR;
case EQUALS:
if (EQUALS_PROCESSOR == null) {
EQUALS_PROCESSOR = new EqualsProcessor();
}
return EQUALS_PROCESSOR;
case LESS_THAN:
if (LESS_THAN_PROCESSOR == null)... | [
"private",
"static",
"Processor",
"getProcessor",
"(",
"Opcode",
"opcode",
")",
"{",
"switch",
"(",
"opcode",
")",
"{",
"case",
"NOT_EMPTY",
":",
"return",
"NOT_EPMTY_PROCESSOR",
";",
"case",
"EQUALS",
":",
"if",
"(",
"EQUALS_PROCESSOR",
"==",
"null",
")",
"... | Operator processor factory. Returned processor instance is a singleton, that is, reused on running virtual machine.
@param opcode return processor suitable for requested operator.
@return operator processor instance. | [
"Operator",
"processor",
"factory",
".",
"Returned",
"processor",
"instance",
"is",
"a",
"singleton",
"that",
"is",
"reused",
"on",
"running",
"virtual",
"machine",
"."
] | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/ConditionalExpression.java#L363-L389 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPolyline.java | MapPolyline.distanceToEnd | @Pure
public double distanceToEnd(Point2D<?, ?> point, double width) {
"""
Replies the distance between the nearest end of this MapElement and
the point.
@param point is the x-coordinate of the point.
@param width is the width of the polyline.
@return the computed distance
"""
final Point2d firstPoint... | java | @Pure
public double distanceToEnd(Point2D<?, ?> point, double width) {
final Point2d firstPoint = getPointAt(0);
final Point2d lastPoint = getPointAt(-1);
double d1 = firstPoint.getDistance(point);
double d2 = lastPoint.getDistance(point);
d1 -= width;
if (d1 < 0) {
d1 = 0;
}
d2 -= width;
if (d2 <... | [
"@",
"Pure",
"public",
"double",
"distanceToEnd",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
",",
"double",
"width",
")",
"{",
"final",
"Point2d",
"firstPoint",
"=",
"getPointAt",
"(",
"0",
")",
";",
"final",
"Point2d",
"lastPoint",
"=",
"getPoint... | Replies the distance between the nearest end of this MapElement and
the point.
@param point is the x-coordinate of the point.
@param width is the width of the polyline.
@return the computed distance | [
"Replies",
"the",
"distance",
"between",
"the",
"nearest",
"end",
"of",
"this",
"MapElement",
"and",
"the",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPolyline.java#L211-L226 |
haifengl/smile | core/src/main/java/smile/manifold/TSNE.java | TSNE.expd | private double[][] expd(double[][] D, double perplexity, double tol) {
"""
Compute the Gaussian kernel (search the width for given perplexity.
"""
int n = D.length;
double[][] P = new double[n][n];
double[] DiSum = Math.rowSums(D);
int nprocs = MulticoreExecutor.getT... | java | private double[][] expd(double[][] D, double perplexity, double tol) {
int n = D.length;
double[][] P = new double[n][n];
double[] DiSum = Math.rowSums(D);
int nprocs = MulticoreExecutor.getThreadPoolSize();
int chunk = n / nprocs;
List<PerplexityTask> tasks =... | [
"private",
"double",
"[",
"]",
"[",
"]",
"expd",
"(",
"double",
"[",
"]",
"[",
"]",
"D",
",",
"double",
"perplexity",
",",
"double",
"tol",
")",
"{",
"int",
"n",
"=",
"D",
".",
"length",
";",
"double",
"[",
"]",
"[",
"]",
"P",
"=",
"new",
"do... | Compute the Gaussian kernel (search the width for given perplexity. | [
"Compute",
"the",
"Gaussian",
"kernel",
"(",
"search",
"the",
"width",
"for",
"given",
"perplexity",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/manifold/TSNE.java#L278-L300 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/button/ButtonRenderer.java | ButtonRenderer.encodeEnd | @Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
"""
Renders the button. <br>
General layout of the generated HTML code:<br>
<button class="btn btn-large" href="#"%gt;<i
class="icon-star"></i> Star</button>
@param context
the current Fac... | java | @Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
Button button = (Button) component;
encodeHTML(context, button);
} | [
"@",
"Override",
"public",
"void",
"encodeEnd",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"Button",
"button",
... | Renders the button. <br>
General layout of the generated HTML code:<br>
<button class="btn btn-large" href="#"%gt;<i
class="icon-star"></i> Star</button>
@param context
the current FacesContext
@throws IOException
thrown if something's wrong with the ResponseWriter | [
"Renders",
"the",
"button",
".",
"<br",
">",
"General",
"layout",
"of",
"the",
"generated",
"HTML",
"code",
":",
"<br",
">",
"<",
";",
"button",
"class",
"=",
"btn",
"btn",
"-",
"large",
"href",
"=",
"#",
"%gt",
";",
"<",
";",
"i",
"class",
"="... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/button/ButtonRenderer.java#L58-L65 |
census-instrumentation/opencensus-java | impl_core/src/main/java/io/opencensus/implcore/stats/MutableViewData.java | MutableViewData.create | static MutableViewData create(final View view, final Timestamp start) {
"""
Constructs a new {@link MutableViewData}.
@param view the {@code View} linked with this {@code MutableViewData}.
@param start the start {@code Timestamp}.
@return a {@code MutableViewData}.
"""
return view.getWindow()
... | java | static MutableViewData create(final View view, final Timestamp start) {
return view.getWindow()
.match(
new CreateCumulative(view, start),
new CreateInterval(view, start),
Functions.<MutableViewData>throwAssertionError());
} | [
"static",
"MutableViewData",
"create",
"(",
"final",
"View",
"view",
",",
"final",
"Timestamp",
"start",
")",
"{",
"return",
"view",
".",
"getWindow",
"(",
")",
".",
"match",
"(",
"new",
"CreateCumulative",
"(",
"view",
",",
"start",
")",
",",
"new",
"Cr... | Constructs a new {@link MutableViewData}.
@param view the {@code View} linked with this {@code MutableViewData}.
@param start the start {@code Timestamp}.
@return a {@code MutableViewData}. | [
"Constructs",
"a",
"new",
"{",
"@link",
"MutableViewData",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/impl_core/src/main/java/io/opencensus/implcore/stats/MutableViewData.java#L79-L85 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.