repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookFragment.java | FacebookFragment.openSessionForRead | protected final void openSessionForRead(String applicationId, List<String> permissions,
SessionLoginBehavior behavior, int activityCode) {
openSession(applicationId, permissions, behavior, activityCode, SessionAuthorizationType.READ);
} | java | protected final void openSessionForRead(String applicationId, List<String> permissions,
SessionLoginBehavior behavior, int activityCode) {
openSession(applicationId, permissions, behavior, activityCode, SessionAuthorizationType.READ);
} | [
"protected",
"final",
"void",
"openSessionForRead",
"(",
"String",
"applicationId",
",",
"List",
"<",
"String",
">",
"permissions",
",",
"SessionLoginBehavior",
"behavior",
",",
"int",
"activityCode",
")",
"{",
"openSession",
"(",
"applicationId",
",",
"permissions"... | Opens a new session with read permissions. If either applicationID or permissions
is null, this method will default to using the values from the associated
meta-data value and an empty list respectively.
@param applicationId the applicationID, can be null
@param permissions the permissions list, can be null
@param beh... | [
"Opens",
"a",
"new",
"session",
"with",
"read",
"permissions",
".",
"If",
"either",
"applicationID",
"or",
"permissions",
"is",
"null",
"this",
"method",
"will",
"default",
"to",
"using",
"the",
"values",
"from",
"the",
"associated",
"meta",
"-",
"data",
"va... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookFragment.java#L228-L231 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppLinkData.java | AppLinkData.fetchDeferredAppLinkData | public static void fetchDeferredAppLinkData(
Context context,
String applicationId,
final CompletionHandler completionHandler) {
Validate.notNull(context, "context");
Validate.notNull(completionHandler, "completionHandler");
if (applicationId == null) {
... | java | public static void fetchDeferredAppLinkData(
Context context,
String applicationId,
final CompletionHandler completionHandler) {
Validate.notNull(context, "context");
Validate.notNull(completionHandler, "completionHandler");
if (applicationId == null) {
... | [
"public",
"static",
"void",
"fetchDeferredAppLinkData",
"(",
"Context",
"context",
",",
"String",
"applicationId",
",",
"final",
"CompletionHandler",
"completionHandler",
")",
"{",
"Validate",
".",
"notNull",
"(",
"context",
",",
"\"context\"",
")",
";",
"Validate",... | Asynchronously fetches app link information that might have been stored for use
after installation of the app
@param context The context
@param applicationId Facebook application Id. If null, it is taken from the manifest
@param completionHandler CompletionHandler to be notified with the AppLinkData object or null if n... | [
"Asynchronously",
"fetches",
"app",
"link",
"information",
"that",
"might",
"have",
"been",
"stored",
"for",
"use",
"after",
"installation",
"of",
"the",
"app"
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppLinkData.java#L103-L124 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppLinkData.java | AppLinkData.createFromActivity | public static AppLinkData createFromActivity(Activity activity) {
Validate.notNull(activity, "activity");
Intent intent = activity.getIntent();
if (intent == null) {
return null;
}
AppLinkData appLinkData = createFromAlApplinkData(intent);
if (appLinkData == ... | java | public static AppLinkData createFromActivity(Activity activity) {
Validate.notNull(activity, "activity");
Intent intent = activity.getIntent();
if (intent == null) {
return null;
}
AppLinkData appLinkData = createFromAlApplinkData(intent);
if (appLinkData == ... | [
"public",
"static",
"AppLinkData",
"createFromActivity",
"(",
"Activity",
"activity",
")",
"{",
"Validate",
".",
"notNull",
"(",
"activity",
",",
"\"activity\"",
")",
";",
"Intent",
"intent",
"=",
"activity",
".",
"getIntent",
"(",
")",
";",
"if",
"(",
"inte... | Parses out any app link data from the Intent of the Activity passed in.
@param activity Activity that was started because of an app link
@return AppLinkData if found. null if not. | [
"Parses",
"out",
"any",
"app",
"link",
"data",
"from",
"the",
"Intent",
"of",
"the",
"Activity",
"passed",
"in",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppLinkData.java#L209-L227 | train |
tommyettinger/RegExodus | src/main/java/regexodus/Matcher.java | Matcher.setPattern | public void setPattern(Pattern regex)
{
this.re = regex;
int memregCount, counterCount, lookaheadCount;
if ((memregCount = regex.memregs) > 0) {
MemReg[] memregs = new MemReg[memregCount];
for (int i = 0; i < memregCount; i++) {
memregs[i] = new MemRe... | java | public void setPattern(Pattern regex)
{
this.re = regex;
int memregCount, counterCount, lookaheadCount;
if ((memregCount = regex.memregs) > 0) {
MemReg[] memregs = new MemReg[memregCount];
for (int i = 0; i < memregCount; i++) {
memregs[i] = new MemRe... | [
"public",
"void",
"setPattern",
"(",
"Pattern",
"regex",
")",
"{",
"this",
".",
"re",
"=",
"regex",
";",
"int",
"memregCount",
",",
"counterCount",
",",
"lookaheadCount",
";",
"if",
"(",
"(",
"memregCount",
"=",
"regex",
".",
"memregs",
")",
">",
"0",
... | Sets the regex Pattern this tries to match. Won't do anything until the target is set as well.
@param regex the Pattern this should match | [
"Sets",
"the",
"regex",
"Pattern",
"this",
"tries",
"to",
"match",
".",
"Won",
"t",
"do",
"anything",
"until",
"the",
"target",
"is",
"set",
"as",
"well",
"."
] | d4af9bb7c132c5f9d29f45b76121f93b2f89de16 | https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/Matcher.java#L166-L197 | train |
tommyettinger/RegExodus | src/main/java/regexodus/Matcher.java | Matcher.skip | public void skip() {
int we = wEnd;
if (wOffset == we) { //requires special handling
//if no variants at 'wOutside',advance pointer and clear
if (top == null) {
wOffset++;
flush();
}
//otherwise, if there exist a variant,
... | java | public void skip() {
int we = wEnd;
if (wOffset == we) { //requires special handling
//if no variants at 'wOutside',advance pointer and clear
if (top == null) {
wOffset++;
flush();
}
//otherwise, if there exist a variant,
... | [
"public",
"void",
"skip",
"(",
")",
"{",
"int",
"we",
"=",
"wEnd",
";",
"if",
"(",
"wOffset",
"==",
"we",
")",
"{",
"//requires special handling",
"//if no variants at 'wOutside',advance pointer and clear",
"if",
"(",
"top",
"==",
"null",
")",
"{",
"wOffset",
... | Sets the current search position just after the end of last match. | [
"Sets",
"the",
"current",
"search",
"position",
"just",
"after",
"the",
"end",
"of",
"last",
"match",
"."
] | d4af9bb7c132c5f9d29f45b76121f93b2f89de16 | https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/Matcher.java#L638-L655 | train |
tommyettinger/RegExodus | src/main/java/regexodus/Matcher.java | Matcher.flush | public void flush() {
top = null;
defaultEntry.reset(0);
first.reset(minQueueLength);
for (int i = memregs.length - 1; i > 0; i--) {
MemReg mr = memregs[i];
mr.in = mr.out = -1;
}
/*
for (int i = memregs.length - 1; i > 0; i--) {
... | java | public void flush() {
top = null;
defaultEntry.reset(0);
first.reset(minQueueLength);
for (int i = memregs.length - 1; i > 0; i--) {
MemReg mr = memregs[i];
mr.in = mr.out = -1;
}
/*
for (int i = memregs.length - 1; i > 0; i--) {
... | [
"public",
"void",
"flush",
"(",
")",
"{",
"top",
"=",
"null",
";",
"defaultEntry",
".",
"reset",
"(",
"0",
")",
";",
"first",
".",
"reset",
"(",
"minQueueLength",
")",
";",
"for",
"(",
"int",
"i",
"=",
"memregs",
".",
"length",
"-",
"1",
";",
"i"... | Resets the internal state. | [
"Resets",
"the",
"internal",
"state",
"."
] | d4af9bb7c132c5f9d29f45b76121f93b2f89de16 | https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/Matcher.java#L668-L683 | train |
tommyettinger/RegExodus | src/main/java/regexodus/Matcher.java | Matcher.start | @Override
public int start(String name) {
Integer id = re.groupId(name);
if (id == null) throw new IllegalArgumentException("<" + name + "> isn't defined");
return start(id);
} | java | @Override
public int start(String name) {
Integer id = re.groupId(name);
if (id == null) throw new IllegalArgumentException("<" + name + "> isn't defined");
return start(id);
} | [
"@",
"Override",
"public",
"int",
"start",
"(",
"String",
"name",
")",
"{",
"Integer",
"id",
"=",
"re",
".",
"groupId",
"(",
"name",
")",
";",
"if",
"(",
"id",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"<\"",
"+",
"name",
... | Returns the start index of the subsequence captured by the given
named-capturing group during the previous match operation.
@param name The name of a named capturing group in this matcher's pattern
@return The index of the first character captured by the group,
or <tt>-1</tt> if the match was successful but the group
... | [
"Returns",
"the",
"start",
"index",
"of",
"the",
"subsequence",
"captured",
"by",
"the",
"given",
"named",
"-",
"capturing",
"group",
"during",
"the",
"previous",
"match",
"operation",
"."
] | d4af9bb7c132c5f9d29f45b76121f93b2f89de16 | https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/Matcher.java#L1112-L1117 | train |
tommyettinger/RegExodus | src/main/java/regexodus/Matcher.java | Matcher.repeat | private static int repeat(char[] data, int off, int out, Term term) {
switch (term.type) {
case Term.CHAR: {
char c = term.c;
int i = off;
while (i < out) {
if (data[i] != c) break;
i++;
}
... | java | private static int repeat(char[] data, int off, int out, Term term) {
switch (term.type) {
case Term.CHAR: {
char c = term.c;
int i = off;
while (i < out) {
if (data[i] != c) break;
i++;
}
... | [
"private",
"static",
"int",
"repeat",
"(",
"char",
"[",
"]",
"data",
",",
"int",
"off",
",",
"int",
"out",
",",
"Term",
"term",
")",
"{",
"switch",
"(",
"term",
".",
"type",
")",
"{",
"case",
"Term",
".",
"CHAR",
":",
"{",
"char",
"c",
"=",
"te... | repeat while matches | [
"repeat",
"while",
"matches"
] | d4af9bb7c132c5f9d29f45b76121f93b2f89de16 | https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/Matcher.java#L2200-L2255 | train |
tommyettinger/RegExodus | src/main/java/regexodus/Matcher.java | Matcher.find | private static int find(char[] data, int off, int out, Term term) {
if (off >= out) return -1;
switch (term.type) {
case Term.CHAR: {
char c = term.c;
int i = off;
while (i < out) {
if (data[i] == c) break;
... | java | private static int find(char[] data, int off, int out, Term term) {
if (off >= out) return -1;
switch (term.type) {
case Term.CHAR: {
char c = term.c;
int i = off;
while (i < out) {
if (data[i] == c) break;
... | [
"private",
"static",
"int",
"find",
"(",
"char",
"[",
"]",
"data",
",",
"int",
"off",
",",
"int",
"out",
",",
"Term",
"term",
")",
"{",
"if",
"(",
"off",
">=",
"out",
")",
"return",
"-",
"1",
";",
"switch",
"(",
"term",
".",
"type",
")",
"{",
... | repeat while doesn't match | [
"repeat",
"while",
"doesn",
"t",
"match"
] | d4af9bb7c132c5f9d29f45b76121f93b2f89de16 | https://github.com/tommyettinger/RegExodus/blob/d4af9bb7c132c5f9d29f45b76121f93b2f89de16/src/main/java/regexodus/Matcher.java#L2258-L2302 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookDialog.java | FacebookDialog.present | public PendingCall present() {
logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);
if (onPresentCallback != null) {
try {
onPresentCallback.onPresent(activity);
... | java | public PendingCall present() {
logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);
if (onPresentCallback != null) {
try {
onPresentCallback.onPresent(activity);
... | [
"public",
"PendingCall",
"present",
"(",
")",
"{",
"logDialogActivity",
"(",
"activity",
",",
"fragment",
",",
"getEventName",
"(",
"appCall",
".",
"getRequestIntent",
"(",
")",
")",
",",
"AnalyticsEvents",
".",
"PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED",
")",
";",
... | Launches an activity in the Facebook application to present the desired dialog. This method returns a
PendingCall that contains a unique ID associated with this call to the Facebook application. In general,
a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure
proper pr... | [
"Launches",
"an",
"activity",
"in",
"the",
"Facebook",
"application",
"to",
"present",
"the",
"desired",
"dialog",
".",
"This",
"method",
"returns",
"a",
"PendingCall",
"that",
"contains",
"a",
"unique",
"ID",
"associated",
"with",
"this",
"call",
"to",
"the",... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookDialog.java#L304-L322 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookDialog.java | FacebookDialog.handleActivityResult | public static boolean handleActivityResult(Context context, PendingCall appCall, int requestCode, Intent data,
Callback callback) {
if (requestCode != appCall.getRequestCode()) {
return false;
}
if (attachmentStore != null) {
attachmentStore.cleanupAttachment... | java | public static boolean handleActivityResult(Context context, PendingCall appCall, int requestCode, Intent data,
Callback callback) {
if (requestCode != appCall.getRequestCode()) {
return false;
}
if (attachmentStore != null) {
attachmentStore.cleanupAttachment... | [
"public",
"static",
"boolean",
"handleActivityResult",
"(",
"Context",
"context",
",",
"PendingCall",
"appCall",
",",
"int",
"requestCode",
",",
"Intent",
"data",
",",
"Callback",
"callback",
")",
"{",
"if",
"(",
"requestCode",
"!=",
"appCall",
".",
"getRequestC... | Parses the results of a dialog activity and calls the appropriate method on the provided Callback.
@param context the Context that is handling the activity result
@param appCall an PendingCall containing the call ID and original Intent used to launch the dialog
@param requestCode the request code for the activ... | [
"Parses",
"the",
"results",
"of",
"a",
"dialog",
"activity",
"and",
"calls",
"the",
"appropriate",
"method",
"on",
"the",
"provided",
"Callback",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookDialog.java#L334-L356 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookDialog.java | FacebookDialog.canPresentShareDialog | public static boolean canPresentShareDialog(Context context, ShareDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(ShareDialogFeature.SHARE_DIALOG, features));
} | java | public static boolean canPresentShareDialog(Context context, ShareDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(ShareDialogFeature.SHARE_DIALOG, features));
} | [
"public",
"static",
"boolean",
"canPresentShareDialog",
"(",
"Context",
"context",
",",
"ShareDialogFeature",
"...",
"features",
")",
"{",
"return",
"handleCanPresent",
"(",
"context",
",",
"EnumSet",
".",
"of",
"(",
"ShareDialogFeature",
".",
"SHARE_DIALOG",
",",
... | Determines whether the version of the Facebook application installed on the user's device is recent
enough to support specific features of the native Share dialog, which in turn may be used to determine
which UI, etc., to present to the user.
@param context the calling Context
@param features zero or more features to... | [
"Determines",
"whether",
"the",
"version",
"of",
"the",
"Facebook",
"application",
"installed",
"on",
"the",
"user",
"s",
"device",
"is",
"recent",
"enough",
"to",
"support",
"specific",
"features",
"of",
"the",
"native",
"Share",
"dialog",
"which",
"in",
"tur... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookDialog.java#L369-L371 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookDialog.java | FacebookDialog.canPresentMessageDialog | public static boolean canPresentMessageDialog(Context context, MessageDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(MessageDialogFeature.MESSAGE_DIALOG, features));
} | java | public static boolean canPresentMessageDialog(Context context, MessageDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(MessageDialogFeature.MESSAGE_DIALOG, features));
} | [
"public",
"static",
"boolean",
"canPresentMessageDialog",
"(",
"Context",
"context",
",",
"MessageDialogFeature",
"...",
"features",
")",
"{",
"return",
"handleCanPresent",
"(",
"context",
",",
"EnumSet",
".",
"of",
"(",
"MessageDialogFeature",
".",
"MESSAGE_DIALOG",
... | Determines whether the version of the Facebook application installed on the user's device is recent
enough to support specific features of the native Message dialog, which in turn may be used to determine
which UI, etc., to present to the user.
@param context the calling Context
@param features zero or more features ... | [
"Determines",
"whether",
"the",
"version",
"of",
"the",
"Facebook",
"application",
"installed",
"on",
"the",
"user",
"s",
"device",
"is",
"recent",
"enough",
"to",
"support",
"specific",
"features",
"of",
"the",
"native",
"Message",
"dialog",
"which",
"in",
"t... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookDialog.java#L384-L386 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookDialog.java | FacebookDialog.canPresentOpenGraphActionDialog | public static boolean canPresentOpenGraphActionDialog(Context context, OpenGraphActionDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(OpenGraphActionDialogFeature.OG_ACTION_DIALOG, features));
} | java | public static boolean canPresentOpenGraphActionDialog(Context context, OpenGraphActionDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(OpenGraphActionDialogFeature.OG_ACTION_DIALOG, features));
} | [
"public",
"static",
"boolean",
"canPresentOpenGraphActionDialog",
"(",
"Context",
"context",
",",
"OpenGraphActionDialogFeature",
"...",
"features",
")",
"{",
"return",
"handleCanPresent",
"(",
"context",
",",
"EnumSet",
".",
"of",
"(",
"OpenGraphActionDialogFeature",
"... | Determines whether the version of the Facebook application installed on the user's device is recent
enough to support specific features of the native Open Graph action dialog, which in turn may be used to
determine which UI, etc., to present to the user.
@param context the calling Context
@param features zero or more... | [
"Determines",
"whether",
"the",
"version",
"of",
"the",
"Facebook",
"application",
"installed",
"on",
"the",
"user",
"s",
"device",
"is",
"recent",
"enough",
"to",
"support",
"specific",
"features",
"of",
"the",
"native",
"Open",
"Graph",
"action",
"dialog",
"... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookDialog.java#L399-L401 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookDialog.java | FacebookDialog.canPresentOpenGraphMessageDialog | public static boolean canPresentOpenGraphMessageDialog(Context context, OpenGraphMessageDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(OpenGraphMessageDialogFeature.OG_MESSAGE_DIALOG, features));
} | java | public static boolean canPresentOpenGraphMessageDialog(Context context, OpenGraphMessageDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(OpenGraphMessageDialogFeature.OG_MESSAGE_DIALOG, features));
} | [
"public",
"static",
"boolean",
"canPresentOpenGraphMessageDialog",
"(",
"Context",
"context",
",",
"OpenGraphMessageDialogFeature",
"...",
"features",
")",
"{",
"return",
"handleCanPresent",
"(",
"context",
",",
"EnumSet",
".",
"of",
"(",
"OpenGraphMessageDialogFeature",
... | Determines whether the version of the Facebook application installed on the user's device is recent
enough to support specific features of the native Open Graph Message dialog, which in turn may be used to
determine which UI, etc., to present to the user.
@param context the calling Context
@param features zero or mor... | [
"Determines",
"whether",
"the",
"version",
"of",
"the",
"Facebook",
"application",
"installed",
"on",
"the",
"user",
"s",
"device",
"is",
"recent",
"enough",
"to",
"support",
"specific",
"features",
"of",
"the",
"native",
"Open",
"Graph",
"Message",
"dialog",
... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookDialog.java#L414-L416 | train |
anotheria/configureme | src/main/java/org/configureme/environments/LocaleBasedEnvironment.java | LocaleBasedEnvironment.reduceVariant | private static String reduceVariant(final String variant){
if (isEmpty(variant))
throw new AssertionError("Shouldn't happen, can't reduce non existent variant");
int indexOfUnderscore = variant.lastIndexOf('_');
if (indexOfUnderscore==-1)
return "";
return variant.substring(0, indexOfUnderscore);
} | java | private static String reduceVariant(final String variant){
if (isEmpty(variant))
throw new AssertionError("Shouldn't happen, can't reduce non existent variant");
int indexOfUnderscore = variant.lastIndexOf('_');
if (indexOfUnderscore==-1)
return "";
return variant.substring(0, indexOfUnderscore);
} | [
"private",
"static",
"String",
"reduceVariant",
"(",
"final",
"String",
"variant",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"variant",
")",
")",
"throw",
"new",
"AssertionError",
"(",
"\"Shouldn't happen, can't reduce non existent variant\"",
")",
";",
"int",
"indexOfUn... | This function is used internally to reduce the variant -> a_b_c -> a_b.
@param variant the variant to reduce
@return reduced variant | [
"This",
"function",
"is",
"used",
"internally",
"to",
"reduce",
"the",
"variant",
"-",
">",
"a_b_c",
"-",
">",
"a_b",
"."
] | 1f52dd9109349623190586bdf5a592de8016e1fa | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/environments/LocaleBasedEnvironment.java#L146-L154 | train |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/TypedIdKey.java | TypedIdKey.associate | @SuppressWarnings({ "unchecked" })
public static <V> V associate(Associator associator, Serializable id,
V value) {
associator.setAssociated(
new TypedIdKey<V>((Class<V>) value.getClass(), id), value);
return value;
} | java | @SuppressWarnings({ "unchecked" })
public static <V> V associate(Associator associator, Serializable id,
V value) {
associator.setAssociated(
new TypedIdKey<V>((Class<V>) value.getClass(), id), value);
return value;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"V",
">",
"V",
"associate",
"(",
"Associator",
"associator",
",",
"Serializable",
"id",
",",
"V",
"value",
")",
"{",
"associator",
".",
"setAssociated",
"(",
"new",
"Typ... | Associates the given value's type and the id with the given value
using the given associator.
@param <V> the value type
@param associator the associator
@param id the id
@param value the value
@return the value for easy chaining | [
"Associates",
"the",
"given",
"value",
"s",
"type",
"and",
"the",
"id",
"with",
"the",
"given",
"value",
"using",
"the",
"given",
"associator",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/TypedIdKey.java#L53-L59 | train |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/TypedIdKey.java | TypedIdKey.put | @SuppressWarnings({ "unchecked" })
public static <V> V put(Map<? super TypedIdKey<V>, ? super V> map,
Serializable id, V value) {
map.put(new TypedIdKey<V>((Class<V>) value.getClass(), id), value);
return value;
} | java | @SuppressWarnings({ "unchecked" })
public static <V> V put(Map<? super TypedIdKey<V>, ? super V> map,
Serializable id, V value) {
map.put(new TypedIdKey<V>((Class<V>) value.getClass(), id), value);
return value;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"V",
">",
"V",
"put",
"(",
"Map",
"<",
"?",
"super",
"TypedIdKey",
"<",
"V",
">",
",",
"?",
"super",
"V",
">",
"map",
",",
"Serializable",
"id",
",",
"V",
"value... | Associates the given value's type and the id with the given value
using the given map.
@param <V> the value type
@param map the map
@param id the id
@param value the value
@return the value for easy chaining | [
"Associates",
"the",
"given",
"value",
"s",
"type",
"and",
"the",
"id",
"with",
"the",
"given",
"value",
"using",
"the",
"given",
"map",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/TypedIdKey.java#L71-L76 | train |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/TypedIdKey.java | TypedIdKey.associated | public static <V> Optional<V> associated(Associator associator,
Class<V> type, Serializable id) {
return associator.associated(new TypedIdKey<>(type, id), type);
} | java | public static <V> Optional<V> associated(Associator associator,
Class<V> type, Serializable id) {
return associator.associated(new TypedIdKey<>(type, id), type);
} | [
"public",
"static",
"<",
"V",
">",
"Optional",
"<",
"V",
">",
"associated",
"(",
"Associator",
"associator",
",",
"Class",
"<",
"V",
">",
"type",
",",
"Serializable",
"id",
")",
"{",
"return",
"associator",
".",
"associated",
"(",
"new",
"TypedIdKey",
"<... | Retrieves a value with the given type and id from the given associator.
@param <V> the value type
@param associator the associator
@param type the type
@param id the id
@return the associated value, if any | [
"Retrieves",
"a",
"value",
"with",
"the",
"given",
"type",
"and",
"id",
"from",
"the",
"given",
"associator",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/TypedIdKey.java#L87-L90 | train |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/TypedIdKey.java | TypedIdKey.get | @SuppressWarnings({ "unchecked" })
public static <V> Optional<V> get(Map<?, ?> map, Class<V> type,
Serializable id) {
return Optional
.ofNullable((V) map.get(new TypedIdKey<>(type, id)));
} | java | @SuppressWarnings({ "unchecked" })
public static <V> Optional<V> get(Map<?, ?> map, Class<V> type,
Serializable id) {
return Optional
.ofNullable((V) map.get(new TypedIdKey<>(type, id)));
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"V",
">",
"Optional",
"<",
"V",
">",
"get",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Class",
"<",
"V",
">",
"type",
",",
"Serializable",
"id",
")",
"{... | Retrieves a value with the given type and id from the given map.
@param <V> the value type
@param map the map
@param type the type
@param id the id
@return the associated value, if any | [
"Retrieves",
"a",
"value",
"with",
"the",
"given",
"type",
"and",
"id",
"from",
"the",
"given",
"map",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/TypedIdKey.java#L101-L106 | train |
ologolo/streamline-api | src/org/daisy/streamline/api/media/BaseFolder.java | BaseFolder.with | public static BaseFolder with(String first, String... more) {
return new BaseFolder(Paths.get(first, more));
} | java | public static BaseFolder with(String first, String... more) {
return new BaseFolder(Paths.get(first, more));
} | [
"public",
"static",
"BaseFolder",
"with",
"(",
"String",
"first",
",",
"String",
"...",
"more",
")",
"{",
"return",
"new",
"BaseFolder",
"(",
"Paths",
".",
"get",
"(",
"first",
",",
"more",
")",
")",
";",
"}"
] | Creates a new base folder at the specified location.
@param first the path string or initial part of the path string
@param more additional strings to be joined to form the path string
@return the new instance | [
"Creates",
"a",
"new",
"base",
"folder",
"at",
"the",
"specified",
"location",
"."
] | 4934b6da1de06e364ae90d6ea9b0929500da9cdb | https://github.com/ologolo/streamline-api/blob/4934b6da1de06e364ae90d6ea9b0929500da9cdb/src/org/daisy/streamline/api/media/BaseFolder.java#L33-L35 | train |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/internal/GeneratorRegistry.java | GeneratorRegistry.add | @SuppressWarnings({ "PMD.GuardLogStatement", "PMD.AvoidDuplicateLiterals" })
public void add(Object obj) {
synchronized (this) {
running += 1;
if (generators != null) {
generators.put(obj, null);
generatorTracking.finest(() -> "Added generator " + obj
... | java | @SuppressWarnings({ "PMD.GuardLogStatement", "PMD.AvoidDuplicateLiterals" })
public void add(Object obj) {
synchronized (this) {
running += 1;
if (generators != null) {
generators.put(obj, null);
generatorTracking.finest(() -> "Added generator " + obj
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"PMD.GuardLogStatement\"",
",",
"\"PMD.AvoidDuplicateLiterals\"",
"}",
")",
"public",
"void",
"add",
"(",
"Object",
"obj",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"running",
"+=",
"1",
";",
"if",
"(",
"generators",... | Adds a generator.
@param obj the obj | [
"Adds",
"a",
"generator",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/internal/GeneratorRegistry.java#L72-L98 | train |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/internal/GeneratorRegistry.java | GeneratorRegistry.remove | @SuppressWarnings("PMD.GuardLogStatement")
public void remove(Object obj) {
synchronized (this) {
running -= 1;
if (generators != null) {
generators.remove(obj);
generatorTracking.finest(() -> "Removed generator " + obj
+ ", " + gen... | java | @SuppressWarnings("PMD.GuardLogStatement")
public void remove(Object obj) {
synchronized (this) {
running -= 1;
if (generators != null) {
generators.remove(obj);
generatorTracking.finest(() -> "Removed generator " + obj
+ ", " + gen... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.GuardLogStatement\"",
")",
"public",
"void",
"remove",
"(",
"Object",
"obj",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"running",
"-=",
"1",
";",
"if",
"(",
"generators",
"!=",
"null",
")",
"{",
"generators",
"."... | Removes the generator.
@param obj the generator | [
"Removes",
"the",
"generator",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/internal/GeneratorRegistry.java#L105-L122 | train |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/internal/GeneratorRegistry.java | GeneratorRegistry.awaitExhaustion | @SuppressWarnings({ "PMD.CollapsibleIfStatements",
"PMD.GuardLogStatement" })
public void awaitExhaustion() throws InterruptedException {
synchronized (this) {
if (generators != null) {
if (running != generators.size()) {
generatorTracking
... | java | @SuppressWarnings({ "PMD.CollapsibleIfStatements",
"PMD.GuardLogStatement" })
public void awaitExhaustion() throws InterruptedException {
synchronized (this) {
if (generators != null) {
if (running != generators.size()) {
generatorTracking
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"PMD.CollapsibleIfStatements\"",
",",
"\"PMD.GuardLogStatement\"",
"}",
")",
"public",
"void",
"awaitExhaustion",
"(",
")",
"throws",
"InterruptedException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"generators",
"!... | Await exhaustion.
@throws InterruptedException the interrupted exception | [
"Await",
"exhaustion",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/internal/GeneratorRegistry.java#L138-L162 | train |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/internal/GeneratorRegistry.java | GeneratorRegistry.awaitExhaustion | @SuppressWarnings({ "PMD.CollapsibleIfStatements",
"PMD.GuardLogStatement" })
public boolean awaitExhaustion(long timeout)
throws InterruptedException {
synchronized (this) {
if (generators != null) {
if (running != generators.size()) {
gen... | java | @SuppressWarnings({ "PMD.CollapsibleIfStatements",
"PMD.GuardLogStatement" })
public boolean awaitExhaustion(long timeout)
throws InterruptedException {
synchronized (this) {
if (generators != null) {
if (running != generators.size()) {
gen... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"PMD.CollapsibleIfStatements\"",
",",
"\"PMD.GuardLogStatement\"",
"}",
")",
"public",
"boolean",
"awaitExhaustion",
"(",
"long",
"timeout",
")",
"throws",
"InterruptedException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
... | Await exhaustion with a timeout.
@param timeout the timeout
@return true, if successful
@throws InterruptedException the interrupted exception | [
"Await",
"exhaustion",
"with",
"a",
"timeout",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/internal/GeneratorRegistry.java#L171-L196 | train |
ologolo/streamline-api | src/org/daisy/streamline/api/tasks/TaskSystemInformation.java | TaskSystemInformation.matchesLocale | public boolean matchesLocale(String loc) {
return getLocale()==null || (getLocale().isPresent() && getLocale().get().startsWith(loc));
} | java | public boolean matchesLocale(String loc) {
return getLocale()==null || (getLocale().isPresent() && getLocale().get().startsWith(loc));
} | [
"public",
"boolean",
"matchesLocale",
"(",
"String",
"loc",
")",
"{",
"return",
"getLocale",
"(",
")",
"==",
"null",
"||",
"(",
"getLocale",
"(",
")",
".",
"isPresent",
"(",
")",
"&&",
"getLocale",
"(",
")",
".",
"get",
"(",
")",
".",
"startsWith",
"... | Returns true if the information matches the specified locale.
@param loc the locale to test
@return returns true if the information is a match for the locale, false otherwise | [
"Returns",
"true",
"if",
"the",
"information",
"matches",
"the",
"specified",
"locale",
"."
] | 4934b6da1de06e364ae90d6ea9b0929500da9cdb | https://github.com/ologolo/streamline-api/blob/4934b6da1de06e364ae90d6ea9b0929500da9cdb/src/org/daisy/streamline/api/tasks/TaskSystemInformation.java#L93-L95 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newPostRequest | public static Request newPostRequest(Session session, String graphPath, GraphObject graphObject, Callback callback) {
Request request = new Request(session, graphPath, null, HttpMethod.POST , callback);
request.setGraphObject(graphObject);
return request;
} | java | public static Request newPostRequest(Session session, String graphPath, GraphObject graphObject, Callback callback) {
Request request = new Request(session, graphPath, null, HttpMethod.POST , callback);
request.setGraphObject(graphObject);
return request;
} | [
"public",
"static",
"Request",
"newPostRequest",
"(",
"Session",
"session",
",",
"String",
"graphPath",
",",
"GraphObject",
"graphObject",
",",
"Callback",
"callback",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"session",
",",
"graphPath",
",",
... | Creates a new Request configured to post a GraphObject to a particular graph path, to either create or update the
object at that path.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param graphPath
the graph path to retrieve, create, or delete
@param graphObject
the Gr... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"post",
"a",
"GraphObject",
"to",
"a",
"particular",
"graph",
"path",
"to",
"either",
"create",
"or",
"update",
"the",
"object",
"at",
"that",
"path",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L260-L264 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newMeRequest | public static Request newMeRequest(Session session, final GraphUserCallback callback) {
Callback wrapper = new Callback() {
@Override
public void onCompleted(Response response) {
if (callback != null) {
callback.onCompleted(response.getGraphObjectAs(Gr... | java | public static Request newMeRequest(Session session, final GraphUserCallback callback) {
Callback wrapper = new Callback() {
@Override
public void onCompleted(Response response) {
if (callback != null) {
callback.onCompleted(response.getGraphObjectAs(Gr... | [
"public",
"static",
"Request",
"newMeRequest",
"(",
"Session",
"session",
",",
"final",
"GraphUserCallback",
"callback",
")",
"{",
"Callback",
"wrapper",
"=",
"new",
"Callback",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onCompleted",
"(",
"Response",
... | Creates a new Request configured to retrieve a user's own profile.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param callback
a callback that will be called when the request is completed to handle success or error conditions
@return a Request that is ready to execut... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"retrieve",
"a",
"user",
"s",
"own",
"profile",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L275-L285 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newMyFriendsRequest | public static Request newMyFriendsRequest(Session session, final GraphUserListCallback callback) {
Callback wrapper = new Callback() {
@Override
public void onCompleted(Response response) {
if (callback != null) {
callback.onCompleted(typedListFromResp... | java | public static Request newMyFriendsRequest(Session session, final GraphUserListCallback callback) {
Callback wrapper = new Callback() {
@Override
public void onCompleted(Response response) {
if (callback != null) {
callback.onCompleted(typedListFromResp... | [
"public",
"static",
"Request",
"newMyFriendsRequest",
"(",
"Session",
"session",
",",
"final",
"GraphUserListCallback",
"callback",
")",
"{",
"Callback",
"wrapper",
"=",
"new",
"Callback",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onCompleted",
"(",
"Re... | Creates a new Request configured to retrieve a user's friend list.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param callback
a callback that will be called when the request is completed to handle success or error conditions
@return a Request that is ready to execut... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"retrieve",
"a",
"user",
"s",
"friend",
"list",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L296-L306 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newUploadPhotoRequest | public static Request newUploadPhotoRequest(Session session, Bitmap image, Callback callback) {
Bundle parameters = new Bundle(1);
parameters.putParcelable(PICTURE_PARAM, image);
return new Request(session, MY_PHOTOS, parameters, HttpMethod.POST, callback);
} | java | public static Request newUploadPhotoRequest(Session session, Bitmap image, Callback callback) {
Bundle parameters = new Bundle(1);
parameters.putParcelable(PICTURE_PARAM, image);
return new Request(session, MY_PHOTOS, parameters, HttpMethod.POST, callback);
} | [
"public",
"static",
"Request",
"newUploadPhotoRequest",
"(",
"Session",
"session",
",",
"Bitmap",
"image",
",",
"Callback",
"callback",
")",
"{",
"Bundle",
"parameters",
"=",
"new",
"Bundle",
"(",
"1",
")",
";",
"parameters",
".",
"putParcelable",
"(",
"PICTUR... | Creates a new Request configured to upload a photo to the user's default photo album.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param image
the image to upload
@param callback
a callback that will be called when the request is completed to handle success or error ... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"upload",
"a",
"photo",
"to",
"the",
"user",
"s",
"default",
"photo",
"album",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L319-L324 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newUploadPhotoRequest | public static Request newUploadPhotoRequest(Session session, File file,
Callback callback) throws FileNotFoundException {
ParcelFileDescriptor descriptor = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
Bundle parameters = new Bundle(1);
parameters.putParcelabl... | java | public static Request newUploadPhotoRequest(Session session, File file,
Callback callback) throws FileNotFoundException {
ParcelFileDescriptor descriptor = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
Bundle parameters = new Bundle(1);
parameters.putParcelabl... | [
"public",
"static",
"Request",
"newUploadPhotoRequest",
"(",
"Session",
"session",
",",
"File",
"file",
",",
"Callback",
"callback",
")",
"throws",
"FileNotFoundException",
"{",
"ParcelFileDescriptor",
"descriptor",
"=",
"ParcelFileDescriptor",
".",
"open",
"(",
"file... | Creates a new Request configured to upload a photo to the user's default photo album. The photo
will be read from the specified stream.
@param session the Session to use, or null; if non-null, the session must be in an opened state
@param file the file containing the photo to upload
@param callback a callback tha... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"upload",
"a",
"photo",
"to",
"the",
"user",
"s",
"default",
"photo",
"album",
".",
"The",
"photo",
"will",
"be",
"read",
"from",
"the",
"specified",
"stream",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L335-L342 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newUploadVideoRequest | public static Request newUploadVideoRequest(Session session, File file,
Callback callback) throws FileNotFoundException {
ParcelFileDescriptor descriptor = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
Bundle parameters = new Bundle(1);
parameters.putParcelabl... | java | public static Request newUploadVideoRequest(Session session, File file,
Callback callback) throws FileNotFoundException {
ParcelFileDescriptor descriptor = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
Bundle parameters = new Bundle(1);
parameters.putParcelabl... | [
"public",
"static",
"Request",
"newUploadVideoRequest",
"(",
"Session",
"session",
",",
"File",
"file",
",",
"Callback",
"callback",
")",
"throws",
"FileNotFoundException",
"{",
"ParcelFileDescriptor",
"descriptor",
"=",
"ParcelFileDescriptor",
".",
"open",
"(",
"file... | Creates a new Request configured to upload a photo to the user's default photo album. The photo
will be read from the specified file descriptor.
@param session the Session to use, or null; if non-null, the session must be in an opened state
@param file the file to upload
@param callback a callback that will be ca... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"upload",
"a",
"photo",
"to",
"the",
"user",
"s",
"default",
"photo",
"album",
".",
"The",
"photo",
"will",
"be",
"read",
"from",
"the",
"specified",
"file",
"descriptor",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L353-L360 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newGraphPathRequest | public static Request newGraphPathRequest(Session session, String graphPath, Callback callback) {
return new Request(session, graphPath, null, null, callback);
} | java | public static Request newGraphPathRequest(Session session, String graphPath, Callback callback) {
return new Request(session, graphPath, null, null, callback);
} | [
"public",
"static",
"Request",
"newGraphPathRequest",
"(",
"Session",
"session",
",",
"String",
"graphPath",
",",
"Callback",
"callback",
")",
"{",
"return",
"new",
"Request",
"(",
"session",
",",
"graphPath",
",",
"null",
",",
"null",
",",
"callback",
")",
... | Creates a new Request configured to retrieve a particular graph path.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param graphPath
the graph path to retrieve
@param callback
a callback that will be called when the request is completed to handle success or error condi... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"retrieve",
"a",
"particular",
"graph",
"path",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L373-L375 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newPlacesSearchRequest | public static Request newPlacesSearchRequest(Session session, Location location, int radiusInMeters,
int resultsLimit, String searchText, final GraphPlaceListCallback callback) {
if (location == null && Utility.isNullOrEmpty(searchText)) {
throw new FacebookException("Either location or ... | java | public static Request newPlacesSearchRequest(Session session, Location location, int radiusInMeters,
int resultsLimit, String searchText, final GraphPlaceListCallback callback) {
if (location == null && Utility.isNullOrEmpty(searchText)) {
throw new FacebookException("Either location or ... | [
"public",
"static",
"Request",
"newPlacesSearchRequest",
"(",
"Session",
"session",
",",
"Location",
"location",
",",
"int",
"radiusInMeters",
",",
"int",
"resultsLimit",
",",
"String",
"searchText",
",",
"final",
"GraphPlaceListCallback",
"callback",
")",
"{",
"if"... | Creates a new Request that is configured to perform a search for places near a specified location via the Graph
API. At least one of location or searchText must be specified.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param location
the location around which to sea... | [
"Creates",
"a",
"new",
"Request",
"that",
"is",
"configured",
"to",
"perform",
"a",
"search",
"for",
"places",
"near",
"a",
"specified",
"location",
"via",
"the",
"Graph",
"API",
".",
"At",
"least",
"one",
"of",
"location",
"or",
"searchText",
"must",
"be"... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L399-L427 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newPostOpenGraphActionRequest | public static Request newPostOpenGraphActionRequest(Session session, OpenGraphAction openGraphAction,
Callback callback) {
if (openGraphAction == null) {
throw new FacebookException("openGraphAction cannot be null");
}
if (Utility.isNullOrEmpty(openGraphAction.getType()))... | java | public static Request newPostOpenGraphActionRequest(Session session, OpenGraphAction openGraphAction,
Callback callback) {
if (openGraphAction == null) {
throw new FacebookException("openGraphAction cannot be null");
}
if (Utility.isNullOrEmpty(openGraphAction.getType()))... | [
"public",
"static",
"Request",
"newPostOpenGraphActionRequest",
"(",
"Session",
"session",
",",
"OpenGraphAction",
"openGraphAction",
",",
"Callback",
"callback",
")",
"{",
"if",
"(",
"openGraphAction",
"==",
"null",
")",
"{",
"throw",
"new",
"FacebookException",
"(... | Creates a new Request configured to publish an Open Graph action.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param openGraphAction
the Open Graph object to create; must not be null, and must have a non-empty 'type'
@param callback
a callback that will be called whe... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"publish",
"an",
"Open",
"Graph",
"action",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L742-L753 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newDeleteObjectRequest | public static Request newDeleteObjectRequest(Session session, String id, Callback callback) {
return new Request(session, id, null, HttpMethod.DELETE, callback);
} | java | public static Request newDeleteObjectRequest(Session session, String id, Callback callback) {
return new Request(session, id, null, HttpMethod.DELETE, callback);
} | [
"public",
"static",
"Request",
"newDeleteObjectRequest",
"(",
"Session",
"session",
",",
"String",
"id",
",",
"Callback",
"callback",
")",
"{",
"return",
"new",
"Request",
"(",
"session",
",",
"id",
",",
"null",
",",
"HttpMethod",
".",
"DELETE",
",",
"callba... | Creates a new Request configured to delete a resource through the Graph API.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param id
the id of the object to delete
@param callback
a callback that will be called when the request is completed to handle success or error c... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"delete",
"a",
"resource",
"through",
"the",
"Graph",
"API",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L766-L768 | train |
anotheria/configureme | src/main/java/org/configureme/sources/ConfigurationSourceKey.java | ConfigurationSourceKey.propertyFile | public static final ConfigurationSourceKey propertyFile(final String name){
return new ConfigurationSourceKey(Type.FILE, Format.PROPERTIES, name);
} | java | public static final ConfigurationSourceKey propertyFile(final String name){
return new ConfigurationSourceKey(Type.FILE, Format.PROPERTIES, name);
} | [
"public",
"static",
"final",
"ConfigurationSourceKey",
"propertyFile",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"ConfigurationSourceKey",
"(",
"Type",
".",
"FILE",
",",
"Format",
".",
"PROPERTIES",
",",
"name",
")",
";",
"}"
] | Creates a new configuration source key for property files.
@param name name of the property file.
@return a new configuration source key instance for property files | [
"Creates",
"a",
"new",
"configuration",
"source",
"key",
"for",
"property",
"files",
"."
] | 1f52dd9109349623190586bdf5a592de8016e1fa | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/sources/ConfigurationSourceKey.java#L201-L203 | train |
anotheria/configureme | src/main/java/org/configureme/sources/ConfigurationSourceKey.java | ConfigurationSourceKey.xmlFile | public static final ConfigurationSourceKey xmlFile(final String name){
return new ConfigurationSourceKey(Type.FILE, Format.XML, name);
} | java | public static final ConfigurationSourceKey xmlFile(final String name){
return new ConfigurationSourceKey(Type.FILE, Format.XML, name);
} | [
"public",
"static",
"final",
"ConfigurationSourceKey",
"xmlFile",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"ConfigurationSourceKey",
"(",
"Type",
".",
"FILE",
",",
"Format",
".",
"XML",
",",
"name",
")",
";",
"}"
] | Creates a new configuration source key for xml files.
@param name name of the xml file.
@return a new configuration source key instance for xml files | [
"Creates",
"a",
"new",
"configuration",
"source",
"key",
"for",
"xml",
"files",
"."
] | 1f52dd9109349623190586bdf5a592de8016e1fa | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/sources/ConfigurationSourceKey.java#L211-L213 | train |
anotheria/configureme | src/main/java/org/configureme/sources/ConfigurationSourceKey.java | ConfigurationSourceKey.jsonFile | public static final ConfigurationSourceKey jsonFile(final String name){
return new ConfigurationSourceKey(Type.FILE, Format.JSON, name);
} | java | public static final ConfigurationSourceKey jsonFile(final String name){
return new ConfigurationSourceKey(Type.FILE, Format.JSON, name);
} | [
"public",
"static",
"final",
"ConfigurationSourceKey",
"jsonFile",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"ConfigurationSourceKey",
"(",
"Type",
".",
"FILE",
",",
"Format",
".",
"JSON",
",",
"name",
")",
";",
"}"
] | Creates a new configuration source key for json files.
@param name name of the json file.
@return a new configuration source key instance for json files | [
"Creates",
"a",
"new",
"configuration",
"source",
"key",
"for",
"json",
"files",
"."
] | 1f52dd9109349623190586bdf5a592de8016e1fa | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/sources/ConfigurationSourceKey.java#L221-L223 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/internal/Utility.java | Utility.isSubset | public static <T> boolean isSubset(Collection<T> subset, Collection<T> superset) {
if ((superset == null) || (superset.size() == 0)) {
return ((subset == null) || (subset.size() == 0));
}
HashSet<T> hash = new HashSet<T>(superset);
for (T t : subset) {
if (!hash.... | java | public static <T> boolean isSubset(Collection<T> subset, Collection<T> superset) {
if ((superset == null) || (superset.size() == 0)) {
return ((subset == null) || (subset.size() == 0));
}
HashSet<T> hash = new HashSet<T>(superset);
for (T t : subset) {
if (!hash.... | [
"public",
"static",
"<",
"T",
">",
"boolean",
"isSubset",
"(",
"Collection",
"<",
"T",
">",
"subset",
",",
"Collection",
"<",
"T",
">",
"superset",
")",
"{",
"if",
"(",
"(",
"superset",
"==",
"null",
")",
"||",
"(",
"superset",
".",
"size",
"(",
")... | the same. | [
"the",
"same",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/internal/Utility.java#L116-L128 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/internal/ImageResponseCache.java | ImageResponseCache.getCachedImageStream | static InputStream getCachedImageStream(URI url, Context context) {
InputStream imageStream = null;
if (url != null) {
if (isCDNURL(url)) {
try {
FileLruCache cache = getCache(context);
imageStream = cache.get(url.toString());
... | java | static InputStream getCachedImageStream(URI url, Context context) {
InputStream imageStream = null;
if (url != null) {
if (isCDNURL(url)) {
try {
FileLruCache cache = getCache(context);
imageStream = cache.get(url.toString());
... | [
"static",
"InputStream",
"getCachedImageStream",
"(",
"URI",
"url",
",",
"Context",
"context",
")",
"{",
"InputStream",
"imageStream",
"=",
"null",
";",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"if",
"(",
"isCDNURL",
"(",
"url",
")",
")",
"{",
"try",
... | Does not throw if there was an error. | [
"Does",
"not",
"throw",
"if",
"there",
"was",
"an",
"error",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/internal/ImageResponseCache.java#L45-L59 | train |
anotheria/configureme | src/main/java/org/configureme/environments/DynamicEnvironment.java | DynamicEnvironment.reduceThis | public void reduceThis(){
if (elements==null || elements.isEmpty())
throw new AssertionError("Can't reduce this environment");
elements.remove(elements.size()-1);
} | java | public void reduceThis(){
if (elements==null || elements.isEmpty())
throw new AssertionError("Can't reduce this environment");
elements.remove(elements.size()-1);
} | [
"public",
"void",
"reduceThis",
"(",
")",
"{",
"if",
"(",
"elements",
"==",
"null",
"||",
"elements",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"AssertionError",
"(",
"\"Can't reduce this environment\"",
")",
";",
"elements",
".",
"remove",
"(",
"elemen... | Reduces current environment. Modifies current object, hence NOT THREADSAFE. | [
"Reduces",
"current",
"environment",
".",
"Modifies",
"current",
"object",
"hence",
"NOT",
"THREADSAFE",
"."
] | 1f52dd9109349623190586bdf5a592de8016e1fa | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/environments/DynamicEnvironment.java#L100-L104 | train |
anotheria/configureme | src/main/java/org/configureme/environments/DynamicEnvironment.java | DynamicEnvironment.parse | public static Environment parse(final String s){
if (s==null || s.isEmpty() || s.trim().isEmpty())
return GlobalEnvironment.INSTANCE;
final String[] tokens = StringUtils.tokenize(s, '_');
final DynamicEnvironment env = new DynamicEnvironment();
for (final String t : tokens) {
env.add(t);
... | java | public static Environment parse(final String s){
if (s==null || s.isEmpty() || s.trim().isEmpty())
return GlobalEnvironment.INSTANCE;
final String[] tokens = StringUtils.tokenize(s, '_');
final DynamicEnvironment env = new DynamicEnvironment();
for (final String t : tokens) {
env.add(t);
... | [
"public",
"static",
"Environment",
"parse",
"(",
"final",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"isEmpty",
"(",
")",
"||",
"s",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"return",
"GlobalEnvironment",
".... | Parses a string and creates a new Environment which corresponds the string.
@param s string to parse
@return new Environment which corresponds the string | [
"Parses",
"a",
"string",
"and",
"creates",
"a",
"new",
"Environment",
"which",
"corresponds",
"the",
"string",
"."
] | 1f52dd9109349623190586bdf5a592de8016e1fa | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/environments/DynamicEnvironment.java#L137-L146 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/internal/ImageDownloader.java | ImageDownloader.downloadAsync | public static void downloadAsync(ImageRequest request) {
if (request == null) {
return;
}
// NOTE: This is the ONLY place where the original request's Url is read. From here on,
// we will keep track of the Url separately. This is because we might be dealing with a
/... | java | public static void downloadAsync(ImageRequest request) {
if (request == null) {
return;
}
// NOTE: This is the ONLY place where the original request's Url is read. From here on,
// we will keep track of the Url separately. This is because we might be dealing with a
/... | [
"public",
"static",
"void",
"downloadAsync",
"(",
"ImageRequest",
"request",
")",
"{",
"if",
"(",
"request",
"==",
"null",
")",
"{",
"return",
";",
"}",
"// NOTE: This is the ONLY place where the original request's Url is read. From here on,",
"// we will keep track of the Ur... | Downloads the image specified in the passed in request.
If a callback is specified, it is guaranteed to be invoked on the calling thread.
@param request Request to process | [
"Downloads",
"the",
"image",
"specified",
"in",
"the",
"passed",
"in",
"request",
".",
"If",
"a",
"callback",
"is",
"specified",
"it",
"is",
"guaranteed",
"to",
"be",
"invoked",
"on",
"the",
"calling",
"thread",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/internal/ImageDownloader.java#L50-L71 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppEventsLogger.java | AppEventsLogger.newLogger | public static AppEventsLogger newLogger(Context context, String applicationId) {
return new AppEventsLogger(context, applicationId, null);
} | java | public static AppEventsLogger newLogger(Context context, String applicationId) {
return new AppEventsLogger(context, applicationId, null);
} | [
"public",
"static",
"AppEventsLogger",
"newLogger",
"(",
"Context",
"context",
",",
"String",
"applicationId",
")",
"{",
"return",
"new",
"AppEventsLogger",
"(",
"context",
",",
"applicationId",
",",
"null",
")",
";",
"}"
] | Build an AppEventsLogger instance to log events that are attributed to the application but not to
any particular Session.
@param context Used to access the attributionId for non-authenticated users.
@param applicationId Explicitly specified Facebook applicationId to log events against. If null, the default
app ... | [
"Build",
"an",
"AppEventsLogger",
"instance",
"to",
"log",
"events",
"that",
"are",
"attributed",
"to",
"the",
"application",
"but",
"not",
"to",
"any",
"particular",
"Session",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppEventsLogger.java#L385-L387 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppEventsLogger.java | AppEventsLogger.logEvent | public void logEvent(String eventName, Bundle parameters) {
logEvent(eventName, null, parameters, false);
} | java | public void logEvent(String eventName, Bundle parameters) {
logEvent(eventName, null, parameters, false);
} | [
"public",
"void",
"logEvent",
"(",
"String",
"eventName",
",",
"Bundle",
"parameters",
")",
"{",
"logEvent",
"(",
"eventName",
",",
"null",
",",
"parameters",
",",
"false",
")",
";",
"}"
] | Log an app event with the specified name and set of parameters.
@param eventName eventName used to denote the event. Choose amongst the EVENT_NAME_* constants in
{@link AppEventsConstants} when possible. Or create your own if none of the EVENT_NAME_*
constants are applicable.
Event names should be 40 characters or ... | [
"Log",
"an",
"app",
"event",
"with",
"the",
"specified",
"name",
"and",
"set",
"of",
"parameters",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppEventsLogger.java#L470-L472 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppEventsLogger.java | AppEventsLogger.logEvent | public void logEvent(String eventName, double valueToSum, Bundle parameters) {
logEvent(eventName, valueToSum, parameters, false);
} | java | public void logEvent(String eventName, double valueToSum, Bundle parameters) {
logEvent(eventName, valueToSum, parameters, false);
} | [
"public",
"void",
"logEvent",
"(",
"String",
"eventName",
",",
"double",
"valueToSum",
",",
"Bundle",
"parameters",
")",
"{",
"logEvent",
"(",
"eventName",
",",
"valueToSum",
",",
"parameters",
",",
"false",
")",
";",
"}"
] | Log an app event with the specified name, supplied value, and set of parameters.
@param eventName eventName used to denote the event. Choose amongst the EVENT_NAME_* constants in
{@link AppEventsConstants} when possible. Or create your own if none of the EVENT_NAME_*
constants are applicable.
Event names should be ... | [
"Log",
"an",
"app",
"event",
"with",
"the",
"specified",
"name",
"supplied",
"value",
"and",
"set",
"of",
"parameters",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppEventsLogger.java#L492-L494 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppEventsLogger.java | AppEventsLogger.logPurchase | public void logPurchase(BigDecimal purchaseAmount, Currency currency, Bundle parameters) {
if (purchaseAmount == null) {
notifyDeveloperError("purchaseAmount cannot be null");
return;
} else if (currency == null) {
notifyDeveloperError("currency cannot be null");
... | java | public void logPurchase(BigDecimal purchaseAmount, Currency currency, Bundle parameters) {
if (purchaseAmount == null) {
notifyDeveloperError("purchaseAmount cannot be null");
return;
} else if (currency == null) {
notifyDeveloperError("currency cannot be null");
... | [
"public",
"void",
"logPurchase",
"(",
"BigDecimal",
"purchaseAmount",
",",
"Currency",
"currency",
",",
"Bundle",
"parameters",
")",
"{",
"if",
"(",
"purchaseAmount",
"==",
"null",
")",
"{",
"notifyDeveloperError",
"(",
"\"purchaseAmount cannot be null\"",
")",
";",... | Logs a purchase event with Facebook, in the specified amount and with the specified currency. Additional
detail about the purchase can be passed in through the parameters bundle.
@param purchaseAmount Amount of purchase, in the currency specified by the 'currency' parameter. This value
will be rounded to the thousand... | [
"Logs",
"a",
"purchase",
"event",
"with",
"Facebook",
"in",
"the",
"specified",
"amount",
"and",
"with",
"the",
"specified",
"currency",
".",
"Additional",
"detail",
"about",
"the",
"purchase",
"can",
"be",
"passed",
"in",
"through",
"the",
"parameters",
"bund... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppEventsLogger.java#L517-L534 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppEventsLogger.java | AppEventsLogger.logSdkEvent | public void logSdkEvent(String eventName, Double valueToSum, Bundle parameters) {
logEvent(eventName, valueToSum, parameters, true);
} | java | public void logSdkEvent(String eventName, Double valueToSum, Bundle parameters) {
logEvent(eventName, valueToSum, parameters, true);
} | [
"public",
"void",
"logSdkEvent",
"(",
"String",
"eventName",
",",
"Double",
"valueToSum",
",",
"Bundle",
"parameters",
")",
"{",
"logEvent",
"(",
"eventName",
",",
"valueToSum",
",",
"parameters",
",",
"true",
")",
";",
"}"
] | This method is intended only for internal use by the Facebook SDK and other use is unsupported. | [
"This",
"method",
"is",
"intended",
"only",
"for",
"internal",
"use",
"by",
"the",
"Facebook",
"SDK",
"and",
"other",
"use",
"is",
"unsupported",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppEventsLogger.java#L564-L566 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppEventsLogger.java | AppEventsLogger.getSessionEventsState | private static SessionEventsState getSessionEventsState(Context context, AccessTokenAppIdPair accessTokenAppId) {
// Do this work outside of the lock to prevent deadlocks in implementation of
// AdvertisingIdClient.getAdvertisingIdInfo, because that implementation blocks waiting on the main thread,
... | java | private static SessionEventsState getSessionEventsState(Context context, AccessTokenAppIdPair accessTokenAppId) {
// Do this work outside of the lock to prevent deadlocks in implementation of
// AdvertisingIdClient.getAdvertisingIdInfo, because that implementation blocks waiting on the main thread,
... | [
"private",
"static",
"SessionEventsState",
"getSessionEventsState",
"(",
"Context",
"context",
",",
"AccessTokenAppIdPair",
"accessTokenAppId",
")",
"{",
"// Do this work outside of the lock to prevent deadlocks in implementation of",
"// AdvertisingIdClient.getAdvertisingIdInfo, because ... | Creates a new SessionEventsState if not already in the map. | [
"Creates",
"a",
"new",
"SessionEventsState",
"if",
"not",
"already",
"in",
"the",
"map",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppEventsLogger.java#L731-L751 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AppEventsLogger.java | AppEventsLogger.setSourceApplication | private static void setSourceApplication(Activity activity) {
ComponentName callingApplication = activity.getCallingActivity();
if (callingApplication != null) {
String callingApplicationPackage = callingApplication.getPackageName();
if (callingApplicationPackage.equals(activity... | java | private static void setSourceApplication(Activity activity) {
ComponentName callingApplication = activity.getCallingActivity();
if (callingApplication != null) {
String callingApplicationPackage = callingApplication.getPackageName();
if (callingApplicationPackage.equals(activity... | [
"private",
"static",
"void",
"setSourceApplication",
"(",
"Activity",
"activity",
")",
"{",
"ComponentName",
"callingApplication",
"=",
"activity",
".",
"getCallingActivity",
"(",
")",
";",
"if",
"(",
"callingApplication",
"!=",
"null",
")",
"{",
"String",
"callin... | Source Application setters and getters | [
"Source",
"Application",
"setters",
"and",
"getters"
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AppEventsLogger.java#L963-L1007 | train |
meridor/perspective-backend | perspective-sql/src/main/java/org/meridor/perspective/sql/impl/QueryPlannerImpl.java | QueryPlannerImpl.extractWhereConditions | private Pair<List<BooleanExpression>, Optional<BooleanExpression>> extractWhereConditions(SelectQueryAware selectQueryAware) {
List<BooleanExpression> whereConditions = new ArrayList<>();
Optional<BooleanExpression> whereExpressionCandidate = selectQueryAware.getWhereExpression();
if (w... | java | private Pair<List<BooleanExpression>, Optional<BooleanExpression>> extractWhereConditions(SelectQueryAware selectQueryAware) {
List<BooleanExpression> whereConditions = new ArrayList<>();
Optional<BooleanExpression> whereExpressionCandidate = selectQueryAware.getWhereExpression();
if (w... | [
"private",
"Pair",
"<",
"List",
"<",
"BooleanExpression",
">",
",",
"Optional",
"<",
"BooleanExpression",
">",
">",
"extractWhereConditions",
"(",
"SelectQueryAware",
"selectQueryAware",
")",
"{",
"List",
"<",
"BooleanExpression",
">",
"whereConditions",
"=",
"new",... | Deciding whether having clause can be moved to where clause | [
"Deciding",
"whether",
"having",
"clause",
"can",
"be",
"moved",
"to",
"where",
"clause"
] | 5f98083977a57115988678e97d1642ee83431258 | https://github.com/meridor/perspective-backend/blob/5f98083977a57115988678e97d1642ee83431258/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/QueryPlannerImpl.java#L161-L177 | train |
meridor/perspective-backend | perspective-sql/src/main/java/org/meridor/perspective/sql/impl/QueryPlannerImpl.java | QueryPlannerImpl.optimizeDataSource | private Pair<DataSource, Optional<BooleanExpression>> optimizeDataSource(
DataSource originalDataSource,
List<BooleanExpression> originalWhereConditions,
Map<String, Object> selectionMap,
Map<String, String> tableAliases
) {
OptimizationContext optimizationCo... | java | private Pair<DataSource, Optional<BooleanExpression>> optimizeDataSource(
DataSource originalDataSource,
List<BooleanExpression> originalWhereConditions,
Map<String, Object> selectionMap,
Map<String, String> tableAliases
) {
OptimizationContext optimizationCo... | [
"private",
"Pair",
"<",
"DataSource",
",",
"Optional",
"<",
"BooleanExpression",
">",
">",
"optimizeDataSource",
"(",
"DataSource",
"originalDataSource",
",",
"List",
"<",
"BooleanExpression",
">",
"originalWhereConditions",
",",
"Map",
"<",
"String",
",",
"Object",... | Deciding whether parts of where clause can be moved to data sources | [
"Deciding",
"whether",
"parts",
"of",
"where",
"clause",
"can",
"be",
"moved",
"to",
"data",
"sources"
] | 5f98083977a57115988678e97d1642ee83431258 | https://github.com/meridor/perspective-backend/blob/5f98083977a57115988678e97d1642ee83431258/perspective-sql/src/main/java/org/meridor/perspective/sql/impl/QueryPlannerImpl.java#L180-L194 | train |
anotheria/configureme | src/main/java/org/configureme/sources/configurationrepository/ReplyObject.java | ReplyObject.success | public static ReplyObject success(final String name, final Object result) {
final ReplyObject ret = new ReplyObject(name, result);
ret.success = true;
return ret;
} | java | public static ReplyObject success(final String name, final Object result) {
final ReplyObject ret = new ReplyObject(name, result);
ret.success = true;
return ret;
} | [
"public",
"static",
"ReplyObject",
"success",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"result",
")",
"{",
"final",
"ReplyObject",
"ret",
"=",
"new",
"ReplyObject",
"(",
"name",
",",
"result",
")",
";",
"ret",
".",
"success",
"=",
"true",
... | Factory method that creates a new reply object for successful request.
@param name a {@link java.lang.String} object.
@param result a {@link java.lang.Object} object.
@return a {@link org.configureme.sources.configurationrepository.ReplyObject} object. | [
"Factory",
"method",
"that",
"creates",
"a",
"new",
"reply",
"object",
"for",
"successful",
"request",
"."
] | 1f52dd9109349623190586bdf5a592de8016e1fa | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/sources/configurationrepository/ReplyObject.java#L71-L75 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Session.java | Session.close | public final void close() {
synchronized (this.lock) {
final SessionState oldState = this.state;
switch (this.state) {
case CREATED:
case OPENING:
this.state = SessionState.CLOSED_LOGIN_FAILED;
postStateChange(oldSt... | java | public final void close() {
synchronized (this.lock) {
final SessionState oldState = this.state;
switch (this.state) {
case CREATED:
case OPENING:
this.state = SessionState.CLOSED_LOGIN_FAILED;
postStateChange(oldSt... | [
"public",
"final",
"void",
"close",
"(",
")",
"{",
"synchronized",
"(",
"this",
".",
"lock",
")",
"{",
"final",
"SessionState",
"oldState",
"=",
"this",
".",
"state",
";",
"switch",
"(",
"this",
".",
"state",
")",
"{",
"case",
"CREATED",
":",
"case",
... | Closes the local in-memory Session object, but does not clear the
persisted token cache. | [
"Closes",
"the",
"local",
"in",
"-",
"memory",
"Session",
"object",
"but",
"does",
"not",
"clear",
"the",
"persisted",
"token",
"cache",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Session.java#L767-L791 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Session.java | Session.closeAndClearTokenInformation | public final void closeAndClearTokenInformation() {
if (this.tokenCachingStrategy != null) {
this.tokenCachingStrategy.clear();
}
Utility.clearFacebookCookies(staticContext);
Utility.clearCaches(staticContext);
close();
} | java | public final void closeAndClearTokenInformation() {
if (this.tokenCachingStrategy != null) {
this.tokenCachingStrategy.clear();
}
Utility.clearFacebookCookies(staticContext);
Utility.clearCaches(staticContext);
close();
} | [
"public",
"final",
"void",
"closeAndClearTokenInformation",
"(",
")",
"{",
"if",
"(",
"this",
".",
"tokenCachingStrategy",
"!=",
"null",
")",
"{",
"this",
".",
"tokenCachingStrategy",
".",
"clear",
"(",
")",
";",
"}",
"Utility",
".",
"clearFacebookCookies",
"(... | Closes the local in-memory Session object and clears any persisted token
cache related to the Session. | [
"Closes",
"the",
"local",
"in",
"-",
"memory",
"Session",
"object",
"and",
"clears",
"any",
"persisted",
"token",
"cache",
"related",
"to",
"the",
"Session",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Session.java#L797-L804 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Session.java | Session.addCallback | public final void addCallback(StatusCallback callback) {
synchronized (callbacks) {
if (callback != null && !callbacks.contains(callback)) {
callbacks.add(callback);
}
}
} | java | public final void addCallback(StatusCallback callback) {
synchronized (callbacks) {
if (callback != null && !callbacks.contains(callback)) {
callbacks.add(callback);
}
}
} | [
"public",
"final",
"void",
"addCallback",
"(",
"StatusCallback",
"callback",
")",
"{",
"synchronized",
"(",
"callbacks",
")",
"{",
"if",
"(",
"callback",
"!=",
"null",
"&&",
"!",
"callbacks",
".",
"contains",
"(",
"callback",
")",
")",
"{",
"callbacks",
".... | Adds a callback that will be called when the state of this Session changes.
@param callback the callback | [
"Adds",
"a",
"callback",
"that",
"will",
"be",
"called",
"when",
"the",
"state",
"of",
"this",
"Session",
"changes",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Session.java#L811-L817 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Session.java | Session.saveSession | public static final void saveSession(Session session, Bundle bundle) {
if (bundle != null && session != null && !bundle.containsKey(SESSION_BUNDLE_SAVE_KEY)) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
new ObjectOutputStream(outputStream).wri... | java | public static final void saveSession(Session session, Bundle bundle) {
if (bundle != null && session != null && !bundle.containsKey(SESSION_BUNDLE_SAVE_KEY)) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
new ObjectOutputStream(outputStream).wri... | [
"public",
"static",
"final",
"void",
"saveSession",
"(",
"Session",
"session",
",",
"Bundle",
"bundle",
")",
"{",
"if",
"(",
"bundle",
"!=",
"null",
"&&",
"session",
"!=",
"null",
"&&",
"!",
"bundle",
".",
"containsKey",
"(",
"SESSION_BUNDLE_SAVE_KEY",
")",
... | Save the Session object into the supplied Bundle. This method is intended to be called from an
Activity or Fragment's onSaveInstanceState method in order to preserve Sessions across Activity lifecycle events.
@param session the Session to save
@param bundle the Bundle to save the Session to | [
"Save",
"the",
"Session",
"object",
"into",
"the",
"supplied",
"Bundle",
".",
"This",
"method",
"is",
"intended",
"to",
"be",
"called",
"from",
"an",
"Activity",
"or",
"Fragment",
"s",
"onSaveInstanceState",
"method",
"in",
"order",
"to",
"preserve",
"Sessions... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Session.java#L877-L888 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Session.java | Session.restoreSession | public static final Session restoreSession(
Context context, TokenCachingStrategy cachingStrategy, StatusCallback callback, Bundle bundle) {
if (bundle == null) {
return null;
}
byte[] data = bundle.getByteArray(SESSION_BUNDLE_SAVE_KEY);
if (data != null) {
... | java | public static final Session restoreSession(
Context context, TokenCachingStrategy cachingStrategy, StatusCallback callback, Bundle bundle) {
if (bundle == null) {
return null;
}
byte[] data = bundle.getByteArray(SESSION_BUNDLE_SAVE_KEY);
if (data != null) {
... | [
"public",
"static",
"final",
"Session",
"restoreSession",
"(",
"Context",
"context",
",",
"TokenCachingStrategy",
"cachingStrategy",
",",
"StatusCallback",
"callback",
",",
"Bundle",
"bundle",
")",
"{",
"if",
"(",
"bundle",
"==",
"null",
")",
"{",
"return",
"nul... | Restores the saved session from a Bundle, if any. Returns the restored Session or
null if it could not be restored. This method is intended to be called from an Activity or Fragment's
onCreate method when a Session has previously been saved into a Bundle via saveState to preserve a Session
across Activity lifecycle eve... | [
"Restores",
"the",
"saved",
"session",
"from",
"a",
"Bundle",
"if",
"any",
".",
"Returns",
"the",
"restored",
"Session",
"or",
"null",
"if",
"it",
"could",
"not",
"be",
"restored",
".",
"This",
"method",
"is",
"intended",
"to",
"be",
"called",
"from",
"a... | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Session.java#L904-L932 | train |
dmerkushov/log-helper | src/main/java/ru/dmerkushov/loghelper/configure/loggerwrapper/LoggerWrapperConfigurator.java | LoggerWrapperConfigurator.getConfigurationOption | public Node getConfigurationOption (String optionName) {
NodeList children = configuration.getChildNodes ();
Node configurationOption = null;
for (int childIndex = 0; childIndex < children.getLength (); childIndex++) {
if (children.item (childIndex).getNodeName ().equals (optionName)) {
configurationOption... | java | public Node getConfigurationOption (String optionName) {
NodeList children = configuration.getChildNodes ();
Node configurationOption = null;
for (int childIndex = 0; childIndex < children.getLength (); childIndex++) {
if (children.item (childIndex).getNodeName ().equals (optionName)) {
configurationOption... | [
"public",
"Node",
"getConfigurationOption",
"(",
"String",
"optionName",
")",
"{",
"NodeList",
"children",
"=",
"configuration",
".",
"getChildNodes",
"(",
")",
";",
"Node",
"configurationOption",
"=",
"null",
";",
"for",
"(",
"int",
"childIndex",
"=",
"0",
";... | Get a configuration option of this configurator.
@param optionName
@return The configuration option node. <code>null</code> if it does not exist | [
"Get",
"a",
"configuration",
"option",
"of",
"this",
"configurator",
"."
] | 3b7d3d30faa7f1437b27cd07c10fa579a995de23 | https://github.com/dmerkushov/log-helper/blob/3b7d3d30faa7f1437b27cd07c10fa579a995de23/src/main/java/ru/dmerkushov/loghelper/configure/loggerwrapper/LoggerWrapperConfigurator.java#L82-L92 | train |
dmerkushov/log-helper | src/main/java/ru/dmerkushov/loghelper/configure/loggerwrapper/LoggerWrapperConfigurator.java | LoggerWrapperConfigurator.getConfigurationOptionValue | public String getConfigurationOptionValue (String optionName, String defaultValue) {
String optionValue;
Node configurationOption = this.getConfigurationOption (optionName);
if (configurationOption != null) {
optionValue = configurationOption.getTextContent ();
} else {
optionValue = defaultValue;
}
r... | java | public String getConfigurationOptionValue (String optionName, String defaultValue) {
String optionValue;
Node configurationOption = this.getConfigurationOption (optionName);
if (configurationOption != null) {
optionValue = configurationOption.getTextContent ();
} else {
optionValue = defaultValue;
}
r... | [
"public",
"String",
"getConfigurationOptionValue",
"(",
"String",
"optionName",
",",
"String",
"defaultValue",
")",
"{",
"String",
"optionValue",
";",
"Node",
"configurationOption",
"=",
"this",
".",
"getConfigurationOption",
"(",
"optionName",
")",
";",
"if",
"(",
... | Get a configuration option value as String.
@param optionName
@param defaultValue
@return The configuration option node value, or <code>defaultValue</code> if it does not exist | [
"Get",
"a",
"configuration",
"option",
"value",
"as",
"String",
"."
] | 3b7d3d30faa7f1437b27cd07c10fa579a995de23 | https://github.com/dmerkushov/log-helper/blob/3b7d3d30faa7f1437b27cd07c10fa579a995de23/src/main/java/ru/dmerkushov/loghelper/configure/loggerwrapper/LoggerWrapperConfigurator.java#L100-L109 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/internal/FileLruCache.java | FileLruCache.interceptAndPut | public InputStream interceptAndPut(String key, InputStream input) throws IOException {
OutputStream output = openPutStream(key);
return new CopyingInputStream(input, output);
} | java | public InputStream interceptAndPut(String key, InputStream input) throws IOException {
OutputStream output = openPutStream(key);
return new CopyingInputStream(input, output);
} | [
"public",
"InputStream",
"interceptAndPut",
"(",
"String",
"key",
",",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"OutputStream",
"output",
"=",
"openPutStream",
"(",
"key",
")",
";",
"return",
"new",
"CopyingInputStream",
"(",
"input",
",",
"out... | copy of input, and associate that data with key. | [
"copy",
"of",
"input",
"and",
"associate",
"that",
"data",
"with",
"key",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/internal/FileLruCache.java#L257-L260 | train |
A-pZ/struts2-thymeleaf3-plugin | src/main/java/serendip/struts/plugins/thymeleaf/spi/DefaultTemplateEngineProvider.java | DefaultTemplateEngineProvider.configure | public void configure() {
ServletContext servletContext = ServletActionContext.getServletContext();
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver(servletContext);
templateResolver.setTemplateMode(templateMode);
templateResolver.setCharacterEncoding(characterEncoding)... | java | public void configure() {
ServletContext servletContext = ServletActionContext.getServletContext();
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver(servletContext);
templateResolver.setTemplateMode(templateMode);
templateResolver.setCharacterEncoding(characterEncoding)... | [
"public",
"void",
"configure",
"(",
")",
"{",
"ServletContext",
"servletContext",
"=",
"ServletActionContext",
".",
"getServletContext",
"(",
")",
";",
"ServletContextTemplateResolver",
"templateResolver",
"=",
"new",
"ServletContextTemplateResolver",
"(",
"servletContext",... | Configure settings from the struts.xml or struts.properties, using
sensible defaults if values are not provided. | [
"Configure",
"settings",
"from",
"the",
"struts",
".",
"xml",
"or",
"struts",
".",
"properties",
"using",
"sensible",
"defaults",
"if",
"values",
"are",
"not",
"provided",
"."
] | 36a4609c1d0a36019784c6dba951c9b27dcc8802 | https://github.com/A-pZ/struts2-thymeleaf3-plugin/blob/36a4609c1d0a36019784c6dba951c9b27dcc8802/src/main/java/serendip/struts/plugins/thymeleaf/spi/DefaultTemplateEngineProvider.java#L65-L86 | train |
A-pZ/struts2-thymeleaf3-plugin | src/main/java/serendip/struts/plugins/thymeleaf/spi/DefaultTemplateEngineProvider.java | DefaultTemplateEngineProvider.setContainer | public void setContainer(Container container) {
this.container = container;
Map<String, TemplateEngine> map = new HashMap<String, TemplateEngine>();
// loading TemplateEngine class from DI Container.
Set<String> prefixes = container.getInstanceNames(TemplateEngine.class);
for (String prefix : prefixe... | java | public void setContainer(Container container) {
this.container = container;
Map<String, TemplateEngine> map = new HashMap<String, TemplateEngine>();
// loading TemplateEngine class from DI Container.
Set<String> prefixes = container.getInstanceNames(TemplateEngine.class);
for (String prefix : prefixe... | [
"public",
"void",
"setContainer",
"(",
"Container",
"container",
")",
"{",
"this",
".",
"container",
"=",
"container",
";",
"Map",
"<",
"String",
",",
"TemplateEngine",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"TemplateEngine",
">",
"(",
")",... | loading di container configulation from struts-plugin.xml , choise thymeleaf template engine.
@param container Struts2Container | [
"loading",
"di",
"container",
"configulation",
"from",
"struts",
"-",
"plugin",
".",
"xml",
"choise",
"thymeleaf",
"template",
"engine",
"."
] | 36a4609c1d0a36019784c6dba951c9b27dcc8802 | https://github.com/A-pZ/struts2-thymeleaf3-plugin/blob/36a4609c1d0a36019784c6dba951c9b27dcc8802/src/main/java/serendip/struts/plugins/thymeleaf/spi/DefaultTemplateEngineProvider.java#L136-L148 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.hasTokenInformation | public static boolean hasTokenInformation(Bundle bundle) {
if (bundle == null) {
return false;
}
String token = bundle.getString(TOKEN_KEY);
if ((token == null) || (token.length() == 0)) {
return false;
}
long expiresMilliseconds = bundle.getLong... | java | public static boolean hasTokenInformation(Bundle bundle) {
if (bundle == null) {
return false;
}
String token = bundle.getString(TOKEN_KEY);
if ((token == null) || (token.length() == 0)) {
return false;
}
long expiresMilliseconds = bundle.getLong... | [
"public",
"static",
"boolean",
"hasTokenInformation",
"(",
"Bundle",
"bundle",
")",
"{",
"if",
"(",
"bundle",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"String",
"token",
"=",
"bundle",
".",
"getString",
"(",
"TOKEN_KEY",
")",
";",
"if",
"(",
... | Returns a boolean indicating whether a Bundle contains properties that
could be a valid saved token.
@param bundle
A Bundle to check for token information.
@return a boolean indicating whether a Bundle contains properties that
could be a valid saved token. | [
"Returns",
"a",
"boolean",
"indicating",
"whether",
"a",
"Bundle",
"contains",
"properties",
"that",
"could",
"be",
"a",
"valid",
"saved",
"token",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L128-L144 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.getToken | public static String getToken(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return bundle.getString(TOKEN_KEY);
} | java | public static String getToken(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return bundle.getString(TOKEN_KEY);
} | [
"public",
"static",
"String",
"getToken",
"(",
"Bundle",
"bundle",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"return",
"bundle",
".",
"getString",
"(",
"TOKEN_KEY",
")",
";",
"}"
] | Gets the cached token value from a Bundle.
@param bundle
A Bundle in which the token value was stored.
@return the cached token value, or null.
@throws NullPointerException if the passed in Bundle is null | [
"Gets",
"the",
"cached",
"token",
"value",
"from",
"a",
"Bundle",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L155-L158 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.putToken | public static void putToken(Bundle bundle, String value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
bundle.putString(TOKEN_KEY, value);
} | java | public static void putToken(Bundle bundle, String value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
bundle.putString(TOKEN_KEY, value);
} | [
"public",
"static",
"void",
"putToken",
"(",
"Bundle",
"bundle",
",",
"String",
"value",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"Validate",
".",
"notNull",
"(",
"value",
",",
"\"value\"",
")",
";",
"bundle",
"."... | Puts the token value into a Bundle.
@param bundle
A Bundle in which the token value should be stored.
@param value
The String representing the token value, or null.
@throws NullPointerException if the passed in Bundle or token value are null | [
"Puts",
"the",
"token",
"value",
"into",
"a",
"Bundle",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L170-L174 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.getExpirationDate | public static Date getExpirationDate(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return getDate(bundle, EXPIRATION_DATE_KEY);
} | java | public static Date getExpirationDate(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return getDate(bundle, EXPIRATION_DATE_KEY);
} | [
"public",
"static",
"Date",
"getExpirationDate",
"(",
"Bundle",
"bundle",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"return",
"getDate",
"(",
"bundle",
",",
"EXPIRATION_DATE_KEY",
")",
";",
"}"
] | Gets the cached expiration date from a Bundle.
@param bundle
A Bundle in which the expiration date was stored.
@return the cached expiration date, or null.
@throws NullPointerException if the passed in Bundle is null | [
"Gets",
"the",
"cached",
"expiration",
"date",
"from",
"a",
"Bundle",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L185-L188 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.getPermissions | public static List<String> getPermissions(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return bundle.getStringArrayList(PERMISSIONS_KEY);
} | java | public static List<String> getPermissions(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return bundle.getStringArrayList(PERMISSIONS_KEY);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getPermissions",
"(",
"Bundle",
"bundle",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"return",
"bundle",
".",
"getStringArrayList",
"(",
"PERMISSIONS_KEY",
")",
";",
"}"
... | Gets the cached list of permissions from a Bundle.
@param bundle
A Bundle in which the list of permissions was stored.
@return the cached list of permissions.
@throws NullPointerException if the passed in Bundle is null | [
"Gets",
"the",
"cached",
"list",
"of",
"permissions",
"from",
"a",
"Bundle",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L246-L249 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.putPermissions | public static void putPermissions(Bundle bundle, List<String> value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
ArrayList<String> arrayList;
if (value instanceof ArrayList<?>) {
arrayList = (ArrayList<String>) value;
} else {
... | java | public static void putPermissions(Bundle bundle, List<String> value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
ArrayList<String> arrayList;
if (value instanceof ArrayList<?>) {
arrayList = (ArrayList<String>) value;
} else {
... | [
"public",
"static",
"void",
"putPermissions",
"(",
"Bundle",
"bundle",
",",
"List",
"<",
"String",
">",
"value",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"Validate",
".",
"notNull",
"(",
"value",
",",
"\"value\"",
... | Puts the list of permissions into a Bundle.
@param bundle
A Bundle in which the list of permissions should be stored.
@param value
The List<String> representing the list of permissions,
or null.
@throws NullPointerException if the passed in Bundle or permissions list are null | [
"Puts",
"the",
"list",
"of",
"permissions",
"into",
"a",
"Bundle",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L262-L273 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.putDeclinedPermissions | public static void putDeclinedPermissions(Bundle bundle, List<String> value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
ArrayList<String> arrayList;
if (value instanceof ArrayList<?>) {
arrayList = (ArrayList<String>) value;
} else {
... | java | public static void putDeclinedPermissions(Bundle bundle, List<String> value) {
Validate.notNull(bundle, "bundle");
Validate.notNull(value, "value");
ArrayList<String> arrayList;
if (value instanceof ArrayList<?>) {
arrayList = (ArrayList<String>) value;
} else {
... | [
"public",
"static",
"void",
"putDeclinedPermissions",
"(",
"Bundle",
"bundle",
",",
"List",
"<",
"String",
">",
"value",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"Validate",
".",
"notNull",
"(",
"value",
",",
"\"val... | Puts the list of declined permissions into a Bundle.
@param bundle
A Bundle in which the list of permissions should be stored.
@param value
The List<String> representing the list of permissions,
or null.
@throws NullPointerException if the passed in Bundle or permissions list are null | [
"Puts",
"the",
"list",
"of",
"declined",
"permissions",
"into",
"a",
"Bundle",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L286-L297 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.getSource | public static AccessTokenSource getSource(Bundle bundle) {
Validate.notNull(bundle, "bundle");
if (bundle.containsKey(TokenCachingStrategy.TOKEN_SOURCE_KEY)) {
return (AccessTokenSource) bundle.getSerializable(TokenCachingStrategy.TOKEN_SOURCE_KEY);
} else {
boolean isSSO... | java | public static AccessTokenSource getSource(Bundle bundle) {
Validate.notNull(bundle, "bundle");
if (bundle.containsKey(TokenCachingStrategy.TOKEN_SOURCE_KEY)) {
return (AccessTokenSource) bundle.getSerializable(TokenCachingStrategy.TOKEN_SOURCE_KEY);
} else {
boolean isSSO... | [
"public",
"static",
"AccessTokenSource",
"getSource",
"(",
"Bundle",
"bundle",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"if",
"(",
"bundle",
".",
"containsKey",
"(",
"TokenCachingStrategy",
".",
"TOKEN_SOURCE_KEY",
")",
... | Gets the cached enum indicating the source of the token from the Bundle.
@param bundle
A Bundle in which the enum was stored.
@return enum indicating the source of the token
@throws NullPointerException if the passed in Bundle is null | [
"Gets",
"the",
"cached",
"enum",
"indicating",
"the",
"source",
"of",
"the",
"token",
"from",
"the",
"Bundle",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L309-L317 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.putSource | public static void putSource(Bundle bundle, AccessTokenSource value) {
Validate.notNull(bundle, "bundle");
bundle.putSerializable(TOKEN_SOURCE_KEY, value);
} | java | public static void putSource(Bundle bundle, AccessTokenSource value) {
Validate.notNull(bundle, "bundle");
bundle.putSerializable(TOKEN_SOURCE_KEY, value);
} | [
"public",
"static",
"void",
"putSource",
"(",
"Bundle",
"bundle",
",",
"AccessTokenSource",
"value",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"bundle",
".",
"putSerializable",
"(",
"TOKEN_SOURCE_KEY",
",",
"value",
")",... | Puts the enum indicating the source of the token into a Bundle.
@param bundle
A Bundle in which the enum should be stored.
@param value
enum indicating the source of the token
@throws NullPointerException if the passed in Bundle is null | [
"Puts",
"the",
"enum",
"indicating",
"the",
"source",
"of",
"the",
"token",
"into",
"a",
"Bundle",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L328-L331 | train |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.getLastRefreshDate | public static Date getLastRefreshDate(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return getDate(bundle, LAST_REFRESH_DATE_KEY);
} | java | public static Date getLastRefreshDate(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return getDate(bundle, LAST_REFRESH_DATE_KEY);
} | [
"public",
"static",
"Date",
"getLastRefreshDate",
"(",
"Bundle",
"bundle",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"return",
"getDate",
"(",
"bundle",
",",
"LAST_REFRESH_DATE_KEY",
")",
";",
"}"
] | Gets the cached last refresh date from a Bundle.
@param bundle
A Bundle in which the last refresh date was stored.
@return the cached last refresh Date, or null.
@throws NullPointerException if the passed in Bundle is null | [
"Gets",
"the",
"cached",
"last",
"refresh",
"date",
"from",
"a",
"Bundle",
"."
] | ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L342-L345 | train |
ologolo/streamline-api | src/org/daisy/streamline/api/tasks/TaskGroupInformation.java | TaskGroupInformation.newCopyBuilder | public Builder newCopyBuilder() {
return new Builder(getInputFormat(), getOutputFormat(), getActivity()).locale(getLocale()).setRequiredOptions(keys);
} | java | public Builder newCopyBuilder() {
return new Builder(getInputFormat(), getOutputFormat(), getActivity()).locale(getLocale()).setRequiredOptions(keys);
} | [
"public",
"Builder",
"newCopyBuilder",
"(",
")",
"{",
"return",
"new",
"Builder",
"(",
"getInputFormat",
"(",
")",
",",
"getOutputFormat",
"(",
")",
",",
"getActivity",
"(",
")",
")",
".",
"locale",
"(",
"getLocale",
"(",
")",
")",
".",
"setRequiredOptions... | Creates a new builder with the same settings as this information.
@return returns a new builder | [
"Creates",
"a",
"new",
"builder",
"with",
"the",
"same",
"settings",
"as",
"this",
"information",
"."
] | 4934b6da1de06e364ae90d6ea9b0929500da9cdb | https://github.com/ologolo/streamline-api/blob/4934b6da1de06e364ae90d6ea9b0929500da9cdb/src/org/daisy/streamline/api/tasks/TaskGroupInformation.java#L113-L115 | train |
ologolo/streamline-api | src/org/daisy/streamline/api/tasks/TaskGroupInformation.java | TaskGroupInformation.newConvertBuilder | public static Builder newConvertBuilder(String input, String output) {
return new Builder(input, output, TaskGroupActivity.CONVERT);
} | java | public static Builder newConvertBuilder(String input, String output) {
return new Builder(input, output, TaskGroupActivity.CONVERT);
} | [
"public",
"static",
"Builder",
"newConvertBuilder",
"(",
"String",
"input",
",",
"String",
"output",
")",
"{",
"return",
"new",
"Builder",
"(",
"input",
",",
"output",
",",
"TaskGroupActivity",
".",
"CONVERT",
")",
";",
"}"
] | Creates a new builder of convert type with the specified parameters.
@param input the input format
@param output the output format
@return returns a new builder | [
"Creates",
"a",
"new",
"builder",
"of",
"convert",
"type",
"with",
"the",
"specified",
"parameters",
"."
] | 4934b6da1de06e364ae90d6ea9b0929500da9cdb | https://github.com/ologolo/streamline-api/blob/4934b6da1de06e364ae90d6ea9b0929500da9cdb/src/org/daisy/streamline/api/tasks/TaskGroupInformation.java#L123-L125 | train |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/internal/ErrorPrinter.java | ErrorPrinter.printError | @SuppressWarnings({ "PMD.DataflowAnomalyAnalysis",
"PMD.AvoidCatchingGenericException",
"PMD.UseStringBufferForStringAppends", "PMD.SystemPrintln" })
public void printError(Error event) {
String msg = "Unhandled " + event;
System.err.println(msg);
if (event.throwable() == nul... | java | @SuppressWarnings({ "PMD.DataflowAnomalyAnalysis",
"PMD.AvoidCatchingGenericException",
"PMD.UseStringBufferForStringAppends", "PMD.SystemPrintln" })
public void printError(Error event) {
String msg = "Unhandled " + event;
System.err.println(msg);
if (event.throwable() == nul... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"PMD.DataflowAnomalyAnalysis\"",
",",
"\"PMD.AvoidCatchingGenericException\"",
",",
"\"PMD.UseStringBufferForStringAppends\"",
",",
"\"PMD.SystemPrintln\"",
"}",
")",
"public",
"void",
"printError",
"(",
"Error",
"event",
")",
"{",
"Stri... | Prints the error.
@param event the event | [
"Prints",
"the",
"error",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/internal/ErrorPrinter.java#L34-L45 | train |
kormide/recipe | recipe-java-runtime/src/main/java/ca/derekcormier/recipe/Recipe.java | Recipe.segment | protected List<Segment> segment() {
List<Segment> segments = new ArrayList<>();
List<Recipe> recipeStack = new ArrayList<>();
recipeStack.add(this);
_segment(new Recipe(), recipeStack, null, segments);
return segments;
} | java | protected List<Segment> segment() {
List<Segment> segments = new ArrayList<>();
List<Recipe> recipeStack = new ArrayList<>();
recipeStack.add(this);
_segment(new Recipe(), recipeStack, null, segments);
return segments;
} | [
"protected",
"List",
"<",
"Segment",
">",
"segment",
"(",
")",
"{",
"List",
"<",
"Segment",
">",
"segments",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"Recipe",
">",
"recipeStack",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"recip... | original recipe, but more efficient for sending payloads of ingredients to different services. | [
"original",
"recipe",
"but",
"more",
"efficient",
"for",
"sending",
"payloads",
"of",
"ingredients",
"to",
"different",
"services",
"."
] | 19f12328f562f57e08dfb23ce4936e337d552f3b | https://github.com/kormide/recipe/blob/19f12328f562f57e08dfb23ce4936e337d552f3b/recipe-java-runtime/src/main/java/ca/derekcormier/recipe/Recipe.java#L69-L75 | train |
mnlipp/jgrapes | examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java | WsEchoServer.onGet | @RequestHandler(patterns = "/ws/echo", priority = 100)
public void onGet(Request.In.Get event, IOSubchannel channel)
throws InterruptedException {
final HttpRequest request = event.httpRequest();
if (!request.findField(
HttpField.UPGRADE, Converters.STRING_LIST)
.... | java | @RequestHandler(patterns = "/ws/echo", priority = 100)
public void onGet(Request.In.Get event, IOSubchannel channel)
throws InterruptedException {
final HttpRequest request = event.httpRequest();
if (!request.findField(
HttpField.UPGRADE, Converters.STRING_LIST)
.... | [
"@",
"RequestHandler",
"(",
"patterns",
"=",
"\"/ws/echo\"",
",",
"priority",
"=",
"100",
")",
"public",
"void",
"onGet",
"(",
"Request",
".",
"In",
".",
"Get",
"event",
",",
"IOSubchannel",
"channel",
")",
"throws",
"InterruptedException",
"{",
"final",
"Ht... | Handle `GET` requests.
@param event the event
@param channel the channel
@throws InterruptedException the interrupted exception | [
"Handle",
"GET",
"requests",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java#L65-L78 | train |
mnlipp/jgrapes | examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java | WsEchoServer.onUpgraded | @Handler
public void onUpgraded(Upgraded event, IOSubchannel channel) {
if (!openChannels.contains(channel)) {
return;
}
channel.respond(Output.from("/Greetings!", true));
} | java | @Handler
public void onUpgraded(Upgraded event, IOSubchannel channel) {
if (!openChannels.contains(channel)) {
return;
}
channel.respond(Output.from("/Greetings!", true));
} | [
"@",
"Handler",
"public",
"void",
"onUpgraded",
"(",
"Upgraded",
"event",
",",
"IOSubchannel",
"channel",
")",
"{",
"if",
"(",
"!",
"openChannels",
".",
"contains",
"(",
"channel",
")",
")",
"{",
"return",
";",
"}",
"channel",
".",
"respond",
"(",
"Outpu... | Handle upgrade confirmation.
@param event the event
@param channel the channel | [
"Handle",
"upgrade",
"confirmation",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java#L86-L92 | train |
mnlipp/jgrapes | org.jgrapes.io/src/org/jgrapes/net/SslCodec.java | SslCodec.onOutput | @Handler
public void onOutput(Output<ByteBuffer> event,
PlainChannel plainChannel)
throws InterruptedException, SSLException, ExecutionException {
if (plainChannel.hub() != this) {
return;
}
plainChannel.sendUpstream(event);
} | java | @Handler
public void onOutput(Output<ByteBuffer> event,
PlainChannel plainChannel)
throws InterruptedException, SSLException, ExecutionException {
if (plainChannel.hub() != this) {
return;
}
plainChannel.sendUpstream(event);
} | [
"@",
"Handler",
"public",
"void",
"onOutput",
"(",
"Output",
"<",
"ByteBuffer",
">",
"event",
",",
"PlainChannel",
"plainChannel",
")",
"throws",
"InterruptedException",
",",
"SSLException",
",",
"ExecutionException",
"{",
"if",
"(",
"plainChannel",
".",
"hub",
... | Sends decrypted data through the engine and then upstream.
@param event
the event with the data
@throws InterruptedException if the execution was interrupted
@throws SSLException if some SSL related problem occurs
@throws ExecutionException | [
"Sends",
"decrypted",
"data",
"through",
"the",
"engine",
"and",
"then",
"upstream",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/net/SslCodec.java#L272-L280 | train |
mnlipp/jgrapes | org.jgrapes.io/src/org/jgrapes/net/SslCodec.java | SslCodec.onClose | @Handler
public void onClose(Close event, PlainChannel plainChannel)
throws InterruptedException, SSLException {
if (plainChannel.hub() != this) {
return;
}
plainChannel.close(event);
} | java | @Handler
public void onClose(Close event, PlainChannel plainChannel)
throws InterruptedException, SSLException {
if (plainChannel.hub() != this) {
return;
}
plainChannel.close(event);
} | [
"@",
"Handler",
"public",
"void",
"onClose",
"(",
"Close",
"event",
",",
"PlainChannel",
"plainChannel",
")",
"throws",
"InterruptedException",
",",
"SSLException",
"{",
"if",
"(",
"plainChannel",
".",
"hub",
"(",
")",
"!=",
"this",
")",
"{",
"return",
";",
... | Forwards a close event upstream.
@param event
the close event
@throws SSLException if an SSL related problem occurs
@throws InterruptedException if the execution was interrupted | [
"Forwards",
"a",
"close",
"event",
"upstream",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/net/SslCodec.java#L290-L297 | train |
mnlipp/jgrapes | org.jgrapes.io/src/org/jgrapes/io/FileStorage.java | FileStorage.onInput | @Handler
public void onInput(Input<ByteBuffer> event, Channel channel) {
Writer writer = inputWriters.get(channel);
if (writer != null) {
writer.write(event.buffer());
}
} | java | @Handler
public void onInput(Input<ByteBuffer> event, Channel channel) {
Writer writer = inputWriters.get(channel);
if (writer != null) {
writer.write(event.buffer());
}
} | [
"@",
"Handler",
"public",
"void",
"onInput",
"(",
"Input",
"<",
"ByteBuffer",
">",
"event",
",",
"Channel",
"channel",
")",
"{",
"Writer",
"writer",
"=",
"inputWriters",
".",
"get",
"(",
"channel",
")",
";",
"if",
"(",
"writer",
"!=",
"null",
")",
"{",... | Handle input by writing it to the file, if a channel exists.
@param event the event
@param channel the channel | [
"Handle",
"input",
"by",
"writing",
"it",
"to",
"the",
"file",
"if",
"a",
"channel",
"exists",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/io/FileStorage.java#L327-L333 | train |
mnlipp/jgrapes | org.jgrapes.io/src/org/jgrapes/io/FileStorage.java | FileStorage.onClose | @Handler
public void onClose(Close event, Channel channel)
throws InterruptedException {
Writer writer = inputWriters.get(channel);
if (writer != null) {
writer.close(event);
}
writer = outputWriters.get(channel);
if (writer != null) {
writ... | java | @Handler
public void onClose(Close event, Channel channel)
throws InterruptedException {
Writer writer = inputWriters.get(channel);
if (writer != null) {
writer.close(event);
}
writer = outputWriters.get(channel);
if (writer != null) {
writ... | [
"@",
"Handler",
"public",
"void",
"onClose",
"(",
"Close",
"event",
",",
"Channel",
"channel",
")",
"throws",
"InterruptedException",
"{",
"Writer",
"writer",
"=",
"inputWriters",
".",
"get",
"(",
"channel",
")",
";",
"if",
"(",
"writer",
"!=",
"null",
")"... | Handle close by closing the file associated with the channel.
@param event the event
@param channel the channel
@throws InterruptedException the interrupted exception | [
"Handle",
"close",
"by",
"closing",
"the",
"file",
"associated",
"with",
"the",
"channel",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/io/FileStorage.java#L383-L394 | train |
mnlipp/jgrapes | org.jgrapes.io/src/org/jgrapes/io/FileStorage.java | FileStorage.onStop | @Handler(priority = -1000)
public void onStop(Stop event) throws InterruptedException {
while (!inputWriters.isEmpty()) {
Writer handler = inputWriters.entrySet().iterator().next()
.getValue();
handler.close(event);
}
while (!outputWriters.isEmpty()) {... | java | @Handler(priority = -1000)
public void onStop(Stop event) throws InterruptedException {
while (!inputWriters.isEmpty()) {
Writer handler = inputWriters.entrySet().iterator().next()
.getValue();
handler.close(event);
}
while (!outputWriters.isEmpty()) {... | [
"@",
"Handler",
"(",
"priority",
"=",
"-",
"1000",
")",
"public",
"void",
"onStop",
"(",
"Stop",
"event",
")",
"throws",
"InterruptedException",
"{",
"while",
"(",
"!",
"inputWriters",
".",
"isEmpty",
"(",
")",
")",
"{",
"Writer",
"handler",
"=",
"inputW... | Handle stop by closing all files.
@param event the event
@throws InterruptedException the interrupted exception | [
"Handle",
"stop",
"by",
"closing",
"all",
"files",
"."
] | 8b5d874935d84c34a52d3e3d3745e869b5203fa0 | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/io/FileStorage.java#L402-L414 | train |
BBN-E/bue-common-open | gnuplot-util/src/main/java/com/bbn/bue/gnuplot/BoxPlot.java | BoxPlot.data | private String data() {
if (datasets.isEmpty()) {
return "";
} else {
final StringBuilder ret = new StringBuilder();
int biggestSize = 0;
for (final Dataset dataset : datasets) {
biggestSize = Math.max(biggestSize, dataset.numPoints());
}
for (int row = 0; row < bigge... | java | private String data() {
if (datasets.isEmpty()) {
return "";
} else {
final StringBuilder ret = new StringBuilder();
int biggestSize = 0;
for (final Dataset dataset : datasets) {
biggestSize = Math.max(biggestSize, dataset.numPoints());
}
for (int row = 0; row < bigge... | [
"private",
"String",
"data",
"(",
")",
"{",
"if",
"(",
"datasets",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"else",
"{",
"final",
"StringBuilder",
"ret",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"biggestSize",
"=",
"0... | gnuplot annoyingly requires data to be written in columns | [
"gnuplot",
"annoyingly",
"requires",
"data",
"to",
"be",
"written",
"in",
"columns"
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/gnuplot-util/src/main/java/com/bbn/bue/gnuplot/BoxPlot.java#L144-L164 | train |
BBN-E/bue-common-open | gnuplot-util/src/main/java/com/bbn/bue/gnuplot/BoxPlot.java | BoxPlot.valueOrBlank | private String valueOrBlank(Dataset dataset, int idx) {
if (idx < dataset.numPoints()) {
return Double.toString(dataset.get(idx));
} else {
return "";
}
} | java | private String valueOrBlank(Dataset dataset, int idx) {
if (idx < dataset.numPoints()) {
return Double.toString(dataset.get(idx));
} else {
return "";
}
} | [
"private",
"String",
"valueOrBlank",
"(",
"Dataset",
"dataset",
",",
"int",
"idx",
")",
"{",
"if",
"(",
"idx",
"<",
"dataset",
".",
"numPoints",
"(",
")",
")",
"{",
"return",
"Double",
".",
"toString",
"(",
"dataset",
".",
"get",
"(",
"idx",
")",
")"... | used by writeData | [
"used",
"by",
"writeData"
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/gnuplot-util/src/main/java/com/bbn/bue/gnuplot/BoxPlot.java#L167-L173 | train |
BBN-E/bue-common-open | gnuplot-util/src/main/java/com/bbn/bue/gnuplot/BoxPlot.java | BoxPlot.main | public static void main(String[] argv) throws IOException {
final File outputDir = new File(argv[0]);
final Random rand = new Random();
final double mean1 = 5.0;
final double mean2 = 7.0;
final double dev1 = 2.0;
final double dev2 = 4.0;
final double[] data1 = new double[100];
final do... | java | public static void main(String[] argv) throws IOException {
final File outputDir = new File(argv[0]);
final Random rand = new Random();
final double mean1 = 5.0;
final double mean2 = 7.0;
final double dev1 = 2.0;
final double dev2 = 4.0;
final double[] data1 = new double[100];
final do... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"argv",
")",
"throws",
"IOException",
"{",
"final",
"File",
"outputDir",
"=",
"new",
"File",
"(",
"argv",
"[",
"0",
"]",
")",
";",
"final",
"Random",
"rand",
"=",
"new",
"Random",
"(",
")",... | Little test program | [
"Little",
"test",
"program"
] | d618652674d647867306e2e4b987a21b7c29c015 | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/gnuplot-util/src/main/java/com/bbn/bue/gnuplot/BoxPlot.java#L341-L366 | train |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java | OrientedBox3f.setFirstAxis | @Override
public void setFirstAxis(double x, double y, double z, double extent, CoordinateSystem3D system) {
this.axis1.set(x, y, z);
assert(this.axis1.isUnitVector());
if (system.isLeftHanded()) {
this.axis3.set(this.axis1.crossLeftHand(this.axis2));
} else {
this.axis3.set(this.axis3.crossRightHand(thi... | java | @Override
public void setFirstAxis(double x, double y, double z, double extent, CoordinateSystem3D system) {
this.axis1.set(x, y, z);
assert(this.axis1.isUnitVector());
if (system.isLeftHanded()) {
this.axis3.set(this.axis1.crossLeftHand(this.axis2));
} else {
this.axis3.set(this.axis3.crossRightHand(thi... | [
"@",
"Override",
"public",
"void",
"setFirstAxis",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
",",
"double",
"extent",
",",
"CoordinateSystem3D",
"system",
")",
"{",
"this",
".",
"axis1",
".",
"set",
"(",
"x",
",",
"y",
",",
"z",
")"... | Set the first axis of the second .
The third axis is updated to be perpendicular to the two other axis.
@param x
@param y
@param z
@param extent
@param system | [
"Set",
"the",
"first",
"axis",
"of",
"the",
"second",
".",
"The",
"third",
"axis",
"is",
"updated",
"to",
"be",
"perpendicular",
"to",
"the",
"two",
"other",
"axis",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java#L453-L463 | train |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java | Path2dfx.windingRuleProperty | public ObjectProperty<PathWindingRule> windingRuleProperty() {
if (this.windingRule == null) {
this.windingRule = new SimpleObjectProperty<>(this, MathFXAttributeNames.WINDING_RULE, DEFAULT_WINDING_RULE);
}
return this.windingRule;
} | java | public ObjectProperty<PathWindingRule> windingRuleProperty() {
if (this.windingRule == null) {
this.windingRule = new SimpleObjectProperty<>(this, MathFXAttributeNames.WINDING_RULE, DEFAULT_WINDING_RULE);
}
return this.windingRule;
} | [
"public",
"ObjectProperty",
"<",
"PathWindingRule",
">",
"windingRuleProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"windingRule",
"==",
"null",
")",
"{",
"this",
".",
"windingRule",
"=",
"new",
"SimpleObjectProperty",
"<>",
"(",
"this",
",",
"MathFXAttribu... | Replies the windingRule property.
@return the windingRule property. | [
"Replies",
"the",
"windingRule",
"property",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java#L275-L280 | train |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java | Path2dfx.isPolylineProperty | public BooleanProperty isPolylineProperty() {
if (this.isPolyline == null) {
this.isPolyline = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_POLYLINE, false);
this.isPolyline.bind(Bindings.createBooleanBinding(() -> {
boolean first = true;
boolean hasOneLine = false;
for (final PathElemen... | java | public BooleanProperty isPolylineProperty() {
if (this.isPolyline == null) {
this.isPolyline = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_POLYLINE, false);
this.isPolyline.bind(Bindings.createBooleanBinding(() -> {
boolean first = true;
boolean hasOneLine = false;
for (final PathElemen... | [
"public",
"BooleanProperty",
"isPolylineProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isPolyline",
"==",
"null",
")",
"{",
"this",
".",
"isPolyline",
"=",
"new",
"ReadOnlyBooleanWrapper",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"IS_POLYLINE",
",",
... | Replies the isPolyline property.
@return the isPolyline property. | [
"Replies",
"the",
"isPolyline",
"property",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java#L299-L322 | train |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java | Path2dfx.isCurvedProperty | public BooleanProperty isCurvedProperty() {
if (this.isCurved == null) {
this.isCurved = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_CURVED, false);
this.isCurved.bind(Bindings.createBooleanBinding(() -> {
for (final PathElementType type : innerTypesProperty()) {
if (type == PathElementTy... | java | public BooleanProperty isCurvedProperty() {
if (this.isCurved == null) {
this.isCurved = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_CURVED, false);
this.isCurved.bind(Bindings.createBooleanBinding(() -> {
for (final PathElementType type : innerTypesProperty()) {
if (type == PathElementTy... | [
"public",
"BooleanProperty",
"isCurvedProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isCurved",
"==",
"null",
")",
"{",
"this",
".",
"isCurved",
"=",
"new",
"ReadOnlyBooleanWrapper",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"IS_CURVED",
",",
"false",... | Replies the isCurved property.
@return the isCurved property. | [
"Replies",
"the",
"isCurved",
"property",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java#L333-L347 | train |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java | Path2dfx.isPolygonProperty | public BooleanProperty isPolygonProperty() {
if (this.isPolygon == null) {
this.isPolygon = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_POLYGON, false);
this.isPolygon.bind(Bindings.createBooleanBinding(() -> {
boolean first = true;
boolean lastIsClose = false;
for (final PathElementTyp... | java | public BooleanProperty isPolygonProperty() {
if (this.isPolygon == null) {
this.isPolygon = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.IS_POLYGON, false);
this.isPolygon.bind(Bindings.createBooleanBinding(() -> {
boolean first = true;
boolean lastIsClose = false;
for (final PathElementTyp... | [
"public",
"BooleanProperty",
"isPolygonProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isPolygon",
"==",
"null",
")",
"{",
"this",
".",
"isPolygon",
"=",
"new",
"ReadOnlyBooleanWrapper",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"IS_POLYGON",
",",
"fal... | Replies the isPolygon property.
@return the isPolygon property. | [
"Replies",
"the",
"isPolygon",
"property",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java#L387-L411 | train |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java | Path2dfx.innerTypesProperty | protected ReadOnlyListWrapper<PathElementType> innerTypesProperty() {
if (this.types == null) {
this.types = new ReadOnlyListWrapper<>(this, MathFXAttributeNames.TYPES,
FXCollections.observableList(new ArrayList<>()));
}
return this.types;
} | java | protected ReadOnlyListWrapper<PathElementType> innerTypesProperty() {
if (this.types == null) {
this.types = new ReadOnlyListWrapper<>(this, MathFXAttributeNames.TYPES,
FXCollections.observableList(new ArrayList<>()));
}
return this.types;
} | [
"protected",
"ReadOnlyListWrapper",
"<",
"PathElementType",
">",
"innerTypesProperty",
"(",
")",
"{",
"if",
"(",
"this",
".",
"types",
"==",
"null",
")",
"{",
"this",
".",
"types",
"=",
"new",
"ReadOnlyListWrapper",
"<>",
"(",
"this",
",",
"MathFXAttributeName... | Replies the private types property.
@return the private types property. | [
"Replies",
"the",
"private",
"types",
"property",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d2/dfx/Path2dfx.java#L865-L871 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java | MultiMapLayer.setMapLayerAt | protected void setMapLayerAt(int index, L layer) {
this.subLayers.set(index, layer);
layer.setContainer(this);
resetBoundingBox();
} | java | protected void setMapLayerAt(int index, L layer) {
this.subLayers.set(index, layer);
layer.setContainer(this);
resetBoundingBox();
} | [
"protected",
"void",
"setMapLayerAt",
"(",
"int",
"index",
",",
"L",
"layer",
")",
"{",
"this",
".",
"subLayers",
".",
"set",
"(",
"index",
",",
"layer",
")",
";",
"layer",
".",
"setContainer",
"(",
"this",
")",
";",
"resetBoundingBox",
"(",
")",
";",
... | Put the given layer at the given index but
do not fire any event.
<p>This function does not test if the layer
is already present in the list of layers.
@param index index.
@param layer layer.
@throws IndexOutOfBoundsException if the index
is invalid. | [
"Put",
"the",
"given",
"layer",
"at",
"the",
"given",
"index",
"but",
"do",
"not",
"fire",
"any",
"event",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java#L286-L290 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java | MultiMapLayer.fireLayerAddedEvent | protected void fireLayerAddedEvent(MapLayer layer, int index) {
fireLayerHierarchyChangedEvent(new MapLayerHierarchyEvent(this, layer, Type.ADD_CHILD, index, layer.isTemporaryLayer()));
} | java | protected void fireLayerAddedEvent(MapLayer layer, int index) {
fireLayerHierarchyChangedEvent(new MapLayerHierarchyEvent(this, layer, Type.ADD_CHILD, index, layer.isTemporaryLayer()));
} | [
"protected",
"void",
"fireLayerAddedEvent",
"(",
"MapLayer",
"layer",
",",
"int",
"index",
")",
"{",
"fireLayerHierarchyChangedEvent",
"(",
"new",
"MapLayerHierarchyEvent",
"(",
"this",
",",
"layer",
",",
"Type",
".",
"ADD_CHILD",
",",
"index",
",",
"layer",
"."... | Fire the event that indicates a layer was added.
@param layer is the added layer.
@param index is the insertion index. | [
"Fire",
"the",
"event",
"that",
"indicates",
"a",
"layer",
"was",
"added",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java#L443-L445 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java | MultiMapLayer.fireLayerRemovedEvent | protected void fireLayerRemovedEvent(MapLayer layer, int oldChildIndex) {
fireLayerHierarchyChangedEvent(new MapLayerHierarchyEvent(
this, layer, Type.REMOVE_CHILD, oldChildIndex, layer.isTemporaryLayer()));
} | java | protected void fireLayerRemovedEvent(MapLayer layer, int oldChildIndex) {
fireLayerHierarchyChangedEvent(new MapLayerHierarchyEvent(
this, layer, Type.REMOVE_CHILD, oldChildIndex, layer.isTemporaryLayer()));
} | [
"protected",
"void",
"fireLayerRemovedEvent",
"(",
"MapLayer",
"layer",
",",
"int",
"oldChildIndex",
")",
"{",
"fireLayerHierarchyChangedEvent",
"(",
"new",
"MapLayerHierarchyEvent",
"(",
"this",
",",
"layer",
",",
"Type",
".",
"REMOVE_CHILD",
",",
"oldChildIndex",
... | Fire the event that indicates a layer was removed.
@param layer is the removed layer.
@param oldChildIndex the old child index. | [
"Fire",
"the",
"event",
"that",
"indicates",
"a",
"layer",
"was",
"removed",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java#L452-L455 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java | MultiMapLayer.fireLayerMovedUpEvent | protected void fireLayerMovedUpEvent(MapLayer layer, int newIndex) {
fireLayerHierarchyChangedEvent(new MapLayerHierarchyEvent(this, layer,
Type.MOVE_CHILD_UP, newIndex, layer.isTemporaryLayer()));
} | java | protected void fireLayerMovedUpEvent(MapLayer layer, int newIndex) {
fireLayerHierarchyChangedEvent(new MapLayerHierarchyEvent(this, layer,
Type.MOVE_CHILD_UP, newIndex, layer.isTemporaryLayer()));
} | [
"protected",
"void",
"fireLayerMovedUpEvent",
"(",
"MapLayer",
"layer",
",",
"int",
"newIndex",
")",
"{",
"fireLayerHierarchyChangedEvent",
"(",
"new",
"MapLayerHierarchyEvent",
"(",
"this",
",",
"layer",
",",
"Type",
".",
"MOVE_CHILD_UP",
",",
"newIndex",
",",
"l... | Fire the event that indicates a layer was moved up.
@param layer is the moved layer.
@param newIndex is the new index of the layer. | [
"Fire",
"the",
"event",
"that",
"indicates",
"a",
"layer",
"was",
"moved",
"up",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java#L462-L465 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java | MultiMapLayer.fireLayerMovedDownEvent | protected void fireLayerMovedDownEvent(MapLayer layer, int newIndex) {
fireLayerHierarchyChangedEvent(new MapLayerHierarchyEvent(this, layer,
Type.MOVE_CHILD_DOWN, newIndex, layer.isTemporaryLayer()));
} | java | protected void fireLayerMovedDownEvent(MapLayer layer, int newIndex) {
fireLayerHierarchyChangedEvent(new MapLayerHierarchyEvent(this, layer,
Type.MOVE_CHILD_DOWN, newIndex, layer.isTemporaryLayer()));
} | [
"protected",
"void",
"fireLayerMovedDownEvent",
"(",
"MapLayer",
"layer",
",",
"int",
"newIndex",
")",
"{",
"fireLayerHierarchyChangedEvent",
"(",
"new",
"MapLayerHierarchyEvent",
"(",
"this",
",",
"layer",
",",
"Type",
".",
"MOVE_CHILD_DOWN",
",",
"newIndex",
",",
... | Fire the event that indicates a layer was moved down.
@param layer is the moved layer.
@param newIndex is the new index of the layer. | [
"Fire",
"the",
"event",
"that",
"indicates",
"a",
"layer",
"was",
"moved",
"down",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java#L472-L475 | train |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java | MultiMapLayer.fireLayerRemoveAllEvent | protected void fireLayerRemoveAllEvent(List<? extends L> removedObjects) {
fireLayerHierarchyChangedEvent(
new MapLayerHierarchyEvent(
this,
removedObjects,
Type.REMOVE_ALL_CHILDREN,
-1,
isTemporaryLayer()));
} | java | protected void fireLayerRemoveAllEvent(List<? extends L> removedObjects) {
fireLayerHierarchyChangedEvent(
new MapLayerHierarchyEvent(
this,
removedObjects,
Type.REMOVE_ALL_CHILDREN,
-1,
isTemporaryLayer()));
} | [
"protected",
"void",
"fireLayerRemoveAllEvent",
"(",
"List",
"<",
"?",
"extends",
"L",
">",
"removedObjects",
")",
"{",
"fireLayerHierarchyChangedEvent",
"(",
"new",
"MapLayerHierarchyEvent",
"(",
"this",
",",
"removedObjects",
",",
"Type",
".",
"REMOVE_ALL_CHILDREN",... | Fire the event that indicates all the layers were removed.
@param removedObjects are the removed objects. | [
"Fire",
"the",
"event",
"that",
"indicates",
"all",
"the",
"layers",
"were",
"removed",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/maplayer/MultiMapLayer.java#L480-L488 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.