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 |
|---|---|---|---|---|---|---|---|---|---|---|
hawkular/hawkular-apm | client/opentracing/src/main/java/org/hawkular/apm/client/opentracing/TagUtil.java | TagUtil.getUriPath | public static String getUriPath(Map<String, Object> tags) {
"""
This method returns the URI value from a set of
supplied tags, by first identifying which tag
relates to a URI and then returning its path value.
@param tags The tags
@return The URI path, or null if not found
"""
for (Map.Entry<Stri... | java | public static String getUriPath(Map<String, Object> tags) {
for (Map.Entry<String,Object> entry : tags.entrySet()) {
if (isUriKey(entry.getKey())) {
return getUriPath(entry.getValue().toString());
}
}
return null;
} | [
"public",
"static",
"String",
"getUriPath",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"tags",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"entry",
":",
"tags",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
... | This method returns the URI value from a set of
supplied tags, by first identifying which tag
relates to a URI and then returning its path value.
@param tags The tags
@return The URI path, or null if not found | [
"This",
"method",
"returns",
"the",
"URI",
"value",
"from",
"a",
"set",
"of",
"supplied",
"tags",
"by",
"first",
"identifying",
"which",
"tag",
"relates",
"to",
"a",
"URI",
"and",
"then",
"returning",
"its",
"path",
"value",
"."
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/client/opentracing/src/main/java/org/hawkular/apm/client/opentracing/TagUtil.java#L81-L88 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/Iterators.java | Iterators.forArray | static <T> UnmodifiableListIterator<T> forArray(
final T[] array, final int offset, int length, int index) {
"""
Returns a list iterator containing the elements in the specified range of
{@code array} in order, starting at the specified index.
<p>The {@code Iterable} equivalent of this method is {@code
... | java | static <T> UnmodifiableListIterator<T> forArray(
final T[] array, final int offset, int length, int index) {
checkArgument(length >= 0);
int end = offset + length;
// Technically we should give a slightly more descriptive error on overflow
Preconditions.checkPositionIndexes(offset, end, array.len... | [
"static",
"<",
"T",
">",
"UnmodifiableListIterator",
"<",
"T",
">",
"forArray",
"(",
"final",
"T",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"int",
"length",
",",
"int",
"index",
")",
"{",
"checkArgument",
"(",
"length",
">=",
"0",
")",
... | Returns a list iterator containing the elements in the specified range of
{@code array} in order, starting at the specified index.
<p>The {@code Iterable} equivalent of this method is {@code
Arrays.asList(array).subList(offset, offset + length).listIterator(index)}. | [
"Returns",
"a",
"list",
"iterator",
"containing",
"the",
"elements",
"in",
"the",
"specified",
"range",
"of",
"{",
"@code",
"array",
"}",
"in",
"order",
"starting",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Iterators.java#L994-L1017 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CertImpl.java | X509CertImpl.getExtendedKeyUsage | public static List<String> getExtendedKeyUsage(X509Certificate cert)
throws CertificateParsingException {
"""
This static method is the default implementation of the
getExtendedKeyUsage method in X509Certificate. A
X509Certificate provider generally should overwrite this to
provide among other things ca... | java | public static List<String> getExtendedKeyUsage(X509Certificate cert)
throws CertificateParsingException {
try {
byte[] ext = cert.getExtensionValue(EXTENDED_KEY_USAGE_OID);
if (ext == null)
return null;
DerValue val = new DerValue(ext);
byt... | [
"public",
"static",
"List",
"<",
"String",
">",
"getExtendedKeyUsage",
"(",
"X509Certificate",
"cert",
")",
"throws",
"CertificateParsingException",
"{",
"try",
"{",
"byte",
"[",
"]",
"ext",
"=",
"cert",
".",
"getExtensionValue",
"(",
"EXTENDED_KEY_USAGE_OID",
")"... | This static method is the default implementation of the
getExtendedKeyUsage method in X509Certificate. A
X509Certificate provider generally should overwrite this to
provide among other things caching for better performance. | [
"This",
"static",
"method",
"is",
"the",
"default",
"implementation",
"of",
"the",
"getExtendedKeyUsage",
"method",
"in",
"X509Certificate",
".",
"A",
"X509Certificate",
"provider",
"generally",
"should",
"overwrite",
"this",
"to",
"provide",
"among",
"other",
"thin... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509CertImpl.java#L1511-L1526 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/V1Instance.java | V1Instance.getAsset | private Asset getAsset(Object id, String assetTypeToken) {
"""
Find an asset in the asset cache or create one for this id.
@param id asset will be found for.
@param assetTypeToken The Asset Type Token of the asset to create if one
does not already exist.
@return An Asset that will exist in the as... | java | private Asset getAsset(Object id, String assetTypeToken) {
Asset result = assetCache.get(id);
if (result == null) {
try {
IAssetType assetType = getMetaModel().getAssetType(
assetTypeToken);
if (id instanceof AssetID) {
... | [
"private",
"Asset",
"getAsset",
"(",
"Object",
"id",
",",
"String",
"assetTypeToken",
")",
"{",
"Asset",
"result",
"=",
"assetCache",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"try",
"{",
"IAssetType",
"assetType",
"... | Find an asset in the asset cache or create one for this id.
@param id asset will be found for.
@param assetTypeToken The Asset Type Token of the asset to create if one
does not already exist.
@return An Asset that will exist in the asset cache. | [
"Find",
"an",
"asset",
"in",
"the",
"asset",
"cache",
"or",
"create",
"one",
"for",
"this",
"id",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/V1Instance.java#L554-L575 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java | DebugUtil.printTimeDifference | public static void printTimeDifference(final Calendar pStartCalendar, final Calendar pEndCalendar) {
"""
Prints out the difference between to calendar times two {@code System.out}.
The first calendar object is subtracted from the second one.
<p>
@param pStartCalendar the first {@code java.util.Calendar}.
@para... | java | public static void printTimeDifference(final Calendar pStartCalendar, final Calendar pEndCalendar) {
printTimeDifference(pStartCalendar, pEndCalendar, System.out);
} | [
"public",
"static",
"void",
"printTimeDifference",
"(",
"final",
"Calendar",
"pStartCalendar",
",",
"final",
"Calendar",
"pEndCalendar",
")",
"{",
"printTimeDifference",
"(",
"pStartCalendar",
",",
"pEndCalendar",
",",
"System",
".",
"out",
")",
";",
"}"
] | Prints out the difference between to calendar times two {@code System.out}.
The first calendar object is subtracted from the second one.
<p>
@param pStartCalendar the first {@code java.util.Calendar}.
@param pEndCalendar the second {@code java.util.Calendar}.
@see <a href="http://java.sun.com/products/jdk/1.3/docs/api/... | [
"Prints",
"out",
"the",
"difference",
"between",
"to",
"calendar",
"times",
"two",
"{"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java#L1046-L1048 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/FunctionMultiArgs.java | FunctionMultiArgs.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize) {
"""
This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corre... | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
super.fixupVariables(vars, globalsSize);
if(null != m_args)
{
for (int i = 0; i < m_args.length; i++)
{
m_args[i].fixupVariables(vars, globalsSize);
}
}
} | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"super",
".",
"fixupVariables",
"(",
"vars",
",",
"globalsSize",
")",
";",
"if",
"(",
"null",
"!=",
"m_args",
")",
"{",
"for",
"("... | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector f... | [
"This",
"function",
"is",
"used",
"to",
"fixup",
"variables",
"from",
"QNames",
"to",
"stack",
"frame",
"indexes",
"at",
"stylesheet",
"build",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/FunctionMultiArgs.java#L100-L110 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.newObjectLiteral | @Deprecated
public static Scriptable newObjectLiteral(Object[] propertyIds,
Object[] propertyValues,
Context cx, Scriptable scope) {
"""
This method is here for backward compat with existing compiled code. It
is calle... | java | @Deprecated
public static Scriptable newObjectLiteral(Object[] propertyIds,
Object[] propertyValues,
Context cx, Scriptable scope)
{
// Passing null for getterSetters means no getters or setters
return ne... | [
"@",
"Deprecated",
"public",
"static",
"Scriptable",
"newObjectLiteral",
"(",
"Object",
"[",
"]",
"propertyIds",
",",
"Object",
"[",
"]",
"propertyValues",
",",
"Context",
"cx",
",",
"Scriptable",
"scope",
")",
"{",
"// Passing null for getterSetters means no getters ... | This method is here for backward compat with existing compiled code. It
is called when an object literal is compiled. The next instance will be
the version called from new code.
<strong>This method only present for compatibility.</strong>
@deprecated Use {@link #newObjectLiteral(Object[], Object[], int[], Context, Sc... | [
"This",
"method",
"is",
"here",
"for",
"backward",
"compat",
"with",
"existing",
"compiled",
"code",
".",
"It",
"is",
"called",
"when",
"an",
"object",
"literal",
"is",
"compiled",
".",
"The",
"next",
"instance",
"will",
"be",
"the",
"version",
"called",
"... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L4061-L4068 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ParsedSelectStmt.java | ParsedSelectStmt.fillUpAggResultColumns | private void fillUpAggResultColumns () {
"""
Continue adding TVEs from DisplayColumns that are left in
function needComplexAggregation().
After this function, aggResultColumns construction work.
"""
for (ParsedColInfo col : m_displayColumns) {
if (m_aggResultColumns.contains(col)) {
... | java | private void fillUpAggResultColumns () {
for (ParsedColInfo col : m_displayColumns) {
if (m_aggResultColumns.contains(col)) {
continue;
}
if (col.m_expression instanceof TupleValueExpression) {
m_aggResultColumns.add(col);
}
... | [
"private",
"void",
"fillUpAggResultColumns",
"(",
")",
"{",
"for",
"(",
"ParsedColInfo",
"col",
":",
"m_displayColumns",
")",
"{",
"if",
"(",
"m_aggResultColumns",
".",
"contains",
"(",
"col",
")",
")",
"{",
"continue",
";",
"}",
"if",
"(",
"col",
".",
"... | Continue adding TVEs from DisplayColumns that are left in
function needComplexAggregation().
After this function, aggResultColumns construction work. | [
"Continue",
"adding",
"TVEs",
"from",
"DisplayColumns",
"that",
"are",
"left",
"in",
"function",
"needComplexAggregation",
"()",
".",
"After",
"this",
"function",
"aggResultColumns",
"construction",
"work",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ParsedSelectStmt.java#L513-L529 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/Seconds.java | Seconds.ofHours | public static Seconds ofHours(int hours) {
"""
Obtains a {@code Seconds} representing the number of seconds
equivalent to a number of hours.
<p>
The resulting amount will be second-based, with the number of seconds
equal to the number of hours multiplied by 3600.
@param hours the number of hours, positive ... | java | public static Seconds ofHours(int hours) {
if (hours == 0) {
return ZERO;
}
return new Seconds(Math.multiplyExact(hours, SECONDS_PER_HOUR));
} | [
"public",
"static",
"Seconds",
"ofHours",
"(",
"int",
"hours",
")",
"{",
"if",
"(",
"hours",
"==",
"0",
")",
"{",
"return",
"ZERO",
";",
"}",
"return",
"new",
"Seconds",
"(",
"Math",
".",
"multiplyExact",
"(",
"hours",
",",
"SECONDS_PER_HOUR",
")",
")"... | Obtains a {@code Seconds} representing the number of seconds
equivalent to a number of hours.
<p>
The resulting amount will be second-based, with the number of seconds
equal to the number of hours multiplied by 3600.
@param hours the number of hours, positive or negative
@return the amount with the input hours conver... | [
"Obtains",
"a",
"{",
"@code",
"Seconds",
"}",
"representing",
"the",
"number",
"of",
"seconds",
"equivalent",
"to",
"a",
"number",
"of",
"hours",
".",
"<p",
">",
"The",
"resulting",
"amount",
"will",
"be",
"second",
"-",
"based",
"with",
"the",
"number",
... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/Seconds.java#L138-L143 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.longFunction | public static <R> LongFunction<R> longFunction(CheckedLongFunction<R> function, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedLongFunction} in a {@link LongFunction} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
LongStream.of(1L, 2L, 3L).mapToObj(Unchecked.longFunction(
l ->... | java | public static <R> LongFunction<R> longFunction(CheckedLongFunction<R> function, Consumer<Throwable> handler) {
return t -> {
try {
return function.apply(t);
}
catch (Throwable e) {
handler.accept(e);
throw new IllegalStateExcep... | [
"public",
"static",
"<",
"R",
">",
"LongFunction",
"<",
"R",
">",
"longFunction",
"(",
"CheckedLongFunction",
"<",
"R",
">",
"function",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"t",
"->",
"{",
"try",
"{",
"return",
"functio... | Wrap a {@link CheckedLongFunction} in a {@link LongFunction} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
LongStream.of(1L, 2L, 3L).mapToObj(Unchecked.longFunction(
l -> {
if (l < 0L)
throw new Exception("Only positive numbers allowed");
return "" + l;
},
e -> {
throw new IllegalStateExcep... | [
"Wrap",
"a",
"{",
"@link",
"CheckedLongFunction",
"}",
"in",
"a",
"{",
"@link",
"LongFunction",
"}",
"with",
"a",
"custom",
"handler",
"for",
"checked",
"exceptions",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"LongStream",
".",
"of",
"("... | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1211-L1222 |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoveryDirectorImpl.java | RecoveryDirectorImpl.addRecoveryRecord | private void addRecoveryRecord(RecoveryAgent recoveryAgent, FailureScope failureScope) {
"""
<p>
Internal method to record an outstanding 'initialRecoveryComplete' call that must
be issued by the client service represented by the supplied RecoveryAgent for
the given failure scope.
</p>
<p>
Just prior to re... | java | private void addRecoveryRecord(RecoveryAgent recoveryAgent, FailureScope failureScope) {
if (tc.isEntryEnabled())
Tr.entry(tc, "addRecoveryRecord", new Object[] { recoveryAgent, failureScope, this });
synchronized (_outstandingRecoveryRecords) {
HashSet<RecoveryAgent> recoveryAg... | [
"private",
"void",
"addRecoveryRecord",
"(",
"RecoveryAgent",
"recoveryAgent",
",",
"FailureScope",
"failureScope",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"addRecoveryRecord\"",
",",
"new",
"Objec... | <p>
Internal method to record an outstanding 'initialRecoveryComplete' call that must
be issued by the client service represented by the supplied RecoveryAgent for
the given failure scope.
</p>
<p>
Just prior to requesting a RecoveryAgent to "initiateRecovery" of a
FailureScope, this method is driven to record the req... | [
"<p",
">",
"Internal",
"method",
"to",
"record",
"an",
"outstanding",
"initialRecoveryComplete",
"call",
"that",
"must",
"be",
"issued",
"by",
"the",
"client",
"service",
"represented",
"by",
"the",
"supplied",
"RecoveryAgent",
"for",
"the",
"given",
"failure",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoveryDirectorImpl.java#L1172-L1189 |
aws/aws-sdk-java | aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java | TraceSummary.setAnnotations | public void setAnnotations(java.util.Map<String, java.util.List<ValueWithServiceIds>> annotations) {
"""
<p>
Annotations from the trace's segment documents.
</p>
@param annotations
Annotations from the trace's segment documents.
"""
this.annotations = annotations;
} | java | public void setAnnotations(java.util.Map<String, java.util.List<ValueWithServiceIds>> annotations) {
this.annotations = annotations;
} | [
"public",
"void",
"setAnnotations",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"ValueWithServiceIds",
">",
">",
"annotations",
")",
"{",
"this",
".",
"annotations",
"=",
"annotations",
";",
"}"
] | <p>
Annotations from the trace's segment documents.
</p>
@param annotations
Annotations from the trace's segment documents. | [
"<p",
">",
"Annotations",
"from",
"the",
"trace",
"s",
"segment",
"documents",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java#L556-L558 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java | ServletUtil.getDevice | public static DeviceType getDevice(final HttpServletRequest request) {
"""
Determine the user's device type from the {@link HttpServletRequest}.
@param request the request being processed
@return the device type
"""
// User agent
String userAgent = ((HttpServletRequest) request).getHeader("User-Agent")... | java | public static DeviceType getDevice(final HttpServletRequest request) {
// User agent
String userAgent = ((HttpServletRequest) request).getHeader("User-Agent");
if (Util.empty(userAgent)) {
LOG.warn("No User-Agent details in the request headers. Will assume normal device.");
return DeviceType.NORMAL;
}
... | [
"public",
"static",
"DeviceType",
"getDevice",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"// User agent",
"String",
"userAgent",
"=",
"(",
"(",
"HttpServletRequest",
")",
"request",
")",
".",
"getHeader",
"(",
"\"User-Agent\"",
")",
";",
"if",
"("... | Determine the user's device type from the {@link HttpServletRequest}.
@param request the request being processed
@return the device type | [
"Determine",
"the",
"user",
"s",
"device",
"type",
"from",
"the",
"{",
"@link",
"HttpServletRequest",
"}",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L718-L734 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/AABBUtils.java | AABBUtils.isColliding | public static boolean isColliding(AxisAlignedBB[] aabbs1, AxisAlignedBB[] aabbs2) {
"""
Checks if an {@link AxisAlignedBB} array is colliding with another one.
@param aabbs1 the aabbs1
@param aabbs2 the aabbs2
@return true, if is colliding
"""
if (ArrayUtils.isEmpty(aabbs1) || ArrayUtils.isEmpty(aabbs2)... | java | public static boolean isColliding(AxisAlignedBB[] aabbs1, AxisAlignedBB[] aabbs2)
{
if (ArrayUtils.isEmpty(aabbs1) || ArrayUtils.isEmpty(aabbs2))
return false;
for (AxisAlignedBB aabb1 : aabbs1)
{
if (aabb1 != null)
{
for (AxisAlignedBB aabb2 : aabbs2)
if (aabb2 != null && aabb1.intersects(aab... | [
"public",
"static",
"boolean",
"isColliding",
"(",
"AxisAlignedBB",
"[",
"]",
"aabbs1",
",",
"AxisAlignedBB",
"[",
"]",
"aabbs2",
")",
"{",
"if",
"(",
"ArrayUtils",
".",
"isEmpty",
"(",
"aabbs1",
")",
"||",
"ArrayUtils",
".",
"isEmpty",
"(",
"aabbs2",
")",... | Checks if an {@link AxisAlignedBB} array is colliding with another one.
@param aabbs1 the aabbs1
@param aabbs2 the aabbs2
@return true, if is colliding | [
"Checks",
"if",
"an",
"{",
"@link",
"AxisAlignedBB",
"}",
"array",
"is",
"colliding",
"with",
"another",
"one",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/AABBUtils.java#L379-L395 |
mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/AndroidUtil.java | AndroidUtil.getMinimumCacheSize | @SuppressWarnings("deprecation")
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static int getMinimumCacheSize(Context c, int tileSize, double overdrawFactor, float screenRatio) {
"""
Compute the minimum cache size for a view. When the cache is created we do not actually
know the size of the mapview... | java | @SuppressWarnings("deprecation")
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static int getMinimumCacheSize(Context c, int tileSize, double overdrawFactor, float screenRatio) {
WindowManager wm = (WindowManager) c.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefault... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB_MR2",
")",
"public",
"static",
"int",
"getMinimumCacheSize",
"(",
"Context",
"c",
",",
"int",
"tileSize",
",",
"double",
"overdrawFactor",
... | Compute the minimum cache size for a view. When the cache is created we do not actually
know the size of the mapview, so the screenRatio is an approximation of the required size.
For the view size we use the frame buffer calculated dimension.
@param c the context
@param tileSize the tile size
@param... | [
"Compute",
"the",
"minimum",
"cache",
"size",
"for",
"a",
"view",
".",
"When",
"the",
"cache",
"is",
"created",
"we",
"do",
"not",
"actually",
"know",
"the",
"size",
"of",
"the",
"mapview",
"so",
"the",
"screenRatio",
"is",
"an",
"approximation",
"of",
"... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/AndroidUtil.java#L350-L379 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/VaadinMessageSource.java | VaadinMessageSource.getMessage | public String getMessage(final String code, final Object... args) {
"""
Tries to resolve the message based on
{@link HawkbitCommonUtil#getCurrentLocale()}. Returns message code if fitting
message could not be found.
@param code
the code to lookup up.
@param args
Array of arguments that will be filled in fo... | java | public String getMessage(final String code, final Object... args) {
return getMessage(HawkbitCommonUtil.getCurrentLocale(), code, args);
} | [
"public",
"String",
"getMessage",
"(",
"final",
"String",
"code",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"return",
"getMessage",
"(",
"HawkbitCommonUtil",
".",
"getCurrentLocale",
"(",
")",
",",
"code",
",",
"args",
")",
";",
"}"
] | Tries to resolve the message based on
{@link HawkbitCommonUtil#getCurrentLocale()}. Returns message code if fitting
message could not be found.
@param code
the code to lookup up.
@param args
Array of arguments that will be filled in for params within
the message.
@return the resolved message, or the message code if t... | [
"Tries",
"to",
"resolve",
"the",
"message",
"based",
"on",
"{",
"@link",
"HawkbitCommonUtil#getCurrentLocale",
"()",
"}",
".",
"Returns",
"message",
"code",
"if",
"fitting",
"message",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/VaadinMessageSource.java#L57-L59 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Highlighter.java | Highlighter.setDefault | @SuppressWarnings( {
"""
Sets the default highlighter to highlight anything between {@code prefixTag} and {@code postfixTag}.
@param prefixTag the String that is inserted before a highlighted part of a result.
@param postfixTag the String that is inserted after a highlighted part of a result.
""""WeakerAc... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public static void setDefault(final String prefixTag, final String postfixTag) {
defaultHighlighter = new Highlighter(prefixTag, postfixTag);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"static",
"void",
"setDefault",
"(",
"final",
"String",
"prefixTag",
",",
"final",
"String",
"postfixTag",
")",
"{",
"defaultHighlighter",
"=",
"n... | Sets the default highlighter to highlight anything between {@code prefixTag} and {@code postfixTag}.
@param prefixTag the String that is inserted before a highlighted part of a result.
@param postfixTag the String that is inserted after a highlighted part of a result. | [
"Sets",
"the",
"default",
"highlighter",
"to",
"highlight",
"anything",
"between",
"{",
"@code",
"prefixTag",
"}",
"and",
"{",
"@code",
"postfixTag",
"}",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Highlighter.java#L97-L100 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java | InvokerHelper.findRegex | public static Matcher findRegex(Object left, Object right) {
"""
Find the right hand regex within the left hand string and return a matcher.
@param left string to compare
@param right regular expression to compare the string to
"""
String stringToCompare;
if (left instanceof String) {
... | java | public static Matcher findRegex(Object left, Object right) {
String stringToCompare;
if (left instanceof String) {
stringToCompare = (String) left;
} else {
stringToCompare = toString(left);
}
String regexToCompareTo;
if (right instanceof String) {... | [
"public",
"static",
"Matcher",
"findRegex",
"(",
"Object",
"left",
",",
"Object",
"right",
")",
"{",
"String",
"stringToCompare",
";",
"if",
"(",
"left",
"instanceof",
"String",
")",
"{",
"stringToCompare",
"=",
"(",
"String",
")",
"left",
";",
"}",
"else"... | Find the right hand regex within the left hand string and return a matcher.
@param left string to compare
@param right regular expression to compare the string to | [
"Find",
"the",
"right",
"hand",
"regex",
"within",
"the",
"left",
"hand",
"string",
"and",
"return",
"a",
"matcher",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java#L335-L352 |
dmak/jaxb-xew-plugin | src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java | CommonUtils.removeAnnotation | public static void removeAnnotation(JVar field, JAnnotationUse annotation) {
"""
Remove the given {@code annotation} from the list of annotations for the given {@code field}.
"""
List<JAnnotationUse> annotations = getPrivateField(field, "annotations");
annotations.remove(annotation);
} | java | public static void removeAnnotation(JVar field, JAnnotationUse annotation) {
List<JAnnotationUse> annotations = getPrivateField(field, "annotations");
annotations.remove(annotation);
} | [
"public",
"static",
"void",
"removeAnnotation",
"(",
"JVar",
"field",
",",
"JAnnotationUse",
"annotation",
")",
"{",
"List",
"<",
"JAnnotationUse",
">",
"annotations",
"=",
"getPrivateField",
"(",
"field",
",",
"\"annotations\"",
")",
";",
"annotations",
".",
"r... | Remove the given {@code annotation} from the list of annotations for the given {@code field}. | [
"Remove",
"the",
"given",
"{"
] | train | https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L124-L127 |
Falydoor/limesurvey-rc | src/main/java/com/github/falydoor/limesurveyrc/LimesurveyRC.java | LimesurveyRC.getQuestion | public LsQuestion getQuestion(int surveyId, int questionId) throws LimesurveyRCException {
"""
Gets question from a survey.
@param surveyId the survey id of the survey you want to get the question
@param questionId the question id
@return the question
@throws LimesurveyRCException if no question was found ... | java | public LsQuestion getQuestion(int surveyId, int questionId) throws LimesurveyRCException {
return getQuestions(surveyId).filter(question -> question.getId() == questionId)
.findFirst().orElseThrow(() -> new LimesurveyRCException("No question found for id " + questionId + " in survey " + surveyId... | [
"public",
"LsQuestion",
"getQuestion",
"(",
"int",
"surveyId",
",",
"int",
"questionId",
")",
"throws",
"LimesurveyRCException",
"{",
"return",
"getQuestions",
"(",
"surveyId",
")",
".",
"filter",
"(",
"question",
"->",
"question",
".",
"getId",
"(",
")",
"=="... | Gets question from a survey.
@param surveyId the survey id of the survey you want to get the question
@param questionId the question id
@return the question
@throws LimesurveyRCException if no question was found with the given id | [
"Gets",
"question",
"from",
"a",
"survey",
"."
] | train | https://github.com/Falydoor/limesurvey-rc/blob/b8d573389086395e46a0bdeeddeef4d1c2c0a488/src/main/java/com/github/falydoor/limesurveyrc/LimesurveyRC.java#L223-L226 |
realtime-framework/RealtimeStorage-Android | library/src/main/java/co/realtime/storage/TableRef.java | TableRef.notNull | public TableRef notNull(String attributeName) {
"""
Applies a filter to the table reference. When fetched, it will return the non null values.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
TableRef tableRef = storage.table("your_table");
// Retrieve all items where their "itemP... | java | public TableRef notNull(String attributeName){
filters.add(new Filter(StorageFilter.NOTNULL, attributeName, null, null));
return this;
} | [
"public",
"TableRef",
"notNull",
"(",
"String",
"attributeName",
")",
"{",
"filters",
".",
"add",
"(",
"new",
"Filter",
"(",
"StorageFilter",
".",
"NOTNULL",
",",
"attributeName",
",",
"null",
",",
"null",
")",
")",
";",
"return",
"this",
";",
"}"
] | Applies a filter to the table reference. When fetched, it will return the non null values.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
TableRef tableRef = storage.table("your_table");
// Retrieve all items where their "itemProperty" value is not null
tableRef.notNull("itemProperty").getI... | [
"Applies",
"a",
"filter",
"to",
"the",
"table",
"reference",
".",
"When",
"fetched",
"it",
"will",
"return",
"the",
"non",
"null",
"values",
"."
] | train | https://github.com/realtime-framework/RealtimeStorage-Android/blob/05816a6b7a6dcc83f9e7400ac3048494dadca302/library/src/main/java/co/realtime/storage/TableRef.java#L796-L799 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java | HtmlRendererUtils.decodeUIInput | public static void decodeUIInput(FacesContext facesContext, UIComponent component) {
"""
Utility to set the submitted value of the provided component from the
data in the current request object.
<p/>
Param component is required to be an EditableValueHolder. On return
from this method, the component's submitted... | java | public static void decodeUIInput(FacesContext facesContext, UIComponent component)
{
if (!(component instanceof EditableValueHolder))
{
throw new IllegalArgumentException("Component "
+ component.getClientId(facesContext)
+ " is not an EditableValu... | [
"public",
"static",
"void",
"decodeUIInput",
"(",
"FacesContext",
"facesContext",
",",
"UIComponent",
"component",
")",
"{",
"if",
"(",
"!",
"(",
"component",
"instanceof",
"EditableValueHolder",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"C... | Utility to set the submitted value of the provided component from the
data in the current request object.
<p/>
Param component is required to be an EditableValueHolder. On return
from this method, the component's submittedValue property will be
set if the submitted form contained that component. | [
"Utility",
"to",
"set",
"the",
"submitted",
"value",
"of",
"the",
"provided",
"component",
"from",
"the",
"data",
"in",
"the",
"current",
"request",
"object",
".",
"<p",
"/",
">",
"Param",
"component",
"is",
"required",
"to",
"be",
"an",
"EditableValueHolder... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java#L107-L132 |
nutzam/nutzboot | nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java | FastdfsService.uploadFile | public String uploadFile(byte[] file, String ext, Map<String, String> metaInfo) {
"""
上传文件(一次性读取全部字节,尽量不要使用,比较耗内存)
@param file 文件字节
@param ext 后缀名
@param metaInfo 元信息
@return
"""
String path = "";
TrackerServer trackerServer = null;
StorageClient1 storageClient1 = null;
... | java | public String uploadFile(byte[] file, String ext, Map<String, String> metaInfo) {
String path = "";
TrackerServer trackerServer = null;
StorageClient1 storageClient1 = null;
try {
trackerServer = fastDfsClientPool.borrowObject();
storageClient1 = new StorageClient... | [
"public",
"String",
"uploadFile",
"(",
"byte",
"[",
"]",
"file",
",",
"String",
"ext",
",",
"Map",
"<",
"String",
",",
"String",
">",
"metaInfo",
")",
"{",
"String",
"path",
"=",
"\"\"",
";",
"TrackerServer",
"trackerServer",
"=",
"null",
";",
"StorageCl... | 上传文件(一次性读取全部字节,尽量不要使用,比较耗内存)
@param file 文件字节
@param ext 后缀名
@param metaInfo 元信息
@return | [
"上传文件",
"(",
"一次性读取全部字节",
"尽量不要使用",
"比较耗内存",
")"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-starter/nutzboot-starter-fastdfs/src/main/java/org/nutz/boot/starter/fastdfs/FastdfsService.java#L199-L224 |
Jasig/uPortal | uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/node/UserLayoutChannelDescription.java | UserLayoutChannelDescription.setParameterValue | @Override
public String setParameterValue(String parameterName, String parameterValue) {
"""
Set a channel parameter value.
@param parameterValue a <code>String</code> value
@param parameterName a <code>String</code> value
@return a <code>String</code> value that was set.
"""
// don't try to s... | java | @Override
public String setParameterValue(String parameterName, String parameterValue) {
// don't try to store a null value
if (parameterValue == null) return null;
return (String) parameters.put(parameterName, parameterValue);
} | [
"@",
"Override",
"public",
"String",
"setParameterValue",
"(",
"String",
"parameterName",
",",
"String",
"parameterValue",
")",
"{",
"// don't try to store a null value",
"if",
"(",
"parameterValue",
"==",
"null",
")",
"return",
"null",
";",
"return",
"(",
"String",... | Set a channel parameter value.
@param parameterValue a <code>String</code> value
@param parameterName a <code>String</code> value
@return a <code>String</code> value that was set. | [
"Set",
"a",
"channel",
"parameter",
"value",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-core/src/main/java/org/apereo/portal/layout/node/UserLayoutChannelDescription.java#L374-L379 |
micrometer-metrics/micrometer | micrometer-spring-legacy/src/main/java/io/micrometer/spring/async/ThreadPoolTaskExecutorMetrics.java | ThreadPoolTaskExecutorMetrics.monitor | public static ThreadPoolTaskExecutor monitor(MeterRegistry registry, String name, Iterable<Tag> tags) {
"""
Returns a new {@link ThreadPoolTaskExecutor} with recorded metrics.
@param registry The registry to bind metrics to.
@param name The name prefix of the metrics.
@param tags Tags to apply to all ... | java | public static ThreadPoolTaskExecutor monitor(MeterRegistry registry, String name, Iterable<Tag> tags) {
return new TimedThreadPoolTaskExecutor(registry, name, tags);
} | [
"public",
"static",
"ThreadPoolTaskExecutor",
"monitor",
"(",
"MeterRegistry",
"registry",
",",
"String",
"name",
",",
"Iterable",
"<",
"Tag",
">",
"tags",
")",
"{",
"return",
"new",
"TimedThreadPoolTaskExecutor",
"(",
"registry",
",",
"name",
",",
"tags",
")",
... | Returns a new {@link ThreadPoolTaskExecutor} with recorded metrics.
@param registry The registry to bind metrics to.
@param name The name prefix of the metrics.
@param tags Tags to apply to all recorded metrics.
@return The instrumented executor, proxied. | [
"Returns",
"a",
"new",
"{",
"@link",
"ThreadPoolTaskExecutor",
"}",
"with",
"recorded",
"metrics",
"."
] | train | https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-spring-legacy/src/main/java/io/micrometer/spring/async/ThreadPoolTaskExecutorMetrics.java#L64-L66 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/AbstractLongObjectMap.java | AbstractLongObjectMap.keyOf | public long keyOf(final Object value) {
"""
Returns the first key the given value is associated with.
It is often a good idea to first check with {@link #containsValue(Object)} whether there exists an association from a key to this value.
Search order is guaranteed to be <i>identical</i> to the order used by met... | java | public long keyOf(final Object value) {
final long[] foundKey = new long[1];
boolean notFound = forEachPair(
new LongObjectProcedure() {
public boolean apply(long iterKey, Object iterValue) {
boolean found = value == iterValue;
if (found) foundKey[0] = iterKey;
return !found;
}
}
);
... | [
"public",
"long",
"keyOf",
"(",
"final",
"Object",
"value",
")",
"{",
"final",
"long",
"[",
"]",
"foundKey",
"=",
"new",
"long",
"[",
"1",
"]",
";",
"boolean",
"notFound",
"=",
"forEachPair",
"(",
"new",
"LongObjectProcedure",
"(",
")",
"{",
"public",
... | Returns the first key the given value is associated with.
It is often a good idea to first check with {@link #containsValue(Object)} whether there exists an association from a key to this value.
Search order is guaranteed to be <i>identical</i> to the order used by method {@link #forEachKey(LongProcedure)}.
@param val... | [
"Returns",
"the",
"first",
"key",
"the",
"given",
"value",
"is",
"associated",
"with",
".",
"It",
"is",
"often",
"a",
"good",
"idea",
"to",
"first",
"check",
"with",
"{",
"@link",
"#containsValue",
"(",
"Object",
")",
"}",
"whether",
"there",
"exists",
"... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractLongObjectMap.java#L170-L183 |
keenon/loglinear | src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java | ConcatVectorNamespace.setDenseFeature | public void setDenseFeature(ConcatVector vector, String featureName, double[] value) {
"""
This adds a dense feature to a vector, setting the appropriate component of the given vector to the passed in
value.
@param vector the vector
@param featureName the feature whose value to set
@param value the value we wa... | java | public void setDenseFeature(ConcatVector vector, String featureName, double[] value) {
vector.setDenseComponent(ensureFeature(featureName), value);
} | [
"public",
"void",
"setDenseFeature",
"(",
"ConcatVector",
"vector",
",",
"String",
"featureName",
",",
"double",
"[",
"]",
"value",
")",
"{",
"vector",
".",
"setDenseComponent",
"(",
"ensureFeature",
"(",
"featureName",
")",
",",
"value",
")",
";",
"}"
] | This adds a dense feature to a vector, setting the appropriate component of the given vector to the passed in
value.
@param vector the vector
@param featureName the feature whose value to set
@param value the value we want to set this vector to | [
"This",
"adds",
"a",
"dense",
"feature",
"to",
"a",
"vector",
"setting",
"the",
"appropriate",
"component",
"of",
"the",
"given",
"vector",
"to",
"the",
"passed",
"in",
"value",
"."
] | train | https://github.com/keenon/loglinear/blob/fa0c370ab6782015412f676ef2ab11c97be58e29/src/main/java/com/github/keenon/loglinear/model/ConcatVectorNamespace.java#L134-L136 |
phax/ph-commons | ph-security/src/main/java/com/helger/security/certificate/CertificateHelper.java | CertificateHelper.getPEMEncodedCertificate | @Nonnull
@Nonempty
public static String getPEMEncodedCertificate (@Nonnull final Certificate aCert) {
"""
Get the provided certificate as PEM (Base64) encoded String.
@param aCert
The certificate to encode. May not be <code>null</code>.
@return The PEM string with {@link #BEGIN_CERTIFICATE} and
{@link #E... | java | @Nonnull
@Nonempty
public static String getPEMEncodedCertificate (@Nonnull final Certificate aCert)
{
ValueEnforcer.notNull (aCert, "Cert");
try
{
final String sEncodedCert = Base64.encodeBytes (aCert.getEncoded ());
return BEGIN_CERTIFICATE + "\n" + sEncodedCert + "\n" + END_CERTIFICATE;
... | [
"@",
"Nonnull",
"@",
"Nonempty",
"public",
"static",
"String",
"getPEMEncodedCertificate",
"(",
"@",
"Nonnull",
"final",
"Certificate",
"aCert",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aCert",
",",
"\"Cert\"",
")",
";",
"try",
"{",
"final",
"String",
... | Get the provided certificate as PEM (Base64) encoded String.
@param aCert
The certificate to encode. May not be <code>null</code>.
@return The PEM string with {@link #BEGIN_CERTIFICATE} and
{@link #END_CERTIFICATE}.
@throws IllegalArgumentException
If the certificate could not be encoded. Cause is a
{@link Certificate... | [
"Get",
"the",
"provided",
"certificate",
"as",
"PEM",
"(",
"Base64",
")",
"encoded",
"String",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-security/src/main/java/com/helger/security/certificate/CertificateHelper.java#L318-L332 |
diirt/util | src/main/java/org/epics/util/text/StringUtil.java | StringUtil.parseCSVLine | public static List<Object> parseCSVLine(String line, String separatorRegex) {
"""
Parses a line of text representing comma separated values and returns
the values themselves.
@param line the line to parse
@param separatorRegex the regular expression for the separator
@return the list of values
"""
... | java | public static List<Object> parseCSVLine(String line, String separatorRegex) {
List<Object> matches = new ArrayList<>();
int currentPosition = 0;
Matcher separatorMatcher = Pattern.compile("^" + separatorRegex).matcher(line);
Matcher stringMatcher = Pattern.compile("^" + QUOTED_STRING... | [
"public",
"static",
"List",
"<",
"Object",
">",
"parseCSVLine",
"(",
"String",
"line",
",",
"String",
"separatorRegex",
")",
"{",
"List",
"<",
"Object",
">",
"matches",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
"currentPosition",
"=",
"0",
";"... | Parses a line of text representing comma separated values and returns
the values themselves.
@param line the line to parse
@param separatorRegex the regular expression for the separator
@return the list of values | [
"Parses",
"a",
"line",
"of",
"text",
"representing",
"comma",
"separated",
"values",
"and",
"returns",
"the",
"values",
"themselves",
"."
] | train | https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/text/StringUtil.java#L111-L140 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/extension/std/XIdentityExtension.java | XIdentityExtension.assignID | public void assignID(XAttributable element, XID id) {
"""
Assigns any log data hierarchy element its id, as defined by this
extension's id attribute.
@param element
Log hierarchy element to assign id to.
@param id
The id to be assigned.
"""
if (id != null) {
XAttributeID attr = (XAttributeID) ATT... | java | public void assignID(XAttributable element, XID id) {
if (id != null) {
XAttributeID attr = (XAttributeID) ATTR_ID.clone();
attr.setValue(id);
element.getAttributes().put(KEY_ID, attr);
}
} | [
"public",
"void",
"assignID",
"(",
"XAttributable",
"element",
",",
"XID",
"id",
")",
"{",
"if",
"(",
"id",
"!=",
"null",
")",
"{",
"XAttributeID",
"attr",
"=",
"(",
"XAttributeID",
")",
"ATTR_ID",
".",
"clone",
"(",
")",
";",
"attr",
".",
"setValue",
... | Assigns any log data hierarchy element its id, as defined by this
extension's id attribute.
@param element
Log hierarchy element to assign id to.
@param id
The id to be assigned. | [
"Assigns",
"any",
"log",
"data",
"hierarchy",
"element",
"its",
"id",
"as",
"defined",
"by",
"this",
"extension",
"s",
"id",
"attribute",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XIdentityExtension.java#L147-L153 |
cqframework/clinical_quality_language | Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java | ElmBaseVisitor.visitFunctionRef | public T visitFunctionRef(FunctionRef elm, C context) {
"""
Visit a FunctionRef. This method will be called for
every node in the tree that is a FunctionRef.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result
"""
for (Expression element : elm.g... | java | public T visitFunctionRef(FunctionRef elm, C context) {
for (Expression element : elm.getOperand()) {
visitElement(element, context);
}
return null;
} | [
"public",
"T",
"visitFunctionRef",
"(",
"FunctionRef",
"elm",
",",
"C",
"context",
")",
"{",
"for",
"(",
"Expression",
"element",
":",
"elm",
".",
"getOperand",
"(",
")",
")",
"{",
"visitElement",
"(",
"element",
",",
"context",
")",
";",
"}",
"return",
... | Visit a FunctionRef. This method will be called for
every node in the tree that is a FunctionRef.
@param elm the ELM tree
@param context the context passed to the visitor
@return the visitor result | [
"Visit",
"a",
"FunctionRef",
".",
"This",
"method",
"will",
"be",
"called",
"for",
"every",
"node",
"in",
"the",
"tree",
"that",
"is",
"a",
"FunctionRef",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L357-L362 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AuditResources.java | AuditResources.findById | @GET
@Path("/ {
"""
Returns the audit record for the given id.
@param id entityId The entity Id. Cannot be null.
@return The audit object.
@throws WebApplicationException Throws the exception for invalid input data.
"""id}")
@Description("Returns the audit trail for a given Id.")
@Pr... | java | @GET
@Path("/{id}")
@Description("Returns the audit trail for a given Id.")
@Produces(MediaType.APPLICATION_JSON)
public AuditDto findById(@PathParam("id") BigInteger id) {
if (id == null || id.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("ID cannot be null and... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{id}\"",
")",
"@",
"Description",
"(",
"\"Returns the audit trail for a given Id.\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"AuditDto",
"findById",
"(",
"@",
"PathParam",
"(",
"\"id\"",
... | Returns the audit record for the given id.
@param id entityId The entity Id. Cannot be null.
@return The audit object.
@throws WebApplicationException Throws the exception for invalid input data. | [
"Returns",
"the",
"audit",
"record",
"for",
"the",
"given",
"id",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AuditResources.java#L106-L122 |
Quickhull3d/quickhull3d | src/main/java/com/github/quickhull3d/Vector3d.java | Vector3d.setRandom | protected void setRandom(double lower, double upper, Random generator) {
"""
Sets the elements of this vector to uniformly distributed random values
in a specified range, using a supplied random number generator.
@param lower
lower random value (inclusive)
@param upper
upper random value (exclusive)
@param... | java | protected void setRandom(double lower, double upper, Random generator) {
double range = upper - lower;
x = generator.nextDouble() * range + lower;
y = generator.nextDouble() * range + lower;
z = generator.nextDouble() * range + lower;
} | [
"protected",
"void",
"setRandom",
"(",
"double",
"lower",
",",
"double",
"upper",
",",
"Random",
"generator",
")",
"{",
"double",
"range",
"=",
"upper",
"-",
"lower",
";",
"x",
"=",
"generator",
".",
"nextDouble",
"(",
")",
"*",
"range",
"+",
"lower",
... | Sets the elements of this vector to uniformly distributed random values
in a specified range, using a supplied random number generator.
@param lower
lower random value (inclusive)
@param upper
upper random value (exclusive)
@param generator
random number generator | [
"Sets",
"the",
"elements",
"of",
"this",
"vector",
"to",
"uniformly",
"distributed",
"random",
"values",
"in",
"a",
"specified",
"range",
"using",
"a",
"supplied",
"random",
"number",
"generator",
"."
] | train | https://github.com/Quickhull3d/quickhull3d/blob/3f80953b86c46385e84730e5d2a1745cbfa12703/src/main/java/com/github/quickhull3d/Vector3d.java#L369-L375 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java | ReceiveMessageBuilder.headerFragment | public T headerFragment(Object model, String mapperName) {
"""
Expect this message header data as model object which is marshalled to a character sequence using the given object to xml mapper that
is accessed by its bean name in Spring bean application context.
@param model
@param mapperName
@return
"""
... | java | public T headerFragment(Object model, String mapperName) {
Assert.notNull(applicationContext, "Citrus application context is not initialized!");
if (applicationContext.containsBean(mapperName)) {
Object mapper = applicationContext.getBean(mapperName);
if (Marshaller.class.isAss... | [
"public",
"T",
"headerFragment",
"(",
"Object",
"model",
",",
"String",
"mapperName",
")",
"{",
"Assert",
".",
"notNull",
"(",
"applicationContext",
",",
"\"Citrus application context is not initialized!\"",
")",
";",
"if",
"(",
"applicationContext",
".",
"containsBea... | Expect this message header data as model object which is marshalled to a character sequence using the given object to xml mapper that
is accessed by its bean name in Spring bean application context.
@param model
@param mapperName
@return | [
"Expect",
"this",
"message",
"header",
"data",
"as",
"model",
"object",
"which",
"is",
"marshalled",
"to",
"a",
"character",
"sequence",
"using",
"the",
"given",
"object",
"to",
"xml",
"mapper",
"that",
"is",
"accessed",
"by",
"its",
"bean",
"name",
"in",
... | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L360-L376 |
cverges/expect4j | src/main/java/expect4j/ExpectUtils.java | ExpectUtils.SSH | public static Expect4j SSH(String hostname, String username, String password) throws Exception {
"""
Creates an SSH session to the given server on TCP port 22 using
the provided credentials. This is equivalent to Expect's
<code>spawn ssh $hostname</code>.
@param hostname the DNS or IP address of the remote s... | java | public static Expect4j SSH(String hostname, String username, String password) throws Exception {
return SSH(hostname, username, password, 22);
} | [
"public",
"static",
"Expect4j",
"SSH",
"(",
"String",
"hostname",
",",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"Exception",
"{",
"return",
"SSH",
"(",
"hostname",
",",
"username",
",",
"password",
",",
"22",
")",
";",
"}"
] | Creates an SSH session to the given server on TCP port 22 using
the provided credentials. This is equivalent to Expect's
<code>spawn ssh $hostname</code>.
@param hostname the DNS or IP address of the remote server
@param username the account name to use when authenticating
@param password the account password to use ... | [
"Creates",
"an",
"SSH",
"session",
"to",
"the",
"given",
"server",
"on",
"TCP",
"port",
"22",
"using",
"the",
"provided",
"credentials",
".",
"This",
"is",
"equivalent",
"to",
"Expect",
"s",
"<code",
">",
"spawn",
"ssh",
"$hostname<",
"/",
"code",
">",
"... | train | https://github.com/cverges/expect4j/blob/97b1da9b7bd231344cd7b7ce26d14caf8bb16cd6/src/main/java/expect4j/ExpectUtils.java#L164-L166 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.translationRotateMul | public Matrix4x3f translationRotateMul(float tx, float ty, float tz, Quaternionfc quat, Matrix4x3fc mat) {
"""
Set <code>this</code> matrix to <code>T * R * M</code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code>,
<code>R</code> is a rotation - and possibly scaling - transformation ... | java | public Matrix4x3f translationRotateMul(float tx, float ty, float tz, Quaternionfc quat, Matrix4x3fc mat) {
return translationRotateMul(tx, ty, tz, quat.x(), quat.y(), quat.z(), quat.w(), mat);
} | [
"public",
"Matrix4x3f",
"translationRotateMul",
"(",
"float",
"tx",
",",
"float",
"ty",
",",
"float",
"tz",
",",
"Quaternionfc",
"quat",
",",
"Matrix4x3fc",
"mat",
")",
"{",
"return",
"translationRotateMul",
"(",
"tx",
",",
"ty",
",",
"tz",
",",
"quat",
".... | Set <code>this</code> matrix to <code>T * R * M</code>, where <code>T</code> is a translation by the given <code>(tx, ty, tz)</code>,
<code>R</code> is a rotation - and possibly scaling - transformation specified by the given quaternion and <code>M</code> is the given matrix <code>mat</code>.
<p>
When transforming a ve... | [
"Set",
"<code",
">",
"this<",
"/",
"code",
">",
"matrix",
"to",
"<code",
">",
"T",
"*",
"R",
"*",
"M<",
"/",
"code",
">",
"where",
"<code",
">",
"T<",
"/",
"code",
">",
"is",
"a",
"translation",
"by",
"the",
"given",
"<code",
">",
"(",
"tx",
"t... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L2958-L2960 |
futuresimple/android-db-commons | library/src/main/java/com/getbase/android/db/cursors/FluentCursor.java | FluentCursor.toOnlyElement | public <T> T toOnlyElement(Function<? super Cursor, T> singleRowTransform) {
"""
Returns the only row of this cursor transformed using the given function.
WARNING: This method closes cursor. Do not use this from onLoadFinished()
@param singleRowTransform Function to apply on the only row of this cursor
@param... | java | public <T> T toOnlyElement(Function<? super Cursor, T> singleRowTransform) {
try {
switch (getCount()) {
case 0:
throw new NoSuchElementException();
case 1:
moveToFirst();
return singleRowTransform.apply(this);
default:
throw new IllegalArgumentException("expe... | [
"public",
"<",
"T",
">",
"T",
"toOnlyElement",
"(",
"Function",
"<",
"?",
"super",
"Cursor",
",",
"T",
">",
"singleRowTransform",
")",
"{",
"try",
"{",
"switch",
"(",
"getCount",
"(",
")",
")",
"{",
"case",
"0",
":",
"throw",
"new",
"NoSuchElementExcep... | Returns the only row of this cursor transformed using the given function.
WARNING: This method closes cursor. Do not use this from onLoadFinished()
@param singleRowTransform Function to apply on the only row of this cursor
@param <T> Type of returned element
@return Transformed first row of the cursor. If the cursor i... | [
"Returns",
"the",
"only",
"row",
"of",
"this",
"cursor",
"transformed",
"using",
"the",
"given",
"function",
".",
"WARNING",
":",
"This",
"method",
"closes",
"cursor",
".",
"Do",
"not",
"use",
"this",
"from",
"onLoadFinished",
"()"
] | train | https://github.com/futuresimple/android-db-commons/blob/a3c37df806f61b1bfab6927ba3710cbb0fa9229a/library/src/main/java/com/getbase/android/db/cursors/FluentCursor.java#L129-L143 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/listeners/OnBindViewHolderListenerImpl.java | OnBindViewHolderListenerImpl.onViewAttachedToWindow | @Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder viewHolder, int position) {
"""
is called in onViewAttachedToWindow when the view is detached from the window
@param viewHolder the viewHolder for the type at this position
@param position the position of this viewHolder
"""
... | java | @Override
public void onViewAttachedToWindow(RecyclerView.ViewHolder viewHolder, int position) {
IItem item = FastAdapter.getHolderAdapterItem(viewHolder, position);
if (item != null) {
try {
item.attachToWindow(viewHolder);
if (viewHolder instanceof FastA... | [
"@",
"Override",
"public",
"void",
"onViewAttachedToWindow",
"(",
"RecyclerView",
".",
"ViewHolder",
"viewHolder",
",",
"int",
"position",
")",
"{",
"IItem",
"item",
"=",
"FastAdapter",
".",
"getHolderAdapterItem",
"(",
"viewHolder",
",",
"position",
")",
";",
"... | is called in onViewAttachedToWindow when the view is detached from the window
@param viewHolder the viewHolder for the type at this position
@param position the position of this viewHolder | [
"is",
"called",
"in",
"onViewAttachedToWindow",
"when",
"the",
"view",
"is",
"detached",
"from",
"the",
"window"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/listeners/OnBindViewHolderListenerImpl.java#L66-L79 |
alkacon/opencms-core | src/org/opencms/ade/galleries/CmsGalleryService.java | CmsGalleryService.getVfsTreeState | public static CmsTreeOpenState getVfsTreeState(HttpServletRequest request, String treeToken) {
"""
Convenience method for reading the saved VFS tree state from the session.<p>
@param request the current request
@param treeToken the tree token (may be null)
@return the saved tree open state (may be null)
... | java | public static CmsTreeOpenState getVfsTreeState(HttpServletRequest request, String treeToken) {
return (CmsTreeOpenState)request.getSession().getAttribute(
getTreeOpenStateAttributeName(I_CmsGalleryProviderConstants.TREE_VFS, treeToken));
} | [
"public",
"static",
"CmsTreeOpenState",
"getVfsTreeState",
"(",
"HttpServletRequest",
"request",
",",
"String",
"treeToken",
")",
"{",
"return",
"(",
"CmsTreeOpenState",
")",
"request",
".",
"getSession",
"(",
")",
".",
"getAttribute",
"(",
"getTreeOpenStateAttributeN... | Convenience method for reading the saved VFS tree state from the session.<p>
@param request the current request
@param treeToken the tree token (may be null)
@return the saved tree open state (may be null) | [
"Convenience",
"method",
"for",
"reading",
"the",
"saved",
"VFS",
"tree",
"state",
"from",
"the",
"session",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/CmsGalleryService.java#L492-L497 |
ontop/ontop | mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/TargetQueryRenderer.java | TargetQueryRenderer.encode | public static String encode(ImmutableList<TargetAtom> body, PrefixManager prefixManager) {
"""
Transforms the given <code>OBDAQuery</code> into a string. The method requires
a prefix manager to shorten full IRI name.
"""
TurtleWriter turtleWriter = new TurtleWriter();
for (TargetAtom atom : body) {
St... | java | public static String encode(ImmutableList<TargetAtom> body, PrefixManager prefixManager) {
TurtleWriter turtleWriter = new TurtleWriter();
for (TargetAtom atom : body) {
String subject, predicate, object = "";
String originalString = atom.getProjectionAtom().getPredicate().toString();
if (isUnary(atom.get... | [
"public",
"static",
"String",
"encode",
"(",
"ImmutableList",
"<",
"TargetAtom",
">",
"body",
",",
"PrefixManager",
"prefixManager",
")",
"{",
"TurtleWriter",
"turtleWriter",
"=",
"new",
"TurtleWriter",
"(",
")",
";",
"for",
"(",
"TargetAtom",
"atom",
":",
"bo... | Transforms the given <code>OBDAQuery</code> into a string. The method requires
a prefix manager to shorten full IRI name. | [
"Transforms",
"the",
"given",
"<code",
">",
"OBDAQuery<",
"/",
"code",
">",
"into",
"a",
"string",
".",
"The",
"method",
"requires",
"a",
"prefix",
"manager",
"to",
"shorten",
"full",
"IRI",
"name",
"."
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/TargetQueryRenderer.java#L45-L81 |
mlhartme/sushi | src/main/java/net/oneandone/sushi/fs/Node.java | Node.writeXml | public T writeXml(org.w3c.dom.Node node, boolean format) throws IOException {
"""
Write the specified node into this file. Adds indentation/newlines when format is true. Otherwise, writes
the document "as is" (but always prefixes the document with an xml declaration and encloses attributes in
double quotes).
... | java | public T writeXml(org.w3c.dom.Node node, boolean format) throws IOException {
getWorld().getXml().getSerializer().serialize(node, this, format);
return (T) this;
} | [
"public",
"T",
"writeXml",
"(",
"org",
".",
"w3c",
".",
"dom",
".",
"Node",
"node",
",",
"boolean",
"format",
")",
"throws",
"IOException",
"{",
"getWorld",
"(",
")",
".",
"getXml",
"(",
")",
".",
"getSerializer",
"(",
")",
".",
"serialize",
"(",
"no... | Write the specified node into this file. Adds indentation/newlines when format is true. Otherwise, writes
the document "as is" (but always prefixes the document with an xml declaration and encloses attributes in
double quotes).
@return this node | [
"Write",
"the",
"specified",
"node",
"into",
"this",
"file",
".",
"Adds",
"indentation",
"/",
"newlines",
"when",
"format",
"is",
"true",
".",
"Otherwise",
"writes",
"the",
"document",
"as",
"is",
"(",
"but",
"always",
"prefixes",
"the",
"document",
"with",
... | train | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/fs/Node.java#L717-L720 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java | BeatGridFinder.updateBeatGrid | private void updateBeatGrid(TrackMetadataUpdate update, BeatGrid beatGrid) {
"""
We have obtained a beat grid for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this beat grid
@param beatGrid the beat grid which we retrieved
"""
hotCache.put(Deck... | java | private void updateBeatGrid(TrackMetadataUpdate update, BeatGrid beatGrid) {
hotCache.put(DeckReference.getDeckReference(update.player, 0), beatGrid); // Main deck
if (update.metadata.getCueList() != null) { // Update the cache with any hot cues in this track as well
for (CueList.Entry ent... | [
"private",
"void",
"updateBeatGrid",
"(",
"TrackMetadataUpdate",
"update",
",",
"BeatGrid",
"beatGrid",
")",
"{",
"hotCache",
".",
"put",
"(",
"DeckReference",
".",
"getDeckReference",
"(",
"update",
".",
"player",
",",
"0",
")",
",",
"beatGrid",
")",
";",
"... | We have obtained a beat grid for a device, so store it and alert any listeners.
@param update the update which caused us to retrieve this beat grid
@param beatGrid the beat grid which we retrieved | [
"We",
"have",
"obtained",
"a",
"beat",
"grid",
"for",
"a",
"device",
"so",
"store",
"it",
"and",
"alert",
"any",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/BeatGridFinder.java#L161-L171 |
beanshell/beanshell | src/main/java/bsh/Types.java | Types.isBshAssignable | static boolean isBshAssignable( Class toType, Class fromType ) {
"""
Test if a type can be converted to another type via BeanShell
extended syntax rules (a superset of Java conversion rules).
"""
try {
return castObject(
toType, fromType, null/*fromValue*/,
... | java | static boolean isBshAssignable( Class toType, Class fromType )
{
try {
return castObject(
toType, fromType, null/*fromValue*/,
ASSIGNMENT, true/*checkOnly*/
) == VALID_CAST;
} catch ( UtilEvalError e ) {
// This should not happen wi... | [
"static",
"boolean",
"isBshAssignable",
"(",
"Class",
"toType",
",",
"Class",
"fromType",
")",
"{",
"try",
"{",
"return",
"castObject",
"(",
"toType",
",",
"fromType",
",",
"null",
"/*fromValue*/",
",",
"ASSIGNMENT",
",",
"true",
"/*checkOnly*/",
")",
"==",
... | Test if a type can be converted to another type via BeanShell
extended syntax rules (a superset of Java conversion rules). | [
"Test",
"if",
"a",
"type",
"can",
"be",
"converted",
"to",
"another",
"type",
"via",
"BeanShell",
"extended",
"syntax",
"rules",
"(",
"a",
"superset",
"of",
"Java",
"conversion",
"rules",
")",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Types.java#L370-L381 |
tianjing/tgtools.web.develop | src/main/java/tgtools/web/develop/util/ValidHelper.java | ValidHelper.validBigTextLength | public static void validBigTextLength(String pContent,int pLength,String pParamName) throws APPErrorException {
"""
验证大文本长度
@param pContent 文本
@param pLength 规则长度
@param pParamName 参数名称
@throws APPErrorException
"""
if(!StringUtil.isNullOrEmpty(pContent)&&pContent.length()>pLength)
{
... | java | public static void validBigTextLength(String pContent,int pLength,String pParamName) throws APPErrorException {
if(!StringUtil.isNullOrEmpty(pContent)&&pContent.length()>pLength)
{
throw new APPErrorException((null==pParamName?StringUtil.EMPTY_STRING:pParamName)+"长度不能超过"+pLength+",请调整;");
... | [
"public",
"static",
"void",
"validBigTextLength",
"(",
"String",
"pContent",
",",
"int",
"pLength",
",",
"String",
"pParamName",
")",
"throws",
"APPErrorException",
"{",
"if",
"(",
"!",
"StringUtil",
".",
"isNullOrEmpty",
"(",
"pContent",
")",
"&&",
"pContent",
... | 验证大文本长度
@param pContent 文本
@param pLength 规则长度
@param pParamName 参数名称
@throws APPErrorException | [
"验证大文本长度"
] | train | https://github.com/tianjing/tgtools.web.develop/blob/a18567f3ccf877249f2e33028d1e7c479900e4eb/src/main/java/tgtools/web/develop/util/ValidHelper.java#L62-L67 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java | SARLOperationHelper._hasSideEffects | protected boolean _hasSideEffects(XAbstractWhileExpression expression, ISideEffectContext context) {
"""
Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects.
"""
context.o... | java | protected boolean _hasSideEffects(XAbstractWhileExpression expression, ISideEffectContext context) {
context.open();
if (hasSideEffects(expression.getPredicate(), context)) {
return true;
}
if (hasSideEffects(expression.getBody(), context.branch())) {
return true;
}
context.close();
return false;
} | [
"protected",
"boolean",
"_hasSideEffects",
"(",
"XAbstractWhileExpression",
"expression",
",",
"ISideEffectContext",
"context",
")",
"{",
"context",
".",
"open",
"(",
")",
";",
"if",
"(",
"hasSideEffects",
"(",
"expression",
".",
"getPredicate",
"(",
")",
",",
"... | Test if the given expression has side effects.
@param expression the expression.
@param context the list of context expressions.
@return {@code true} if the expression has side effects. | [
"Test",
"if",
"the",
"given",
"expression",
"has",
"side",
"effects",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L284-L294 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java | TreeModelUtils.renderModelAsJson | public static String renderModelAsJson(Node rootNode, boolean renderRoot) {
"""
Render the node model as JSON
@param rootNode
@param renderRoot
@return
"""
if (renderRoot) {
return renderSubnodes(rootNode == null ? new ArrayList<Node>() : new ArrayList<Node>(Arrays.asList(rootNode)));
... | java | public static String renderModelAsJson(Node rootNode, boolean renderRoot) {
if (renderRoot) {
return renderSubnodes(rootNode == null ? new ArrayList<Node>() : new ArrayList<Node>(Arrays.asList(rootNode)));
} else if (rootNode != null && rootNode.hasChild()) {
return renderSubnode... | [
"public",
"static",
"String",
"renderModelAsJson",
"(",
"Node",
"rootNode",
",",
"boolean",
"renderRoot",
")",
"{",
"if",
"(",
"renderRoot",
")",
"{",
"return",
"renderSubnodes",
"(",
"rootNode",
"==",
"null",
"?",
"new",
"ArrayList",
"<",
"Node",
">",
"(",
... | Render the node model as JSON
@param rootNode
@param renderRoot
@return | [
"Render",
"the",
"node",
"model",
"as",
"JSON"
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java#L78-L86 |
seedstack/seed | core/src/main/java/org/seedstack/seed/core/internal/el/ELBinder.java | ELBinder.bindELAnnotation | public ELBinder bindELAnnotation(Class<? extends Annotation> annotationClass, ExecutionPolicy policy) {
"""
Bind an ELInterceptor to the given annotation with the given
{@link ELBinder.ExecutionPolicy}.
@param annotationClass EL annotation to intercept
@param policy determine when the EL is evaluated... | java | public ELBinder bindELAnnotation(Class<? extends Annotation> annotationClass, ExecutionPolicy policy) {
ELInterceptor interceptor = new ELInterceptor(annotationClass, policy);
binder.requestInjection(interceptor);
binder.bindInterceptor(Matchers.any(), handlerMethodMatcher(annotationClass), inte... | [
"public",
"ELBinder",
"bindELAnnotation",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"ExecutionPolicy",
"policy",
")",
"{",
"ELInterceptor",
"interceptor",
"=",
"new",
"ELInterceptor",
"(",
"annotationClass",
",",
"policy",
")",
... | Bind an ELInterceptor to the given annotation with the given
{@link ELBinder.ExecutionPolicy}.
@param annotationClass EL annotation to intercept
@param policy determine when the EL is evaluated
@return ELBinder | [
"Bind",
"an",
"ELInterceptor",
"to",
"the",
"given",
"annotation",
"with",
"the",
"given",
"{",
"@link",
"ELBinder",
".",
"ExecutionPolicy",
"}",
"."
] | train | https://github.com/seedstack/seed/blob/d9cf33bfb2fffcdbb0976f4726e943acda90e828/core/src/main/java/org/seedstack/seed/core/internal/el/ELBinder.java#L71-L76 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseRemoteIp | private void parseRemoteIp(Map<Object, Object> props) {
"""
Check the configuration to see if the remoteIp element has been configured
to consider forwarding header values in the NCSA Access Log
@param props
"""
Object value = props.get(HttpConfigConstants.PROPNAME_REMOTE_IP);
if (null != v... | java | private void parseRemoteIp(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_REMOTE_IP);
if (null != value) {
this.useForwardingHeaders = convertBoolean(value);
if (this.useForwardingHeaders && (TraceComponent.isAnyTracingEnabled()) && (tc.isEve... | [
"private",
"void",
"parseRemoteIp",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_REMOTE_IP",
")",
";",
"if",
"(",
"null",
"!=",
"value",
")",
"{"... | Check the configuration to see if the remoteIp element has been configured
to consider forwarding header values in the NCSA Access Log
@param props | [
"Check",
"the",
"configuration",
"to",
"see",
"if",
"the",
"remoteIp",
"element",
"has",
"been",
"configured",
"to",
"consider",
"forwarding",
"header",
"values",
"in",
"the",
"NCSA",
"Access",
"Log"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L939-L950 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getProperty | public static Object getProperty(Scriptable obj, String name) {
"""
Gets a named property from an object or any object in its prototype chain.
<p>
Searches the prototype chain for a property named <code>name</code>.
<p>
@param obj a JavaScript object
@param name a property name
@return the value of a propert... | java | public static Object getProperty(Scriptable obj, String name)
{
Scriptable start = obj;
Object result;
do {
result = obj.get(name, start);
if (result != Scriptable.NOT_FOUND)
break;
obj = obj.getPrototype();
} while (obj != null);
... | [
"public",
"static",
"Object",
"getProperty",
"(",
"Scriptable",
"obj",
",",
"String",
"name",
")",
"{",
"Scriptable",
"start",
"=",
"obj",
";",
"Object",
"result",
";",
"do",
"{",
"result",
"=",
"obj",
".",
"get",
"(",
"name",
",",
"start",
")",
";",
... | Gets a named property from an object or any object in its prototype chain.
<p>
Searches the prototype chain for a property named <code>name</code>.
<p>
@param obj a JavaScript object
@param name a property name
@return the value of a property with name <code>name</code> found in
<code>obj</code> or any object in its pr... | [
"Gets",
"a",
"named",
"property",
"from",
"an",
"object",
"or",
"any",
"object",
"in",
"its",
"prototype",
"chain",
".",
"<p",
">",
"Searches",
"the",
"prototype",
"chain",
"for",
"a",
"property",
"named",
"<code",
">",
"name<",
"/",
"code",
">",
".",
... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2315-L2326 |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.reportException | @Deprecated
public static void reportException(final Throwable throwable, final String level) {
"""
report an exception to Rollbar, specifying the level.
@param throwable the exception that occurred.
@param level the severity level.
"""
reportException(throwable, level, null, null);
} | java | @Deprecated
public static void reportException(final Throwable throwable, final String level) {
reportException(throwable, level, null, null);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"reportException",
"(",
"final",
"Throwable",
"throwable",
",",
"final",
"String",
"level",
")",
"{",
"reportException",
"(",
"throwable",
",",
"level",
",",
"null",
",",
"null",
")",
";",
"}"
] | report an exception to Rollbar, specifying the level.
@param throwable the exception that occurred.
@param level the severity level. | [
"report",
"an",
"exception",
"to",
"Rollbar",
"specifying",
"the",
"level",
"."
] | train | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L820-L823 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/serialization/bulk/UpdateBulkFactory.java | UpdateBulkFactory.writeLegacyFormatting | private void writeLegacyFormatting(List<Object> list, Object paramExtractor) {
"""
Script format meant for versions 1.x to 2.x. Required format for 1.x and below.
@param list Consumer of snippets
@param paramExtractor Extracts parameters from documents or constants
"""
if (paramExtractor != null) {
... | java | private void writeLegacyFormatting(List<Object> list, Object paramExtractor) {
if (paramExtractor != null) {
list.add("{\"params\":");
list.add(paramExtractor);
list.add(",");
}
else {
list.add("{");
}
if (HAS_SCRIPT) {
... | [
"private",
"void",
"writeLegacyFormatting",
"(",
"List",
"<",
"Object",
">",
"list",
",",
"Object",
"paramExtractor",
")",
"{",
"if",
"(",
"paramExtractor",
"!=",
"null",
")",
"{",
"list",
".",
"add",
"(",
"\"{\\\"params\\\":\"",
")",
";",
"list",
".",
"ad... | Script format meant for versions 1.x to 2.x. Required format for 1.x and below.
@param list Consumer of snippets
@param paramExtractor Extracts parameters from documents or constants | [
"Script",
"format",
"meant",
"for",
"versions",
"1",
".",
"x",
"to",
"2",
".",
"x",
".",
"Required",
"format",
"for",
"1",
".",
"x",
"and",
"below",
"."
] | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/serialization/bulk/UpdateBulkFactory.java#L129-L168 |
Bearded-Hen/Android-Bootstrap | AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java | TypefaceProvider.retrieveRegisteredIconSet | public static IconSet retrieveRegisteredIconSet(String fontPath, boolean editMode) {
"""
Retrieves a registered IconSet whose font can be found in the asset directory at the given path
@param fontPath the given path
@param editMode - whether the view requesting the icon set is displayed in the preview editor
... | java | public static IconSet retrieveRegisteredIconSet(String fontPath, boolean editMode) {
final IconSet iconSet = REGISTERED_ICON_SETS.get(fontPath);
if (iconSet == null && !editMode) {
throw new RuntimeException(String.format("Font '%s' not properly registered, please" +
" s... | [
"public",
"static",
"IconSet",
"retrieveRegisteredIconSet",
"(",
"String",
"fontPath",
",",
"boolean",
"editMode",
")",
"{",
"final",
"IconSet",
"iconSet",
"=",
"REGISTERED_ICON_SETS",
".",
"get",
"(",
"fontPath",
")",
";",
"if",
"(",
"iconSet",
"==",
"null",
... | Retrieves a registered IconSet whose font can be found in the asset directory at the given path
@param fontPath the given path
@param editMode - whether the view requesting the icon set is displayed in the preview editor
@return the registered IconSet instance | [
"Retrieves",
"a",
"registered",
"IconSet",
"whose",
"font",
"can",
"be",
"found",
"in",
"the",
"asset",
"directory",
"at",
"the",
"given",
"path"
] | train | https://github.com/Bearded-Hen/Android-Bootstrap/blob/b3d62cc1847e26d420c53c92665a4fe1e6ee7ecf/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/TypefaceProvider.java#L71-L79 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/Controller.java | Controller.mapOutField | void mapOutField(Object from, String from_out, Object to, String to_field) {
"""
Map a object to an output field.
@param from
@param from_out
@param to
@param to_field
"""
if (from == ca.getComponent()) {
throw new ComponentException("wrong connect:" + to_field);
}
Com... | java | void mapOutField(Object from, String from_out, Object to, String to_field) {
if (from == ca.getComponent()) {
throw new ComponentException("wrong connect:" + to_field);
}
ComponentAccess ca_from = lookup(from);
Access from_access = ca_from.output(from_out);
checkFA(fr... | [
"void",
"mapOutField",
"(",
"Object",
"from",
",",
"String",
"from_out",
",",
"Object",
"to",
",",
"String",
"to_field",
")",
"{",
"if",
"(",
"from",
"==",
"ca",
".",
"getComponent",
"(",
")",
")",
"{",
"throw",
"new",
"ComponentException",
"(",
"\"wrong... | Map a object to an output field.
@param from
@param from_out
@param to
@param to_field | [
"Map",
"a",
"object",
"to",
"an",
"output",
"field",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/Controller.java#L191-L209 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java | Descriptor.setOutgoingLinks | public void setOutgoingLinks(int i, Title v) {
"""
indexed setter for outgoingLinks - sets an indexed value - List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page.
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (Descriptor_Type... | java | public void setOutgoingLinks(int i, Title v) {
if (Descriptor_Type.featOkTst && ((Descriptor_Type)jcasType).casFeat_outgoingLinks == null)
jcasType.jcas.throwFeatMissing("outgoingLinks", "de.julielab.jules.types.wikipedia.Descriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, (... | [
"public",
"void",
"setOutgoingLinks",
"(",
"int",
"i",
",",
"Title",
"v",
")",
"{",
"if",
"(",
"Descriptor_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Descriptor_Type",
")",
"jcasType",
")",
".",
"casFeat_outgoingLinks",
"==",
"null",
")",
"jcasType",
".",
"... | indexed setter for outgoingLinks - sets an indexed value - List of outgoing links pointing to other Wikipedia pages starting at a Wikipedia page.
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"outgoingLinks",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"List",
"of",
"outgoing",
"links",
"pointing",
"to",
"other",
"Wikipedia",
"pages",
"starting",
"at",
"a",
"Wikipedia",
"page",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/wikipedia/Descriptor.java#L205-L209 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PickupUrl.java | PickupUrl.getPickupUrl | public static MozuUrl getPickupUrl(String orderId, String pickupId, String responseFields) {
"""
Get Resource Url for GetPickup
@param orderId Unique identifier of the order.
@param pickupId Unique identifier of the pickup to remove.
@param responseFields Filtering syntax appended to an API call to increase or ... | java | public static MozuUrl getPickupUrl(String orderId, String pickupId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/pickups/{pickupId}?responseFields={responseFields}");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("pickupId", pickupId);
f... | [
"public",
"static",
"MozuUrl",
"getPickupUrl",
"(",
"String",
"orderId",
",",
"String",
"pickupId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/orders/{orderId}/pickups/{pickupId}?responseFields={... | Get Resource Url for GetPickup
@param orderId Unique identifier of the order.
@param pickupId Unique identifier of the pickup to remove.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve... | [
"Get",
"Resource",
"Url",
"for",
"GetPickup"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/PickupUrl.java#L37-L44 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/MathUtils.java | MathUtils.divideRoundUp | public static <T extends Number> long divideRoundUp(final T dividend, final T divisor) {
"""
Returns a long average number by round up with specify dividend and
divisor.<br>
Returns 0 if dividend == null or divisor == null.<br>
Returns 1 if dividend == divisor or divisor == 0.<br>
e.g: average is 3.5, then ret... | java | public static <T extends Number> long divideRoundUp(final T dividend, final T divisor) {
double average = divide(dividend, divisor);
return RoundUp(average);
} | [
"public",
"static",
"<",
"T",
"extends",
"Number",
">",
"long",
"divideRoundUp",
"(",
"final",
"T",
"dividend",
",",
"final",
"T",
"divisor",
")",
"{",
"double",
"average",
"=",
"divide",
"(",
"dividend",
",",
"divisor",
")",
";",
"return",
"RoundUp",
"(... | Returns a long average number by round up with specify dividend and
divisor.<br>
Returns 0 if dividend == null or divisor == null.<br>
Returns 1 if dividend == divisor or divisor == 0.<br>
e.g: average is 3.5, then return 4.
@param dividend
number to be handled.
@param divisor
number to be handled.
@return a long aver... | [
"Returns",
"a",
"long",
"average",
"number",
"by",
"round",
"up",
"with",
"specify",
"dividend",
"and",
"divisor",
".",
"<br",
">",
"Returns",
"0",
"if",
"dividend",
"==",
"null",
"or",
"divisor",
"==",
"null",
".",
"<br",
">",
"Returns",
"1",
"if",
"d... | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/MathUtils.java#L187-L191 |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java | ImageLoader.toBgr | public INDArray toBgr(InputStream inputStream) {
"""
Convert an input stream to an bgr spectrum image
@param inputStream the input stream to convert
@return the input stream to convert
"""
try {
BufferedImage image = ImageIO.read(inputStream);
return toBgr(image);
} ... | java | public INDArray toBgr(InputStream inputStream) {
try {
BufferedImage image = ImageIO.read(inputStream);
return toBgr(image);
} catch (IOException e) {
throw new RuntimeException("Unable to load image", e);
}
} | [
"public",
"INDArray",
"toBgr",
"(",
"InputStream",
"inputStream",
")",
"{",
"try",
"{",
"BufferedImage",
"image",
"=",
"ImageIO",
".",
"read",
"(",
"inputStream",
")",
";",
"return",
"toBgr",
"(",
"image",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
... | Convert an input stream to an bgr spectrum image
@param inputStream the input stream to convert
@return the input stream to convert | [
"Convert",
"an",
"input",
"stream",
"to",
"an",
"bgr",
"spectrum",
"image"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java#L211-L218 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/TaylorSeries.java | TaylorSeries.Exp | public static double Exp(double x, int nTerms) {
"""
compute Exp using Taylor Series.
@param x An angle, in radians.
@param nTerms Number of terms.
@return Result.
"""
if (nTerms < 2) return 1 + x;
if (nTerms == 2) {
return 1 + x + (x * x) / 2;
} else {
... | java | public static double Exp(double x, int nTerms) {
if (nTerms < 2) return 1 + x;
if (nTerms == 2) {
return 1 + x + (x * x) / 2;
} else {
double mult = x * x;
double fact = 2;
double result = 1 + x + mult / fact;
for (int i = 3; ... | [
"public",
"static",
"double",
"Exp",
"(",
"double",
"x",
",",
"int",
"nTerms",
")",
"{",
"if",
"(",
"nTerms",
"<",
"2",
")",
"return",
"1",
"+",
"x",
";",
"if",
"(",
"nTerms",
"==",
"2",
")",
"{",
"return",
"1",
"+",
"x",
"+",
"(",
"x",
"*",
... | compute Exp using Taylor Series.
@param x An angle, in radians.
@param nTerms Number of terms.
@return Result. | [
"compute",
"Exp",
"using",
"Taylor",
"Series",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/TaylorSeries.java#L163-L180 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/jaxrx/resource/AResource.java | AResource.addParameter | private void addParameter(final String key, final String value,
final Map<QueryParameter, String> newParams, final Set<QueryParameter> impl) {
"""
Adds a key/value combination to the parameter map. Multiple output
parameters are separated with commas.
@param key
The parameter key
@param value
The p... | java | private void addParameter(final String key, final String value,
final Map<QueryParameter, String> newParams, final Set<QueryParameter> impl) {
try {
final QueryParameter ep = QueryParameter.valueOf(key.toUpperCase());
if (!impl.contains(ep)) {
throw new Jax... | [
"private",
"void",
"addParameter",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
",",
"final",
"Map",
"<",
"QueryParameter",
",",
"String",
">",
"newParams",
",",
"final",
"Set",
"<",
"QueryParameter",
">",
"impl",
")",
"{",
"try",
"{",
... | Adds a key/value combination to the parameter map. Multiple output
parameters are separated with commas.
@param key
The parameter key
@param value
The parameter value
@param newParams
New query parameter map
@param impl
Implementation parameters | [
"Adds",
"a",
"key",
"/",
"value",
"combination",
"to",
"the",
"parameter",
"map",
".",
"Multiple",
"output",
"parameters",
"are",
"separated",
"with",
"commas",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/jaxrx/resource/AResource.java#L243-L265 |
joniles/mpxj | src/main/java/net/sf/mpxj/json/JsonWriter.java | JsonWriter.writeMap | private void writeMap(String fieldName, Object value) throws IOException {
"""
Write a map field to the JSON file.
@param fieldName field name
@param value field value
"""
@SuppressWarnings("unchecked")
Map<String, Object> map = (Map<String, Object>) value;
m_writer.writeStartObject(field... | java | private void writeMap(String fieldName, Object value) throws IOException
{
@SuppressWarnings("unchecked")
Map<String, Object> map = (Map<String, Object>) value;
m_writer.writeStartObject(fieldName);
for (Map.Entry<String, Object> entry : map.entrySet())
{
Object entryValue = en... | [
"private",
"void",
"writeMap",
"(",
"String",
"fieldName",
",",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"(",
"Map",
"<",
"String",
",",
... | Write a map field to the JSON file.
@param fieldName field name
@param value field value | [
"Write",
"a",
"map",
"field",
"to",
"the",
"JSON",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonWriter.java#L484-L504 |
gfk-ba/senbot | SenBotRunner/src/main/java/com/gfk/senbot/framework/services/selenium/NavigationService.java | NavigationService.clickElementWithAttributeValue | public void clickElementWithAttributeValue(String attributeName, String attributeValue) {
"""
Find a Element that has a attribute with a certain value and click it
@param attributeName
@param attributeValue
"""
By xpath = By.xpath("//*[@" + attributeName + "='" + attributeValue + "']");
Web... | java | public void clickElementWithAttributeValue(String attributeName, String attributeValue) {
By xpath = By.xpath("//*[@" + attributeName + "='" + attributeValue + "']");
WebElement element = seleniumElementService.findExpectedElement(xpath);
assertTrue("The element you are trying to click (" + xpat... | [
"public",
"void",
"clickElementWithAttributeValue",
"(",
"String",
"attributeName",
",",
"String",
"attributeValue",
")",
"{",
"By",
"xpath",
"=",
"By",
".",
"xpath",
"(",
"\"//*[@\"",
"+",
"attributeName",
"+",
"\"='\"",
"+",
"attributeValue",
"+",
"\"']\"",
")... | Find a Element that has a attribute with a certain value and click it
@param attributeName
@param attributeValue | [
"Find",
"a",
"Element",
"that",
"has",
"a",
"attribute",
"with",
"a",
"certain",
"value",
"and",
"click",
"it"
] | train | https://github.com/gfk-ba/senbot/blob/e9a152aa67be48b1bb13a4691655caf6d873b553/SenBotRunner/src/main/java/com/gfk/senbot/framework/services/selenium/NavigationService.java#L90-L95 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/CustomClassMapper.java | CustomClassMapper.convertToCustomClass | static <T> T convertToCustomClass(Object object, Class<T> clazz) {
"""
Converts a standard library Java representation of JSON data to an object of the provided
class.
@param object The representation of the JSON data
@param clazz The class of the object to convert to
@return The POJO object.
"""
ret... | java | static <T> T convertToCustomClass(Object object, Class<T> clazz) {
return deserializeToClass(object, clazz, ErrorPath.EMPTY);
} | [
"static",
"<",
"T",
">",
"T",
"convertToCustomClass",
"(",
"Object",
"object",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"deserializeToClass",
"(",
"object",
",",
"clazz",
",",
"ErrorPath",
".",
"EMPTY",
")",
";",
"}"
] | Converts a standard library Java representation of JSON data to an object of the provided
class.
@param object The representation of the JSON data
@param clazz The class of the object to convert to
@return The POJO object. | [
"Converts",
"a",
"standard",
"library",
"Java",
"representation",
"of",
"JSON",
"data",
"to",
"an",
"object",
"of",
"the",
"provided",
"class",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/CustomClassMapper.java#L96-L98 |
googleads/googleads-java-lib | examples/adwords_axis/src/main/java/adwords/axis/v201809/extensions/AddSiteLinks.java | AddSiteLinks.createSiteLinkFeedItem | private static SitelinkFeedItem createSiteLinkFeedItem(String sitelinkText, String sitelinkUrl) {
"""
Creates a new {@link SitelinkFeedItem} with the specified attributes.
@param sitelinkText the text for the sitelink
@param sitelinkUrl the URL for the sitelink
@return a new SitelinkFeedItem
"""
Sitel... | java | private static SitelinkFeedItem createSiteLinkFeedItem(String sitelinkText, String sitelinkUrl) {
SitelinkFeedItem sitelinkFeedItem = new SitelinkFeedItem();
sitelinkFeedItem.setSitelinkText(sitelinkText);
sitelinkFeedItem.setSitelinkFinalUrls(new UrlList(new String[] {sitelinkUrl}));
return sitelinkFee... | [
"private",
"static",
"SitelinkFeedItem",
"createSiteLinkFeedItem",
"(",
"String",
"sitelinkText",
",",
"String",
"sitelinkUrl",
")",
"{",
"SitelinkFeedItem",
"sitelinkFeedItem",
"=",
"new",
"SitelinkFeedItem",
"(",
")",
";",
"sitelinkFeedItem",
".",
"setSitelinkText",
"... | Creates a new {@link SitelinkFeedItem} with the specified attributes.
@param sitelinkText the text for the sitelink
@param sitelinkUrl the URL for the sitelink
@return a new SitelinkFeedItem | [
"Creates",
"a",
"new",
"{",
"@link",
"SitelinkFeedItem",
"}",
"with",
"the",
"specified",
"attributes",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/adwords_axis/src/main/java/adwords/axis/v201809/extensions/AddSiteLinks.java#L254-L259 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbMemberTagsHandler.java | OjbMemberTagsHandler.forAllMemberTags | public void forAllMemberTags(String template, Properties attributes) throws XDocletException {
"""
Iterates over all tags of current member and evaluates the template for each one.
@param template The template to be evaluated
@param attributes The attributes of the template tag
@except... | java | public void forAllMemberTags(String template, Properties attributes) throws XDocletException
{
if (getCurrentField() != null) {
forAllMemberTags(template, attributes, FOR_FIELD, XDocletTagshandlerMessages.ONLY_CALL_FIELD_NOT_NULL, new String[]{"forAllMemberTags"});
}
else if... | [
"public",
"void",
"forAllMemberTags",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"if",
"(",
"getCurrentField",
"(",
")",
"!=",
"null",
")",
"{",
"forAllMemberTags",
"(",
"template",
",",
"attributes",
",",... | Iterates over all tags of current member and evaluates the template for each one.
@param template The template to be evaluated
@param attributes The attributes of the template tag
@exception XDocletException If an error occurs
@doc.tag type="block"
@doc.param ... | [
"Iterates",
"over",
"all",
"tags",
"of",
"current",
"member",
"and",
"evaluates",
"the",
"template",
"for",
"each",
"one",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbMemberTagsHandler.java#L239-L247 |
grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java | GroovyPagesUriSupport.getDeployedAbsoluteViewURI | public String getDeployedAbsoluteViewURI(String viewName) {
"""
Obtains a view URI when deployed within the /WEB-INF/grails-app/views context
@param viewName The name of the view
@return The view URI
"""
FastStringWriter buf = new FastStringWriter(PATH_TO_VIEWS);
return getAbsoluteViewURIInte... | java | public String getDeployedAbsoluteViewURI(String viewName) {
FastStringWriter buf = new FastStringWriter(PATH_TO_VIEWS);
return getAbsoluteViewURIInternal(viewName, buf, true);
} | [
"public",
"String",
"getDeployedAbsoluteViewURI",
"(",
"String",
"viewName",
")",
"{",
"FastStringWriter",
"buf",
"=",
"new",
"FastStringWriter",
"(",
"PATH_TO_VIEWS",
")",
";",
"return",
"getAbsoluteViewURIInternal",
"(",
"viewName",
",",
"buf",
",",
"true",
")",
... | Obtains a view URI when deployed within the /WEB-INF/grails-app/views context
@param viewName The name of the view
@return The view URI | [
"Obtains",
"a",
"view",
"URI",
"when",
"deployed",
"within",
"the",
"/",
"WEB",
"-",
"INF",
"/",
"grails",
"-",
"app",
"/",
"views",
"context"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L231-L234 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.translateLocal | public Matrix4d translateLocal(double x, double y, double z, Matrix4d dest) {
"""
Pre-multiply a translation to this matrix by translating by the given number of
units in x, y and z and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation
m... | java | public Matrix4d translateLocal(double x, double y, double z, Matrix4d dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return dest.translation(x, y, z);
return translateLocalGeneric(x, y, z, dest);
} | [
"public",
"Matrix4d",
"translateLocal",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
",",
"Matrix4d",
"dest",
")",
"{",
"if",
"(",
"(",
"properties",
"&",
"PROPERTY_IDENTITY",
")",
"!=",
"0",
")",
"return",
"dest",
".",
"translation",
"(",... | Pre-multiply a translation to this matrix by translating by the given number of
units in x, y and z and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation
matrix, then the new matrix will be <code>T * M</code>. So when
transforming a vector <code>... | [
"Pre",
"-",
"multiply",
"a",
"translation",
"to",
"this",
"matrix",
"by",
"translating",
"by",
"the",
"given",
"number",
"of",
"units",
"in",
"x",
"y",
"and",
"z",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"dest<",
"/",
"code",
">",
".",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L5664-L5668 |
Waikato/moa | moa/src/main/java/moa/gui/GUIDefaults.java | GUIDefaults.getObject | protected static Object getObject(String property, String defaultValue) {
"""
Tries to instantiate the class stored for this property, optional
options will be set as well. Returns null if unsuccessful.
@param property the property to get the object for
@param defaultValue the default object spec string... | java | protected static Object getObject(String property, String defaultValue) {
return getObject(property, defaultValue, Object.class);
} | [
"protected",
"static",
"Object",
"getObject",
"(",
"String",
"property",
",",
"String",
"defaultValue",
")",
"{",
"return",
"getObject",
"(",
"property",
",",
"defaultValue",
",",
"Object",
".",
"class",
")",
";",
"}"
] | Tries to instantiate the class stored for this property, optional
options will be set as well. Returns null if unsuccessful.
@param property the property to get the object for
@param defaultValue the default object spec string
@return if successful the fully configured object, null
otherwise | [
"Tries",
"to",
"instantiate",
"the",
"class",
"stored",
"for",
"this",
"property",
"optional",
"options",
"will",
"be",
"set",
"as",
"well",
".",
"Returns",
"null",
"if",
"unsuccessful",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/gui/GUIDefaults.java#L91-L93 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/SelectorRefresher.java | SelectorRefresher.computeSelection | private void computeSelection(Viewer viewer, Cursor cursor, SelectorModel model) {
"""
Compute the selection from cursor location.
@param viewer The viewer reference.
@param cursor The cursor reference.
@param model The selector model.
"""
final double viewX = viewer.getX() + viewer.getViewX();
... | java | private void computeSelection(Viewer viewer, Cursor cursor, SelectorModel model)
{
final double viewX = viewer.getX() + viewer.getViewX();
final double viewY = viewer.getY() - viewer.getViewY();
final double currentX = UtilMath.clamp(cursor.getX(), viewX, viewX + viewer.getWidth());
... | [
"private",
"void",
"computeSelection",
"(",
"Viewer",
"viewer",
",",
"Cursor",
"cursor",
",",
"SelectorModel",
"model",
")",
"{",
"final",
"double",
"viewX",
"=",
"viewer",
".",
"getX",
"(",
")",
"+",
"viewer",
".",
"getViewX",
"(",
")",
";",
"final",
"d... | Compute the selection from cursor location.
@param viewer The viewer reference.
@param cursor The cursor reference.
@param model The selector model. | [
"Compute",
"the",
"selection",
"from",
"cursor",
"location",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/SelectorRefresher.java#L213-L241 |
protegeproject/sparql-dl-api | src/main/java/de/derivo/sparqldlapi/impl/QueryEngineImpl.java | QueryEngineImpl.combineResults | private QueryResultImpl combineResults(QueryResultImpl a, QueryResultImpl b, boolean distinct) {
"""
Combine two results with the cartesian product.
@return the combined result
"""
QueryResultImpl result = new QueryResultImpl(a.getQuery());
for (QueryBindingImpl bindingA : a.getBindings()) ... | java | private QueryResultImpl combineResults(QueryResultImpl a, QueryResultImpl b, boolean distinct) {
QueryResultImpl result = new QueryResultImpl(a.getQuery());
for (QueryBindingImpl bindingA : a.getBindings()) {
for (QueryBindingImpl bindingB : b.getBindings()) {
QueryBindingIm... | [
"private",
"QueryResultImpl",
"combineResults",
"(",
"QueryResultImpl",
"a",
",",
"QueryResultImpl",
"b",
",",
"boolean",
"distinct",
")",
"{",
"QueryResultImpl",
"result",
"=",
"new",
"QueryResultImpl",
"(",
"a",
".",
"getQuery",
"(",
")",
")",
";",
"for",
"(... | Combine two results with the cartesian product.
@return the combined result | [
"Combine",
"two",
"results",
"with",
"the",
"cartesian",
"product",
"."
] | train | https://github.com/protegeproject/sparql-dl-api/blob/80d430d439e17a691d0111819af2d3613e28d625/src/main/java/de/derivo/sparqldlapi/impl/QueryEngineImpl.java#L288-L304 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/action/menu/InsertPointAction.java | InsertPointAction.execute | public boolean execute(Canvas target, Menu menu, MenuItem item) {
"""
Implementation of the <code>MenuItemIfFunction</code> interface. This will determine if the menu action should be
enabled or not. In essence, this action will be enabled when the context menu event occurred on an edge of the
painted <code>Feat... | java | public boolean execute(Canvas target, Menu menu, MenuItem item) {
FeatureTransaction featureTransaction = mapWidget.getMapModel().getFeatureEditor().getFeatureTransaction();
if (featureTransaction != null) {
MenuContext graphics = mapWidget.getMenuContext();
coordinate = mapWidget.getMapModel().getMapView().g... | [
"public",
"boolean",
"execute",
"(",
"Canvas",
"target",
",",
"Menu",
"menu",
",",
"MenuItem",
"item",
")",
"{",
"FeatureTransaction",
"featureTransaction",
"=",
"mapWidget",
".",
"getMapModel",
"(",
")",
".",
"getFeatureEditor",
"(",
")",
".",
"getFeatureTransa... | Implementation of the <code>MenuItemIfFunction</code> interface. This will determine if the menu action should be
enabled or not. In essence, this action will be enabled when the context menu event occurred on an edge of the
painted <code>FeatureTransaction</code>. | [
"Implementation",
"of",
"the",
"<code",
">",
"MenuItemIfFunction<",
"/",
"code",
">",
"interface",
".",
"This",
"will",
"determine",
"if",
"the",
"menu",
"action",
"should",
"be",
"enabled",
"or",
"not",
".",
"In",
"essence",
"this",
"action",
"will",
"be",
... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/action/menu/InsertPointAction.java#L82-L95 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/filters/EntityFilter.java | EntityFilter.buildFilter | public IFilterTerm buildFilter(IAssetType assetType, V1Instance instance) {
"""
Create representation one filter term on a query.
@param assetType information about Asset type.
@param instance The type this filter belongs to.
@return created {@code IFilterTerm}.
"""
FilterBuilder builder = new Fil... | java | public IFilterTerm buildFilter(IAssetType assetType, V1Instance instance) {
FilterBuilder builder = new FilterBuilder(assetType, instance);
internalModifyFilter(builder);
internalModifyState(builder);
return builder.root.hasTerm() ? builder.root : null;
} | [
"public",
"IFilterTerm",
"buildFilter",
"(",
"IAssetType",
"assetType",
",",
"V1Instance",
"instance",
")",
"{",
"FilterBuilder",
"builder",
"=",
"new",
"FilterBuilder",
"(",
"assetType",
",",
"instance",
")",
";",
"internalModifyFilter",
"(",
"builder",
")",
";",... | Create representation one filter term on a query.
@param assetType information about Asset type.
@param instance The type this filter belongs to.
@return created {@code IFilterTerm}. | [
"Create",
"representation",
"one",
"filter",
"term",
"on",
"a",
"query",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/filters/EntityFilter.java#L167-L173 |
alkacon/opencms-core | src/org/opencms/xml/types/CmsXmlBooleanValue.java | CmsXmlBooleanValue.getBooleanValue | public static boolean getBooleanValue(CmsObject cms, I_CmsWidgetParameter value) {
"""
Returns the boolean value of the given widget parameter.<p>
@param cms an initialized instance of a CmsObject
@param value the XML content value to get the boolean value of
@return the boolean value of the given widget pa... | java | public static boolean getBooleanValue(CmsObject cms, I_CmsWidgetParameter value) {
boolean result;
if (value instanceof CmsXmlBooleanValue) {
// this is a "native" boolean type
result = ((CmsXmlBooleanValue)value).getBooleanValue();
} else {
// get the boolea... | [
"public",
"static",
"boolean",
"getBooleanValue",
"(",
"CmsObject",
"cms",
",",
"I_CmsWidgetParameter",
"value",
")",
"{",
"boolean",
"result",
";",
"if",
"(",
"value",
"instanceof",
"CmsXmlBooleanValue",
")",
"{",
"// this is a \"native\" boolean type",
"result",
"="... | Returns the boolean value of the given widget parameter.<p>
@param cms an initialized instance of a CmsObject
@param value the XML content value to get the boolean value of
@return the boolean value of the given widget parameter | [
"Returns",
"the",
"boolean",
"value",
"of",
"the",
"given",
"widget",
"parameter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/types/CmsXmlBooleanValue.java#L102-L113 |
networknt/light-4j | dump/src/main/java/com/networknt/dump/CookiesDumper.java | CookiesDumper.putDumpInfoTo | @Override
protected void putDumpInfoTo(Map<String, Object> result) {
"""
put cookieMap to result
@param result a Map you want to put dumping info to.
"""
if(this.cookieMap.size() > 0) {
result.put(DumpConstants.COOKIES, cookieMap);
}
} | java | @Override
protected void putDumpInfoTo(Map<String, Object> result) {
if(this.cookieMap.size() > 0) {
result.put(DumpConstants.COOKIES, cookieMap);
}
} | [
"@",
"Override",
"protected",
"void",
"putDumpInfoTo",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
")",
"{",
"if",
"(",
"this",
".",
"cookieMap",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"result",
".",
"put",
"(",
"DumpConstants",
".",... | put cookieMap to result
@param result a Map you want to put dumping info to. | [
"put",
"cookieMap",
"to",
"result"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/CookiesDumper.java#L80-L85 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/filter/RawScale2x.java | RawScale2x.getSourcePixel | private int getSourcePixel(int[] srcImage, int x, int y) {
"""
Get pixel source.
@param srcImage The image source.
@param x The location x.
@param y The location y.
@return The pixel value found.
"""
int x1 = Math.max(0, x);
x1 = Math.min(width - 1, x1);
int y1 = Math.max(0, y)... | java | private int getSourcePixel(int[] srcImage, int x, int y)
{
int x1 = Math.max(0, x);
x1 = Math.min(width - 1, x1);
int y1 = Math.max(0, y);
y1 = Math.min(height - 1, y1);
return srcImage[x1 + y1 * width];
} | [
"private",
"int",
"getSourcePixel",
"(",
"int",
"[",
"]",
"srcImage",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"x1",
"=",
"Math",
".",
"max",
"(",
"0",
",",
"x",
")",
";",
"x1",
"=",
"Math",
".",
"min",
"(",
"width",
"-",
"1",
",",
... | Get pixel source.
@param srcImage The image source.
@param x The location x.
@param y The location y.
@return The pixel value found. | [
"Get",
"pixel",
"source",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/filter/RawScale2x.java#L89-L97 |
socialsensor/geo-util | src/main/java/eu/socialsensor/geo/ReverseGeocoder.java | ReverseGeocoder.loadCitiesFileToTree | protected void loadCitiesFileToTree(String gnObjectsFilename, Map<String, String> countryCodes) {
"""
A kd-tree is loaded with the set of geographical objects. The key for each entry
corresponds to its lat/lon coordinates, while the value is a LightweightGeoObject
@param gnObjectsFilename
@param countryCodes
... | java | protected void loadCitiesFileToTree(String gnObjectsFilename, Map<String, String> countryCodes){
EasyBufferedReader reader = new EasyBufferedReader(gnObjectsFilename);
String line = null;
int count = 0;
long t0 = System.currentTimeMillis();
logger.info("loading of objects started");
while ((line = reader.re... | [
"protected",
"void",
"loadCitiesFileToTree",
"(",
"String",
"gnObjectsFilename",
",",
"Map",
"<",
"String",
",",
"String",
">",
"countryCodes",
")",
"{",
"EasyBufferedReader",
"reader",
"=",
"new",
"EasyBufferedReader",
"(",
"gnObjectsFilename",
")",
";",
"String",
... | A kd-tree is loaded with the set of geographical objects. The key for each entry
corresponds to its lat/lon coordinates, while the value is a LightweightGeoObject
@param gnObjectsFilename
@param countryCodes | [
"A",
"kd",
"-",
"tree",
"is",
"loaded",
"with",
"the",
"set",
"of",
"geographical",
"objects",
".",
"The",
"key",
"for",
"each",
"entry",
"corresponds",
"to",
"its",
"lat",
"/",
"lon",
"coordinates",
"while",
"the",
"value",
"is",
"a",
"LightweightGeoObjec... | train | https://github.com/socialsensor/geo-util/blob/ffe729896187dc589f4a362d6e6819fc155ced1d/src/main/java/eu/socialsensor/geo/ReverseGeocoder.java#L62-L88 |
dkpro/dkpro-argumentation | dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java | JCasUtil2.doOverlap | public static <T extends Annotation> boolean doOverlap(final T anno1, final T anno2) {
"""
Returns whether the given annotations have a non-empty overlap.
<p>
Note that this method is symmetric. Two annotations overlap
if they have at least one character position in common.
Annotations that merely touch at t... | java | public static <T extends Annotation> boolean doOverlap(final T anno1, final T anno2)
{
return anno1.getEnd() > anno2.getBegin() && anno1.getBegin() < anno2.getEnd();
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"boolean",
"doOverlap",
"(",
"final",
"T",
"anno1",
",",
"final",
"T",
"anno2",
")",
"{",
"return",
"anno1",
".",
"getEnd",
"(",
")",
">",
"anno2",
".",
"getBegin",
"(",
")",
"&&",
"anno1",
... | Returns whether the given annotations have a non-empty overlap.
<p>
Note that this method is symmetric. Two annotations overlap
if they have at least one character position in common.
Annotations that merely touch at the begin or end are not
overlapping.
</p>
<ul>
<li>anno1[0,1], anno2[1,2] => no overlap</li>
<li>a... | [
"Returns",
"whether",
"the",
"given",
"annotations",
"have",
"a",
"non",
"-",
"empty",
"overlap",
"."
] | train | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L182-L185 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/DateTimeUtil.java | DateTimeUtil.setTime | public static void setTime(Datebox datebox, Timebox timebox, Date value) {
"""
Sets the UI to reflect the specified time.
@param datebox The date box.
@param timebox The time box.
@param value Time value to set.
"""
value = value == null ? new Date() : value;
datebox.setValue(DateUtil.stri... | java | public static void setTime(Datebox datebox, Timebox timebox, Date value) {
value = value == null ? new Date() : value;
datebox.setValue(DateUtil.stripTime(value));
timebox.setValue(value);
} | [
"public",
"static",
"void",
"setTime",
"(",
"Datebox",
"datebox",
",",
"Timebox",
"timebox",
",",
"Date",
"value",
")",
"{",
"value",
"=",
"value",
"==",
"null",
"?",
"new",
"Date",
"(",
")",
":",
"value",
";",
"datebox",
".",
"setValue",
"(",
"DateUti... | Sets the UI to reflect the specified time.
@param datebox The date box.
@param timebox The time box.
@param value Time value to set. | [
"Sets",
"the",
"UI",
"to",
"reflect",
"the",
"specified",
"time",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/util/DateTimeUtil.java#L68-L72 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLFunctionalDataPropertyAxiomImpl_CustomFieldSerializer.java | OWLFunctionalDataPropertyAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLFunctionalDataPropertyAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLFunctionalDataPropertyAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLFunctionalDataPropertyAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLFunctionalDataPropertyAxiomImpl_CustomFieldSerializer.java#L96-L99 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/provider/HdfsBasedUpdateProvider.java | HdfsBasedUpdateProvider.getUpdateTime | @Override
public long getUpdateTime(Table table) throws UpdateNotFoundException {
"""
Get the update time of a {@link Table}
@return the update time if available, 0 otherwise
{@inheritDoc}
@see HiveUnitUpdateProvider#getUpdateTime(org.apache.hadoop.hive.ql.metadata.Table)
"""
try {
return getU... | java | @Override
public long getUpdateTime(Table table) throws UpdateNotFoundException {
try {
return getUpdateTime(table.getDataLocation());
} catch (IOException e) {
throw new UpdateNotFoundException(String.format("Failed to get update time for %s.", table.getCompleteName()), e);
}
} | [
"@",
"Override",
"public",
"long",
"getUpdateTime",
"(",
"Table",
"table",
")",
"throws",
"UpdateNotFoundException",
"{",
"try",
"{",
"return",
"getUpdateTime",
"(",
"table",
".",
"getDataLocation",
"(",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
... | Get the update time of a {@link Table}
@return the update time if available, 0 otherwise
{@inheritDoc}
@see HiveUnitUpdateProvider#getUpdateTime(org.apache.hadoop.hive.ql.metadata.Table) | [
"Get",
"the",
"update",
"time",
"of",
"a",
"{",
"@link",
"Table",
"}",
"@return",
"the",
"update",
"time",
"if",
"available",
"0",
"otherwise"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/provider/HdfsBasedUpdateProvider.java#L74-L81 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java | RandomMatrices_ZDRM.fillHermitian | public static void fillHermitian(ZMatrixRMaj A, double min, double max, Random rand) {
"""
Assigns the provided square matrix to be a random Hermitian matrix with elements from min to max value.
@param A The matrix that is to be modified. Must be square. Modified.
@param min Minimum value an element can have... | java | public static void fillHermitian(ZMatrixRMaj A, double min, double max, Random rand) {
if( A.numRows != A.numCols )
throw new IllegalArgumentException("A must be a square matrix");
double range = max-min;
int length = A.numRows;
for( int i = 0; i < length; i++ ) {
... | [
"public",
"static",
"void",
"fillHermitian",
"(",
"ZMatrixRMaj",
"A",
",",
"double",
"min",
",",
"double",
"max",
",",
"Random",
"rand",
")",
"{",
"if",
"(",
"A",
".",
"numRows",
"!=",
"A",
".",
"numCols",
")",
"throw",
"new",
"IllegalArgumentException",
... | Assigns the provided square matrix to be a random Hermitian matrix with elements from min to max value.
@param A The matrix that is to be modified. Must be square. Modified.
@param min Minimum value an element can have.
@param max Maximum value an element can have.
@param rand Random number generator. | [
"Assigns",
"the",
"provided",
"square",
"matrix",
"to",
"be",
"a",
"random",
"Hermitian",
"matrix",
"with",
"elements",
"from",
"min",
"to",
"max",
"value",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java#L151-L169 |
googleapis/google-api-java-client | google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential.java | GoogleAccountCredential.usingOAuth2 | public static GoogleAccountCredential usingOAuth2(Context context, Collection<String> scopes) {
"""
Constructs a new instance using OAuth 2.0 scopes.
@param context context
@param scopes non empty OAuth 2.0 scope list
@return new instance
@since 1.15
"""
Preconditions.checkArgument(scopes != null &... | java | public static GoogleAccountCredential usingOAuth2(Context context, Collection<String> scopes) {
Preconditions.checkArgument(scopes != null && scopes.iterator().hasNext());
String scopesStr = "oauth2: " + Joiner.on(' ').join(scopes);
return new GoogleAccountCredential(context, scopesStr);
} | [
"public",
"static",
"GoogleAccountCredential",
"usingOAuth2",
"(",
"Context",
"context",
",",
"Collection",
"<",
"String",
">",
"scopes",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"scopes",
"!=",
"null",
"&&",
"scopes",
".",
"iterator",
"(",
")",
"... | Constructs a new instance using OAuth 2.0 scopes.
@param context context
@param scopes non empty OAuth 2.0 scope list
@return new instance
@since 1.15 | [
"Constructs",
"a",
"new",
"instance",
"using",
"OAuth",
"2",
".",
"0",
"scopes",
"."
] | train | https://github.com/googleapis/google-api-java-client/blob/88decfd14fc40cae6eb6729a45c7d56a1132e450/google-api-client-android/src/main/java/com/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential.java#L112-L116 |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/company/api/QYOauthAPI.java | QYOauthAPI.getOauthPageUrl | public String getOauthPageUrl(String redirectUrl, OauthScope scope, String state) {
"""
生成回调url,这个结果要求用户在微信中打开,即可获得token,并指向redirectUrl
@param redirectUrl 用户自己设置的回调url
@param scope 授权作用域
@param state 用户自带参数
@return 回调url,用户在微信中打开即可开始授权
"""
if(StrUtil.isBlank(redirectUrl)){
t... | java | public String getOauthPageUrl(String redirectUrl, OauthScope scope, String state){
if(StrUtil.isBlank(redirectUrl)){
throw new NullPointerException("redirectUrl is null");
}
BeanUtil.requireNonNull(scope, "scope is null");
String userstate = StrUtil.isBlank(state) ? "STATE" :... | [
"public",
"String",
"getOauthPageUrl",
"(",
"String",
"redirectUrl",
",",
"OauthScope",
"scope",
",",
"String",
"state",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"redirectUrl",
")",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"redirect... | 生成回调url,这个结果要求用户在微信中打开,即可获得token,并指向redirectUrl
@param redirectUrl 用户自己设置的回调url
@param scope 授权作用域
@param state 用户自带参数
@return 回调url,用户在微信中打开即可开始授权 | [
"生成回调url,这个结果要求用户在微信中打开,即可获得token,并指向redirectUrl"
] | train | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/company/api/QYOauthAPI.java#L44-L63 |
sniffy/sniffy | sniffy-core/src/main/java/io/sniffy/LegacySpy.java | LegacySpy.verifyNever | @Deprecated
public C verifyNever(Threads threadMatcher, Query query) throws WrongNumberOfQueriesError {
"""
Alias for {@link #verifyBetween(int, int, Threads, Query)} with arguments 0, 0, {@code threads}, {@code queryType}
@since 2.2
"""
return verify(SqlQueries.noneQueries().threads(threadMatcher... | java | @Deprecated
public C verifyNever(Threads threadMatcher, Query query) throws WrongNumberOfQueriesError {
return verify(SqlQueries.noneQueries().threads(threadMatcher).type(adapter(query)));
} | [
"@",
"Deprecated",
"public",
"C",
"verifyNever",
"(",
"Threads",
"threadMatcher",
",",
"Query",
"query",
")",
"throws",
"WrongNumberOfQueriesError",
"{",
"return",
"verify",
"(",
"SqlQueries",
".",
"noneQueries",
"(",
")",
".",
"threads",
"(",
"threadMatcher",
"... | Alias for {@link #verifyBetween(int, int, Threads, Query)} with arguments 0, 0, {@code threads}, {@code queryType}
@since 2.2 | [
"Alias",
"for",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-core/src/main/java/io/sniffy/LegacySpy.java#L197-L200 |
mikepenz/FastAdapter | library/src/main/java/com/mikepenz/fastadapter/commons/adapters/AbstractWrapAdapter.java | AbstractWrapAdapter.onCreateViewHolder | @Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
"""
the onCreateViewHolder is managed by the FastAdapter so forward this correctly
@param parent
@param viewType
@return
"""
//TODO OPTIMIZE
for (Item item : mItems) {
if (item.get... | java | @Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//TODO OPTIMIZE
for (Item item : mItems) {
if (item.getType() == viewType) {
return item.getViewHolder(parent);
}
}
return mAdapter.onCreateViewHolder... | [
"@",
"Override",
"public",
"RecyclerView",
".",
"ViewHolder",
"onCreateViewHolder",
"(",
"ViewGroup",
"parent",
",",
"int",
"viewType",
")",
"{",
"//TODO OPTIMIZE",
"for",
"(",
"Item",
"item",
":",
"mItems",
")",
"{",
"if",
"(",
"item",
".",
"getType",
"(",
... | the onCreateViewHolder is managed by the FastAdapter so forward this correctly
@param parent
@param viewType
@return | [
"the",
"onCreateViewHolder",
"is",
"managed",
"by",
"the",
"FastAdapter",
"so",
"forward",
"this",
"correctly"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/adapters/AbstractWrapAdapter.java#L157-L166 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/BadComparable.java | BadComparable.getTypeOfSubtract | private static Type getTypeOfSubtract(BinaryTree expression, VisitorState state) {
"""
Compute the type of the subtract BinaryTree. We use the type of the left/right operand except
when they're not the same, in which case we prefer the type of the expression. This ensures
that a byte/short subtracted from anothe... | java | private static Type getTypeOfSubtract(BinaryTree expression, VisitorState state) {
Type expressionType = ASTHelpers.getType(expression.getLeftOperand());
if (!ASTHelpers.isSameType(
expressionType, ASTHelpers.getType(expression.getRightOperand()), state)) {
return ASTHelpers.getType(expression);
... | [
"private",
"static",
"Type",
"getTypeOfSubtract",
"(",
"BinaryTree",
"expression",
",",
"VisitorState",
"state",
")",
"{",
"Type",
"expressionType",
"=",
"ASTHelpers",
".",
"getType",
"(",
"expression",
".",
"getLeftOperand",
"(",
")",
")",
";",
"if",
"(",
"!"... | Compute the type of the subtract BinaryTree. We use the type of the left/right operand except
when they're not the same, in which case we prefer the type of the expression. This ensures
that a byte/short subtracted from another byte/short isn't regarded as an int. | [
"Compute",
"the",
"type",
"of",
"the",
"subtract",
"BinaryTree",
".",
"We",
"use",
"the",
"type",
"of",
"the",
"left",
"/",
"right",
"operand",
"except",
"when",
"they",
"re",
"not",
"the",
"same",
"in",
"which",
"case",
"we",
"prefer",
"the",
"type",
... | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/BadComparable.java#L83-L90 |
Jasig/uPortal | uPortal-spring/src/main/java/org/apereo/portal/spring/security/preauth/PortalPreAuthenticatedProcessingFilter.java | PortalPreAuthenticatedProcessingFilter.getPropertyFromRequest | private HashMap<String, String> getPropertyFromRequest(
HashMap<String, String> tokens, HttpServletRequest request) {
"""
Get the values represented by each token from the request and load them into a HashMap that
is returned.
@param tokens
@param request
@return HashMap of properties
"""
... | java | private HashMap<String, String> getPropertyFromRequest(
HashMap<String, String> tokens, HttpServletRequest request) {
// Iterate through all of the other property keys looking for the first property
// named like propname that has a value in the request
HashMap<String, String> retHas... | [
"private",
"HashMap",
"<",
"String",
",",
"String",
">",
"getPropertyFromRequest",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"tokens",
",",
"HttpServletRequest",
"request",
")",
"{",
"// Iterate through all of the other property keys looking for the first property"... | Get the values represented by each token from the request and load them into a HashMap that
is returned.
@param tokens
@param request
@return HashMap of properties | [
"Get",
"the",
"values",
"represented",
"by",
"each",
"token",
"from",
"the",
"request",
"and",
"load",
"them",
"into",
"a",
"HashMap",
"that",
"is",
"returned",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-spring/src/main/java/org/apereo/portal/spring/security/preauth/PortalPreAuthenticatedProcessingFilter.java#L525-L568 |
pac4j/pac4j | pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPPostEncoder.java | Pac4jHTTPPostEncoder.marshallMessage | protected Element marshallMessage(XMLObject message) throws MessageEncodingException {
"""
Helper method that marshalls the given message.
@param message message the marshall and serialize
@return marshalled message
@throws MessageEncodingException thrown if the give message can not be marshalled into its... | java | protected Element marshallMessage(XMLObject message) throws MessageEncodingException {
log.debug("Marshalling message");
try {
return XMLObjectSupport.marshall(message);
} catch (MarshallingException e) {
throw new MessageEncodingException("Error marshalling message", e)... | [
"protected",
"Element",
"marshallMessage",
"(",
"XMLObject",
"message",
")",
"throws",
"MessageEncodingException",
"{",
"log",
".",
"debug",
"(",
"\"Marshalling message\"",
")",
";",
"try",
"{",
"return",
"XMLObjectSupport",
".",
"marshall",
"(",
"message",
")",
"... | Helper method that marshalls the given message.
@param message message the marshall and serialize
@return marshalled message
@throws MessageEncodingException thrown if the give message can not be marshalled into its DOM representation | [
"Helper",
"method",
"that",
"marshalls",
"the",
"given",
"message",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPPostEncoder.java#L224-L232 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/constraint/ConstraintContextProperties.java | ConstraintContextProperties.getConstraint | private AbstractConstraint<?> getConstraint(String constraintName) throws PropertyException {
"""
Extracts the constraint with the given name in form of a constraint-object.<br>
@param constraintName The property-name of the constraint (CONSTRAINT_X)
@return The constraint-representation of the constraint-proper... | java | private AbstractConstraint<?> getConstraint(String constraintName) throws PropertyException{
String constraintString = props.getProperty(constraintName);
if(constraintString == null)
throw new PropertyException(ConstraintContextProperty.CONSTRAINT, constraintName, "Unparseable constraint");
AbstractConstraint<... | [
"private",
"AbstractConstraint",
"<",
"?",
">",
"getConstraint",
"(",
"String",
"constraintName",
")",
"throws",
"PropertyException",
"{",
"String",
"constraintString",
"=",
"props",
".",
"getProperty",
"(",
"constraintName",
")",
";",
"if",
"(",
"constraintString",... | Extracts the constraint with the given name in form of a constraint-object.<br>
@param constraintName The property-name of the constraint (CONSTRAINT_X)
@return The constraint-representation of the constraint-property
@throws PropertyException if there is no constraint with the given name or the value cannot be convert... | [
"Extracts",
"the",
"constraint",
"with",
"the",
"given",
"name",
"in",
"form",
"of",
"a",
"constraint",
"-",
"object",
".",
"<br",
">"
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/constraint/ConstraintContextProperties.java#L262-L277 |
mediathekview/MLib | src/main/java/de/mediathekview/mlib/tool/FilenameUtils.java | FilenameUtils.convertToNativeEncoding | private static String convertToNativeEncoding(String fileName, boolean isPath) {
"""
Convert a filename from Java´s native UTF-16 to OS native character encoding.
@param fileName The UTF-16 filename string.
@return Natively encoded string for the OS.
"""
String ret = fileName;
ret = remove... | java | private static String convertToNativeEncoding(String fileName, boolean isPath) {
String ret = fileName;
ret = removeIllegalCharacters(ret, isPath);
//convert our filename to OS encoding...
try {
final CharsetEncoder charsetEncoder = Charset.defaultCharset().newEncoder();
... | [
"private",
"static",
"String",
"convertToNativeEncoding",
"(",
"String",
"fileName",
",",
"boolean",
"isPath",
")",
"{",
"String",
"ret",
"=",
"fileName",
";",
"ret",
"=",
"removeIllegalCharacters",
"(",
"ret",
",",
"isPath",
")",
";",
"//convert our filename to O... | Convert a filename from Java´s native UTF-16 to OS native character encoding.
@param fileName The UTF-16 filename string.
@return Natively encoded string for the OS. | [
"Convert",
"a",
"filename",
"from",
"Java´s",
"native",
"UTF",
"-",
"16",
"to",
"OS",
"native",
"character",
"encoding",
"."
] | train | https://github.com/mediathekview/MLib/blob/01fd5791d87390fea7536275b8a2d4407fc00908/src/main/java/de/mediathekview/mlib/tool/FilenameUtils.java#L124-L148 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.scatterMax | public SDVariable scatterMax(String name, SDVariable ref, SDVariable indices, SDVariable updates) {
"""
Scatter max operation.<br>
If indices is rank 0 (a scalar), then out[index, ...] = max(updates[...], in[index,...])<br>
If indices is rank 1 (a vector), then for each position i, out[indices[i], ...] = max(upd... | java | public SDVariable scatterMax(String name, SDVariable ref, SDVariable indices, SDVariable updates) {
validateInteger("scatterMax", "indices", indices);
SDVariable ret = f().scatterMax(ref, indices, updates);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"scatterMax",
"(",
"String",
"name",
",",
"SDVariable",
"ref",
",",
"SDVariable",
"indices",
",",
"SDVariable",
"updates",
")",
"{",
"validateInteger",
"(",
"\"scatterMax\"",
",",
"\"indices\"",
",",
"indices",
")",
";",
"SDVariable",
"re... | Scatter max operation.<br>
If indices is rank 0 (a scalar), then out[index, ...] = max(updates[...], in[index,...])<br>
If indices is rank 1 (a vector), then for each position i, out[indices[i], ...] = max(updates[i,...], in[indices[i],...])<br>
If indices is rank 2+, then for each position (i,...,k), out[indices[i], .... | [
"Scatter",
"max",
"operation",
".",
"<br",
">",
"If",
"indices",
"is",
"rank",
"0",
"(",
"a",
"scalar",
")",
"then",
"out",
"[",
"index",
"...",
"]",
"=",
"max",
"(",
"updates",
"[",
"...",
"]",
"in",
"[",
"index",
"...",
"]",
")",
"<br",
">",
... | 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#L2082-L2086 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionsTable.java | ExtensionsTable.elementAvailable | public boolean elementAvailable(String ns, String elemName)
throws javax.xml.transform.TransformerException {
"""
Execute the element-available() function.
@param ns the URI of namespace in which the function is needed
@param elemName name of element being tested
@return whether the given elem... | java | public boolean elementAvailable(String ns, String elemName)
throws javax.xml.transform.TransformerException
{
boolean isAvailable = false;
if (null != ns)
{
ExtensionHandler extNS =
(ExtensionHandler) m_extensionFunctionNamespaces.get(ns);
if (extNS != null) // defens... | [
"public",
"boolean",
"elementAvailable",
"(",
"String",
"ns",
",",
"String",
"elemName",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"boolean",
"isAvailable",
"=",
"false",
";",
"if",
"(",
"null",
"!=",
"ns",
")",
... | Execute the element-available() function.
@param ns the URI of namespace in which the function is needed
@param elemName name of element being tested
@return whether the given element is available or not.
@throws javax.xml.transform.TransformerException | [
"Execute",
"the",
"element",
"-",
"available",
"()",
"function",
".",
"@param",
"ns",
"the",
"URI",
"of",
"namespace",
"in",
"which",
"the",
"function",
"is",
"needed",
"@param",
"elemName",
"name",
"of",
"element",
"being",
"tested"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/extensions/ExtensionsTable.java#L132-L144 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java | FTPFileSystem.delete | private boolean delete(FTPClient client, Path file, boolean recursive)
throws IOException {
"""
Convenience method, so that we don't open a new connection when using this
method from within another method. Otherwise every API invocation incurs
the overhead of opening/closing a TCP connection.
"""
P... | java | private boolean delete(FTPClient client, Path file, boolean recursive)
throws IOException {
Path workDir = new Path(client.printWorkingDirectory());
Path absolute = makeAbsolute(workDir, file);
String pathName = absolute.toUri().getPath();
FileStatus fileStat = getFileStatus(client, absolute);
... | [
"private",
"boolean",
"delete",
"(",
"FTPClient",
"client",
",",
"Path",
"file",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"Path",
"workDir",
"=",
"new",
"Path",
"(",
"client",
".",
"printWorkingDirectory",
"(",
")",
")",
";",
"Path",
... | Convenience method, so that we don't open a new connection when using this
method from within another method. Otherwise every API invocation incurs
the overhead of opening/closing a TCP connection. | [
"Convenience",
"method",
"so",
"that",
"we",
"don",
"t",
"open",
"a",
"new",
"connection",
"when",
"using",
"this",
"method",
"from",
"within",
"another",
"method",
".",
"Otherwise",
"every",
"API",
"invocation",
"incurs",
"the",
"overhead",
"of",
"opening",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java#L297-L316 |
GoogleCloudPlatform/bigdata-interop | gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/InMemoryGlobberFileSystem.java | InMemoryGlobberFileSystem.createInstance | public static FileSystem createInstance(
Configuration config, Path workingDirectory, Collection<FileStatus> fileStatuses) {
"""
Factory method for constructing and initializing an instance of InMemoryGlobberFileSystem which
is ready to list/get FileStatus entries corresponding to {@code fileStatuses}.
... | java | public static FileSystem createInstance(
Configuration config, Path workingDirectory, Collection<FileStatus> fileStatuses) {
checkNotNull(config, "configuration can not be null");
FileSystem fileSystem = new InMemoryGlobberFileSystem(workingDirectory, fileStatuses);
fileSystem.setConf(config);
r... | [
"public",
"static",
"FileSystem",
"createInstance",
"(",
"Configuration",
"config",
",",
"Path",
"workingDirectory",
",",
"Collection",
"<",
"FileStatus",
">",
"fileStatuses",
")",
"{",
"checkNotNull",
"(",
"config",
",",
"\"configuration can not be null\"",
")",
";",... | Factory method for constructing and initializing an instance of InMemoryGlobberFileSystem which
is ready to list/get FileStatus entries corresponding to {@code fileStatuses}. | [
"Factory",
"method",
"for",
"constructing",
"and",
"initializing",
"an",
"instance",
"of",
"InMemoryGlobberFileSystem",
"which",
"is",
"ready",
"to",
"list",
"/",
"get",
"FileStatus",
"entries",
"corresponding",
"to",
"{"
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcs/src/main/java/com/google/cloud/hadoop/fs/gcs/InMemoryGlobberFileSystem.java#L52-L60 |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/PosixParser.java | PosixParser.burstToken | protected void burstToken(String token, boolean stopAtNonOption) {
"""
Breaks <code>token</code> into its constituent parts
using the following algorithm.
<ul>
<li>ignore the first character ("<b>-</b>")</li>
<li>foreach remaining character check if an {@link Option}
exists with that id.</li>
<li>if an {@l... | java | protected void burstToken(String token, boolean stopAtNonOption)
{
for (int i = 1; i < token.length(); i++)
{
String ch = String.valueOf(token.charAt(i));
if (options.hasOption(ch))
{
tokens.add("-" + ch);
currentOption = options.g... | [
"protected",
"void",
"burstToken",
"(",
"String",
"token",
",",
"boolean",
"stopAtNonOption",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"token",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"String",
"ch",
"=",
"String",
".",... | Breaks <code>token</code> into its constituent parts
using the following algorithm.
<ul>
<li>ignore the first character ("<b>-</b>")</li>
<li>foreach remaining character check if an {@link Option}
exists with that id.</li>
<li>if an {@link Option} does exist then add that character
prepended with "<b>-</b>" to the lis... | [
"Breaks",
"<code",
">",
"token<",
"/",
"code",
">",
"into",
"its",
"constituent",
"parts",
"using",
"the",
"following",
"algorithm",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/PosixParser.java#L264-L293 |
spring-cloud/spring-cloud-netflix | spring-cloud-netflix-ribbon/src/main/java/org/springframework/cloud/netflix/ribbon/SpringClientFactory.java | SpringClientFactory.getClient | public <C extends IClient<?, ?>> C getClient(String name, Class<C> clientClass) {
"""
Get the rest client associated with the name.
@param name name to search by
@param clientClass the class of the client bean
@param <C> {@link IClient} subtype
@return {@link IClient} instance
@throws RuntimeException if any ... | java | public <C extends IClient<?, ?>> C getClient(String name, Class<C> clientClass) {
return getInstance(name, clientClass);
} | [
"public",
"<",
"C",
"extends",
"IClient",
"<",
"?",
",",
"?",
">",
">",
"C",
"getClient",
"(",
"String",
"name",
",",
"Class",
"<",
"C",
">",
"clientClass",
")",
"{",
"return",
"getInstance",
"(",
"name",
",",
"clientClass",
")",
";",
"}"
] | Get the rest client associated with the name.
@param name name to search by
@param clientClass the class of the client bean
@param <C> {@link IClient} subtype
@return {@link IClient} instance
@throws RuntimeException if any error occurs | [
"Get",
"the",
"rest",
"client",
"associated",
"with",
"the",
"name",
"."
] | train | https://github.com/spring-cloud/spring-cloud-netflix/blob/03b1e326ce5971c41239890dc71cae616366cff8/spring-cloud-netflix-ribbon/src/main/java/org/springframework/cloud/netflix/ribbon/SpringClientFactory.java#L54-L56 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/style/ColorUtils.java | ColorUtils.toColorWithAlpha | public static String toColorWithAlpha(String red, String green, String blue) {
"""
Convert the hex color values to a hex color including an opaque alpha
value of FF
@param red
red hex color in format RR or R
@param green
green hex color in format GG or G
@param blue
blue hex color in format BB or B
@re... | java | public static String toColorWithAlpha(String red, String green, String blue) {
String defaultAlpha = "FF";
if (red != null && !red.isEmpty()
&& Character.isLowerCase(red.charAt(0))) {
defaultAlpha = defaultAlpha.toLowerCase();
}
return toColorWithAlpha(red, green, blue, defaultAlpha);
} | [
"public",
"static",
"String",
"toColorWithAlpha",
"(",
"String",
"red",
",",
"String",
"green",
",",
"String",
"blue",
")",
"{",
"String",
"defaultAlpha",
"=",
"\"FF\"",
";",
"if",
"(",
"red",
"!=",
"null",
"&&",
"!",
"red",
".",
"isEmpty",
"(",
")",
"... | Convert the hex color values to a hex color including an opaque alpha
value of FF
@param red
red hex color in format RR or R
@param green
green hex color in format GG or G
@param blue
blue hex color in format BB or B
@return hex color in format #AARRGGBB | [
"Convert",
"the",
"hex",
"color",
"values",
"to",
"a",
"hex",
"color",
"including",
"an",
"opaque",
"alpha",
"value",
"of",
"FF"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/style/ColorUtils.java#L73-L80 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/TableFactory.java | TableFactory.createTable | public Table createTable(ProjectFile file, byte[] data, VarMeta varMeta, Var2Data varData) {
"""
Creates a new Table instance from data extracted from an MPP file.
@param file parent project file
@param data fixed data
@param varMeta var meta
@param varData var data
@return Table instance
"""
Tabl... | java | public Table createTable(ProjectFile file, byte[] data, VarMeta varMeta, Var2Data varData)
{
Table table = new Table();
table.setID(MPPUtility.getInt(data, 0));
table.setResourceFlag(MPPUtility.getShort(data, 108) == 1);
table.setName(MPPUtility.removeAmpersands(MPPUtility.getUnicodeString(d... | [
"public",
"Table",
"createTable",
"(",
"ProjectFile",
"file",
",",
"byte",
"[",
"]",
"data",
",",
"VarMeta",
"varMeta",
",",
"Var2Data",
"varData",
")",
"{",
"Table",
"table",
"=",
"new",
"Table",
"(",
")",
";",
"table",
".",
"setID",
"(",
"MPPUtility",
... | Creates a new Table instance from data extracted from an MPP file.
@param file parent project file
@param data fixed data
@param varMeta var meta
@param varData var data
@return Table instance | [
"Creates",
"a",
"new",
"Table",
"instance",
"from",
"data",
"extracted",
"from",
"an",
"MPP",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/TableFactory.java#L61-L90 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.primitiveArrayGet | protected static List primitiveArrayGet(Object self, Collection indices) {
"""
Implements the getAt(Collection) method for primitive type arrays. Each
value in the collection argument is assumed to be a valid array index.
The value at each index is then added to a list which is returned.
@param self an ar... | java | protected static List primitiveArrayGet(Object self, Collection indices) {
List answer = new ArrayList();
for (Object value : indices) {
if (value instanceof Range) {
answer.addAll(primitiveArrayGet(self, (Range) value));
} else if (value instanceof List) {
... | [
"protected",
"static",
"List",
"primitiveArrayGet",
"(",
"Object",
"self",
",",
"Collection",
"indices",
")",
"{",
"List",
"answer",
"=",
"new",
"ArrayList",
"(",
")",
";",
"for",
"(",
"Object",
"value",
":",
"indices",
")",
"{",
"if",
"(",
"value",
"ins... | Implements the getAt(Collection) method for primitive type arrays. Each
value in the collection argument is assumed to be a valid array index.
The value at each index is then added to a list which is returned.
@param self an array object
@param indices the indices of interest
@return the returned values from the a... | [
"Implements",
"the",
"getAt",
"(",
"Collection",
")",
"method",
"for",
"primitive",
"type",
"arrays",
".",
"Each",
"value",
"in",
"the",
"collection",
"argument",
"is",
"assumed",
"to",
"be",
"a",
"valid",
"array",
"index",
".",
"The",
"value",
"at",
"each... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L14575-L14588 |
jsonld-java/jsonld-java | core/src/main/java/com/github/jsonldjava/core/DocumentLoader.java | DocumentLoader.loadDocument | public RemoteDocument loadDocument(String url) throws JsonLdError {
"""
Loads the URL if possible, returning it as a RemoteDocument.
@param url
The URL to load
@return The resolved URL as a RemoteDocument
@throws JsonLdError
If there are errors loading or remote context loading has
been disallowed.
"""... | java | public RemoteDocument loadDocument(String url) throws JsonLdError {
if (m_injectedDocs.containsKey(url)) {
try {
return new RemoteDocument(url, m_injectedDocs.get(url));
} catch (final Exception e) {
throw new JsonLdError(JsonLdError.Error.LOADING_INJECTED... | [
"public",
"RemoteDocument",
"loadDocument",
"(",
"String",
"url",
")",
"throws",
"JsonLdError",
"{",
"if",
"(",
"m_injectedDocs",
".",
"containsKey",
"(",
"url",
")",
")",
"{",
"try",
"{",
"return",
"new",
"RemoteDocument",
"(",
"url",
",",
"m_injectedDocs",
... | Loads the URL if possible, returning it as a RemoteDocument.
@param url
The URL to load
@return The resolved URL as a RemoteDocument
@throws JsonLdError
If there are errors loading or remote context loading has
been disallowed. | [
"Loads",
"the",
"URL",
"if",
"possible",
"returning",
"it",
"as",
"a",
"RemoteDocument",
"."
] | train | https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/core/DocumentLoader.java#L56-L77 |
apache/incubator-druid | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java | ApproximateHistogram.heapify | private static void heapify(int[] heap, int[] reverseIndex, int count, float[] values) {
"""
Builds a min-heap and a reverseIndex into the heap from the given array of values
@param heap min-heap stored as indices into the array of values
@param reverseIndex reverse index from the array of values into ... | java | private static void heapify(int[] heap, int[] reverseIndex, int count, float[] values)
{
int start = (count - 2) / 2;
while (start >= 0) {
siftDown(heap, reverseIndex, start, count - 1, values);
start--;
}
} | [
"private",
"static",
"void",
"heapify",
"(",
"int",
"[",
"]",
"heap",
",",
"int",
"[",
"]",
"reverseIndex",
",",
"int",
"count",
",",
"float",
"[",
"]",
"values",
")",
"{",
"int",
"start",
"=",
"(",
"count",
"-",
"2",
")",
"/",
"2",
";",
"while",... | Builds a min-heap and a reverseIndex into the heap from the given array of values
@param heap min-heap stored as indices into the array of values
@param reverseIndex reverse index from the array of values into the heap
@param count current size of the heap
@param values values to be stored in the ... | [
"Builds",
"a",
"min",
"-",
"heap",
"and",
"a",
"reverseIndex",
"into",
"the",
"heap",
"from",
"the",
"given",
"array",
"of",
"values"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogram.java#L988-L995 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.