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 |
|---|---|---|---|---|---|---|---|---|---|---|
fengwenyi/JavaLib | src/main/java/com/fengwenyi/javalib/third/Base64.java | Base64.base64toInt | private static int base64toInt(char c, byte[] alphaToInt) {
"""
Translates the specified character, which is assumed to be in the "Base 64 Alphabet" into its equivalent 6-bit
positive integer.
@throw IllegalArgumentException or ArrayOutOfBoundsException if c is not in the Base64 Alphabet.
@param c [ellipsis]
... | java | private static int base64toInt(char c, byte[] alphaToInt) {
int result = alphaToInt[c];
if (result < 0) {
throw new IllegalArgumentException("Illegal character " + c);
}
return result;
} | [
"private",
"static",
"int",
"base64toInt",
"(",
"char",
"c",
",",
"byte",
"[",
"]",
"alphaToInt",
")",
"{",
"int",
"result",
"=",
"alphaToInt",
"[",
"c",
"]",
";",
"if",
"(",
"result",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"("... | Translates the specified character, which is assumed to be in the "Base 64 Alphabet" into its equivalent 6-bit
positive integer.
@throw IllegalArgumentException or ArrayOutOfBoundsException if c is not in the Base64 Alphabet.
@param c [ellipsis]
@param alphaToInt [ellipsis]
@return [ellipsis] | [
"Translates",
"the",
"specified",
"character",
"which",
"is",
"assumed",
"to",
"be",
"in",
"the",
"Base",
"64",
"Alphabet",
"into",
"its",
"equivalent",
"6",
"-",
"bit",
"positive",
"integer",
"."
] | train | https://github.com/fengwenyi/JavaLib/blob/14838b13fb11c024e41be766aa3e13ead4be1703/src/main/java/com/fengwenyi/javalib/third/Base64.java#L195-L201 |
ihaolin/session | session-api/src/main/java/me/hao0/session/util/WebUtil.java | WebUtil.findCookieValue | public static String findCookieValue(HttpServletRequest request, String name) {
"""
find cookie value
@param request current request
@param name cookie name
@return cookie value
"""
Cookie cookie = findCookie(request, name);
return cookie != null ? cookie.getValue() : null;
} | java | public static String findCookieValue(HttpServletRequest request, String name) {
Cookie cookie = findCookie(request, name);
return cookie != null ? cookie.getValue() : null;
} | [
"public",
"static",
"String",
"findCookieValue",
"(",
"HttpServletRequest",
"request",
",",
"String",
"name",
")",
"{",
"Cookie",
"cookie",
"=",
"findCookie",
"(",
"request",
",",
"name",
")",
";",
"return",
"cookie",
"!=",
"null",
"?",
"cookie",
".",
"getVa... | find cookie value
@param request current request
@param name cookie name
@return cookie value | [
"find",
"cookie",
"value"
] | train | https://github.com/ihaolin/session/blob/322c3a9f47b305a39345135fa8163dd7e065b4f8/session-api/src/main/java/me/hao0/session/util/WebUtil.java#L81-L84 |
stapler/stapler | core/src/main/java/org/kohsuke/stapler/Stapler.java | Stapler.getViewURL | public static String getViewURL(Class clazz,String jspName) {
"""
Gets the URL (e.g., "/WEB-INF/side-files/fully/qualified/class/name/jspName")
from a class and the JSP name.
"""
return "/WEB-INF/side-files/"+clazz.getName().replace('.','/')+'/'+jspName;
} | java | public static String getViewURL(Class clazz,String jspName) {
return "/WEB-INF/side-files/"+clazz.getName().replace('.','/')+'/'+jspName;
} | [
"public",
"static",
"String",
"getViewURL",
"(",
"Class",
"clazz",
",",
"String",
"jspName",
")",
"{",
"return",
"\"/WEB-INF/side-files/\"",
"+",
"clazz",
".",
"getName",
"(",
")",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
"+",
"'",
"'",
"+",
... | Gets the URL (e.g., "/WEB-INF/side-files/fully/qualified/class/name/jspName")
from a class and the JSP name. | [
"Gets",
"the",
"URL",
"(",
"e",
".",
"g",
".",
"/",
"WEB",
"-",
"INF",
"/",
"side",
"-",
"files",
"/",
"fully",
"/",
"qualified",
"/",
"class",
"/",
"name",
"/",
"jspName",
")",
"from",
"a",
"class",
"and",
"the",
"JSP",
"name",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/Stapler.java#L927-L929 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseServerHeader | private void parseServerHeader(Map<Object, Object> props) {
"""
Check the input configuration map for the parameters that control the
Server header value.
@param props
"""
// @PK15848
String value = getProp(props, HttpConfigConstants.PROPNAME_SERVER_HEADER_VALUE);
if (null == value ... | java | private void parseServerHeader(Map<Object, Object> props) {
// @PK15848
String value = getProp(props, HttpConfigConstants.PROPNAME_SERVER_HEADER_VALUE);
if (null == value || "".equals(value)) {
// due to security change, do not default value in Server header. // PM87013 Start
... | [
"private",
"void",
"parseServerHeader",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"// @PK15848",
"String",
"value",
"=",
"getProp",
"(",
"props",
",",
"HttpConfigConstants",
".",
"PROPNAME_SERVER_HEADER_VALUE",
")",
";",
"if",
"(",
"nul... | Check the input configuration map for the parameters that control the
Server header value.
@param props | [
"Check",
"the",
"input",
"configuration",
"map",
"for",
"the",
"parameters",
"that",
"control",
"the",
"Server",
"header",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L1061-L1084 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.foldCase | public static String foldCase(String str, boolean defaultmapping) {
"""
<strong>[icu]</strong> The given string is mapped to its case folding equivalent according to
UnicodeData.txt and CaseFolding.txt; if any character has no case
folding equivalent, the character itself is returned.
"Full", multiple-code poin... | java | public static String foldCase(String str, boolean defaultmapping) {
return foldCase(str, defaultmapping ? FOLD_CASE_DEFAULT : FOLD_CASE_EXCLUDE_SPECIAL_I);
} | [
"public",
"static",
"String",
"foldCase",
"(",
"String",
"str",
",",
"boolean",
"defaultmapping",
")",
"{",
"return",
"foldCase",
"(",
"str",
",",
"defaultmapping",
"?",
"FOLD_CASE_DEFAULT",
":",
"FOLD_CASE_EXCLUDE_SPECIAL_I",
")",
";",
"}"
] | <strong>[icu]</strong> The given string is mapped to its case folding equivalent according to
UnicodeData.txt and CaseFolding.txt; if any character has no case
folding equivalent, the character itself is returned.
"Full", multiple-code point case folding mappings are returned here.
For "simple" single-code point mappin... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"The",
"given",
"string",
"is",
"mapped",
"to",
"its",
"case",
"folding",
"equivalent",
"according",
"to",
"UnicodeData",
".",
"txt",
"and",
"CaseFolding",
".",
"txt",
";",
"if",
"any",
"character... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L4678-L4680 |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.initalize | private PowerShell initalize(String powerShellExecutablePath) throws PowerShellNotAvailableException {
"""
Initializes PowerShell console in which we will enter the commands
"""
String codePage = PowerShellCodepage.getIdentifierByCodePageName(Charset.defaultCharset().name());
ProcessBuilder pb;... | java | private PowerShell initalize(String powerShellExecutablePath) throws PowerShellNotAvailableException {
String codePage = PowerShellCodepage.getIdentifierByCodePageName(Charset.defaultCharset().name());
ProcessBuilder pb;
//Start powershell executable in process
if (OSDetector.isWindows(... | [
"private",
"PowerShell",
"initalize",
"(",
"String",
"powerShellExecutablePath",
")",
"throws",
"PowerShellNotAvailableException",
"{",
"String",
"codePage",
"=",
"PowerShellCodepage",
".",
"getIdentifierByCodePageName",
"(",
"Charset",
".",
"defaultCharset",
"(",
")",
".... | Initializes PowerShell console in which we will enter the commands | [
"Initializes",
"PowerShell",
"console",
"in",
"which",
"we",
"will",
"enter",
"the",
"commands"
] | train | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L136-L174 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java | IndexChangeAdapters.forMultipleColumns | public static IndexChangeAdapter forMultipleColumns( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
ProvidedIndex<?> inde... | java | public static IndexChangeAdapter forMultipleColumns( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
ProvidedIndex<?> inde... | [
"public",
"static",
"IndexChangeAdapter",
"forMultipleColumns",
"(",
"ExecutionContext",
"context",
",",
"NodeTypePredicate",
"matcher",
",",
"String",
"workspaceName",
",",
"ProvidedIndex",
"<",
"?",
">",
"index",
",",
"Iterable",
"<",
"IndexChangeAdapter",
">",
"ada... | Creates a composite change adapter which handles the case when an index has multiple columns.
@param context the execution context; may not be null
@param matcher the node type matcher used to determine which nodes should be included in the index; may not be null
@param workspaceName the name of the workspace; may not... | [
"Creates",
"a",
"composite",
"change",
"adapter",
"which",
"handles",
"the",
"case",
"when",
"an",
"index",
"has",
"multiple",
"columns",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java#L63-L69 |
osglworks/java-tool | src/main/java/org/osgl/util/FastStr.java | FastStr.unsafeOf | public static FastStr unsafeOf(String s) {
"""
Construct a FastStr instance from a String instance.
The FastStr instance will share the char array buf with
the String instance
@param s the string instance
@return A FastStr instance
"""
int sz = s.length();
if (sz == 0) return EMPTY_STR;
... | java | public static FastStr unsafeOf(String s) {
int sz = s.length();
if (sz == 0) return EMPTY_STR;
char[] buf = bufOf(s);
return new FastStr(buf, 0, sz);
} | [
"public",
"static",
"FastStr",
"unsafeOf",
"(",
"String",
"s",
")",
"{",
"int",
"sz",
"=",
"s",
".",
"length",
"(",
")",
";",
"if",
"(",
"sz",
"==",
"0",
")",
"return",
"EMPTY_STR",
";",
"char",
"[",
"]",
"buf",
"=",
"bufOf",
"(",
"s",
")",
";"... | Construct a FastStr instance from a String instance.
The FastStr instance will share the char array buf with
the String instance
@param s the string instance
@return A FastStr instance | [
"Construct",
"a",
"FastStr",
"instance",
"from",
"a",
"String",
"instance",
".",
"The",
"FastStr",
"instance",
"will",
"share",
"the",
"char",
"array",
"buf",
"with",
"the",
"String",
"instance"
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/FastStr.java#L1662-L1667 |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.moveEntry | public GoogleEntry moveEntry(GoogleEntry entry, GoogleCalendar from, GoogleCalendar to) throws IOException {
"""
Moves an entry from one calendar to another.
@param entry The entry to be moved.
@param from The current calendar.
@param to The future calendar.
@return The entry updated.
@throws IOException Fo... | java | public GoogleEntry moveEntry(GoogleEntry entry, GoogleCalendar from, GoogleCalendar to) throws IOException {
dao.events().move(from.getId(), entry.getId(), to.getId()).execute();
return entry;
} | [
"public",
"GoogleEntry",
"moveEntry",
"(",
"GoogleEntry",
"entry",
",",
"GoogleCalendar",
"from",
",",
"GoogleCalendar",
"to",
")",
"throws",
"IOException",
"{",
"dao",
".",
"events",
"(",
")",
".",
"move",
"(",
"from",
".",
"getId",
"(",
")",
",",
"entry"... | Moves an entry from one calendar to another.
@param entry The entry to be moved.
@param from The current calendar.
@param to The future calendar.
@return The entry updated.
@throws IOException For unexpected errors. | [
"Moves",
"an",
"entry",
"from",
"one",
"calendar",
"to",
"another",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L140-L143 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/HttpUtils.java | HttpUtils.checkIfMatch | public static void checkIfMatch(final String ifMatch, final EntityTag etag) {
"""
Check for a conditional operation.
@param ifMatch the If-Match header
@param etag the resource etag
"""
if (ifMatch == null) {
return;
}
final Set<String> items = stream(ifMatch.split(",")).m... | java | public static void checkIfMatch(final String ifMatch, final EntityTag etag) {
if (ifMatch == null) {
return;
}
final Set<String> items = stream(ifMatch.split(",")).map(String::trim).collect(toSet());
if (items.contains("*")) {
return;
}
try {
... | [
"public",
"static",
"void",
"checkIfMatch",
"(",
"final",
"String",
"ifMatch",
",",
"final",
"EntityTag",
"etag",
")",
"{",
"if",
"(",
"ifMatch",
"==",
"null",
")",
"{",
"return",
";",
"}",
"final",
"Set",
"<",
"String",
">",
"items",
"=",
"stream",
"(... | Check for a conditional operation.
@param ifMatch the If-Match header
@param etag the resource etag | [
"Check",
"for",
"a",
"conditional",
"operation",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/HttpUtils.java#L336-L351 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/git/GitService.java | GitService.checkinNewContent | public String checkinNewContent(String sourceDirectory, String message) throws Exception {
"""
Checks in content from a source directory into the current git repository.
@param sourceDirectory The directory to pull content in from.
@param message The commit message to use.
@return The new SHA revision.
@throws... | java | public String checkinNewContent(String sourceDirectory, String message) throws Exception {
RmCommand remove = git.rm();
boolean hasFiles = false;
for(String filename : new File(getBaseDirectory()).list()) {
if(!filename.equals(".git")) {
remove.addFilepattern(filename);
hasFiles = true... | [
"public",
"String",
"checkinNewContent",
"(",
"String",
"sourceDirectory",
",",
"String",
"message",
")",
"throws",
"Exception",
"{",
"RmCommand",
"remove",
"=",
"git",
".",
"rm",
"(",
")",
";",
"boolean",
"hasFiles",
"=",
"false",
";",
"for",
"(",
"String",... | Checks in content from a source directory into the current git repository.
@param sourceDirectory The directory to pull content in from.
@param message The commit message to use.
@return The new SHA revision.
@throws Exception | [
"Checks",
"in",
"content",
"from",
"a",
"source",
"directory",
"into",
"the",
"current",
"git",
"repository",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/git/GitService.java#L578-L604 |
Clivern/Racter | src/main/java/com/clivern/racter/senders/templates/GenericTemplate.java | GenericTemplate.setElementButton | public void setElementButton(Integer index, String title, String type, String url, Boolean messenger_extensions, String webview_height_ratio, String fallback_url) {
"""
Set Element Button
@param index the element index
@param title the element title
@param type the element type
@param url the element url
@p... | java | public void setElementButton(Integer index, String title, String type, String url, Boolean messenger_extensions, String webview_height_ratio, String fallback_url)
{
if( this.elements.get(index).containsKey("buttons") ){
HashMap<String, String> button = new HashMap<String, String>();
... | [
"public",
"void",
"setElementButton",
"(",
"Integer",
"index",
",",
"String",
"title",
",",
"String",
"type",
",",
"String",
"url",
",",
"Boolean",
"messenger_extensions",
",",
"String",
"webview_height_ratio",
",",
"String",
"fallback_url",
")",
"{",
"if",
"(",... | Set Element Button
@param index the element index
@param title the element title
@param type the element type
@param url the element url
@param messenger_extensions the messenger extensions
@param webview_height_ratio the webview height ratio
@param fallback_url the fallback url | [
"Set",
"Element",
"Button"
] | train | https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/senders/templates/GenericTemplate.java#L104-L130 |
ibm-bluemix-mobile-services/bms-clientsdk-android-push | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/push/api/MFPPush.java | MFPPush.initialize | public void initialize(Context context, String appGUID, String pushClientSecret,MFPPushNotificationOptions options) {
"""
MFPPush Intitialization method with clientSecret and Push App GUID.
<p/>
@param context this is the Context of the application from getApplicationContext()
@param appGUID ... | java | public void initialize(Context context, String appGUID, String pushClientSecret,MFPPushNotificationOptions options) {
try {
if (MFPPushUtils.validateString(pushClientSecret) && MFPPushUtils.validateString(appGUID)) {
// Get the applicationId and backend route from core
clientSecret = pushClie... | [
"public",
"void",
"initialize",
"(",
"Context",
"context",
",",
"String",
"appGUID",
",",
"String",
"pushClientSecret",
",",
"MFPPushNotificationOptions",
"options",
")",
"{",
"try",
"{",
"if",
"(",
"MFPPushUtils",
".",
"validateString",
"(",
"pushClientSecret",
"... | MFPPush Intitialization method with clientSecret and Push App GUID.
<p/>
@param context this is the Context of the application from getApplicationContext()
@param appGUID The unique ID of the Push service instance that the application must connect to.
@param pushClientSecret ClientSecret from the pus... | [
"MFPPush",
"Intitialization",
"method",
"with",
"clientSecret",
"and",
"Push",
"App",
"GUID",
".",
"<p",
"/",
">"
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-push/blob/26c048637e81a6942004693919558f3d9aa8c674/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/push/api/MFPPush.java#L255-L288 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java | PhotosetsInterface.getPhotos | public PhotoList<Photo> getPhotos(String photosetId, int perPage, int page) throws FlickrException {
"""
Convenience method.
Calls getPhotos() with Extras.MIN_EXTRAS and Flickr.PRIVACY_LEVEL_NO_FILTER.
This method does not require authentication.
@see com.flickr4java.flickr.photos.Extras
@see com.flickr4... | java | public PhotoList<Photo> getPhotos(String photosetId, int perPage, int page) throws FlickrException {
return getPhotos(photosetId, Extras.MIN_EXTRAS, Flickr.PRIVACY_LEVEL_NO_FILTER, perPage, page);
} | [
"public",
"PhotoList",
"<",
"Photo",
">",
"getPhotos",
"(",
"String",
"photosetId",
",",
"int",
"perPage",
",",
"int",
"page",
")",
"throws",
"FlickrException",
"{",
"return",
"getPhotos",
"(",
"photosetId",
",",
"Extras",
".",
"MIN_EXTRAS",
",",
"Flickr",
"... | Convenience method.
Calls getPhotos() with Extras.MIN_EXTRAS and Flickr.PRIVACY_LEVEL_NO_FILTER.
This method does not require authentication.
@see com.flickr4java.flickr.photos.Extras
@see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_NO_FILTER
@see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_PUBLIC
@see com.flickr4ja... | [
"Convenience",
"method",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java#L552-L554 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/VariantAggregatedExacStatsCalculator.java | VariantAggregatedExacStatsCalculator.getHeterozygousGenotype | public static void getHeterozygousGenotype(int index, int numAlternativeAlleles, Integer alleles[]) {
"""
returns in alleles[] the heterozygous genotype specified in index in the sequence (in this example for 3 ALT alleles):
0/1, 0/2, 0/3, 1/2, 1/3, 2/3
@param index in this sequence, starting in 0
@param numAlt... | java | public static void getHeterozygousGenotype(int index, int numAlternativeAlleles, Integer alleles[]) {
// index++;
// double value = (-3 + Math.sqrt(1 + 8 * index)) / 2; // slower than the iterating version, right?
// alleles[1] = new Double(Math.ceil(value)).intValue();
// alleles[0] = al... | [
"public",
"static",
"void",
"getHeterozygousGenotype",
"(",
"int",
"index",
",",
"int",
"numAlternativeAlleles",
",",
"Integer",
"alleles",
"[",
"]",
")",
"{",
"// index++;",
"// double value = (-3 + Math.sqrt(1 + 8 * index)) / 2; // slower than the iterating ver... | returns in alleles[] the heterozygous genotype specified in index in the sequence (in this example for 3 ALT alleles):
0/1, 0/2, 0/3, 1/2, 1/3, 2/3
@param index in this sequence, starting in 0
@param numAlternativeAlleles note that this ordering requires knowing how many alleles there are
@param alleles returned genoty... | [
"returns",
"in",
"alleles",
"[]",
"the",
"heterozygous",
"genotype",
"specified",
"in",
"index",
"in",
"the",
"sequence",
"(",
"in",
"this",
"example",
"for",
"3",
"ALT",
"alleles",
")",
":",
"0",
"/",
"1",
"0",
"/",
"2",
"0",
"/",
"3",
"1",
"/",
"... | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/stats/VariantAggregatedExacStatsCalculator.java#L275-L294 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.getChar | public char getChar(String name, char defaultValue) {
"""
Returns the char value for the specified name. If the name does not exist
or the value for the name can not be interpreted as a char, the
defaultValue is returned.
@param name
@param defaultValue
@return name value or defaultValue
"""
Str... | java | public char getChar(String name, char defaultValue) {
String value = getString(name, null);
if (!StringUtils.isNullOrEmpty(value)) {
return value.trim().charAt(0);
}
return defaultValue;
} | [
"public",
"char",
"getChar",
"(",
"String",
"name",
",",
"char",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getString",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"value",
")",
")",
"{",
"retur... | Returns the char value for the specified name. If the name does not exist
or the value for the name can not be interpreted as a char, the
defaultValue is returned.
@param name
@param defaultValue
@return name value or defaultValue | [
"Returns",
"the",
"char",
"value",
"for",
"the",
"specified",
"name",
".",
"If",
"the",
"name",
"does",
"not",
"exist",
"or",
"the",
"value",
"for",
"the",
"name",
"can",
"not",
"be",
"interpreted",
"as",
"a",
"char",
"the",
"defaultValue",
"is",
"return... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L587-L594 |
reactor/reactor-netty | src/main/java/reactor/netty/ByteBufMono.java | ByteBufMono.asString | public final Mono<String> asString(Charset charset) {
"""
a {@link String} inbound {@link Mono}
@param charset the decoding charset
@return a {@link String} inbound {@link Mono}
"""
return handle((bb, sink) -> {
try {
sink.next(bb.readCharSequence(bb.readableBytes(), charset).toString());
}
... | java | public final Mono<String> asString(Charset charset) {
return handle((bb, sink) -> {
try {
sink.next(bb.readCharSequence(bb.readableBytes(), charset).toString());
}
catch (IllegalReferenceCountException e) {
sink.complete();
}
});
} | [
"public",
"final",
"Mono",
"<",
"String",
">",
"asString",
"(",
"Charset",
"charset",
")",
"{",
"return",
"handle",
"(",
"(",
"bb",
",",
"sink",
")",
"->",
"{",
"try",
"{",
"sink",
".",
"next",
"(",
"bb",
".",
"readCharSequence",
"(",
"bb",
".",
"r... | a {@link String} inbound {@link Mono}
@param charset the decoding charset
@return a {@link String} inbound {@link Mono} | [
"a",
"{",
"@link",
"String",
"}",
"inbound",
"{",
"@link",
"Mono",
"}"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/ByteBufMono.java#L90-L99 |
liferay/com-liferay-commerce | commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java | CommerceCurrencyPersistenceImpl.removeByG_C | @Override
public CommerceCurrency removeByG_C(long groupId, String code)
throws NoSuchCurrencyException {
"""
Removes the commerce currency where groupId = ? and code = ? from the database.
@param groupId the group ID
@param code the code
@return the commerce currency that was removed
"""
Com... | java | @Override
public CommerceCurrency removeByG_C(long groupId, String code)
throws NoSuchCurrencyException {
CommerceCurrency commerceCurrency = findByG_C(groupId, code);
return remove(commerceCurrency);
} | [
"@",
"Override",
"public",
"CommerceCurrency",
"removeByG_C",
"(",
"long",
"groupId",
",",
"String",
"code",
")",
"throws",
"NoSuchCurrencyException",
"{",
"CommerceCurrency",
"commerceCurrency",
"=",
"findByG_C",
"(",
"groupId",
",",
"code",
")",
";",
"return",
"... | Removes the commerce currency where groupId = ? and code = ? from the database.
@param groupId the group ID
@param code the code
@return the commerce currency that was removed | [
"Removes",
"the",
"commerce",
"currency",
"where",
"groupId",
"=",
"?",
";",
"and",
"code",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java#L2157-L2163 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java | GenericUtils.formatHexData | static private StringBuilder formatHexData(StringBuilder buffer, byte[] data, int inOffset) {
"""
Format the next 8 bytes of the input data starting from the offset as
2 digit hex characters.
@param buffer
@param data
@param inOffset
@return StringBuilder
"""
int offset = inOffset;
int e... | java | static private StringBuilder formatHexData(StringBuilder buffer, byte[] data, int inOffset) {
int offset = inOffset;
int end = offset + 8;
if (offset >= data.length) {
// have nothing, just print empty chars
buffer.append(" ");
return buf... | [
"static",
"private",
"StringBuilder",
"formatHexData",
"(",
"StringBuilder",
"buffer",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"inOffset",
")",
"{",
"int",
"offset",
"=",
"inOffset",
";",
"int",
"end",
"=",
"offset",
"+",
"8",
";",
"if",
"(",
"offset"... | Format the next 8 bytes of the input data starting from the offset as
2 digit hex characters.
@param buffer
@param data
@param inOffset
@return StringBuilder | [
"Format",
"the",
"next",
"8",
"bytes",
"of",
"the",
"input",
"data",
"starting",
"from",
"the",
"offset",
"as",
"2",
"digit",
"hex",
"characters",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java#L957-L978 |
pietermartin/sqlg | sqlg-core/src/main/java/org/umlg/sqlg/strategy/BaseStrategy.java | BaseStrategy.isNotNullStep | private String isNotNullStep(Step<?, ?> currentStep) {
"""
if this is a has(property) step, returns the property key, otherwise returns null
@param currentStep the step
@return the property which should be not null
"""
if (currentStep instanceof TraversalFilterStep<?>) {
TraversalFilter... | java | private String isNotNullStep(Step<?, ?> currentStep) {
if (currentStep instanceof TraversalFilterStep<?>) {
TraversalFilterStep<?> tfs = (TraversalFilterStep<?>) currentStep;
List<?> c = tfs.getLocalChildren();
if (c != null && c.size() == 1) {
Traversal.Admin... | [
"private",
"String",
"isNotNullStep",
"(",
"Step",
"<",
"?",
",",
"?",
">",
"currentStep",
")",
"{",
"if",
"(",
"currentStep",
"instanceof",
"TraversalFilterStep",
"<",
"?",
">",
")",
"{",
"TraversalFilterStep",
"<",
"?",
">",
"tfs",
"=",
"(",
"TraversalFi... | if this is a has(property) step, returns the property key, otherwise returns null
@param currentStep the step
@return the property which should be not null | [
"if",
"this",
"is",
"a",
"has",
"(",
"property",
")",
"step",
"returns",
"the",
"property",
"key",
"otherwise",
"returns",
"null"
] | train | https://github.com/pietermartin/sqlg/blob/c1845a1b31328a5ffda646873b0369ee72af56a7/sqlg-core/src/main/java/org/umlg/sqlg/strategy/BaseStrategy.java#L609-L626 |
threerings/nenya | core/src/main/java/com/threerings/cast/CharacterComponent.java | CharacterComponent.getFramePath | public String getFramePath (String action, String type, Set<String> existentPaths) {
"""
Returns the path to the image frames for the specified action animation or null if no
animation for the specified action is available for this component.
@param type null for the normal action frames or one of the custom a... | java | public String getFramePath (String action, String type, Set<String> existentPaths)
{
return _frameProvider.getFramePath(this, action, type, existentPaths);
} | [
"public",
"String",
"getFramePath",
"(",
"String",
"action",
",",
"String",
"type",
",",
"Set",
"<",
"String",
">",
"existentPaths",
")",
"{",
"return",
"_frameProvider",
".",
"getFramePath",
"(",
"this",
",",
"action",
",",
"type",
",",
"existentPaths",
")"... | Returns the path to the image frames for the specified action animation or null if no
animation for the specified action is available for this component.
@param type null for the normal action frames or one of the custom action sub-types:
{@link StandardActions#SHADOW_TYPE}, etc.
@param existentPaths the set of all p... | [
"Returns",
"the",
"path",
"to",
"the",
"image",
"frames",
"for",
"the",
"specified",
"action",
"animation",
"or",
"null",
"if",
"no",
"animation",
"for",
"the",
"specified",
"action",
"is",
"available",
"for",
"this",
"component",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterComponent.java#L88-L91 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/FilterMatcher.java | FilterMatcher.vectorsMatch | private static boolean vectorsMatch(VectorValueExpression e1, VectorValueExpression e2) {
"""
Compare two vectors as sets, e.g. "WHERE a in (1, 2, 3)" vs. "WHERE a in (2, 1, 3)", to check whether two VVEs match.
\pre all contents of VVE are either CVE or PVE.
@param e1 first expression
@param e2 second expressi... | java | private static boolean vectorsMatch(VectorValueExpression e1, VectorValueExpression e2) {
final Set<ConstantValueExpression> c1 = new HashSet<>(), c2 = new HashSet<>();
final Set<Integer> tveIndices1 = new HashSet<>(), tveIndices2 = new HashSet<>();
e1.getArgs().forEach(e -> {
if (e ... | [
"private",
"static",
"boolean",
"vectorsMatch",
"(",
"VectorValueExpression",
"e1",
",",
"VectorValueExpression",
"e2",
")",
"{",
"final",
"Set",
"<",
"ConstantValueExpression",
">",
"c1",
"=",
"new",
"HashSet",
"<>",
"(",
")",
",",
"c2",
"=",
"new",
"HashSet"... | Compare two vectors as sets, e.g. "WHERE a in (1, 2, 3)" vs. "WHERE a in (2, 1, 3)", to check whether two VVEs match.
\pre all contents of VVE are either CVE or PVE.
@param e1 first expression
@param e2 second expression
@return whether they are equivalent as collection of sets. | [
"Compare",
"two",
"vectors",
"as",
"sets",
"e",
".",
"g",
".",
"WHERE",
"a",
"in",
"(",
"1",
"2",
"3",
")",
"vs",
".",
"WHERE",
"a",
"in",
"(",
"2",
"1",
"3",
")",
"to",
"check",
"whether",
"two",
"VVEs",
"match",
".",
"\\",
"pre",
"all",
"co... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/FilterMatcher.java#L170-L190 |
looly/hulu | src/main/java/com/xiaoleilu/hulu/ActionFilter.java | ActionFilter.doFilter | @Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
"""
拦截请求
@param req ServletRequest
@param res ServletResponse
@param chain FilterChain
"""
//-- 处理请求,如果处理失败(无对应的Action),继续后续步骤
if(false == ActionContext.handle(req, res))... | java | @Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
//-- 处理请求,如果处理失败(无对应的Action),继续后续步骤
if(false == ActionContext.handle(req, res)) {
chain.doFilter(req, res);
}
} | [
"@",
"Override",
"public",
"void",
"doFilter",
"(",
"ServletRequest",
"req",
",",
"ServletResponse",
"res",
",",
"FilterChain",
"chain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"//-- 处理请求,如果处理失败(无对应的Action),继续后续步骤\r",
"if",
"(",
"false",
"==",
"A... | 拦截请求
@param req ServletRequest
@param res ServletResponse
@param chain FilterChain | [
"拦截请求"
] | train | https://github.com/looly/hulu/blob/4072de684e2e2f28ac8a3a44c0d5a690b289ef28/src/main/java/com/xiaoleilu/hulu/ActionFilter.java#L36-L42 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/BundleUtil.java | BundleUtil.resolveBundleDependencies | public static IBundleDependencies resolveBundleDependencies(Bundle bundle, String... directDependencies) {
"""
Replies the dependencies for the given bundle.
@param bundle the bundle.
@param directDependencies the list of the bundle symbolic names that are the direct dependencies of the bundle to
be considere... | java | public static IBundleDependencies resolveBundleDependencies(Bundle bundle, String... directDependencies) {
return resolveBundleDependencies(bundle, (BundleURLMappings) null, directDependencies);
} | [
"public",
"static",
"IBundleDependencies",
"resolveBundleDependencies",
"(",
"Bundle",
"bundle",
",",
"String",
"...",
"directDependencies",
")",
"{",
"return",
"resolveBundleDependencies",
"(",
"bundle",
",",
"(",
"BundleURLMappings",
")",
"null",
",",
"directDependenc... | Replies the dependencies for the given bundle.
@param bundle the bundle.
@param directDependencies the list of the bundle symbolic names that are the direct dependencies of the bundle to
be considered. If the given bundle has other dependencies in its Manifest, they will be ignored if they
are not in this parameter.
@... | [
"Replies",
"the",
"dependencies",
"for",
"the",
"given",
"bundle",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/BundleUtil.java#L242-L244 |
enioka/jqm | jqm-all/jqm-xml/src/main/java/com/enioka/jqm/tools/XmlJobDefParser.java | XmlJobDefParser.parse | static void parse(String path, DbConn cnx) throws JqmXmlException {
"""
Will import all JobDef from an XML file. Creates and commits a transaction.
@param path
full or relative path to the deployment descriptor to read.
@param cnx
a database connection to use with no active transaction.
@throws JqmEngineExc... | java | static void parse(String path, DbConn cnx) throws JqmXmlException
{
parse(path, cnx, null);
} | [
"static",
"void",
"parse",
"(",
"String",
"path",
",",
"DbConn",
"cnx",
")",
"throws",
"JqmXmlException",
"{",
"parse",
"(",
"path",
",",
"cnx",
",",
"null",
")",
";",
"}"
] | Will import all JobDef from an XML file. Creates and commits a transaction.
@param path
full or relative path to the deployment descriptor to read.
@param cnx
a database connection to use with no active transaction.
@throws JqmEngineException | [
"Will",
"import",
"all",
"JobDef",
"from",
"an",
"XML",
"file",
".",
"Creates",
"and",
"commits",
"a",
"transaction",
"."
] | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-xml/src/main/java/com/enioka/jqm/tools/XmlJobDefParser.java#L67-L70 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/application/ViewHandler.java | ViewHandler.getRedirectURL | public String getRedirectURL(FacesContext context,
String viewId,
Map<String,List<String>>parameters,
boolean includeViewParams) {
"""
<p class="changed_added_2_0"> Return a JSF action URL derived
from the <code>vie... | java | public String getRedirectURL(FacesContext context,
String viewId,
Map<String,List<String>>parameters,
boolean includeViewParams) {
return getActionURL(context, viewId);
} | [
"public",
"String",
"getRedirectURL",
"(",
"FacesContext",
"context",
",",
"String",
"viewId",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"parameters",
",",
"boolean",
"includeViewParams",
")",
"{",
"return",
"getActionURL",
"(",
"context... | <p class="changed_added_2_0"> Return a JSF action URL derived
from the <code>viewId</code> argument that is suitable to be used
by the {@link NavigationHandler} to issue a redirect request to
the URL using a NonFaces request. Compliant implementations
must implement this method as specified in section JSF.7.6.2.
The d... | [
"<p",
"class",
"=",
"changed_added_2_0",
">",
"Return",
"a",
"JSF",
"action",
"URL",
"derived",
"from",
"the",
"<code",
">",
"viewId<",
"/",
"code",
">",
"argument",
"that",
"is",
"suitable",
"to",
"be",
"used",
"by",
"the",
"{",
"@link",
"NavigationHandle... | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/application/ViewHandler.java#L543-L550 |
netty/netty | buffer/src/main/java/io/netty/buffer/PoolThreadCache.java | PoolThreadCache.allocateNormal | boolean allocateNormal(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int normCapacity) {
"""
Try to allocate a small buffer out of the cache. Returns {@code true} if successful {@code false} otherwise
"""
return allocate(cacheForNormal(area, normCapacity), buf, reqCapacity);
} | java | boolean allocateNormal(PoolArena<?> area, PooledByteBuf<?> buf, int reqCapacity, int normCapacity) {
return allocate(cacheForNormal(area, normCapacity), buf, reqCapacity);
} | [
"boolean",
"allocateNormal",
"(",
"PoolArena",
"<",
"?",
">",
"area",
",",
"PooledByteBuf",
"<",
"?",
">",
"buf",
",",
"int",
"reqCapacity",
",",
"int",
"normCapacity",
")",
"{",
"return",
"allocate",
"(",
"cacheForNormal",
"(",
"area",
",",
"normCapacity",
... | Try to allocate a small buffer out of the cache. Returns {@code true} if successful {@code false} otherwise | [
"Try",
"to",
"allocate",
"a",
"small",
"buffer",
"out",
"of",
"the",
"cache",
".",
"Returns",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java#L179-L181 |
derari/cthul | objects/src/main/java/org/cthul/objects/Boxing.java | Boxing.as | public static <T> T as(Object src, Class<T> type) {
"""
Transforms any (multidimensional) array into an array of another type.
@param <T>
@param src source array
@param type target type
@return array
"""
Class<?> t = type;
while (t.isArray()) {
t = t.getComponentType();
... | java | public static <T> T as(Object src, Class<T> type) {
Class<?> t = type;
while (t.isArray()) {
t = t.getComponentType();
}
if (t == type) {
// not an array at all
return boxAs(src, type);
} else {
if (t.isPrimitive()) {
... | [
"public",
"static",
"<",
"T",
">",
"T",
"as",
"(",
"Object",
"src",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Class",
"<",
"?",
">",
"t",
"=",
"type",
";",
"while",
"(",
"t",
".",
"isArray",
"(",
")",
")",
"{",
"t",
"=",
"t",
".",
"... | Transforms any (multidimensional) array into an array of another type.
@param <T>
@param src source array
@param type target type
@return array | [
"Transforms",
"any",
"(",
"multidimensional",
")",
"array",
"into",
"an",
"array",
"of",
"another",
"type",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/Boxing.java#L756-L771 |
m-m-m/util | xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/IdResolverContext.java | IdResolverContext.put | public void put(String id, Object value) {
"""
This method {@link com.sun.xml.bind.IDResolver#bind(String, Object) binds} the given {@code value} with the given
{@code id}.
@param id is the {@link javax.xml.bind.annotation.XmlID}.
@param value is the JAXB bean to bind.
"""
Object old = this.id2valueM... | java | public void put(String id, Object value) {
Object old = this.id2valueMap.put(id, value);
if ((old != null) && (old != value)) {
this.duplicateIdErrors.add(this.bundle.errorDuplicateObjectWithKey(value, id));
}
} | [
"public",
"void",
"put",
"(",
"String",
"id",
",",
"Object",
"value",
")",
"{",
"Object",
"old",
"=",
"this",
".",
"id2valueMap",
".",
"put",
"(",
"id",
",",
"value",
")",
";",
"if",
"(",
"(",
"old",
"!=",
"null",
")",
"&&",
"(",
"old",
"!=",
"... | This method {@link com.sun.xml.bind.IDResolver#bind(String, Object) binds} the given {@code value} with the given
{@code id}.
@param id is the {@link javax.xml.bind.annotation.XmlID}.
@param value is the JAXB bean to bind. | [
"This",
"method",
"{",
"@link",
"com",
".",
"sun",
".",
"xml",
".",
"bind",
".",
"IDResolver#bind",
"(",
"String",
"Object",
")",
"binds",
"}",
"the",
"given",
"{",
"@code",
"value",
"}",
"with",
"the",
"given",
"{",
"@code",
"id",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/base/jaxb/IdResolverContext.java#L61-L67 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java | ProfilesConfigFileWriter.deleteProfiles | public static void deleteProfiles(File destination, String... profileNames) {
"""
Remove one or more profiles from the existing credentials file by
in-place modification.
@param destination
The destination file to modify
@param profileNames
The names of all the profiles to be deleted.
"""
final ... | java | public static void deleteProfiles(File destination, String... profileNames) {
final Map<String, Profile> modifications = new LinkedHashMap<String, Profile>();
for (String profileName : profileNames) {
modifications.put(profileName, null); // null value indicates a deletion
}
... | [
"public",
"static",
"void",
"deleteProfiles",
"(",
"File",
"destination",
",",
"String",
"...",
"profileNames",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Profile",
">",
"modifications",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Profile",
">",
"(... | Remove one or more profiles from the existing credentials file by
in-place modification.
@param destination
The destination file to modify
@param profileNames
The names of all the profiles to be deleted. | [
"Remove",
"one",
"or",
"more",
"profiles",
"from",
"the",
"existing",
"credentials",
"file",
"by",
"in",
"-",
"place",
"modification",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java#L141-L148 |
VoltDB/voltdb | src/frontend/org/voltdb/messaging/FragmentTaskMessage.java | FragmentTaskMessage.addCustomFragment | public void addCustomFragment(byte[] planHash, int outputDepId, ByteBuffer parameterSet, byte[] fragmentPlan, String stmtText) {
"""
Add an unplanned fragment.
@param fragmentId
@param outputDepId
@param parameterSet
@param fragmentPlan
"""
FragmentData item = new FragmentData();
item.m_p... | java | public void addCustomFragment(byte[] planHash, int outputDepId, ByteBuffer parameterSet, byte[] fragmentPlan, String stmtText) {
FragmentData item = new FragmentData();
item.m_planHash = planHash;
item.m_outputDepId = outputDepId;
item.m_parameterSet = parameterSet;
item.m_fragme... | [
"public",
"void",
"addCustomFragment",
"(",
"byte",
"[",
"]",
"planHash",
",",
"int",
"outputDepId",
",",
"ByteBuffer",
"parameterSet",
",",
"byte",
"[",
"]",
"fragmentPlan",
",",
"String",
"stmtText",
")",
"{",
"FragmentData",
"item",
"=",
"new",
"FragmentDat... | Add an unplanned fragment.
@param fragmentId
@param outputDepId
@param parameterSet
@param fragmentPlan | [
"Add",
"an",
"unplanned",
"fragment",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/messaging/FragmentTaskMessage.java#L312-L320 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/publisher/DataPublisher.java | DataPublisher.getInstance | public static DataPublisher getInstance(Class<? extends DataPublisher> dataPublisherClass, State state)
throws ReflectiveOperationException {
"""
Get an instance of {@link DataPublisher}.
@param dataPublisherClass A concrete class that extends {@link DataPublisher}.
@param state A {@link State} used to i... | java | public static DataPublisher getInstance(Class<? extends DataPublisher> dataPublisherClass, State state)
throws ReflectiveOperationException {
Constructor<? extends DataPublisher> dataPublisherConstructor = dataPublisherClass.getConstructor(State.class);
return dataPublisherConstructor.newInstance(state);
... | [
"public",
"static",
"DataPublisher",
"getInstance",
"(",
"Class",
"<",
"?",
"extends",
"DataPublisher",
">",
"dataPublisherClass",
",",
"State",
"state",
")",
"throws",
"ReflectiveOperationException",
"{",
"Constructor",
"<",
"?",
"extends",
"DataPublisher",
">",
"d... | Get an instance of {@link DataPublisher}.
@param dataPublisherClass A concrete class that extends {@link DataPublisher}.
@param state A {@link State} used to instantiate the {@link DataPublisher}.
@return A {@link DataPublisher} instance. | [
"Get",
"an",
"instance",
"of",
"{",
"@link",
"DataPublisher",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/publisher/DataPublisher.java#L97-L101 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerCacheImpl.java | LayerCacheImpl.setLayerBuildAccessors | private void setLayerBuildAccessors(Set<String> buildKeys) {
"""
Calls setLayerBuildAccessor for each layer in <code>layerMap</code>.
@param buildKeys
Set of keys in the build map. This is not necessarily the
same as <code>layerBuildMap.keySet()</code> because we may be
migrating th builds to a new map in th... | java | private void setLayerBuildAccessors(Set<String> buildKeys) {
NavigableSet<String> sorted = new TreeSet<String>(buildKeys);
Set<String> evictionKeys = new HashSet<String>(); // list of layer keys to remove because they
// have no layer builds in the layerBuildMap
for (Map.Entry<String, ILayer> entry : cacheM... | [
"private",
"void",
"setLayerBuildAccessors",
"(",
"Set",
"<",
"String",
">",
"buildKeys",
")",
"{",
"NavigableSet",
"<",
"String",
">",
"sorted",
"=",
"new",
"TreeSet",
"<",
"String",
">",
"(",
"buildKeys",
")",
";",
"Set",
"<",
"String",
">",
"evictionKey... | Calls setLayerBuildAccessor for each layer in <code>layerMap</code>.
@param buildKeys
Set of keys in the build map. This is not necessarily the
same as <code>layerBuildMap.keySet()</code> because we may be
migrating th builds to a new map in the event that the maximum
size has changed. | [
"Calls",
"setLayerBuildAccessor",
"for",
"each",
"layer",
"in",
"<code",
">",
"layerMap<",
"/",
"code",
">",
"."
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/impl/layer/LayerCacheImpl.java#L255-L272 |
rzwitserloot/lombok | src/core/lombok/javac/handlers/JavacHandlerUtil.java | JavacHandlerUtil.generateNullCheck | public static JCStatement generateNullCheck(JavacTreeMaker maker, JavacNode variable, JavacNode source) {
"""
Generates a new statement that checks if the given variable is null, and if so, throws a configured exception with the
variable name as message.
"""
return generateNullCheck(maker, variable, (JCVari... | java | public static JCStatement generateNullCheck(JavacTreeMaker maker, JavacNode variable, JavacNode source) {
return generateNullCheck(maker, variable, (JCVariableDecl) variable.get(), source);
} | [
"public",
"static",
"JCStatement",
"generateNullCheck",
"(",
"JavacTreeMaker",
"maker",
",",
"JavacNode",
"variable",
",",
"JavacNode",
"source",
")",
"{",
"return",
"generateNullCheck",
"(",
"maker",
",",
"variable",
",",
"(",
"JCVariableDecl",
")",
"variable",
"... | Generates a new statement that checks if the given variable is null, and if so, throws a configured exception with the
variable name as message. | [
"Generates",
"a",
"new",
"statement",
"that",
"checks",
"if",
"the",
"given",
"variable",
"is",
"null",
"and",
"if",
"so",
"throws",
"a",
"configured",
"exception",
"with",
"the",
"variable",
"name",
"as",
"message",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/handlers/JavacHandlerUtil.java#L1471-L1473 |
real-logic/agrona | agrona/src/main/java/org/agrona/IoUtil.java | IoUtil.ensureDirectoryExists | public static void ensureDirectoryExists(final File directory, final String descriptionLabel) {
"""
Create a directory if it doesn't already exist.
@param directory the directory which definitely exists after this method call.
@param descriptionLabel to associate with the directory for any exceptions.
... | java | public static void ensureDirectoryExists(final File directory, final String descriptionLabel)
{
if (!directory.exists())
{
if (!directory.mkdirs())
{
throw new IllegalArgumentException("could not create " + descriptionLabel + " directory: " + directory);
... | [
"public",
"static",
"void",
"ensureDirectoryExists",
"(",
"final",
"File",
"directory",
",",
"final",
"String",
"descriptionLabel",
")",
"{",
"if",
"(",
"!",
"directory",
".",
"exists",
"(",
")",
")",
"{",
"if",
"(",
"!",
"directory",
".",
"mkdirs",
"(",
... | Create a directory if it doesn't already exist.
@param directory the directory which definitely exists after this method call.
@param descriptionLabel to associate with the directory for any exceptions. | [
"Create",
"a",
"directory",
"if",
"it",
"doesn",
"t",
"already",
"exist",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/IoUtil.java#L171-L180 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/OperatorTable.java | OperatorTable.infixr | public OperatorTable<T> infixr(
Parser<? extends BiFunction<? super T, ? super T, ? extends T>> parser, int precedence) {
"""
Adds an infix right-associative binary operator.
@param parser the parser for the operator.
@param precedence the precedence number.
@return this.
"""
ops.add(new Operato... | java | public OperatorTable<T> infixr(
Parser<? extends BiFunction<? super T, ? super T, ? extends T>> parser, int precedence) {
ops.add(new Operator(parser, precedence, Associativity.RASSOC));
return this;
} | [
"public",
"OperatorTable",
"<",
"T",
">",
"infixr",
"(",
"Parser",
"<",
"?",
"extends",
"BiFunction",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"T",
",",
"?",
"extends",
"T",
">",
">",
"parser",
",",
"int",
"precedence",
")",
"{",
"ops",
".",
"add... | Adds an infix right-associative binary operator.
@param parser the parser for the operator.
@param precedence the precedence number.
@return this. | [
"Adds",
"an",
"infix",
"right",
"-",
"associative",
"binary",
"operator",
"."
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/OperatorTable.java#L128-L132 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/TrueTypeFont.java | TrueTypeFont.drawString | public void drawString(float x, float y, String whatchars) {
"""
Draw a string
@param x
The x position to draw the string
@param y
The y position to draw the string
@param whatchars
The string to draw
"""
drawString(x, y, whatchars, org.newdawn.slick.Color.white);
} | java | public void drawString(float x, float y, String whatchars) {
drawString(x, y, whatchars, org.newdawn.slick.Color.white);
} | [
"public",
"void",
"drawString",
"(",
"float",
"x",
",",
"float",
"y",
",",
"String",
"whatchars",
")",
"{",
"drawString",
"(",
"x",
",",
"y",
",",
"whatchars",
",",
"org",
".",
"newdawn",
".",
"slick",
".",
"Color",
".",
"white",
")",
";",
"}"
] | Draw a string
@param x
The x position to draw the string
@param y
The y position to draw the string
@param whatchars
The string to draw | [
"Draw",
"a",
"string"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/TrueTypeFont.java#L405-L407 |
terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/OracleNamingStrategyShogunCore.java | OracleNamingStrategyShogunCore.toPhysicalColumnName | @Override
public Identifier toPhysicalColumnName(Identifier name, JdbcEnvironment context) {
"""
Check if column {@link Identifier} equals reserved word. If true, add prefix to column name
@param name identifier to check
@param context JDBC env
@return Identifier
"""
// call superclass and ... | java | @Override
public Identifier toPhysicalColumnName(Identifier name, JdbcEnvironment context) {
// call superclass and get string value
Identifier columnIdentifier = super.toPhysicalColumnName(name, context);
String columnIdentifierText = columnIdentifier.getText();
if (StringUtils.equa... | [
"@",
"Override",
"public",
"Identifier",
"toPhysicalColumnName",
"(",
"Identifier",
"name",
",",
"JdbcEnvironment",
"context",
")",
"{",
"// call superclass and get string value",
"Identifier",
"columnIdentifier",
"=",
"super",
".",
"toPhysicalColumnName",
"(",
"name",
",... | Check if column {@link Identifier} equals reserved word. If true, add prefix to column name
@param name identifier to check
@param context JDBC env
@return Identifier | [
"Check",
"if",
"column",
"{",
"@link",
"Identifier",
"}",
"equals",
"reserved",
"word",
".",
"If",
"true",
"add",
"prefix",
"to",
"column",
"name"
] | train | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/OracleNamingStrategyShogunCore.java#L39-L49 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java | MLStructure.setField | public void setField(String name, MLArray value, int m, int n) {
"""
Sets field for (m,n)'th structure in struct array
@param name - name of the field
@param value - <code>MLArray</code> field value
@param m
@param n
"""
setField(name, value, getIndex(m,n) );
} | java | public void setField(String name, MLArray value, int m, int n)
{
setField(name, value, getIndex(m,n) );
} | [
"public",
"void",
"setField",
"(",
"String",
"name",
",",
"MLArray",
"value",
",",
"int",
"m",
",",
"int",
"n",
")",
"{",
"setField",
"(",
"name",
",",
"value",
",",
"getIndex",
"(",
"m",
",",
"n",
")",
")",
";",
"}"
] | Sets field for (m,n)'th structure in struct array
@param name - name of the field
@param value - <code>MLArray</code> field value
@param m
@param n | [
"Sets",
"field",
"for",
"(",
"m",
"n",
")",
"th",
"structure",
"in",
"struct",
"array"
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java#L69-L72 |
CloudSlang/cs-actions | cs-postgres/src/main/java/io/cloudslang/content/postgres/actions/UpdatePostgresConfigAction.java | UpdatePostgresConfigAction.execute | @Action(name = "Update Property Value",
outputs = {
"""
Updates the Postgres config postgresql.conf
@param installationPath The full path to the PostgreSQL configuration file in the local machine to be updated
@param listenAddresses The list of addresses where the PostgreSQL database listens
... | java | @Action(name = "Update Property Value",
outputs = {
@Output(RETURN_CODE),
@Output(RETURN_RESULT),
@Output(EXCEPTION),
@Output(STDERR)
},
responses = {
@Response(text = ResponseNames.SU... | [
"@",
"Action",
"(",
"name",
"=",
"\"Update Property Value\"",
",",
"outputs",
"=",
"{",
"@",
"Output",
"(",
"RETURN_CODE",
")",
",",
"@",
"Output",
"(",
"RETURN_RESULT",
")",
",",
"@",
"Output",
"(",
"EXCEPTION",
")",
",",
"@",
"Output",
"(",
"STDERR",
... | Updates the Postgres config postgresql.conf
@param installationPath The full path to the PostgreSQL configuration file in the local machine to be updated
@param listenAddresses The list of addresses where the PostgreSQL database listens
@param port The port the PostgreSQL database should listen.
@pa... | [
"Updates",
"the",
"Postgres",
"config",
"postgresql",
".",
"conf"
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-postgres/src/main/java/io/cloudslang/content/postgres/actions/UpdatePostgresConfigAction.java#L58-L97 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/util/logging/ExceptionLogger.java | ExceptionLogger.getConsumer | @SafeVarargs
public static Consumer<Throwable> getConsumer(Predicate<Throwable> logFilter,
Class<? extends Throwable>... ignoredThrowableTypes) {
"""
Returns a consumer that can for example be used in the {@link TextChannel#typeContinuously(Consumer)} method.
... | java | @SafeVarargs
public static Consumer<Throwable> getConsumer(Predicate<Throwable> logFilter,
Class<? extends Throwable>... ignoredThrowableTypes) {
return get(logFilter, ignoredThrowableTypes)::apply;
} | [
"@",
"SafeVarargs",
"public",
"static",
"Consumer",
"<",
"Throwable",
">",
"getConsumer",
"(",
"Predicate",
"<",
"Throwable",
">",
"logFilter",
",",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"...",
"ignoredThrowableTypes",
")",
"{",
"return",
"get",
"(",... | Returns a consumer that can for example be used in the {@link TextChannel#typeContinuously(Consumer)} method.
It unwraps {@link CompletionException CompletionExceptions},
{@link InvocationTargetException InvocationTargetExceptions} and {@link ExecutionException ExecutionExceptions}
first, and then adds a fresh {@code C... | [
"Returns",
"a",
"consumer",
"that",
"can",
"for",
"example",
"be",
"used",
"in",
"the",
"{",
"@link",
"TextChannel#typeContinuously",
"(",
"Consumer",
")",
"}",
"method",
".",
"It",
"unwraps",
"{",
"@link",
"CompletionException",
"CompletionExceptions",
"}",
"{"... | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/util/logging/ExceptionLogger.java#L45-L49 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/GroupWsSupport.java | GroupWsSupport.findGroup | public GroupId findGroup(DbSession dbSession, Request request) {
"""
Find a group by its id (parameter {@link #PARAM_GROUP_ID}) or couple organization key/group name
(parameters {@link #PARAM_ORGANIZATION_KEY} and {@link #PARAM_GROUP_NAME}). The virtual
group "Anyone" is not supported.
@throws NotFoundExcepti... | java | public GroupId findGroup(DbSession dbSession, Request request) {
return GroupId.from(findGroupDto(dbSession, request));
} | [
"public",
"GroupId",
"findGroup",
"(",
"DbSession",
"dbSession",
",",
"Request",
"request",
")",
"{",
"return",
"GroupId",
".",
"from",
"(",
"findGroupDto",
"(",
"dbSession",
",",
"request",
")",
")",
";",
"}"
] | Find a group by its id (parameter {@link #PARAM_GROUP_ID}) or couple organization key/group name
(parameters {@link #PARAM_ORGANIZATION_KEY} and {@link #PARAM_GROUP_NAME}). The virtual
group "Anyone" is not supported.
@throws NotFoundException if parameters are missing/incorrect, if the requested group does not exist
... | [
"Find",
"a",
"group",
"by",
"its",
"id",
"(",
"parameter",
"{",
"@link",
"#PARAM_GROUP_ID",
"}",
")",
"or",
"couple",
"organization",
"key",
"/",
"group",
"name",
"(",
"parameters",
"{",
"@link",
"#PARAM_ORGANIZATION_KEY",
"}",
"and",
"{",
"@link",
"#PARAM_G... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/usergroups/ws/GroupWsSupport.java#L75-L77 |
UrielCh/ovh-java-sdk | ovh-java-sdk-overTheBox/src/main/java/net/minidev/ovh/api/ApiOvhOverTheBox.java | ApiOvhOverTheBox.serviceName_backups_backupId_GET | public OvhBackup serviceName_backups_backupId_GET(String serviceName, String backupId) throws IOException {
"""
Get this object properties
REST: GET /overTheBox/{serviceName}/backups/{backupId}
@param serviceName [required] The internal name of your overTheBox offer
@param backupId [required] The id of the ba... | java | public OvhBackup serviceName_backups_backupId_GET(String serviceName, String backupId) throws IOException {
String qPath = "/overTheBox/{serviceName}/backups/{backupId}";
StringBuilder sb = path(qPath, serviceName, backupId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhBacku... | [
"public",
"OvhBackup",
"serviceName_backups_backupId_GET",
"(",
"String",
"serviceName",
",",
"String",
"backupId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/overTheBox/{serviceName}/backups/{backupId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",... | Get this object properties
REST: GET /overTheBox/{serviceName}/backups/{backupId}
@param serviceName [required] The internal name of your overTheBox offer
@param backupId [required] The id of the backup
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-overTheBox/src/main/java/net/minidev/ovh/api/ApiOvhOverTheBox.java#L395-L400 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/protocol/ChunkFetchSuccess.java | ChunkFetchSuccess.decode | public static ChunkFetchSuccess decode(ByteBuf buf) {
"""
Decoding uses the given ByteBuf as our data, and will retain() it.
"""
StreamChunkId streamChunkId = StreamChunkId.decode(buf);
buf.retain();
NettyManagedBuffer managedBuf = new NettyManagedBuffer(buf.duplicate());
return new ChunkFetchS... | java | public static ChunkFetchSuccess decode(ByteBuf buf) {
StreamChunkId streamChunkId = StreamChunkId.decode(buf);
buf.retain();
NettyManagedBuffer managedBuf = new NettyManagedBuffer(buf.duplicate());
return new ChunkFetchSuccess(streamChunkId, managedBuf);
} | [
"public",
"static",
"ChunkFetchSuccess",
"decode",
"(",
"ByteBuf",
"buf",
")",
"{",
"StreamChunkId",
"streamChunkId",
"=",
"StreamChunkId",
".",
"decode",
"(",
"buf",
")",
";",
"buf",
".",
"retain",
"(",
")",
";",
"NettyManagedBuffer",
"managedBuf",
"=",
"new"... | Decoding uses the given ByteBuf as our data, and will retain() it. | [
"Decoding",
"uses",
"the",
"given",
"ByteBuf",
"as",
"our",
"data",
"and",
"will",
"retain",
"()",
"it",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/protocol/ChunkFetchSuccess.java#L61-L66 |
osiam/connector4java | src/main/java/org/osiam/client/OsiamConnector.java | OsiamConnector.retrieveAccessToken | public AccessToken retrieveAccessToken(String userName, String password, Scope... scopes) {
"""
Provide an {@link AccessToken} for the {@link org.osiam.client.oauth.GrantType}
RESOURCE_OWNER_PASSWORD_CREDENTIALS.
@param userName the userName of the actual User
@param password the password of the actual User
... | java | public AccessToken retrieveAccessToken(String userName, String password, Scope... scopes) {
return getAuthService().retrieveAccessToken(userName, password, scopes);
} | [
"public",
"AccessToken",
"retrieveAccessToken",
"(",
"String",
"userName",
",",
"String",
"password",
",",
"Scope",
"...",
"scopes",
")",
"{",
"return",
"getAuthService",
"(",
")",
".",
"retrieveAccessToken",
"(",
"userName",
",",
"password",
",",
"scopes",
")",... | Provide an {@link AccessToken} for the {@link org.osiam.client.oauth.GrantType}
RESOURCE_OWNER_PASSWORD_CREDENTIALS.
@param userName the userName of the actual User
@param password the password of the actual User
@param scopes the wanted Scopes of the {@link AccessToken}
@return an valid {@link AccessToken}
@throws ... | [
"Provide",
"an",
"{",
"@link",
"AccessToken",
"}",
"for",
"the",
"{",
"@link",
"org",
".",
"osiam",
".",
"client",
".",
"oauth",
".",
"GrantType",
"}",
"RESOURCE_OWNER_PASSWORD_CREDENTIALS",
"."
] | train | https://github.com/osiam/connector4java/blob/a5e6ae1e706f4889d662a069fe2f3bf8e3848d12/src/main/java/org/osiam/client/OsiamConnector.java#L420-L422 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/SamlSettingsApi.java | SamlSettingsApi.getSPMetadata | public GetSPMetadataResponse getSPMetadata(String location, Boolean download, Boolean noSpinner) throws ApiException {
"""
Get Metadata
Returns exist Metadata xml file.
@param location Define SAML location. (required)
@param download Define if need download file. (required)
@param noSpinner Define if need page... | java | public GetSPMetadataResponse getSPMetadata(String location, Boolean download, Boolean noSpinner) throws ApiException {
ApiResponse<GetSPMetadataResponse> resp = getSPMetadataWithHttpInfo(location, download, noSpinner);
return resp.getData();
} | [
"public",
"GetSPMetadataResponse",
"getSPMetadata",
"(",
"String",
"location",
",",
"Boolean",
"download",
",",
"Boolean",
"noSpinner",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"GetSPMetadataResponse",
">",
"resp",
"=",
"getSPMetadataWithHttpInfo",
"(",
... | Get Metadata
Returns exist Metadata xml file.
@param location Define SAML location. (required)
@param download Define if need download file. (required)
@param noSpinner Define if need page reload (optional)
@return GetSPMetadataResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deseriali... | [
"Get",
"Metadata",
"Returns",
"exist",
"Metadata",
"xml",
"file",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/SamlSettingsApi.java#L623-L626 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java | CertificatesInner.generateVerificationCodeAsync | public Observable<CertificateWithNonceDescriptionInner> generateVerificationCodeAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) {
"""
Generate verification code for proof of possession flow.
Generates verification code for proof of possession flow. The verification cod... | java | public Observable<CertificateWithNonceDescriptionInner> generateVerificationCodeAsync(String resourceGroupName, String resourceName, String certificateName, String ifMatch) {
return generateVerificationCodeWithServiceResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch).map(new Func1<ServiceR... | [
"public",
"Observable",
"<",
"CertificateWithNonceDescriptionInner",
">",
"generateVerificationCodeAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"certificateName",
",",
"String",
"ifMatch",
")",
"{",
"return",
"generateVerificatio... | Generate verification code for proof of possession flow.
Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@param ce... | [
"Generate",
"verification",
"code",
"for",
"proof",
"of",
"possession",
"flow",
".",
"Generates",
"verification",
"code",
"for",
"proof",
"of",
"possession",
"flow",
".",
"The",
"verification",
"code",
"will",
"be",
"used",
"to",
"generate",
"a",
"leaf",
"cert... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java#L623-L630 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/httpsessions/HttpSessionsPanel.java | HttpSessionsPanel.getHttpSessionsTable | private JXTable getHttpSessionsTable() {
"""
Gets the http sessions table.
@return the http sessions table
"""
if (sessionsTable == null) {
sessionsTable = new JXTable(sessionsModel);
sessionsTable.setColumnSelectionAllowed(false);
sessionsTable.setCellSelectionEnabled(false);
sessionsT... | java | private JXTable getHttpSessionsTable() {
if (sessionsTable == null) {
sessionsTable = new JXTable(sessionsModel);
sessionsTable.setColumnSelectionAllowed(false);
sessionsTable.setCellSelectionEnabled(false);
sessionsTable.setRowSelectionAllowed(true);
sessionsTable.setAutoCreateRowSorter(true);... | [
"private",
"JXTable",
"getHttpSessionsTable",
"(",
")",
"{",
"if",
"(",
"sessionsTable",
"==",
"null",
")",
"{",
"sessionsTable",
"=",
"new",
"JXTable",
"(",
"sessionsModel",
")",
";",
"sessionsTable",
".",
"setColumnSelectionAllowed",
"(",
"false",
")",
";",
... | Gets the http sessions table.
@return the http sessions table | [
"Gets",
"the",
"http",
"sessions",
"table",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/httpsessions/HttpSessionsPanel.java#L309-L357 |
roskart/dropwizard-jaxws | dropwizard-jaxws/src/main/java/com/roskart/dropwizard/jaxws/JAXWSBundle.java | JAXWSBundle.publishEndpoint | public Endpoint publishEndpoint(String path, Object service) {
"""
Publish JAX-WS endpoint. Endpoint is published relative to the CXF servlet path.
@param path Relative endpoint path.
@param service Service implementation.
@return javax.xml.ws.Endpoint
@deprecated Use the {@link #publishEndpoint(EndpointBuil... | java | public Endpoint publishEndpoint(String path, Object service) {
return this.publishEndpoint(path, service, null, null);
} | [
"public",
"Endpoint",
"publishEndpoint",
"(",
"String",
"path",
",",
"Object",
"service",
")",
"{",
"return",
"this",
".",
"publishEndpoint",
"(",
"path",
",",
"service",
",",
"null",
",",
"null",
")",
";",
"}"
] | Publish JAX-WS endpoint. Endpoint is published relative to the CXF servlet path.
@param path Relative endpoint path.
@param service Service implementation.
@return javax.xml.ws.Endpoint
@deprecated Use the {@link #publishEndpoint(EndpointBuilder)} publishEndpoint} method instead. | [
"Publish",
"JAX",
"-",
"WS",
"endpoint",
".",
"Endpoint",
"is",
"published",
"relative",
"to",
"the",
"CXF",
"servlet",
"path",
".",
"@param",
"path",
"Relative",
"endpoint",
"path",
".",
"@param",
"service",
"Service",
"implementation",
".",
"@return",
"javax... | train | https://github.com/roskart/dropwizard-jaxws/blob/972eb63ba9626f3282d4a1d6127dc2b60b28f2bc/dropwizard-jaxws/src/main/java/com/roskart/dropwizard/jaxws/JAXWSBundle.java#L96-L98 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigVerification.java | ConfigVerification.getValueAt | @Override
public Object getValueAt(final int row, final int column) {
"""
Returns the value at the specified column of the specified row.
@return value
"""
ConfigItem item = this.list.get(row);
switch (column) {
case 0:
return item.getType();
case 1:
return item.getKey();
case 2:
retur... | java | @Override
public Object getValueAt(final int row, final int column)
{
ConfigItem item = this.list.get(row);
switch (column) {
case 0:
return item.getType();
case 1:
return item.getKey();
case 2:
return item.getMessage();
}
return null;
} | [
"@",
"Override",
"public",
"Object",
"getValueAt",
"(",
"final",
"int",
"row",
",",
"final",
"int",
"column",
")",
"{",
"ConfigItem",
"item",
"=",
"this",
".",
"list",
".",
"get",
"(",
"row",
")",
";",
"switch",
"(",
"column",
")",
"{",
"case",
"0",
... | Returns the value at the specified column of the specified row.
@return value | [
"Returns",
"the",
"value",
"at",
"the",
"specified",
"column",
"of",
"the",
"specified",
"row",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigVerification.java#L110-L125 |
Squarespace/cldr | core/src/main/java/com/squarespace/cldr/units/UnitFactorMap.java | UnitFactorMap.get | public UnitFactor get(Unit from, Unit to) {
"""
Find an exact conversion factor between the from and to units, or return
null if none exists.
"""
Map<Unit, UnitFactor> map = factors.get(from);
if (map != null) {
UnitFactor factor = map.get(to);
if (factor != null) {
return factor;
... | java | public UnitFactor get(Unit from, Unit to) {
Map<Unit, UnitFactor> map = factors.get(from);
if (map != null) {
UnitFactor factor = map.get(to);
if (factor != null) {
return factor;
}
}
return null;
} | [
"public",
"UnitFactor",
"get",
"(",
"Unit",
"from",
",",
"Unit",
"to",
")",
"{",
"Map",
"<",
"Unit",
",",
"UnitFactor",
">",
"map",
"=",
"factors",
".",
"get",
"(",
"from",
")",
";",
"if",
"(",
"map",
"!=",
"null",
")",
"{",
"UnitFactor",
"factor",... | Find an exact conversion factor between the from and to units, or return
null if none exists. | [
"Find",
"an",
"exact",
"conversion",
"factor",
"between",
"the",
"from",
"and",
"to",
"units",
"or",
"return",
"null",
"if",
"none",
"exists",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/core/src/main/java/com/squarespace/cldr/units/UnitFactorMap.java#L305-L314 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/parseinfo/StmtTargetTableScan.java | StmtTargetTableScan.processTVE | @Override
public AbstractExpression processTVE(TupleValueExpression tve, String columnName) {
"""
/*
Process this tve named columnName. Most often we just
resolve the tve in the table of this scan. But if this
is a table which is a replacement for a derived table,
we may need to return the expression whi... | java | @Override
public AbstractExpression processTVE(TupleValueExpression tve, String columnName) {
if (m_origSubqueryScan == null) {
tve.resolveForTable(m_table);
return tve;
}
// Example:
// SELECT TA1.CA CA1 FROM (SELECT T.C CA FROM T TA) TA1;
// gets si... | [
"@",
"Override",
"public",
"AbstractExpression",
"processTVE",
"(",
"TupleValueExpression",
"tve",
",",
"String",
"columnName",
")",
"{",
"if",
"(",
"m_origSubqueryScan",
"==",
"null",
")",
"{",
"tve",
".",
"resolveForTable",
"(",
"m_table",
")",
";",
"return",
... | /*
Process this tve named columnName. Most often we just
resolve the tve in the table of this scan. But if this
is a table which is a replacement for a derived table,
we may need to return the expression which is in the
display list for the derived table and update aliases
in tves in that expression. | [
"/",
"*",
"Process",
"this",
"tve",
"named",
"columnName",
".",
"Most",
"often",
"we",
"just",
"resolve",
"the",
"tve",
"in",
"the",
"table",
"of",
"this",
"scan",
".",
"But",
"if",
"this",
"is",
"a",
"table",
"which",
"is",
"a",
"replacement",
"for",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/parseinfo/StmtTargetTableScan.java#L132-L173 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/IOUtil.java | IOUtil.readFully | public static int readFully(Reader reader, char ch[]) throws IOException {
"""
Reads data from given reader into specified buffer.<br>
If the given reader doesn't have number of chars equal to the length
of the buffer available, it simply reads only the available number of chars.
@param reader reader from ... | java | public static int readFully(Reader reader, char ch[]) throws IOException {
return readFully(reader, ch, 0, ch.length);
} | [
"public",
"static",
"int",
"readFully",
"(",
"Reader",
"reader",
",",
"char",
"ch",
"[",
"]",
")",
"throws",
"IOException",
"{",
"return",
"readFully",
"(",
"reader",
",",
"ch",
",",
"0",
",",
"ch",
".",
"length",
")",
";",
"}"
] | Reads data from given reader into specified buffer.<br>
If the given reader doesn't have number of chars equal to the length
of the buffer available, it simply reads only the available number of chars.
@param reader reader from which data is read
@param ch the buffer into which the data is read.
@return ... | [
"Reads",
"data",
"from",
"given",
"reader",
"into",
"specified",
"buffer",
".",
"<br",
">",
"If",
"the",
"given",
"reader",
"doesn",
"t",
"have",
"number",
"of",
"chars",
"equal",
"to",
"the",
"length",
"of",
"the",
"buffer",
"available",
"it",
"simply",
... | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/IOUtil.java#L261-L263 |
infinispan/infinispan | core/src/main/java/org/infinispan/interceptors/impl/MultiSubCommandInvoker.java | MultiSubCommandInvoker.invokeEach | public static Object invokeEach(InvocationContext ctx, Iterator<VisitableCommand> subCommands,
BaseAsyncInterceptor interceptor, Object finalReturnValue) {
"""
Call {@link BaseAsyncInterceptor#invokeNext(InvocationContext, VisitableCommand)} on a sequence of sub-commands.
<p>
S... | java | public static Object invokeEach(InvocationContext ctx, Iterator<VisitableCommand> subCommands,
BaseAsyncInterceptor interceptor, Object finalReturnValue) {
if (!subCommands.hasNext())
return finalReturnValue;
MultiSubCommandInvoker invoker = new MultiSubCommandIn... | [
"public",
"static",
"Object",
"invokeEach",
"(",
"InvocationContext",
"ctx",
",",
"Iterator",
"<",
"VisitableCommand",
">",
"subCommands",
",",
"BaseAsyncInterceptor",
"interceptor",
",",
"Object",
"finalReturnValue",
")",
"{",
"if",
"(",
"!",
"subCommands",
".",
... | Call {@link BaseAsyncInterceptor#invokeNext(InvocationContext, VisitableCommand)} on a sequence of sub-commands.
<p>
Stop when one of the sub-commands throws an exception, and return an invocation stage with that exception. If all
the sub-commands are successful, return the {@code finalStage}. If {@code finalStage} has... | [
"Call",
"{"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/impl/MultiSubCommandInvoker.java#L35-L43 |
sababado/CircularView | library/src/main/java/com/sababado/circularview/CircularView.java | CircularView.animateHighlightedDegree | public void animateHighlightedDegree(final float startDegree, final float endDegree, final long duration, final boolean animateMarkers) {
"""
Start animating the highlighted degree. This will cancel any current animations of this type.
Pass <code>true</code> to {@link #setAnimateMarkerOnStillHighlight(boolean)} i... | java | public void animateHighlightedDegree(final float startDegree, final float endDegree, final long duration, final boolean animateMarkers) {
mHighlightedDegreeObjectAnimator.cancel();
mHighlightedDegreeObjectAnimator.setFloatValues(startDegree, endDegree);
mHighlightedDegreeObjectAnimator.setDurati... | [
"public",
"void",
"animateHighlightedDegree",
"(",
"final",
"float",
"startDegree",
",",
"final",
"float",
"endDegree",
",",
"final",
"long",
"duration",
",",
"final",
"boolean",
"animateMarkers",
")",
"{",
"mHighlightedDegreeObjectAnimator",
".",
"cancel",
"(",
")"... | Start animating the highlighted degree. This will cancel any current animations of this type.
Pass <code>true</code> to {@link #setAnimateMarkerOnStillHighlight(boolean)} in order to see individual
marker animations when the highlighted degree reaches each marker.
@param startDegree Degree to start the animation at... | [
"Start",
"animating",
"the",
"highlighted",
"degree",
".",
"This",
"will",
"cancel",
"any",
"current",
"animations",
"of",
"this",
"type",
".",
"Pass",
"<code",
">",
"true<",
"/",
"code",
">",
"to",
"{",
"@link",
"#setAnimateMarkerOnStillHighlight",
"(",
"bool... | train | https://github.com/sababado/CircularView/blob/c9ab818d063bcc0796183616f8a82166a9b80aac/library/src/main/java/com/sababado/circularview/CircularView.java#L748-L755 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.createTagAsync | public Observable<Tag> createTagAsync(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter) {
"""
Create a tag for the project.
@param projectId The project id
@param name The tag name
@param createTagOptionalParameter the object representing the optional parameters to be set bef... | java | public Observable<Tag> createTagAsync(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter) {
return createTagWithServiceResponseAsync(projectId, name, createTagOptionalParameter).map(new Func1<ServiceResponse<Tag>, Tag>() {
@Override
public Tag call(Service... | [
"public",
"Observable",
"<",
"Tag",
">",
"createTagAsync",
"(",
"UUID",
"projectId",
",",
"String",
"name",
",",
"CreateTagOptionalParameter",
"createTagOptionalParameter",
")",
"{",
"return",
"createTagWithServiceResponseAsync",
"(",
"projectId",
",",
"name",
",",
"c... | Create a tag for the project.
@param projectId The project id
@param name The tag name
@param createTagOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Tag object | [
"Create",
"a",
"tag",
"for",
"the",
"project",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L313-L320 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/MultiPathImpl.java | MultiPathImpl.addEnvelope | public void addEnvelope(Envelope envSrc, boolean bReverse) {
"""
adds a rectangular closed Path to the MultiPathImpl.
@param envSrc
is the source rectangle.
@param bReverse
Creates reversed path.
"""
if (envSrc.isEmpty())
return;
boolean bWasEmpty = m_pointCount == 0;
Point pt = new Point(m_des... | java | public void addEnvelope(Envelope envSrc, boolean bReverse) {
if (envSrc.isEmpty())
return;
boolean bWasEmpty = m_pointCount == 0;
Point pt = new Point(m_description);// getDescription());
for (int i = 0, n = 4; i < n; i++) {
int j = bReverse ? n - i - 1 : i;
envSrc.queryCornerByVal(j, pt);
if (i =... | [
"public",
"void",
"addEnvelope",
"(",
"Envelope",
"envSrc",
",",
"boolean",
"bReverse",
")",
"{",
"if",
"(",
"envSrc",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"boolean",
"bWasEmpty",
"=",
"m_pointCount",
"==",
"0",
";",
"Point",
"pt",
"=",
"new",
... | adds a rectangular closed Path to the MultiPathImpl.
@param envSrc
is the source rectangle.
@param bReverse
Creates reversed path. | [
"adds",
"a",
"rectangular",
"closed",
"Path",
"to",
"the",
"MultiPathImpl",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MultiPathImpl.java#L657-L680 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java | InternalUtilities.isDateVetoed | static public boolean isDateVetoed(DateVetoPolicy policy, LocalDate date) {
"""
isDateVetoed, This is a convenience function for checking whether or not a particular date is
vetoed. Note that veto policies do not have any say about null dates, so this function always
returns false for null dates.
"""
... | java | static public boolean isDateVetoed(DateVetoPolicy policy, LocalDate date) {
if (policy == null || date == null) {
return false;
}
return (!policy.isDateAllowed(date));
} | [
"static",
"public",
"boolean",
"isDateVetoed",
"(",
"DateVetoPolicy",
"policy",
",",
"LocalDate",
"date",
")",
"{",
"if",
"(",
"policy",
"==",
"null",
"||",
"date",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"!",
"policy",
".",
... | isDateVetoed, This is a convenience function for checking whether or not a particular date is
vetoed. Note that veto policies do not have any say about null dates, so this function always
returns false for null dates. | [
"isDateVetoed",
"This",
"is",
"a",
"convenience",
"function",
"for",
"checking",
"whether",
"or",
"not",
"a",
"particular",
"date",
"is",
"vetoed",
".",
"Note",
"that",
"veto",
"policies",
"do",
"not",
"have",
"any",
"say",
"about",
"null",
"dates",
"so",
... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/zinternaltools/InternalUtilities.java#L353-L358 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/engine/ProcessorTemplateHandler.java | ProcessorTemplateHandler.queueEvent | private void queueEvent(final ITemplateEvent event) {
"""
/*
This method will be called for any event that arrives from a previous handler in the chain (or the parser, cache...)
when the execution has already been stopped and we (potentially) have some work pending. The idea is to queue
these events at the end ... | java | private void queueEvent(final ITemplateEvent event) {
final SimpleModelProcessable pendingProcessableModel;
if (this.pendingProcessingsSize > 0) {
final IEngineProcessable level0Pending = this.pendingProcessings[0];
if (level0Pending instanceof SimpleModelProcessable && ((Simple... | [
"private",
"void",
"queueEvent",
"(",
"final",
"ITemplateEvent",
"event",
")",
"{",
"final",
"SimpleModelProcessable",
"pendingProcessableModel",
";",
"if",
"(",
"this",
".",
"pendingProcessingsSize",
">",
"0",
")",
"{",
"final",
"IEngineProcessable",
"level0Pending",... | /*
This method will be called for any event that arrives from a previous handler in the chain (or the parser, cache...)
when the execution has already been stopped and we (potentially) have some work pending. The idea is to queue
these events at the end of the pending queue (i.e. at level 0) so that they are processed ... | [
"/",
"*",
"This",
"method",
"will",
"be",
"called",
"for",
"any",
"event",
"that",
"arrives",
"from",
"a",
"previous",
"handler",
"in",
"the",
"chain",
"(",
"or",
"the",
"parser",
"cache",
"...",
")",
"when",
"the",
"execution",
"has",
"already",
"been",... | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/engine/ProcessorTemplateHandler.java#L2133-L2158 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/util/cache/ImageMemoryCache.java | ImageMemoryCache.generateMemoryCacheEntryKey | public static String generateMemoryCacheEntryKey(String imageUri, int width, int height) {
"""
Generates key for memory cache entry
Format for memory cache key is [imageUri]_[width]:[height].
"""
return new StringBuilder(imageUri).append(URI_DIMENTION_SEPARATOR).append(width).append(WIDTH_HEIGHT_SEPARATOR).... | java | public static String generateMemoryCacheEntryKey(String imageUri, int width, int height) {
return new StringBuilder(imageUri).append(URI_DIMENTION_SEPARATOR).append(width).append(WIDTH_HEIGHT_SEPARATOR).append(height).toString();
} | [
"public",
"static",
"String",
"generateMemoryCacheEntryKey",
"(",
"String",
"imageUri",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
"imageUri",
")",
".",
"append",
"(",
"URI_DIMENTION_SEPARATOR",
")",
".",
"append"... | Generates key for memory cache entry
Format for memory cache key is [imageUri]_[width]:[height]. | [
"Generates",
"key",
"for",
"memory",
"cache",
"entry",
"Format",
"for",
"memory",
"cache",
"key",
"is",
"[",
"imageUri",
"]",
"_",
"[",
"width",
"]",
":",
"[",
"height",
"]",
"."
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/util/cache/ImageMemoryCache.java#L126-L128 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java | InvokerHelper.matchRegex | public static boolean matchRegex(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
"""
if (left == null || right == null) return false;
Pattern ... | java | public static boolean matchRegex(Object left, Object right) {
if (left == null || right == null) return false;
Pattern pattern;
if (right instanceof Pattern) {
pattern = (Pattern) right;
} else {
pattern = Pattern.compile(toString(right));
}
String... | [
"public",
"static",
"boolean",
"matchRegex",
"(",
"Object",
"left",
",",
"Object",
"right",
")",
"{",
"if",
"(",
"left",
"==",
"null",
"||",
"right",
"==",
"null",
")",
"return",
"false",
";",
"Pattern",
"pattern",
";",
"if",
"(",
"right",
"instanceof",
... | 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#L360-L372 |
comapi/comapi-chat-sdk-android | COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java | ChatController.handleMessageError | private Observable<ChatResult> handleMessageError(MessageProcessor mp, Throwable t) {
"""
Handle failure when sent message.
@param mp Message processor holding message sent details.
@param t Thrown exception.
@return Observable with Chat SDK result.
"""
return persistenceController.updateStoreFor... | java | private Observable<ChatResult> handleMessageError(MessageProcessor mp, Throwable t) {
return persistenceController.updateStoreForSentError(mp.getConversationId(), mp.getTempId(), mp.getSender())
.map(success -> new ChatResult(false, new ChatResult.Error(0, t)));
} | [
"private",
"Observable",
"<",
"ChatResult",
">",
"handleMessageError",
"(",
"MessageProcessor",
"mp",
",",
"Throwable",
"t",
")",
"{",
"return",
"persistenceController",
".",
"updateStoreForSentError",
"(",
"mp",
".",
"getConversationId",
"(",
")",
",",
"mp",
".",... | Handle failure when sent message.
@param mp Message processor holding message sent details.
@param t Thrown exception.
@return Observable with Chat SDK result. | [
"Handle",
"failure",
"when",
"sent",
"message",
"."
] | train | https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/ChatController.java#L219-L222 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java | PerceptronClassifier.readInstance | private Instance[] readInstance(String corpus, FeatureMap featureMap) {
"""
从语料库读取实例
@param corpus 语料库
@param featureMap 特征映射
@return 数据集
"""
IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(corpus);
List<Instance> instanceList = new LinkedList<Instance>();
for (Strin... | java | private Instance[] readInstance(String corpus, FeatureMap featureMap)
{
IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(corpus);
List<Instance> instanceList = new LinkedList<Instance>();
for (String line : lineIterator)
{
String[] cells = line.split(",");
... | [
"private",
"Instance",
"[",
"]",
"readInstance",
"(",
"String",
"corpus",
",",
"FeatureMap",
"featureMap",
")",
"{",
"IOUtil",
".",
"LineIterator",
"lineIterator",
"=",
"new",
"IOUtil",
".",
"LineIterator",
"(",
"corpus",
")",
";",
"List",
"<",
"Instance",
"... | 从语料库读取实例
@param corpus 语料库
@param featureMap 特征映射
@return 数据集 | [
"从语料库读取实例"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java#L193-L210 |
checkstyle-addons/checkstyle-addons | src/main/java/com/thomasjensen/checkstyle/addons/util/Util.java | Util.findLeftMostTokenInLine | @Nonnull
public static DetailAST findLeftMostTokenInLine(@Nonnull final DetailAST pAst) {
"""
Find the left-most token in the given AST. The left-most token is the token with the smallest column number. Only
tokens which are located on the same line as the given AST are considered.
@param pAst the root of ... | java | @Nonnull
public static DetailAST findLeftMostTokenInLine(@Nonnull final DetailAST pAst)
{
return findLeftMostTokenInLineInternal(pAst, pAst.getLineNo(), pAst.getColumnNo());
} | [
"@",
"Nonnull",
"public",
"static",
"DetailAST",
"findLeftMostTokenInLine",
"(",
"@",
"Nonnull",
"final",
"DetailAST",
"pAst",
")",
"{",
"return",
"findLeftMostTokenInLineInternal",
"(",
"pAst",
",",
"pAst",
".",
"getLineNo",
"(",
")",
",",
"pAst",
".",
"getColu... | Find the left-most token in the given AST. The left-most token is the token with the smallest column number. Only
tokens which are located on the same line as the given AST are considered.
@param pAst the root of a subtree. This token is also considered for the result.
@return the left-most token | [
"Find",
"the",
"left",
"-",
"most",
"token",
"in",
"the",
"given",
"AST",
".",
"The",
"left",
"-",
"most",
"token",
"is",
"the",
"token",
"with",
"the",
"smallest",
"column",
"number",
".",
"Only",
"tokens",
"which",
"are",
"located",
"on",
"the",
"sam... | train | https://github.com/checkstyle-addons/checkstyle-addons/blob/fae1b4d341639c8e32c3e59ec5abdc0ffc11b865/src/main/java/com/thomasjensen/checkstyle/addons/util/Util.java#L317-L321 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfTemplate.java | PdfTemplate.createTemplate | public static PdfTemplate createTemplate(PdfWriter writer, float width, float height) {
"""
Creates a new template.
<P>
Creates a new template that is nothing more than a form XObject. This template can be included
in this template or in another template. Templates are only written
to the output when the docum... | java | public static PdfTemplate createTemplate(PdfWriter writer, float width, float height) {
return createTemplate(writer, width, height, null);
} | [
"public",
"static",
"PdfTemplate",
"createTemplate",
"(",
"PdfWriter",
"writer",
",",
"float",
"width",
",",
"float",
"height",
")",
"{",
"return",
"createTemplate",
"(",
"writer",
",",
"width",
",",
"height",
",",
"null",
")",
";",
"}"
] | Creates a new template.
<P>
Creates a new template that is nothing more than a form XObject. This template can be included
in this template or in another template. Templates are only written
to the output when the document is closed permitting things like showing text in the first page
that is only defined in the last ... | [
"Creates",
"a",
"new",
"template",
".",
"<P",
">",
"Creates",
"a",
"new",
"template",
"that",
"is",
"nothing",
"more",
"than",
"a",
"form",
"XObject",
".",
"This",
"template",
"can",
"be",
"included",
"in",
"this",
"template",
"or",
"in",
"another",
"tem... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfTemplate.java#L116-L118 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_DELETE | public OvhTaskPop domain_account_accountName_DELETE(String domain, String accountName) throws IOException {
"""
Delete an existing mailbox in server
REST: DELETE /email/domain/{domain}/account/{accountName}
@param domain [required] Name of your domain name
@param accountName [required] Name of account
"""... | java | public OvhTaskPop domain_account_accountName_DELETE(String domain, String accountName) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}";
StringBuilder sb = path(qPath, domain, accountName);
String resp = exec(qPath, "DELETE", sb.toString(), null);
return convertTo(resp, OvhTask... | [
"public",
"OvhTaskPop",
"domain_account_accountName_DELETE",
"(",
"String",
"domain",
",",
"String",
"accountName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/account/{accountName}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",... | Delete an existing mailbox in server
REST: DELETE /email/domain/{domain}/account/{accountName}
@param domain [required] Name of your domain name
@param accountName [required] Name of account | [
"Delete",
"an",
"existing",
"mailbox",
"in",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L856-L861 |
JohnPersano/SuperToasts | library/src/main/java/com/github/johnpersano/supertoasts/library/Toaster.java | Toaster.sendDelayedMessage | private void sendDelayedMessage(SuperToast superToast, int messageId, long delay) {
"""
Send a message at a later time. This is used to dismiss a SuperToast.
"""
Message message = obtainMessage(messageId);
message.obj = superToast;
sendMessageDelayed(message, delay);
} | java | private void sendDelayedMessage(SuperToast superToast, int messageId, long delay) {
Message message = obtainMessage(messageId);
message.obj = superToast;
sendMessageDelayed(message, delay);
} | [
"private",
"void",
"sendDelayedMessage",
"(",
"SuperToast",
"superToast",
",",
"int",
"messageId",
",",
"long",
"delay",
")",
"{",
"Message",
"message",
"=",
"obtainMessage",
"(",
"messageId",
")",
";",
"message",
".",
"obj",
"=",
"superToast",
";",
"sendMessa... | Send a message at a later time. This is used to dismiss a SuperToast. | [
"Send",
"a",
"message",
"at",
"a",
"later",
"time",
".",
"This",
"is",
"used",
"to",
"dismiss",
"a",
"SuperToast",
"."
] | train | https://github.com/JohnPersano/SuperToasts/blob/5394db6a2f5c38410586d5d001d61f731da1132a/library/src/main/java/com/github/johnpersano/supertoasts/library/Toaster.java#L122-L126 |
TGIO/RNCryptorNative | rncryptor-native/src/main/java/tgio/rncryptor/RNCryptorNative.java | RNCryptorNative.decryptFile | public static void decryptFile(File encryptedFile, File result, String password) throws IOException {
"""
Decrypts file using password
@param encryptedFile file which needs to be decrypted
@param result destination file for decrypted file
@param password strong generated password
@throws IOException
"""
... | java | public static void decryptFile(File encryptedFile, File result, String password) throws IOException {
byte[] b = readBytes(encryptedFile);
String decryptedImageString = new RNCryptorNative().decrypt(new String(b), password);
byte[] decodedBytes = Base64.decode(decryptedImageString, 0);
w... | [
"public",
"static",
"void",
"decryptFile",
"(",
"File",
"encryptedFile",
",",
"File",
"result",
",",
"String",
"password",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"b",
"=",
"readBytes",
"(",
"encryptedFile",
")",
";",
"String",
"decryptedImageStri... | Decrypts file using password
@param encryptedFile file which needs to be decrypted
@param result destination file for decrypted file
@param password strong generated password
@throws IOException | [
"Decrypts",
"file",
"using",
"password"
] | train | https://github.com/TGIO/RNCryptorNative/blob/5209f10b988e4033c0b769a40b0d6cc99ea16af7/rncryptor-native/src/main/java/tgio/rncryptor/RNCryptorNative.java#L112-L117 |
google/closure-templates | java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java | JavaQualifiedNames.getClassName | public static String getClassName(EnumDescriptor descriptor, ProtoFlavor flavor) {
"""
Gets the fully qualified name for generated classes in Java convention. Nested classes will be
separated using '$' instead of '.'.
"""
return getClassName(classNameWithoutPackage(descriptor, flavor), descriptor.getFile(... | java | public static String getClassName(EnumDescriptor descriptor, ProtoFlavor flavor) {
return getClassName(classNameWithoutPackage(descriptor, flavor), descriptor.getFile(), flavor);
} | [
"public",
"static",
"String",
"getClassName",
"(",
"EnumDescriptor",
"descriptor",
",",
"ProtoFlavor",
"flavor",
")",
"{",
"return",
"getClassName",
"(",
"classNameWithoutPackage",
"(",
"descriptor",
",",
"flavor",
")",
",",
"descriptor",
".",
"getFile",
"(",
")",... | Gets the fully qualified name for generated classes in Java convention. Nested classes will be
separated using '$' instead of '.'. | [
"Gets",
"the",
"fully",
"qualified",
"name",
"for",
"generated",
"classes",
"in",
"Java",
"convention",
".",
"Nested",
"classes",
"will",
"be",
"separated",
"using",
"$",
"instead",
"of",
".",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/proto/JavaQualifiedNames.java#L104-L106 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/Routers.java | Routers.ofVirtualHost | public static Router<ServiceConfig> ofVirtualHost(VirtualHost virtualHost, Iterable<ServiceConfig> configs,
RejectedPathMappingHandler rejectionHandler) {
"""
Returns the default implementation of the {@link Router} to find a {@link ServiceConfig}.
It consists... | java | public static Router<ServiceConfig> ofVirtualHost(VirtualHost virtualHost, Iterable<ServiceConfig> configs,
RejectedPathMappingHandler rejectionHandler) {
requireNonNull(virtualHost, "virtualHost");
requireNonNull(configs, "configs");
require... | [
"public",
"static",
"Router",
"<",
"ServiceConfig",
">",
"ofVirtualHost",
"(",
"VirtualHost",
"virtualHost",
",",
"Iterable",
"<",
"ServiceConfig",
">",
"configs",
",",
"RejectedPathMappingHandler",
"rejectionHandler",
")",
"{",
"requireNonNull",
"(",
"virtualHost",
"... | Returns the default implementation of the {@link Router} to find a {@link ServiceConfig}.
It consists of several router implementations which use one of Trie and List. It also includes
cache mechanism to improve its performance. | [
"Returns",
"the",
"default",
"implementation",
"of",
"the",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/Routers.java#L60-L76 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java | DiscreteDistributions.geometric | public static double geometric(int k, double p) {
"""
Returns the probability that the first success requires k trials with probability of success p
@param k
@param p
@return
"""
if(k<=0 || p<0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
... | java | public static double geometric(int k, double p) {
if(k<=0 || p<0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
double probability = Math.pow(1-p,k-1)*p;
return probability;
} | [
"public",
"static",
"double",
"geometric",
"(",
"int",
"k",
",",
"double",
"p",
")",
"{",
"if",
"(",
"k",
"<=",
"0",
"||",
"p",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"All the parameters must be positive.\"",
")",
";",
"}",
... | Returns the probability that the first success requires k trials with probability of success p
@param k
@param p
@return | [
"Returns",
"the",
"probability",
"that",
"the",
"first",
"success",
"requires",
"k",
"trials",
"with",
"probability",
"of",
"success",
"p"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java#L153-L161 |
buschmais/jqa-java-plugin | src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java | VisitorHelper.resolveType | TypeCache.CachedType resolveType(String fullQualifiedName, TypeCache.CachedType<? extends ClassFileDescriptor> dependentType) {
"""
/*
Return the type descriptor for the given type name.
@param typeName The full qualified name of the type (e.g. java.lang.Object).
"""
TypeCache.CachedType cachedType... | java | TypeCache.CachedType resolveType(String fullQualifiedName, TypeCache.CachedType<? extends ClassFileDescriptor> dependentType) {
TypeCache.CachedType cachedType = getTypeResolver().resolve(fullQualifiedName, scannerContext);
if (!dependentType.equals(cachedType)) {
dependentType.addDependency... | [
"TypeCache",
".",
"CachedType",
"resolveType",
"(",
"String",
"fullQualifiedName",
",",
"TypeCache",
".",
"CachedType",
"<",
"?",
"extends",
"ClassFileDescriptor",
">",
"dependentType",
")",
"{",
"TypeCache",
".",
"CachedType",
"cachedType",
"=",
"getTypeResolver",
... | /*
Return the type descriptor for the given type name.
@param typeName The full qualified name of the type (e.g. java.lang.Object). | [
"/",
"*",
"Return",
"the",
"type",
"descriptor",
"for",
"the",
"given",
"type",
"name",
"."
] | train | https://github.com/buschmais/jqa-java-plugin/blob/4c050943e9c28cf1c4a08aa962d5b5bf03c4fe54/src/main/java/com/buschmais/jqassistant/plugin/java/impl/scanner/visitor/VisitorHelper.java#L51-L57 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java | CommerceRegionPersistenceImpl.findByC_C | @Override
public CommerceRegion findByC_C(long commerceCountryId, String code)
throws NoSuchRegionException {
"""
Returns the commerce region where commerceCountryId = ? and code = ? or throws a {@link NoSuchRegionException} if it could not be found.
@param commerceCountryId the commerce country ID
... | java | @Override
public CommerceRegion findByC_C(long commerceCountryId, String code)
throws NoSuchRegionException {
CommerceRegion commerceRegion = fetchByC_C(commerceCountryId, code);
if (commerceRegion == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("... | [
"@",
"Override",
"public",
"CommerceRegion",
"findByC_C",
"(",
"long",
"commerceCountryId",
",",
"String",
"code",
")",
"throws",
"NoSuchRegionException",
"{",
"CommerceRegion",
"commerceRegion",
"=",
"fetchByC_C",
"(",
"commerceCountryId",
",",
"code",
")",
";",
"i... | Returns the commerce region where commerceCountryId = ? and code = ? or throws a {@link NoSuchRegionException} if it could not be found.
@param commerceCountryId the commerce country ID
@param code the code
@return the matching commerce region
@throws NoSuchRegionException if a matching commerce region could n... | [
"Returns",
"the",
"commerce",
"region",
"where",
"commerceCountryId",
"=",
"?",
";",
"and",
"code",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchRegionException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java#L2023-L2049 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/IOUtils.java | IOUtils.read | public static String read(InputStream in, String charset) throws IOException {
"""
将流中的数据读取为字符串(缓冲区大小为256byte)
@param in 输入流
@param charset 字符串编码
@return 流中的数据
@throws IOException IO异常
"""
log.debug("开始从流中读取内容");
charset = charset == null ? "UTF8" : charset;
int bufSize = 256... | java | public static String read(InputStream in, String charset) throws IOException {
log.debug("开始从流中读取内容");
charset = charset == null ? "UTF8" : charset;
int bufSize = 256;
log.debug("文本编码为:{},缓冲区大小为{}byte", charset, bufSize);
return new String(read(in, bufSize), charset);
} | [
"public",
"static",
"String",
"read",
"(",
"InputStream",
"in",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"log",
".",
"debug",
"(",
"\"开始从流中读取内容\");",
"",
"",
"charset",
"=",
"charset",
"==",
"null",
"?",
"\"UTF8\"",
":",
"charset",
";",... | 将流中的数据读取为字符串(缓冲区大小为256byte)
@param in 输入流
@param charset 字符串编码
@return 流中的数据
@throws IOException IO异常 | [
"将流中的数据读取为字符串(缓冲区大小为256byte)"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/IOUtils.java#L24-L30 |
indeedeng/util | io/src/main/java/com/indeed/util/io/Files.java | Files.writeObjectToFileOrDie | public static void writeObjectToFileOrDie(@Nonnull final Object obj, @Nonnull final String file) throws IOException {
"""
Serializes an object to a file, throws an exception if it fails
@param obj object to write to a file
@param file path to save the object to
@throws java.io.IOException if the existing file... | java | public static void writeObjectToFileOrDie(@Nonnull final Object obj, @Nonnull final String file) throws IOException {
writeObjectToFileOrDie(obj, file, LOGGER);
} | [
"public",
"static",
"void",
"writeObjectToFileOrDie",
"(",
"@",
"Nonnull",
"final",
"Object",
"obj",
",",
"@",
"Nonnull",
"final",
"String",
"file",
")",
"throws",
"IOException",
"{",
"writeObjectToFileOrDie",
"(",
"obj",
",",
"file",
",",
"LOGGER",
")",
";",
... | Serializes an object to a file, throws an exception if it fails
@param obj object to write to a file
@param file path to save the object to
@throws java.io.IOException if the existing file could not be erased, or the file could not be written, flushed, synced, or closed | [
"Serializes",
"an",
"object",
"to",
"a",
"file",
"throws",
"an",
"exception",
"if",
"it",
"fails"
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/io/src/main/java/com/indeed/util/io/Files.java#L53-L55 |
oboehm/jfachwert | src/main/java/de/jfachwert/post/Postfach.java | Postfach.validate | public static void validate(String postfach) {
"""
Zerlegt das uebergebene Postfach in seine Einzelteile und validiert sie.
Folgende Heuristiken werden fuer die Zerlegung herangezogen:
<ul>
<li>Format ist "Postfach, Ort" oder nur "Ort" (mit PLZ)</li>
<li>Postfach ist vom Ort durch Komma oder Zeilenvorschub get... | java | public static void validate(String postfach) {
String[] lines = split(postfach);
toNumber(lines[0]);
Ort ort = new Ort(lines[1]);
if (!ort.getPLZ().isPresent()) {
throw new InvalidValueException(postfach, "postal_code");
}
} | [
"public",
"static",
"void",
"validate",
"(",
"String",
"postfach",
")",
"{",
"String",
"[",
"]",
"lines",
"=",
"split",
"(",
"postfach",
")",
";",
"toNumber",
"(",
"lines",
"[",
"0",
"]",
")",
";",
"Ort",
"ort",
"=",
"new",
"Ort",
"(",
"lines",
"["... | Zerlegt das uebergebene Postfach in seine Einzelteile und validiert sie.
Folgende Heuristiken werden fuer die Zerlegung herangezogen:
<ul>
<li>Format ist "Postfach, Ort" oder nur "Ort" (mit PLZ)</li>
<li>Postfach ist vom Ort durch Komma oder Zeilenvorschub getrennt</li>
</ul>
@param postfach z.B. "Postfach 98765, 1234... | [
"Zerlegt",
"das",
"uebergebene",
"Postfach",
"in",
"seine",
"Einzelteile",
"und",
"validiert",
"sie",
".",
"Folgende",
"Heuristiken",
"werden",
"fuer",
"die",
"Zerlegung",
"herangezogen",
":",
"<ul",
">",
"<li",
">",
"Format",
"ist",
"Postfach",
"Ort",
"oder",
... | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/post/Postfach.java#L192-L199 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3f.java | AlignedBox3f.setFromCorners | @Override
public void setFromCorners(double x1, double y1, double z1, double x2, double y2, double z2) {
"""
Change the frame of the box.
@param x1 is the coordinate of the first corner.
@param y1 is the coordinate of the first corner.
@param z1 is the coordinate of the first corner.
@param x2 is the coordi... | java | @Override
public void setFromCorners(double x1, double y1, double z1, double x2, double y2, double z2) {
if (x1<x2) {
this.minx = x1;
this.maxx = x2;
}
else {
this.minx = x2;
this.maxx = x1;
}
if (y1<y2) {
this.miny = y1;
this.maxy = y2;
}
else {
this.miny = y2;
this.maxy = y1;
... | [
"@",
"Override",
"public",
"void",
"setFromCorners",
"(",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"z1",
",",
"double",
"x2",
",",
"double",
"y2",
",",
"double",
"z2",
")",
"{",
"if",
"(",
"x1",
"<",
"x2",
")",
"{",
"this",
".",
"minx",
... | Change the frame of the box.
@param x1 is the coordinate of the first corner.
@param y1 is the coordinate of the first corner.
@param z1 is the coordinate of the first corner.
@param x2 is the coordinate of the second corner.
@param y2 is the coordinate of the second corner.
@param z2 is the coordinate of the second c... | [
"Change",
"the",
"frame",
"of",
"the",
"box",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AlignedBox3f.java#L300-L326 |
apereo/cas | core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java | AbstractCasWebflowConfigurer.containsTransition | public boolean containsTransition(final TransitionableState state, final String transition) {
"""
Contains transition boolean.
@param state the state
@param transition the transition
@return the boolean
"""
if (state == null) {
LOGGER.error("State is not configured correctly and c... | java | public boolean containsTransition(final TransitionableState state, final String transition) {
if (state == null) {
LOGGER.error("State is not configured correctly and cannot be null.");
return false;
}
return state.getTransition(transition) != null;
} | [
"public",
"boolean",
"containsTransition",
"(",
"final",
"TransitionableState",
"state",
",",
"final",
"String",
"transition",
")",
"{",
"if",
"(",
"state",
"==",
"null",
")",
"{",
"LOGGER",
".",
"error",
"(",
"\"State is not configured correctly and cannot be null.\"... | Contains transition boolean.
@param state the state
@param transition the transition
@return the boolean | [
"Contains",
"transition",
"boolean",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java#L575-L581 |
whitesource/agents | wss-agent-utils/src/main/java/org/whitesource/agent/utils/ZipUtils.java | ZipUtils.compressString | public static void compressString(InputStream inputStream, OutputStream outputStream) throws IOException {
"""
The method compresses the big strings using gzip - low memory via Streams
@param inputStream
@param outputStream
@throws IOException
"""
try (ByteArrayOutputStream byteArrayOutputStream =... | java | public static void compressString(InputStream inputStream, OutputStream outputStream) throws IOException {
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
fillExportStreamCompress(inputStream, byteArrayOutputStream);
// to do -> make it in chunks
... | [
"public",
"static",
"void",
"compressString",
"(",
"InputStream",
"inputStream",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"try",
"(",
"ByteArrayOutputStream",
"byteArrayOutputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
")",
"... | The method compresses the big strings using gzip - low memory via Streams
@param inputStream
@param outputStream
@throws IOException | [
"The",
"method",
"compresses",
"the",
"big",
"strings",
"using",
"gzip",
"-",
"low",
"memory",
"via",
"Streams"
] | train | https://github.com/whitesource/agents/blob/8a947a3dbad257aff70f23f79fb3a55ca90b765f/wss-agent-utils/src/main/java/org/whitesource/agent/utils/ZipUtils.java#L180-L189 |
Squarespace/cldr | core/src/main/java/com/squarespace/cldr/units/UnitFactorMap.java | UnitFactorMap.getFactors | public List<UnitValue> getFactors(Unit base, RoundingMode mode, Unit...units) {
"""
Return an array of factors to convert the array of units to the given base.
"""
List<UnitValue> result = new ArrayList<>();
for (int i = 0; i < units.length; i++) {
UnitFactor factor = resolve(units[i], base);
... | java | public List<UnitValue> getFactors(Unit base, RoundingMode mode, Unit...units) {
List<UnitValue> result = new ArrayList<>();
for (int i = 0; i < units.length; i++) {
UnitFactor factor = resolve(units[i], base);
if (factor != null) {
BigDecimal n = factor.rational().compute(mode);
resu... | [
"public",
"List",
"<",
"UnitValue",
">",
"getFactors",
"(",
"Unit",
"base",
",",
"RoundingMode",
"mode",
",",
"Unit",
"...",
"units",
")",
"{",
"List",
"<",
"UnitValue",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
... | Return an array of factors to convert the array of units to the given base. | [
"Return",
"an",
"array",
"of",
"factors",
"to",
"convert",
"the",
"array",
"of",
"units",
"to",
"the",
"given",
"base",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/core/src/main/java/com/squarespace/cldr/units/UnitFactorMap.java#L87-L97 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/OrganizationHandler.java | OrganizationHandler.addCorporateGroupId | public void addCorporateGroupId(final String organizationId, final String corporateGroupId) {
"""
Adds a corporate groupId to an organization
@param organizationId String
@param corporateGroupId String
"""
final DbOrganization dbOrganization = getOrganization(organizationId);
if(!dbOrganiz... | java | public void addCorporateGroupId(final String organizationId, final String corporateGroupId) {
final DbOrganization dbOrganization = getOrganization(organizationId);
if(!dbOrganization.getCorporateGroupIdPrefixes().contains(corporateGroupId)){
dbOrganization.getCorporateGroupIdPrefixes().add... | [
"public",
"void",
"addCorporateGroupId",
"(",
"final",
"String",
"organizationId",
",",
"final",
"String",
"corporateGroupId",
")",
"{",
"final",
"DbOrganization",
"dbOrganization",
"=",
"getOrganization",
"(",
"organizationId",
")",
";",
"if",
"(",
"!",
"dbOrganiza... | Adds a corporate groupId to an organization
@param organizationId String
@param corporateGroupId String | [
"Adds",
"a",
"corporate",
"groupId",
"to",
"an",
"organization"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/OrganizationHandler.java#L90-L99 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/event/EventBuilder.java | EventBuilder.withSentryInterface | public EventBuilder withSentryInterface(SentryInterface sentryInterface, boolean replace) {
"""
Adds a {@link SentryInterface} to the event.
<p>
Checks whether or not the entry already exists, and replaces it only if {@code replace} is true.
@param sentryInterface sentry interface to add to the event.
@param... | java | public EventBuilder withSentryInterface(SentryInterface sentryInterface, boolean replace) {
if (replace || !event.getSentryInterfaces().containsKey(sentryInterface.getInterfaceName())) {
event.getSentryInterfaces().put(sentryInterface.getInterfaceName(), sentryInterface);
}
return th... | [
"public",
"EventBuilder",
"withSentryInterface",
"(",
"SentryInterface",
"sentryInterface",
",",
"boolean",
"replace",
")",
"{",
"if",
"(",
"replace",
"||",
"!",
"event",
".",
"getSentryInterfaces",
"(",
")",
".",
"containsKey",
"(",
"sentryInterface",
".",
"getIn... | Adds a {@link SentryInterface} to the event.
<p>
Checks whether or not the entry already exists, and replaces it only if {@code replace} is true.
@param sentryInterface sentry interface to add to the event.
@param replace If true and a Sentry Interface with the same name has already been added it will be
repla... | [
"Adds",
"a",
"{",
"@link",
"SentryInterface",
"}",
"to",
"the",
"event",
".",
"<p",
">",
"Checks",
"whether",
"or",
"not",
"the",
"entry",
"already",
"exists",
"and",
"replaces",
"it",
"only",
"if",
"{",
"@code",
"replace",
"}",
"is",
"true",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/event/EventBuilder.java#L424-L429 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebSiteManagementClientImpl.java | WebSiteManagementClientImpl.checkNameAvailability | public ResourceNameAvailabilityInner checkNameAvailability(String name, CheckNameResourceTypes type) {
"""
Check if a resource name is available.
Check if a resource name is available.
@param name Resource name to verify.
@param type Resource type used for verification. Possible values include: 'Site', 'Slot'... | java | public ResourceNameAvailabilityInner checkNameAvailability(String name, CheckNameResourceTypes type) {
return checkNameAvailabilityWithServiceResponseAsync(name, type).toBlocking().single().body();
} | [
"public",
"ResourceNameAvailabilityInner",
"checkNameAvailability",
"(",
"String",
"name",
",",
"CheckNameResourceTypes",
"type",
")",
"{",
"return",
"checkNameAvailabilityWithServiceResponseAsync",
"(",
"name",
",",
"type",
")",
".",
"toBlocking",
"(",
")",
".",
"singl... | Check if a resource name is available.
Check if a resource name is available.
@param name Resource name to verify.
@param type Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', 'Microsoft.Web/hosting... | [
"Check",
"if",
"a",
"resource",
"name",
"is",
"available",
".",
"Check",
"if",
"a",
"resource",
"name",
"is",
"available",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebSiteManagementClientImpl.java#L1160-L1162 |
fcrepo3/fcrepo | fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/objecteditor/Util.java | Util.getObjectFields | public static ObjectFields getObjectFields(String pid, String[] fields)
throws IOException {
"""
Get the indicated fields of the indicated object from the repository.
"""
FieldSearchQuery query = new FieldSearchQuery();
Condition condition = new Condition();
condition.setPro... | java | public static ObjectFields getObjectFields(String pid, String[] fields)
throws IOException {
FieldSearchQuery query = new FieldSearchQuery();
Condition condition = new Condition();
condition.setProperty("pid");
condition.setOperator(ComparisonOperator.fromValue("eq"));
... | [
"public",
"static",
"ObjectFields",
"getObjectFields",
"(",
"String",
"pid",
",",
"String",
"[",
"]",
"fields",
")",
"throws",
"IOException",
"{",
"FieldSearchQuery",
"query",
"=",
"new",
"FieldSearchQuery",
"(",
")",
";",
"Condition",
"condition",
"=",
"new",
... | Get the indicated fields of the indicated object from the repository. | [
"Get",
"the",
"indicated",
"fields",
"of",
"the",
"indicated",
"object",
"from",
"the",
"repository",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/objecteditor/Util.java#L93-L115 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipSession.java | SipSession.sendRequestWithTransaction | public SipTransaction sendRequestWithTransaction(String reqMessage, boolean viaProxy,
Dialog dialog) throws ParseException {
"""
This basic method sends out a request message as part of a transaction. A test program should
use this method when a response to a request is expected. A Request object is constru... | java | public SipTransaction sendRequestWithTransaction(String reqMessage, boolean viaProxy,
Dialog dialog) throws ParseException {
Request request = parent.getMessageFactory().createRequest(reqMessage);
return sendRequestWithTransaction(request, viaProxy, dialog);
} | [
"public",
"SipTransaction",
"sendRequestWithTransaction",
"(",
"String",
"reqMessage",
",",
"boolean",
"viaProxy",
",",
"Dialog",
"dialog",
")",
"throws",
"ParseException",
"{",
"Request",
"request",
"=",
"parent",
".",
"getMessageFactory",
"(",
")",
".",
"createReq... | This basic method sends out a request message as part of a transaction. A test program should
use this method when a response to a request is expected. A Request object is constructed from
the string passed in.
<p>
This method returns when the request message has been sent out. The calling program must
subsequently ca... | [
"This",
"basic",
"method",
"sends",
"out",
"a",
"request",
"message",
"as",
"part",
"of",
"a",
"transaction",
".",
"A",
"test",
"program",
"should",
"use",
"this",
"method",
"when",
"a",
"response",
"to",
"a",
"request",
"is",
"expected",
".",
"A",
"Requ... | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipSession.java#L826-L830 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortablePositionNavigator.java | PortablePositionNavigator.navigateToPathTokenWithNumberQuantifier | private static PortablePosition navigateToPathTokenWithNumberQuantifier(
PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {
"""
Token with [number] quantifier. It means we are navigating in an array cell.
"""
// makes sure that the field type is an array and parses ... | java | private static PortablePosition navigateToPathTokenWithNumberQuantifier(
PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {
// makes sure that the field type is an array and parses the qantifier
validateArrayType(ctx.getCurrentClassDefinition(), ctx.getCurrentFieldDe... | [
"private",
"static",
"PortablePosition",
"navigateToPathTokenWithNumberQuantifier",
"(",
"PortableNavigatorContext",
"ctx",
",",
"PortablePathCursor",
"path",
")",
"throws",
"IOException",
"{",
"// makes sure that the field type is an array and parses the qantifier",
"validateArrayType... | Token with [number] quantifier. It means we are navigating in an array cell. | [
"Token",
"with",
"[",
"number",
"]",
"quantifier",
".",
"It",
"means",
"we",
"are",
"navigating",
"in",
"an",
"array",
"cell",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/PortablePositionNavigator.java#L332-L359 |
alibaba/vlayout | vlayout/src/main/java/com/alibaba/android/vlayout/ExposeLinearLayoutManagerEx.java | ExposeLinearLayoutManagerEx.scrollToPositionWithOffset | public void scrollToPositionWithOffset(int position, int offset) {
"""
Scroll to the specified adapter position with the given offset from resolved layout
start. Resolved layout start depends on {@link #getReverseLayout()},
{@link ViewCompat#getLayoutDirection(View)} and {@link #getStackFromEnd()}.
<p/>
For ex... | java | public void scrollToPositionWithOffset(int position, int offset) {
mCurrentPendingScrollPosition = position;
mPendingScrollPositionOffset = offset;
if (mCurrentPendingSavedState != null) {
mCurrentPendingSavedState.putInt("AnchorPosition", RecyclerView.NO_POSITION);
}
... | [
"public",
"void",
"scrollToPositionWithOffset",
"(",
"int",
"position",
",",
"int",
"offset",
")",
"{",
"mCurrentPendingScrollPosition",
"=",
"position",
";",
"mPendingScrollPositionOffset",
"=",
"offset",
";",
"if",
"(",
"mCurrentPendingSavedState",
"!=",
"null",
")"... | Scroll to the specified adapter position with the given offset from resolved layout
start. Resolved layout start depends on {@link #getReverseLayout()},
{@link ViewCompat#getLayoutDirection(View)} and {@link #getStackFromEnd()}.
<p/>
For example, if layout is {@link #VERTICAL} and {@link #getStackFromEnd()} is true, ca... | [
"Scroll",
"to",
"the",
"specified",
"adapter",
"position",
"with",
"the",
"given",
"offset",
"from",
"resolved",
"layout",
"start",
".",
"Resolved",
"layout",
"start",
"depends",
"on",
"{",
"@link",
"#getReverseLayout",
"()",
"}",
"{",
"@link",
"ViewCompat#getLa... | train | https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/ExposeLinearLayoutManagerEx.java#L867-L874 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeManagerImpl.java | NodeTypeManagerImpl.getMixinNodeTypes | public NodeTypeIterator getMixinNodeTypes() throws RepositoryException {
"""
Returns an iterator over all available mixin node types.
@return An <code>NodeTypeIterator</code>.
@throws RepositoryException if an error occurs.
"""
List<NodeTypeData> allNodeTypes = typesManager.getAllNodeTypes();
... | java | public NodeTypeIterator getMixinNodeTypes() throws RepositoryException
{
List<NodeTypeData> allNodeTypes = typesManager.getAllNodeTypes();
Collections.sort(allNodeTypes, new NodeTypeDataComparator());
EntityCollection ec = new EntityCollection();
for (NodeTypeData nodeTypeData : allNodeType... | [
"public",
"NodeTypeIterator",
"getMixinNodeTypes",
"(",
")",
"throws",
"RepositoryException",
"{",
"List",
"<",
"NodeTypeData",
">",
"allNodeTypes",
"=",
"typesManager",
".",
"getAllNodeTypes",
"(",
")",
";",
"Collections",
".",
"sort",
"(",
"allNodeTypes",
",",
"... | Returns an iterator over all available mixin node types.
@return An <code>NodeTypeIterator</code>.
@throws RepositoryException if an error occurs. | [
"Returns",
"an",
"iterator",
"over",
"all",
"available",
"mixin",
"node",
"types",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeManagerImpl.java#L117-L132 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java | PropertyInfo.getConfigValueBoolean | public Boolean getConfigValueBoolean(String key, Boolean dflt) {
"""
This is a convenience method for returning a named configuration value that is expected to be
a Boolean value.
@param key The configuration value's key.
@param dflt Default value.
@return Configuration value as a Boolean or default value if... | java | public Boolean getConfigValueBoolean(String key, Boolean dflt) {
try {
String value = getConfigValue(key);
return value == null ? dflt : Boolean.parseBoolean(value);
} catch (Exception e) {
return dflt;
}
} | [
"public",
"Boolean",
"getConfigValueBoolean",
"(",
"String",
"key",
",",
"Boolean",
"dflt",
")",
"{",
"try",
"{",
"String",
"value",
"=",
"getConfigValue",
"(",
"key",
")",
";",
"return",
"value",
"==",
"null",
"?",
"dflt",
":",
"Boolean",
".",
"parseBoole... | This is a convenience method for returning a named configuration value that is expected to be
a Boolean value.
@param key The configuration value's key.
@param dflt Default value.
@return Configuration value as a Boolean or default value if not found or not a valid
Boolean. | [
"This",
"is",
"a",
"convenience",
"method",
"for",
"returning",
"a",
"named",
"configuration",
"value",
"that",
"is",
"expected",
"to",
"be",
"a",
"Boolean",
"value",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/property/PropertyInfo.java#L342-L349 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.createInputStream | static InputStream createInputStream(String method, String id, String params) throws IOException {
"""
Returns parameters into an {@link InputStream} of JSON data.
@param method the method
@param id the id
@param params the base64 encoded params
@return the {@link InputStream}
@throws IOException on err... | java | static InputStream createInputStream(String method, String id, String params) throws IOException {
StringBuilder envelope = new StringBuilder();
envelope.append("{\"");
envelope.append(JSONRPC);
envelope.append("\":\"");
envelope.append(VERSION);
envelope.append("\",\"");
envelope.append(ID);
enve... | [
"static",
"InputStream",
"createInputStream",
"(",
"String",
"method",
",",
"String",
"id",
",",
"String",
"params",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"envelope",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"envelope",
".",
"append",
"(",
"\"... | Returns parameters into an {@link InputStream} of JSON data.
@param method the method
@param id the id
@param params the base64 encoded params
@return the {@link InputStream}
@throws IOException on error | [
"Returns",
"parameters",
"into",
"an",
"{",
"@link",
"InputStream",
"}",
"of",
"JSON",
"data",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L148-L214 |
virgo47/javasimon | core/src/main/java/org/javasimon/callback/quantiles/Buckets.java | Buckets.estimateQuantile | protected double estimateQuantile(Bucket bucket, double expectedCount, double lastCount) {
"""
Interpolate quantile located in given Bucket using linear regression.
<ul>
<li>Quantile is between {@link Bucket#min} and {@link Bucket#max}</li>
<li>Expected count is between last count and last count+{@link Bucket#c... | java | protected double estimateQuantile(Bucket bucket, double expectedCount, double lastCount) {
return bucket.getMin() + (expectedCount - lastCount) * (bucket.getMax() - bucket.getMin()) / bucket.getCount();
} | [
"protected",
"double",
"estimateQuantile",
"(",
"Bucket",
"bucket",
",",
"double",
"expectedCount",
",",
"double",
"lastCount",
")",
"{",
"return",
"bucket",
".",
"getMin",
"(",
")",
"+",
"(",
"expectedCount",
"-",
"lastCount",
")",
"*",
"(",
"bucket",
".",
... | Interpolate quantile located in given Bucket using linear regression.
<ul>
<li>Quantile is between {@link Bucket#min} and {@link Bucket#max}</li>
<li>Expected count is between last count and last count+{@link Bucket#count}</li>
</ul>
@param bucket Current bucket containing the quantile
@param expectedCount Searched va... | [
"Interpolate",
"quantile",
"located",
"in",
"given",
"Bucket",
"using",
"linear",
"regression",
".",
"<ul",
">",
"<li",
">",
"Quantile",
"is",
"between",
"{",
"@link",
"Bucket#min",
"}",
"and",
"{",
"@link",
"Bucket#max",
"}",
"<",
"/",
"li",
">",
"<li",
... | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/callback/quantiles/Buckets.java#L140-L142 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L1_WSG84 | @Pure
public static GeodesicPosition L1_WSG84(double x, double y) {
"""
This function convert France Lambert I coordinate to geographic WSG84 Data.
@param x is the coordinate in France Lambert I
@param y is the coordinate in France Lambert I
@return lambda and phi in geographic WSG84 in degrees.
"""
fi... | java | @Pure
public static GeodesicPosition L1_WSG84(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,
LAMBERT_1_YS);
return NTFLambdaPhi_WSG84(ntfLambdaPhi.getX(), ntfLambdaPhi.getY());
} | [
"@",
"Pure",
"public",
"static",
"GeodesicPosition",
"L1_WSG84",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_1_N",
",",
"LAMBERT_1_C",
",",
"LAMBERT_1_X... | This function convert France Lambert I coordinate to geographic WSG84 Data.
@param x is the coordinate in France Lambert I
@param y is the coordinate in France Lambert I
@return lambda and phi in geographic WSG84 in degrees. | [
"This",
"function",
"convert",
"France",
"Lambert",
"I",
"coordinate",
"to",
"geographic",
"WSG84",
"Data",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L287-L295 |
jayantk/jklol | src/com/jayantkrish/jklol/sequence/SequenceModelUtils.java | SequenceModelUtils.buildSequenceModel | public static ParametricFactorGraph buildSequenceModel(Iterable<String> emissionFeatureLines,
String featureDelimiter) {
"""
Constructs a sequence model from the lines of a file containing features of
the emission distribution.
@param emissionFeatureLines
@param featureDelimiter
@return
"""
// ... | java | public static ParametricFactorGraph buildSequenceModel(Iterable<String> emissionFeatureLines,
String featureDelimiter) {
// Read in the possible values of each variable.
List<String> words = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 0, featureDelimiter);
List<String> labels = Stri... | [
"public",
"static",
"ParametricFactorGraph",
"buildSequenceModel",
"(",
"Iterable",
"<",
"String",
">",
"emissionFeatureLines",
",",
"String",
"featureDelimiter",
")",
"{",
"// Read in the possible values of each variable.",
"List",
"<",
"String",
">",
"words",
"=",
"Stri... | Constructs a sequence model from the lines of a file containing features of
the emission distribution.
@param emissionFeatureLines
@param featureDelimiter
@return | [
"Constructs",
"a",
"sequence",
"model",
"from",
"the",
"lines",
"of",
"a",
"file",
"containing",
"features",
"of",
"the",
"emission",
"distribution",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/sequence/SequenceModelUtils.java#L40-L86 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlContainerContext.java | ControlContainerContext.removeResourceContext | protected synchronized void removeResourceContext(ResourceContext resourceContext, ControlBean bean) {
"""
Removes a managed ResourceContext from the ControlContainerContext. This method
is used to unregister a resource context that has already acquired resources
@param resourceContext the ResourceContext servi... | java | protected synchronized void removeResourceContext(ResourceContext resourceContext, ControlBean bean)
{
//
// Ignore removal requests received within the context of global cleanup. The
// stack is already being popped, so these are just requests for resources that
// already have in-... | [
"protected",
"synchronized",
"void",
"removeResourceContext",
"(",
"ResourceContext",
"resourceContext",
",",
"ControlBean",
"bean",
")",
"{",
"//",
"// Ignore removal requests received within the context of global cleanup. The",
"// stack is already being popped, so these are just requ... | Removes a managed ResourceContext from the ControlContainerContext. This method
is used to unregister a resource context that has already acquired resources
@param resourceContext the ResourceContext service to be removed
@param bean the acquiring ControlBean. Unused by the base implementation, but
available so subcl... | [
"Removes",
"a",
"managed",
"ResourceContext",
"from",
"the",
"ControlContainerContext",
".",
"This",
"method",
"is",
"used",
"to",
"unregister",
"a",
"resource",
"context",
"that",
"has",
"already",
"acquired",
"resources"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlContainerContext.java#L112-L121 |
umano/AndroidSlidingUpPanel | library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java | ViewDragHelper.smoothSlideViewTo | public boolean smoothSlideViewTo(View child, int finalLeft, int finalTop) {
"""
Animate the view <code>child</code> to the given (left, top) position.
If this method returns true, the caller should invoke {@link #continueSettling(boolean)}
on each subsequent frame to continue the motion until it returns false. I... | java | public boolean smoothSlideViewTo(View child, int finalLeft, int finalTop) {
mCapturedView = child;
mActivePointerId = INVALID_POINTER;
return forceSettleCapturedViewAt(finalLeft, finalTop, 0, 0);
} | [
"public",
"boolean",
"smoothSlideViewTo",
"(",
"View",
"child",
",",
"int",
"finalLeft",
",",
"int",
"finalTop",
")",
"{",
"mCapturedView",
"=",
"child",
";",
"mActivePointerId",
"=",
"INVALID_POINTER",
";",
"return",
"forceSettleCapturedViewAt",
"(",
"finalLeft",
... | Animate the view <code>child</code> to the given (left, top) position.
If this method returns true, the caller should invoke {@link #continueSettling(boolean)}
on each subsequent frame to continue the motion until it returns false. If this method
returns false there is no further work to do to complete the movement.
<... | [
"Animate",
"the",
"view",
"<code",
">",
"child<",
"/",
"code",
">",
"to",
"the",
"given",
"(",
"left",
"top",
")",
"position",
".",
"If",
"this",
"method",
"returns",
"true",
"the",
"caller",
"should",
"invoke",
"{",
"@link",
"#continueSettling",
"(",
"b... | train | https://github.com/umano/AndroidSlidingUpPanel/blob/45a460435b07e764138a700328836cafc1ed5c42/library/src/main/java/com/sothree/slidinguppanel/ViewDragHelper.java#L569-L574 |
VoltDB/voltdb | src/frontend/org/voltdb/jni/ExecutionEngineJNI.java | ExecutionEngineJNI.releaseLargeTempTableBlock | public boolean releaseLargeTempTableBlock(long siteId, long blockCounter) {
"""
Delete the block with the given id from disk.
@param siteId The originating site id of the block to release
@param blockCounter The serial number of the block to release
@return True if the operation succeeded, and false o... | java | public boolean releaseLargeTempTableBlock(long siteId, long blockCounter) {
LargeBlockTask task = LargeBlockTask.getReleaseTask(new BlockId(siteId, blockCounter));
return executeLargeBlockTaskSynchronously(task);
} | [
"public",
"boolean",
"releaseLargeTempTableBlock",
"(",
"long",
"siteId",
",",
"long",
"blockCounter",
")",
"{",
"LargeBlockTask",
"task",
"=",
"LargeBlockTask",
".",
"getReleaseTask",
"(",
"new",
"BlockId",
"(",
"siteId",
",",
"blockCounter",
")",
")",
";",
"re... | Delete the block with the given id from disk.
@param siteId The originating site id of the block to release
@param blockCounter The serial number of the block to release
@return True if the operation succeeded, and false otherwise | [
"Delete",
"the",
"block",
"with",
"the",
"given",
"id",
"from",
"disk",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jni/ExecutionEngineJNI.java#L904-L907 |
anotheria/configureme | src/main/java/org/configureme/mbean/util/MBeanRegisterUtil.java | MBeanRegisterUtil.regMBean | public static void regMBean(final Object object, final String... parameters) {
"""
Register mBean object in {@link javax.management.MBeanServer}.
@param object provided object
@param parameters additional parameters
"""
try {
final String name = buildObjectName(object, parameters);
final Object... | java | public static void regMBean(final Object object, final String... parameters) {
try {
final String name = buildObjectName(object, parameters);
final ObjectName objectName = new ObjectName(name);
if (mbs.isRegistered(objectName))
return;
mbs.registerMBean(object, objectName);
} catch (final MalformedO... | [
"public",
"static",
"void",
"regMBean",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"...",
"parameters",
")",
"{",
"try",
"{",
"final",
"String",
"name",
"=",
"buildObjectName",
"(",
"object",
",",
"parameters",
")",
";",
"final",
"ObjectName",... | Register mBean object in {@link javax.management.MBeanServer}.
@param object provided object
@param parameters additional parameters | [
"Register",
"mBean",
"object",
"in",
"{",
"@link",
"javax",
".",
"management",
".",
"MBeanServer",
"}",
"."
] | train | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/mbean/util/MBeanRegisterUtil.java#L38-L50 |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/Deployment.java | Deployment.of | public static Deployment of(final URL url) {
"""
Creates a new deployment for the URL. The target server will require access to the URL.
@param url the URL representing the content
@return the deployment
"""
final DeploymentContent deploymentContent = DeploymentContent.of(Assert.checkNotNullParam... | java | public static Deployment of(final URL url) {
final DeploymentContent deploymentContent = DeploymentContent.of(Assert.checkNotNullParam("url", url));
return new Deployment(deploymentContent, null);
} | [
"public",
"static",
"Deployment",
"of",
"(",
"final",
"URL",
"url",
")",
"{",
"final",
"DeploymentContent",
"deploymentContent",
"=",
"DeploymentContent",
".",
"of",
"(",
"Assert",
".",
"checkNotNullParam",
"(",
"\"url\"",
",",
"url",
")",
")",
";",
"return",
... | Creates a new deployment for the URL. The target server will require access to the URL.
@param url the URL representing the content
@return the deployment | [
"Creates",
"a",
"new",
"deployment",
"for",
"the",
"URL",
".",
"The",
"target",
"server",
"will",
"require",
"access",
"to",
"the",
"URL",
"."
] | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/Deployment.java#L110-L113 |
unbescape/unbescape | src/main/java/org/unbescape/properties/PropertiesEscape.java | PropertiesEscape.escapePropertiesValue | public static void escapePropertiesValue(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform a Java Properties Value level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>char[]... | java | public static void escapePropertiesValue(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
escapePropertiesValue(text, offset, len, writer, PropertiesValueEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapePropertiesValue",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapePropertiesValue",
"(",
"text",
... | <p>
Perform a Java Properties Value level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>char[]</tt> input.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The Java Properties basic escape set:
<ul>
<li>The <em>Single Escape Characters</em>:
<tt>\t</tt> (<tt>... | [
"<p",
">",
"Perform",
"a",
"Java",
"Properties",
"Value",
"level",
"2",
"(",
"basic",
"set",
"and",
"all",
"non",
"-",
"ASCII",
"chars",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L687-L690 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java | PackageManagerUtils.getIntentFilterPackageInfo | public static PackageInfo getIntentFilterPackageInfo(Context context, String targetPackage) throws NameNotFoundException {
"""
Get the {@link android.content.pm.PackageInfo} that contains intent-filter declaration for the context.
@param context the context.
@param targetPackage the target package name.
@return... | java | public static PackageInfo getIntentFilterPackageInfo(Context context, String targetPackage) throws NameNotFoundException {
PackageManager manager = context.getPackageManager();
return manager.getPackageInfo(targetPackage, PackageManager.GET_INTENT_FILTERS);
} | [
"public",
"static",
"PackageInfo",
"getIntentFilterPackageInfo",
"(",
"Context",
"context",
",",
"String",
"targetPackage",
")",
"throws",
"NameNotFoundException",
"{",
"PackageManager",
"manager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"return",
"ma... | Get the {@link android.content.pm.PackageInfo} that contains intent-filter declaration for the context.
@param context the context.
@param targetPackage the target package name.
@return the {@link android.content.pm.PackageInfo}.
@throws NameNotFoundException if no package found. | [
"Get",
"the",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java#L154-L157 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.