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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/utils/MaterialUtils.java | MaterialUtils.findLocalDocumentByParentAndUrlName | public static LocalDocument findLocalDocumentByParentAndUrlName(Folder parentFolder, String urlName) {
ResourceDAO resourceDAO = new ResourceDAO();
Resource resource = resourceDAO.findByUrlNameAndParentFolder(urlName, parentFolder);
if (resource instanceof LocalDocument) {
return (LocalDocument) ... | java | public static LocalDocument findLocalDocumentByParentAndUrlName(Folder parentFolder, String urlName) {
ResourceDAO resourceDAO = new ResourceDAO();
Resource resource = resourceDAO.findByUrlNameAndParentFolder(urlName, parentFolder);
if (resource instanceof LocalDocument) {
return (LocalDocument) ... | [
"public",
"static",
"LocalDocument",
"findLocalDocumentByParentAndUrlName",
"(",
"Folder",
"parentFolder",
",",
"String",
"urlName",
")",
"{",
"ResourceDAO",
"resourceDAO",
"=",
"new",
"ResourceDAO",
"(",
")",
";",
"Resource",
"resource",
"=",
"resourceDAO",
".",
"f... | Returns local document by parent folder and URL name
@param parentFolder parent folder
@param urlName URL name
@return Document or null if not found | [
"Returns",
"local",
"document",
"by",
"parent",
"folder",
"and",
"URL",
"name"
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/MaterialUtils.java#L109-L118 | train |
Metatavu/edelphi | rest/src/main/java/fi/metatavu/edelphi/rest/translate/AbstractTranslator.java | AbstractTranslator.translateDate | protected OffsetDateTime translateDate(Date date) {
if (date == null) {
return null;
}
return OffsetDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
} | java | protected OffsetDateTime translateDate(Date date) {
if (date == null) {
return null;
}
return OffsetDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
} | [
"protected",
"OffsetDateTime",
"translateDate",
"(",
"Date",
"date",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"OffsetDateTime",
".",
"ofInstant",
"(",
"date",
".",
"toInstant",
"(",
")",
",",
"ZoneId",
".... | Translates date into offset date time
@param date
@return offset date time | [
"Translates",
"date",
"into",
"offset",
"date",
"time"
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/translate/AbstractTranslator.java#L40-L46 | train |
Metatavu/edelphi | rest/src/main/java/fi/metatavu/edelphi/rest/translate/AbstractTranslator.java | AbstractTranslator.translateUserId | protected UUID translateUserId(User user) {
if (user == null) {
return null;
}
return userController.getUserKeycloakId(user);
} | java | protected UUID translateUserId(User user) {
if (user == null) {
return null;
}
return userController.getUserKeycloakId(user);
} | [
"protected",
"UUID",
"translateUserId",
"(",
"User",
"user",
")",
"{",
"if",
"(",
"user",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"userController",
".",
"getUserKeycloakId",
"(",
"user",
")",
";",
"}"
] | Translates user into user id
@param user user
@return user id | [
"Translates",
"user",
"into",
"user",
"id"
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/translate/AbstractTranslator.java#L54-L60 | train |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/utils/comments/AbstractReportPageCommentProcessor.java | AbstractReportPageCommentProcessor.getCommentLabel | public String getCommentLabel(Long id) {
Map<String, String> valueMap = answers.get(id);
if (valueMap != null && !valueMap.isEmpty()) {
Set<Entry<String,String>> entrySet = valueMap.entrySet();
List<String> labels = entrySet.stream()
.map(entry -> String.format("%s / %s", entry.getKey(), ent... | java | public String getCommentLabel(Long id) {
Map<String, String> valueMap = answers.get(id);
if (valueMap != null && !valueMap.isEmpty()) {
Set<Entry<String,String>> entrySet = valueMap.entrySet();
List<String> labels = entrySet.stream()
.map(entry -> String.format("%s / %s", entry.getKey(), ent... | [
"public",
"String",
"getCommentLabel",
"(",
"Long",
"id",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"valueMap",
"=",
"answers",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"valueMap",
"!=",
"null",
"&&",
"!",
"valueMap",
".",
"isEmpty",
"("... | Returns comment label as string
@param id comment id
@return comment label as string | [
"Returns",
"comment",
"label",
"as",
"string"
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/comments/AbstractReportPageCommentProcessor.java#L71-L83 | train |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/utils/comments/AbstractReportPageCommentProcessor.java | AbstractReportPageCommentProcessor.setCommentLabel | protected void setCommentLabel(Long id, String caption, String value) {
Map<String, String> valueMap = answers.get(id);
if (valueMap == null) {
valueMap = new LinkedHashMap<>();
}
valueMap.put(caption, value);
answers.put(id, valueMap);
} | java | protected void setCommentLabel(Long id, String caption, String value) {
Map<String, String> valueMap = answers.get(id);
if (valueMap == null) {
valueMap = new LinkedHashMap<>();
}
valueMap.put(caption, value);
answers.put(id, valueMap);
} | [
"protected",
"void",
"setCommentLabel",
"(",
"Long",
"id",
",",
"String",
"caption",
",",
"String",
"value",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"valueMap",
"=",
"answers",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"valueMap",
"==",
... | Sets a label for a specified comment
@param id comment id
@param caption caption
@param value value | [
"Sets",
"a",
"label",
"for",
"a",
"specified",
"comment"
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/comments/AbstractReportPageCommentProcessor.java#L101-L109 | train |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/utils/comments/AbstractReportPageCommentProcessor.java | AbstractReportPageCommentProcessor.listRootComments | private List<QueryQuestionComment> listRootComments() {
QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO();
return queryQuestionCommentDAO.listRootCommentsByQueryPageAndStampOrderByCreated(queryPage, panelStamp);
} | java | private List<QueryQuestionComment> listRootComments() {
QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO();
return queryQuestionCommentDAO.listRootCommentsByQueryPageAndStampOrderByCreated(queryPage, panelStamp);
} | [
"private",
"List",
"<",
"QueryQuestionComment",
">",
"listRootComments",
"(",
")",
"{",
"QueryQuestionCommentDAO",
"queryQuestionCommentDAO",
"=",
"new",
"QueryQuestionCommentDAO",
"(",
")",
";",
"return",
"queryQuestionCommentDAO",
".",
"listRootCommentsByQueryPageAndStampOr... | Lists page's root comments
@return page's root comments | [
"Lists",
"page",
"s",
"root",
"comments"
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/comments/AbstractReportPageCommentProcessor.java#L116-L119 | train |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/liquibase/changes/FixInvitations.java | FixInvitations.isPanelUser | private boolean isPanelUser(JdbcConnection connection, Long panelId, String email) throws CustomChangeException {
try (PreparedStatement statement = connection.prepareStatement("SELECT id FROM PANELUSER WHERE panel_id = ? AND user_id = (SELECT id FROM USEREMAIL WHERE address = ?)")) {
statement.setLong(1, pan... | java | private boolean isPanelUser(JdbcConnection connection, Long panelId, String email) throws CustomChangeException {
try (PreparedStatement statement = connection.prepareStatement("SELECT id FROM PANELUSER WHERE panel_id = ? AND user_id = (SELECT id FROM USEREMAIL WHERE address = ?)")) {
statement.setLong(1, pan... | [
"private",
"boolean",
"isPanelUser",
"(",
"JdbcConnection",
"connection",
",",
"Long",
"panelId",
",",
"String",
"email",
")",
"throws",
"CustomChangeException",
"{",
"try",
"(",
"PreparedStatement",
"statement",
"=",
"connection",
".",
"prepareStatement",
"(",
"\"S... | Returns whether user by email is a PanelUser or not
@param connection connection
@param panelId panel id
@param email email
@return whether user by email is a PanelUser or not
@throws CustomChangeException on error | [
"Returns",
"whether",
"user",
"by",
"email",
"is",
"a",
"PanelUser",
"or",
"not"
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/liquibase/changes/FixInvitations.java#L48-L59 | train |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/liquibase/changes/FixInvitations.java | FixInvitations.deleteInvitation | private void deleteInvitation(JdbcConnection connection, Long id) throws CustomChangeException {
try (PreparedStatement statement = connection.prepareStatement("DELETE FROM PANELINVITATION WHERE id = ?")) {
statement.setLong(1, id);
statement.execute();
} catch (Exception e) {
throw new Custom... | java | private void deleteInvitation(JdbcConnection connection, Long id) throws CustomChangeException {
try (PreparedStatement statement = connection.prepareStatement("DELETE FROM PANELINVITATION WHERE id = ?")) {
statement.setLong(1, id);
statement.execute();
} catch (Exception e) {
throw new Custom... | [
"private",
"void",
"deleteInvitation",
"(",
"JdbcConnection",
"connection",
",",
"Long",
"id",
")",
"throws",
"CustomChangeException",
"{",
"try",
"(",
"PreparedStatement",
"statement",
"=",
"connection",
".",
"prepareStatement",
"(",
"\"DELETE FROM PANELINVITATION WHERE ... | Deletes an invitation
@param connection connection
@param id invitation id
@throws CustomChangeException on error | [
"Deletes",
"an",
"invitation"
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/liquibase/changes/FixInvitations.java#L68-L75 | train |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/QueryFieldDataStatistics.java | QueryFieldDataStatistics.getQuantile | public Double getQuantile(int quantile, int base) {
if (getCount() == 0)
return null;
if ((quantile > base) || (quantile <= 0) || (base <= 0))
throw new IllegalArgumentException("Incorrect quantile/base specified.");
double quantileFraq = (double) quantile / base;
int index = ... | java | public Double getQuantile(int quantile, int base) {
if (getCount() == 0)
return null;
if ((quantile > base) || (quantile <= 0) || (base <= 0))
throw new IllegalArgumentException("Incorrect quantile/base specified.");
double quantileFraq = (double) quantile / base;
int index = ... | [
"public",
"Double",
"getQuantile",
"(",
"int",
"quantile",
",",
"int",
"base",
")",
"{",
"if",
"(",
"getCount",
"(",
")",
"==",
"0",
")",
"return",
"null",
";",
"if",
"(",
"(",
"quantile",
">",
"base",
")",
"||",
"(",
"quantile",
"<=",
"0",
")",
... | Returns quantile over base value.
@param quantile quantile index
@param base quantile base
@return quantile over base value. | [
"Returns",
"quantile",
"over",
"base",
"value",
"."
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/QueryFieldDataStatistics.java#L110-L122 | train |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/thesis/ThesisTimelineQueryReportPage.java | ThesisTimelineQueryReportPage.createStatistics | private QueryFieldDataStatistics createStatistics(List<Double> data, double min, double max, double step) {
Map<Double, String> dataNames = new HashMap<>();
for (double d = min; d <= max; d += step) {
String caption = step % 1 == 0 ? Long.toString(Math.round(d)) : Double.toString(d);
dataNames.... | java | private QueryFieldDataStatistics createStatistics(List<Double> data, double min, double max, double step) {
Map<Double, String> dataNames = new HashMap<>();
for (double d = min; d <= max; d += step) {
String caption = step % 1 == 0 ? Long.toString(Math.round(d)) : Double.toString(d);
dataNames.... | [
"private",
"QueryFieldDataStatistics",
"createStatistics",
"(",
"List",
"<",
"Double",
">",
"data",
",",
"double",
"min",
",",
"double",
"max",
",",
"double",
"step",
")",
"{",
"Map",
"<",
"Double",
",",
"String",
">",
"dataNames",
"=",
"new",
"HashMap",
"... | Creates statistics object
@param data data
@param min min
@param max max
@param step step
@return statistics object | [
"Creates",
"statistics",
"object"
] | d91a0b54f954b33b4ee674a1bdf03612d76c3305 | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/thesis/ThesisTimelineQueryReportPage.java#L142-L151 | train |
blackdoor/blackdoor | src/main/java/black/door/util/CommandLineParser.java | CommandLineParser.getParsedArgs | @Deprecated
public List<List<String>> getParsedArgs(String[] args)
throws InvalidFormatException {
for (int i = 0; i < args.length; i++) {
if (!args[i].startsWith("-")) {
if (this.params.size() > 0) {
List<String> option = new ArrayList<String>();
option.add(this.params.get(0).longOption);
t... | java | @Deprecated
public List<List<String>> getParsedArgs(String[] args)
throws InvalidFormatException {
for (int i = 0; i < args.length; i++) {
if (!args[i].startsWith("-")) {
if (this.params.size() > 0) {
List<String> option = new ArrayList<String>();
option.add(this.params.get(0).longOption);
t... | [
"@",
"Deprecated",
"public",
"List",
"<",
"List",
"<",
"String",
">",
">",
"getParsedArgs",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"InvalidFormatException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"args",
".",
"length",
";",
"i... | Get the parsed and checked command line arguments for this parser
@param args
- The command line arguments to add. These can be passed
straight from the parameter of main(String[])
<p>
@return A list of strings, the first([0]) element in each list is the
command line option, if the second([1]) element exists it is the... | [
"Get",
"the",
"parsed",
"and",
"checked",
"command",
"line",
"arguments",
"for",
"this",
"parser"
] | 060c7a71dfafb85e10e8717736e6d3160262e96b | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/util/CommandLineParser.java#L75-L123 | train |
blackdoor/blackdoor | src/main/java/black/door/util/CommandLineParser.java | CommandLineParser.addArguments | @Deprecated
public void addArguments(String[] argList) throws DuplicateOptionException,
InvalidFormatException {
for (String arg : argList) {
Argument f = new Argument();
String[] breakdown = arg.split(",");
for (String s : breakdown) {
s = s.trim();
if (s.startsWith("--")) {
f.longOption = ... | java | @Deprecated
public void addArguments(String[] argList) throws DuplicateOptionException,
InvalidFormatException {
for (String arg : argList) {
Argument f = new Argument();
String[] breakdown = arg.split(",");
for (String s : breakdown) {
s = s.trim();
if (s.startsWith("--")) {
f.longOption = ... | [
"@",
"Deprecated",
"public",
"void",
"addArguments",
"(",
"String",
"[",
"]",
"argList",
")",
"throws",
"DuplicateOptionException",
",",
"InvalidFormatException",
"{",
"for",
"(",
"String",
"arg",
":",
"argList",
")",
"{",
"Argument",
"f",
"=",
"new",
"Argumen... | adds options for this command line parser
@param argList
a list of Strings of options in a comma separated format
<p>
single char options should be prepended with a single "-"
<p>
string options should be prepended with "--"
<p>
non-option parameters should add a "?" to the string.
non-option parameters should define ... | [
"adds",
"options",
"for",
"this",
"command",
"line",
"parser"
] | 060c7a71dfafb85e10e8717736e6d3160262e96b | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/util/CommandLineParser.java#L449-L479 | train |
blackdoor/blackdoor | src/main/java/black/door/util/CommandLineParser.java | CommandLineParser.addArgument | @Deprecated
public void addArgument(char shortForm, String longForm, String helpText,
boolean isParameter, boolean takesValue, boolean valueRequired)
throws DuplicateOptionException {
Argument f = new Argument();
f.option = "" + shortForm;
f.longOption = longForm;
f.takesValue = takesValue;
f.valueRequ... | java | @Deprecated
public void addArgument(char shortForm, String longForm, String helpText,
boolean isParameter, boolean takesValue, boolean valueRequired)
throws DuplicateOptionException {
Argument f = new Argument();
f.option = "" + shortForm;
f.longOption = longForm;
f.takesValue = takesValue;
f.valueRequ... | [
"@",
"Deprecated",
"public",
"void",
"addArgument",
"(",
"char",
"shortForm",
",",
"String",
"longForm",
",",
"String",
"helpText",
",",
"boolean",
"isParameter",
",",
"boolean",
"takesValue",
",",
"boolean",
"valueRequired",
")",
"throws",
"DuplicateOptionException... | Add an argument for this command line parser. Options should not be
prepended by dashes.
@param shortForm
Single character command line option
@param longForm
String command line option
@param helpText
Help text to show after the short and long form in
getHelpText()
@param isParameter
True if this argument is a parame... | [
"Add",
"an",
"argument",
"for",
"this",
"command",
"line",
"parser",
".",
"Options",
"should",
"not",
"be",
"prepended",
"by",
"dashes",
"."
] | 060c7a71dfafb85e10e8717736e6d3160262e96b | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/util/CommandLineParser.java#L520-L534 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java | JDesktopPaneLayout.add | public void add(JDesktopPaneLayout child, Object constraints, int index)
{
if (child.parent != this)
{
throw new IllegalArgumentException(
"Layout is not a child of this layout");
}
container.add(child.container, constraints, index);
} | java | public void add(JDesktopPaneLayout child, Object constraints, int index)
{
if (child.parent != this)
{
throw new IllegalArgumentException(
"Layout is not a child of this layout");
}
container.add(child.container, constraints, index);
} | [
"public",
"void",
"add",
"(",
"JDesktopPaneLayout",
"child",
",",
"Object",
"constraints",
",",
"int",
"index",
")",
"{",
"if",
"(",
"child",
".",
"parent",
"!=",
"this",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Layout is not a child of this... | Add the given desktop pane layout as a child to this one
@param child The child to add
@param constraints The constraints.
See {@link Container#add(Component, Object)}
@param index The index.
See {@link Container#add(Component, Object, int)}
@throws IllegalArgumentException If the given child was not
created by callin... | [
"Add",
"the",
"given",
"desktop",
"pane",
"layout",
"as",
"a",
"child",
"to",
"this",
"one"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java#L271-L279 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java | JDesktopPaneLayout.remove | public void remove(JDesktopPaneLayout child)
{
if (child.parent != this)
{
throw new IllegalArgumentException(
"Layout is not a child of this layout");
}
container.remove(child.container);
} | java | public void remove(JDesktopPaneLayout child)
{
if (child.parent != this)
{
throw new IllegalArgumentException(
"Layout is not a child of this layout");
}
container.remove(child.container);
} | [
"public",
"void",
"remove",
"(",
"JDesktopPaneLayout",
"child",
")",
"{",
"if",
"(",
"child",
".",
"parent",
"!=",
"this",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Layout is not a child of this layout\"",
")",
";",
"}",
"container",
".",
"re... | Remove the given child layout
@param child The child to remove
@throws IllegalArgumentException If the given child was not
created by calling {@link #createChild()} on this layout | [
"Remove",
"the",
"given",
"child",
"layout"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java#L288-L296 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java | JDesktopPaneLayout.validate | public void validate()
{
Dimension size = desktopPane.getSize();
size.height -= computeDesktopIconsSpace();
layoutInternalFrames(size);
} | java | public void validate()
{
Dimension size = desktopPane.getSize();
size.height -= computeDesktopIconsSpace();
layoutInternalFrames(size);
} | [
"public",
"void",
"validate",
"(",
")",
"{",
"Dimension",
"size",
"=",
"desktopPane",
".",
"getSize",
"(",
")",
";",
"size",
".",
"height",
"-=",
"computeDesktopIconsSpace",
"(",
")",
";",
"layoutInternalFrames",
"(",
"size",
")",
";",
"}"
] | Validate the layout after internal frames have been added
or removed | [
"Validate",
"the",
"layout",
"after",
"internal",
"frames",
"have",
"been",
"added",
"or",
"removed"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java#L379-L384 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java | JDesktopPaneLayout.computeDesktopIconsSpace | private int computeDesktopIconsSpace()
{
for (JInternalFrame f : frameToComponent.keySet())
{
if (f.isIcon())
{
JDesktopIcon desktopIcon = f.getDesktopIcon();
return desktopIcon.getPreferredSize().height;
}
}
... | java | private int computeDesktopIconsSpace()
{
for (JInternalFrame f : frameToComponent.keySet())
{
if (f.isIcon())
{
JDesktopIcon desktopIcon = f.getDesktopIcon();
return desktopIcon.getPreferredSize().height;
}
}
... | [
"private",
"int",
"computeDesktopIconsSpace",
"(",
")",
"{",
"for",
"(",
"JInternalFrame",
"f",
":",
"frameToComponent",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"f",
".",
"isIcon",
"(",
")",
")",
"{",
"JDesktopIcon",
"desktopIcon",
"=",
"f",
".",
... | Compute the space for iconified desktop icons
@return The space | [
"Compute",
"the",
"space",
"for",
"iconified",
"desktop",
"icons"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java#L391-L402 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java | JDesktopPaneLayout.callDoLayout | private void callDoLayout(Container container)
{
container.doLayout();
int n = container.getComponentCount();
for (int i=0; i<n; i++)
{
Component component = container.getComponent(i);
if (component instanceof Container)
{
... | java | private void callDoLayout(Container container)
{
container.doLayout();
int n = container.getComponentCount();
for (int i=0; i<n; i++)
{
Component component = container.getComponent(i);
if (component instanceof Container)
{
... | [
"private",
"void",
"callDoLayout",
"(",
"Container",
"container",
")",
"{",
"container",
".",
"doLayout",
"(",
")",
";",
"int",
"n",
"=",
"container",
".",
"getComponentCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",... | Recursively call doLayout on the container and all its
sub-containers
@param container The container | [
"Recursively",
"call",
"doLayout",
"on",
"the",
"container",
"and",
"all",
"its",
"sub",
"-",
"containers"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java#L422-L435 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java | JDesktopPaneLayout.applyLayout | private void applyLayout()
{
int n = container.getComponentCount();
for (int i=0; i<n; i++)
{
Component component = container.getComponent(i);
if (component instanceof FrameComponent)
{
FrameComponent frameComponent = (FrameComponen... | java | private void applyLayout()
{
int n = container.getComponentCount();
for (int i=0; i<n; i++)
{
Component component = container.getComponent(i);
if (component instanceof FrameComponent)
{
FrameComponent frameComponent = (FrameComponen... | [
"private",
"void",
"applyLayout",
"(",
")",
"{",
"int",
"n",
"=",
"container",
".",
"getComponentCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"{",
"Component",
"component",
"=",
"container",
".",... | Apply the current layout to the internal frames | [
"Apply",
"the",
"current",
"layout",
"to",
"the",
"internal",
"frames"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/utils/desktop/JDesktopPaneLayout.java#L441-L467 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/BenchmarkResult.java | BenchmarkResult.addData | public void addData(final BenchmarkMethod meth, final AbstractMeter meter, final double data) {
final Class<?> clazz = meth.getMethodToBench().getDeclaringClass();
if (!elements.containsKey(clazz)) {
elements.put(clazz, new ClassResult(clazz));
}
final ClassResult clazzResu... | java | public void addData(final BenchmarkMethod meth, final AbstractMeter meter, final double data) {
final Class<?> clazz = meth.getMethodToBench().getDeclaringClass();
if (!elements.containsKey(clazz)) {
elements.put(clazz, new ClassResult(clazz));
}
final ClassResult clazzResu... | [
"public",
"void",
"addData",
"(",
"final",
"BenchmarkMethod",
"meth",
",",
"final",
"AbstractMeter",
"meter",
",",
"final",
"double",
"data",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"clazz",
"=",
"meth",
".",
"getMethodToBench",
"(",
")",
".",
"getDecla... | Adding a dataset to a given meter and adapting the underlaying result model.
@param meth where the result is corresponding to
@param meter where the result is corresponding to
@param data the data itself | [
"Adding",
"a",
"dataset",
"to",
"a",
"given",
"meter",
"and",
"adapting",
"the",
"underlaying",
"result",
"model",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/BenchmarkResult.java#L79-L101 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/BenchmarkResult.java | BenchmarkResult.addException | public void addException(final AbstractPerfidixMethodException exec) {
this.getExceptions().add(exec);
for (final AbstractOutput output : outputs) {
output.listenToException(exec);
}
} | java | public void addException(final AbstractPerfidixMethodException exec) {
this.getExceptions().add(exec);
for (final AbstractOutput output : outputs) {
output.listenToException(exec);
}
} | [
"public",
"void",
"addException",
"(",
"final",
"AbstractPerfidixMethodException",
"exec",
")",
"{",
"this",
".",
"getExceptions",
"(",
")",
".",
"add",
"(",
"exec",
")",
";",
"for",
"(",
"final",
"AbstractOutput",
"output",
":",
"outputs",
")",
"{",
"output... | Adding an exception to this result.
@param exec the exception stored to this result | [
"Adding",
"an",
"exception",
"to",
"this",
"result",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/BenchmarkResult.java#L108-L113 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/Actions.java | Actions.create | static Action create(Runnable command)
{
Objects.requireNonNull(command, "The command may not be null");
return new AbstractAction()
{
/**
* Serial UID
*/
private static final long serialVersionUID = 8693271079128413874L;
... | java | static Action create(Runnable command)
{
Objects.requireNonNull(command, "The command may not be null");
return new AbstractAction()
{
/**
* Serial UID
*/
private static final long serialVersionUID = 8693271079128413874L;
... | [
"static",
"Action",
"create",
"(",
"Runnable",
"command",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"command",
",",
"\"The command may not be null\"",
")",
";",
"return",
"new",
"AbstractAction",
"(",
")",
"{",
"/**\r\n * Serial UID\r\n */... | Create a new action that simply executes the given command
@param command The command
@return The action | [
"Create",
"a",
"new",
"action",
"that",
"simply",
"executes",
"the",
"given",
"command"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/Actions.java#L46-L62 | train |
blackdoor/blackdoor | src/main/java/black/door/crypto/Crypto.java | Crypto.doAESEncryption | public void doAESEncryption() throws Exception{
if(!initAESDone)
initAES();
cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
//System.out.println(secretKey.getEncoded());
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
AlgorithmParameters params = cipher.getParameters();
iv = params.getParameterSpec(IvP... | java | public void doAESEncryption() throws Exception{
if(!initAESDone)
initAES();
cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
//System.out.println(secretKey.getEncoded());
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
AlgorithmParameters params = cipher.getParameters();
iv = params.getParameterSpec(IvP... | [
"public",
"void",
"doAESEncryption",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"initAESDone",
")",
"initAES",
"(",
")",
";",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"\"AES/CBC/PKCS5Padding\"",
")",
";",
"//System.out.println(secretKey.getEnco... | clears all plaintext passwords and secrets. password, secret and initAES must all be set before re-using
@throws Exception | [
"clears",
"all",
"plaintext",
"passwords",
"and",
"secrets",
".",
"password",
"secret",
"and",
"initAES",
"must",
"all",
"be",
"set",
"before",
"re",
"-",
"using"
] | 060c7a71dfafb85e10e8717736e6d3160262e96b | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/crypto/Crypto.java#L174-L184 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/GuiUtils.java | GuiUtils.wrapTitled | public static JPanel wrapTitled(String title, JComponent component)
{
JPanel p = new JPanel(new GridLayout(1,1));
p.setBorder(BorderFactory.createTitledBorder(title));
p.add(component);
return p;
} | java | public static JPanel wrapTitled(String title, JComponent component)
{
JPanel p = new JPanel(new GridLayout(1,1));
p.setBorder(BorderFactory.createTitledBorder(title));
p.add(component);
return p;
} | [
"public",
"static",
"JPanel",
"wrapTitled",
"(",
"String",
"title",
",",
"JComponent",
"component",
")",
"{",
"JPanel",
"p",
"=",
"new",
"JPanel",
"(",
"new",
"GridLayout",
"(",
"1",
",",
"1",
")",
")",
";",
"p",
".",
"setBorder",
"(",
"BorderFactory",
... | Wrap the given component into a panel with a titled border with
the given title
@param title The title
@param component The component
@return The panel | [
"Wrap",
"the",
"given",
"component",
"into",
"a",
"panel",
"with",
"a",
"titled",
"border",
"with",
"the",
"given",
"title"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/GuiUtils.java#L72-L78 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/GuiUtils.java | GuiUtils.wrapFlow | public static JPanel wrapFlow(JComponent component)
{
JPanel p = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
p.add(component);
return p;
} | java | public static JPanel wrapFlow(JComponent component)
{
JPanel p = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
p.add(component);
return p;
} | [
"public",
"static",
"JPanel",
"wrapFlow",
"(",
"JComponent",
"component",
")",
"{",
"JPanel",
"p",
"=",
"new",
"JPanel",
"(",
"new",
"FlowLayout",
"(",
"FlowLayout",
".",
"CENTER",
",",
"0",
",",
"0",
")",
")",
";",
"p",
".",
"add",
"(",
"component",
... | Wrap the given component into a panel with flow layout
@param component The component
@return The panel | [
"Wrap",
"the",
"given",
"component",
"into",
"a",
"panel",
"with",
"flow",
"layout"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/GuiUtils.java#L86-L91 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/GuiUtils.java | GuiUtils.setDeepEnabled | public static void setDeepEnabled(Component component, boolean enabled)
{
component.setEnabled(enabled);
if (component instanceof Container)
{
Container container = (Container)component;
for (Component c : container.getComponents())
{
... | java | public static void setDeepEnabled(Component component, boolean enabled)
{
component.setEnabled(enabled);
if (component instanceof Container)
{
Container container = (Container)component;
for (Component c : container.getComponents())
{
... | [
"public",
"static",
"void",
"setDeepEnabled",
"(",
"Component",
"component",
",",
"boolean",
"enabled",
")",
"{",
"component",
".",
"setEnabled",
"(",
"enabled",
")",
";",
"if",
"(",
"component",
"instanceof",
"Container",
")",
"{",
"Container",
"container",
"... | Enables or disables the given component and all its children
recursively
@param component The component
@param enabled Whether the component tree should be enabled | [
"Enables",
"or",
"disables",
"the",
"given",
"component",
"and",
"all",
"its",
"children",
"recursively"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/GuiUtils.java#L100-L111 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/StringUtils.java | StringUtils.indexOf | static int indexOf(String source, String target,
int startIndex, boolean ignoreCase)
{
if (ignoreCase)
{
return indexOf(source, target, startIndex, IGNORING_CASE);
}
return indexOf(source, target, startIndex,
(c0, c1) -> Integer.compare(c0, c... | java | static int indexOf(String source, String target,
int startIndex, boolean ignoreCase)
{
if (ignoreCase)
{
return indexOf(source, target, startIndex, IGNORING_CASE);
}
return indexOf(source, target, startIndex,
(c0, c1) -> Integer.compare(c0, c... | [
"static",
"int",
"indexOf",
"(",
"String",
"source",
",",
"String",
"target",
",",
"int",
"startIndex",
",",
"boolean",
"ignoreCase",
")",
"{",
"if",
"(",
"ignoreCase",
")",
"{",
"return",
"indexOf",
"(",
"source",
",",
"target",
",",
"startIndex",
",",
... | Returns the index of the first appearance of the given target in
the given source, starting at the given index. Returns -1 if the
target string is not found.
@param source The source string
@param target The target string
@param startIndex The start index
@param ignoreCase Whether the case should be ignored
@return Th... | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"appearance",
"of",
"the",
"given",
"target",
"in",
"the",
"given",
"source",
"starting",
"at",
"the",
"given",
"index",
".",
"Returns",
"-",
"1",
"if",
"the",
"target",
"string",
"is",
"not",
"found",
"."... | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/StringUtils.java#L66-L75 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/StringUtils.java | StringUtils.indexOf | private static int indexOf(String source, String target,
int startIndex, IntBinaryOperator comparator)
{
return indexOf(
source, 0, source.length(),
target, 0, target.length(),
startIndex, comparator);
} | java | private static int indexOf(String source, String target,
int startIndex, IntBinaryOperator comparator)
{
return indexOf(
source, 0, source.length(),
target, 0, target.length(),
startIndex, comparator);
} | [
"private",
"static",
"int",
"indexOf",
"(",
"String",
"source",
",",
"String",
"target",
",",
"int",
"startIndex",
",",
"IntBinaryOperator",
"comparator",
")",
"{",
"return",
"indexOf",
"(",
"source",
",",
"0",
",",
"source",
".",
"length",
"(",
")",
",",
... | Returns the index of the first appearance of the given target in
the given source, starting at the given index, using the given
comparator for characters. Returns -1 if the target string is
not found.
@param source The source string
@param target The target string
@param startIndex The start index
@param comparator Th... | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"appearance",
"of",
"the",
"given",
"target",
"in",
"the",
"given",
"source",
"starting",
"at",
"the",
"given",
"index",
"using",
"the",
"given",
"comparator",
"for",
"characters",
".",
"Returns",
"-",
"1",
... | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/StringUtils.java#L89-L96 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/StringUtils.java | StringUtils.indexOf | private static int indexOf(
String source, int sourceOffset, int sourceCount,
String target, int targetOffset, int targetCount,
int startIndex, IntBinaryOperator comparator)
{
int fromIndex = startIndex;
// Adapted from String#indexOf
if (fromIndex >... | java | private static int indexOf(
String source, int sourceOffset, int sourceCount,
String target, int targetOffset, int targetCount,
int startIndex, IntBinaryOperator comparator)
{
int fromIndex = startIndex;
// Adapted from String#indexOf
if (fromIndex >... | [
"private",
"static",
"int",
"indexOf",
"(",
"String",
"source",
",",
"int",
"sourceOffset",
",",
"int",
"sourceCount",
",",
"String",
"target",
",",
"int",
"targetOffset",
",",
"int",
"targetCount",
",",
"int",
"startIndex",
",",
"IntBinaryOperator",
"comparator... | Returns the index of the first appearance of the given range of the
target in the given range of the source, source, starting at the
given index, using the given comparator for characters. Returns -1 if
the target string is not found.
@param source The source string
@param sourceOffset The source offset
@param sourceC... | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"appearance",
"of",
"the",
"given",
"range",
"of",
"the",
"target",
"in",
"the",
"given",
"range",
"of",
"the",
"source",
"source",
"starting",
"at",
"the",
"given",
"index",
"using",
"the",
"given",
"compar... | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/StringUtils.java#L114-L165 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/StringUtils.java | StringUtils.lastIndexOf | private static int lastIndexOf(String source, String target,
int startIndex, IntBinaryOperator comparator)
{
return lastIndexOf(
source, 0, source.length(),
target, 0, target.length(),
startIndex, comparator);
} | java | private static int lastIndexOf(String source, String target,
int startIndex, IntBinaryOperator comparator)
{
return lastIndexOf(
source, 0, source.length(),
target, 0, target.length(),
startIndex, comparator);
} | [
"private",
"static",
"int",
"lastIndexOf",
"(",
"String",
"source",
",",
"String",
"target",
",",
"int",
"startIndex",
",",
"IntBinaryOperator",
"comparator",
")",
"{",
"return",
"lastIndexOf",
"(",
"source",
",",
"0",
",",
"source",
".",
"length",
"(",
")",... | Returns the index of the previous appearance of the given target in
the given source, starting at the given index, using the given
comparator for characters. Returns -1 if the target string is
not found.
@param source The source string
@param target The target string
@param startIndex The start index
@param comparator... | [
"Returns",
"the",
"index",
"of",
"the",
"previous",
"appearance",
"of",
"the",
"given",
"target",
"in",
"the",
"given",
"source",
"starting",
"at",
"the",
"given",
"index",
"using",
"the",
"given",
"comparator",
"for",
"characters",
".",
"Returns",
"-",
"1",... | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/StringUtils.java#L201-L208 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/StringUtils.java | StringUtils.lastIndexOf | static int lastIndexOf(
String source, int sourceOffset, int sourceCount,
String target, int targetOffset, int targetCount,
int startIndex, IntBinaryOperator comparator)
{
int fromIndex = startIndex;
// Adapted from String#lastIndexOf
int rightIndex ... | java | static int lastIndexOf(
String source, int sourceOffset, int sourceCount,
String target, int targetOffset, int targetCount,
int startIndex, IntBinaryOperator comparator)
{
int fromIndex = startIndex;
// Adapted from String#lastIndexOf
int rightIndex ... | [
"static",
"int",
"lastIndexOf",
"(",
"String",
"source",
",",
"int",
"sourceOffset",
",",
"int",
"sourceCount",
",",
"String",
"target",
",",
"int",
"targetOffset",
",",
"int",
"targetCount",
",",
"int",
"startIndex",
",",
"IntBinaryOperator",
"comparator",
")",... | Returns the index of the previous appearance of the given range of the
target in the given range of the source, source, starting at the
given index, using the given comparator for characters. Returns -1 if
the target string is not found.
@param source The source string
@param sourceOffset The source offset
@param sour... | [
"Returns",
"the",
"index",
"of",
"the",
"previous",
"appearance",
"of",
"the",
"given",
"range",
"of",
"the",
"target",
"in",
"the",
"given",
"range",
"of",
"the",
"source",
"source",
"starting",
"at",
"the",
"given",
"index",
"using",
"the",
"given",
"com... | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/StringUtils.java#L226-L279 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/ServiceApiWrapper.java | ServiceApiWrapper.doQueryMessages | Observable<ComapiResult<MessagesQueryResponse>> doQueryMessages(@NonNull final String token, @NonNull final String conversationId, final Long from, @NonNull final Integer limit) {
return wrapObservable(service.queryMessages(AuthManager.addAuthPrefix(token), apiSpaceId, conversationId, from, limit).map(mapToComa... | java | Observable<ComapiResult<MessagesQueryResponse>> doQueryMessages(@NonNull final String token, @NonNull final String conversationId, final Long from, @NonNull final Integer limit) {
return wrapObservable(service.queryMessages(AuthManager.addAuthPrefix(token), apiSpaceId, conversationId, from, limit).map(mapToComa... | [
"Observable",
"<",
"ComapiResult",
"<",
"MessagesQueryResponse",
">",
">",
"doQueryMessages",
"(",
"@",
"NonNull",
"final",
"String",
"token",
",",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"final",
"Long",
"from",
",",
"@",
"NonNull",
"final",
... | Query messages in a conversation.
@param token Comapi access token.
@param conversationId Id of the conversation.
@param from Event id to start from when agregating messages.
@param limit Limit of messages send in query response.
@return Observable to get messages in a conversation. | [
"Query",
"messages",
"in",
"a",
"conversation",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/ServiceApiWrapper.java#L307-L309 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/ServiceApiWrapper.java | ServiceApiWrapper.doIsTyping | Observable<ComapiResult<Void>> doIsTyping(@NonNull final String token, @NonNull final String conversationId, final boolean isTyping) {
if (isTyping) {
return wrapObservable(service.isTyping(AuthManager.addAuthPrefix(token), apiSpaceId, conversationId).map(mapToComapiResult()), log, "Sending is typin... | java | Observable<ComapiResult<Void>> doIsTyping(@NonNull final String token, @NonNull final String conversationId, final boolean isTyping) {
if (isTyping) {
return wrapObservable(service.isTyping(AuthManager.addAuthPrefix(token), apiSpaceId, conversationId).map(mapToComapiResult()), log, "Sending is typin... | [
"Observable",
"<",
"ComapiResult",
"<",
"Void",
">",
">",
"doIsTyping",
"(",
"@",
"NonNull",
"final",
"String",
"token",
",",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"final",
"boolean",
"isTyping",
")",
"{",
"if",
"(",
"isTyping",
")",
"{... | Send information if user started or stopped typing message in a conversation.
@param token Comapi access token.
@param conversationId Id of the conversation.
@return Observable to send 'is typing' notification. | [
"Send",
"information",
"if",
"user",
"started",
"or",
"stopped",
"typing",
"message",
"in",
"a",
"conversation",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/ServiceApiWrapper.java#L328-L334 | train |
blackdoor/blackdoor | src/main/java/black/door/crypto/SHECipher.java | SHECipher.init | @Override
public void init(Key key, IvParameterSpec iv) throws InvalidKeyException {
if(!(key instanceof SecretKey))
throw new InvalidKeyException();
int ivLength = iv.getIV().length;
if(key.getEncoded().length < MIN_KEY_SIZE || key.getEncoded().length < ivLength)
throw new InvalidKeyException("Key must be... | java | @Override
public void init(Key key, IvParameterSpec iv) throws InvalidKeyException {
if(!(key instanceof SecretKey))
throw new InvalidKeyException();
int ivLength = iv.getIV().length;
if(key.getEncoded().length < MIN_KEY_SIZE || key.getEncoded().length < ivLength)
throw new InvalidKeyException("Key must be... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"Key",
"key",
",",
"IvParameterSpec",
"iv",
")",
"throws",
"InvalidKeyException",
"{",
"if",
"(",
"!",
"(",
"key",
"instanceof",
"SecretKey",
")",
")",
"throw",
"new",
"InvalidKeyException",
"(",
")",
";",
"i... | Initializes the cipher with key and iv
@param iv An initialization vector to use for the cipher.
@param key A key to encrypt with.
@throws InvalidKeyException | [
"Initializes",
"the",
"cipher",
"with",
"key",
"and",
"iv"
] | 060c7a71dfafb85e10e8717736e6d3160262e96b | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/crypto/SHECipher.java#L84-L98 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onParticipantIsTyping | private void onParticipantIsTyping(ParticipantTypingEvent event) {
handler.post(() -> listener.onParticipantIsTyping(event));
log("Event published " + event.toString());
} | java | private void onParticipantIsTyping(ParticipantTypingEvent event) {
handler.post(() -> listener.onParticipantIsTyping(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onParticipantIsTyping",
"(",
"ParticipantTypingEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onParticipantIsTyping",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event",
... | Dispatch conversation participant is typing event.
@param event Event to dispatch. | [
"Dispatch",
"conversation",
"participant",
"is",
"typing",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L135-L138 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onParticipantTypingOff | private void onParticipantTypingOff(ParticipantTypingOffEvent event) {
handler.post(() -> listener.onParticipantTypingOff(event));
log("Event published " + event.toString());
} | java | private void onParticipantTypingOff(ParticipantTypingOffEvent event) {
handler.post(() -> listener.onParticipantTypingOff(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onParticipantTypingOff",
"(",
"ParticipantTypingOffEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onParticipantTypingOff",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event... | Dispatch conversation participant stopped typing event.
@param event Event to dispatch. | [
"Dispatch",
"conversation",
"participant",
"stopped",
"typing",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L145-L148 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onProfileUpdate | private void onProfileUpdate(ProfileUpdateEvent event) {
handler.post(() -> listener.onProfileUpdate(event));
log("Event published " + event.toString());
} | java | private void onProfileUpdate(ProfileUpdateEvent event) {
handler.post(() -> listener.onProfileUpdate(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onProfileUpdate",
"(",
"ProfileUpdateEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onProfileUpdate",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event",
".",
"toString... | Dispatch profile update event.
@param event Event to dispatch. | [
"Dispatch",
"profile",
"update",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L155-L158 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onMessageSent | private void onMessageSent(MessageSentEvent event) {
handler.post(() -> listener.onMessageSent(event));
log("Event published " + event.toString());
} | java | private void onMessageSent(MessageSentEvent event) {
handler.post(() -> listener.onMessageSent(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onMessageSent",
"(",
"MessageSentEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onMessageSent",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event",
".",
"toString",
"... | Dispatch conversation message event.
@param event Event to dispatch. | [
"Dispatch",
"conversation",
"message",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L165-L168 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onSocketStarted | private void onSocketStarted(SocketStartEvent event) {
handler.post(() -> listener.onSocketStarted(event));
log("Event published " + event.toString());
} | java | private void onSocketStarted(SocketStartEvent event) {
handler.post(() -> listener.onSocketStarted(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onSocketStarted",
"(",
"SocketStartEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onSocketStarted",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event",
".",
"toString",... | Dispatch socket info event.
@param event Event to dispatch. | [
"Dispatch",
"socket",
"info",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L195-L198 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onParticipantAdded | private void onParticipantAdded(ParticipantAddedEvent event) {
handler.post(() -> listener.onParticipantAdded(event));
log("Event published " + event.toString());
} | java | private void onParticipantAdded(ParticipantAddedEvent event) {
handler.post(() -> listener.onParticipantAdded(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onParticipantAdded",
"(",
"ParticipantAddedEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onParticipantAdded",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event",
".",
... | Dispatch participant added to a conversation event.
@param event Event to dispatch. | [
"Dispatch",
"participant",
"added",
"to",
"a",
"conversation",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L205-L208 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onParticipantUpdated | private void onParticipantUpdated(ParticipantUpdatedEvent event) {
handler.post(() -> listener.onParticipantUpdated(event));
log("Event published " + event.toString());
} | java | private void onParticipantUpdated(ParticipantUpdatedEvent event) {
handler.post(() -> listener.onParticipantUpdated(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onParticipantUpdated",
"(",
"ParticipantUpdatedEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onParticipantUpdated",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event",
"... | Dispatch participant updated event.
@param event Event to dispatch. | [
"Dispatch",
"participant",
"updated",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L215-L218 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onParticipantRemoved | private void onParticipantRemoved(ParticipantRemovedEvent event) {
handler.post(() -> listener.onParticipantRemoved(event));
log("Event published " + event.toString());
} | java | private void onParticipantRemoved(ParticipantRemovedEvent event) {
handler.post(() -> listener.onParticipantRemoved(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onParticipantRemoved",
"(",
"ParticipantRemovedEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onParticipantRemoved",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event",
"... | Dispatch participant removed event.
@param event Event to dispatch. | [
"Dispatch",
"participant",
"removed",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L225-L228 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onConversationUpdated | private void onConversationUpdated(ConversationUpdateEvent event) {
handler.post(() -> listener.onConversationUpdated(event));
log("Event published " + event.toString());
} | java | private void onConversationUpdated(ConversationUpdateEvent event) {
handler.post(() -> listener.onConversationUpdated(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onConversationUpdated",
"(",
"ConversationUpdateEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onConversationUpdated",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event",
... | Dispatch conversation updated event.
@param event Event to dispatch. | [
"Dispatch",
"conversation",
"updated",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L235-L238 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onConversationDeleted | private void onConversationDeleted(ConversationDeleteEvent event) {
handler.post(() -> listener.onConversationDeleted(event));
log("Event published " + event.toString());
} | java | private void onConversationDeleted(ConversationDeleteEvent event) {
handler.post(() -> listener.onConversationDeleted(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onConversationDeleted",
"(",
"ConversationDeleteEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onConversationDeleted",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"event",
... | Dispatch conversation deleted event.
@param event Event to dispatch. | [
"Dispatch",
"conversation",
"deleted",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L245-L248 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java | SocketEventDispatcher.onConversationUndeleted | private void onConversationUndeleted(ConversationUndeleteEvent event) {
handler.post(() -> listener.onConversationUndeleted(event));
log("Event published " + event.toString());
} | java | private void onConversationUndeleted(ConversationUndeleteEvent event) {
handler.post(() -> listener.onConversationUndeleted(event));
log("Event published " + event.toString());
} | [
"private",
"void",
"onConversationUndeleted",
"(",
"ConversationUndeleteEvent",
"event",
")",
"{",
"handler",
".",
"post",
"(",
"(",
")",
"->",
"listener",
".",
"onConversationUndeleted",
"(",
"event",
")",
")",
";",
"log",
"(",
"\"Event published \"",
"+",
"eve... | Dispatch conversation restored event.
@param event Event to dispatch. | [
"Dispatch",
"conversation",
"restored",
"event",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketEventDispatcher.java#L255-L258 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/ServiceQueue.java | ServiceQueue.getToken | protected String getToken() {
return dataMgr.getSessionDAO().session() != null ? dataMgr.getSessionDAO().session().getAccessToken() : null;
} | java | protected String getToken() {
return dataMgr.getSessionDAO().session() != null ? dataMgr.getSessionDAO().session().getAccessToken() : null;
} | [
"protected",
"String",
"getToken",
"(",
")",
"{",
"return",
"dataMgr",
".",
"getSessionDAO",
"(",
")",
".",
"session",
"(",
")",
"!=",
"null",
"?",
"dataMgr",
".",
"getSessionDAO",
"(",
")",
".",
"session",
"(",
")",
".",
"getAccessToken",
"(",
")",
":... | Gets session access token.
@return Session access token. | [
"Gets",
"session",
"access",
"token",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/ServiceQueue.java#L83-L85 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/data/DataManager.java | DataManager.init | public void init(@NonNull final Context context, @Nullable final String suffix, @NonNull final Logger log) {
deviceDAO = new DeviceDAO(context, suffix);
onetimeDeviceSetup(context);
logInfo(log);
sessionDAO = new SessionDAO(context, suffix);
} | java | public void init(@NonNull final Context context, @Nullable final String suffix, @NonNull final Logger log) {
deviceDAO = new DeviceDAO(context, suffix);
onetimeDeviceSetup(context);
logInfo(log);
sessionDAO = new SessionDAO(context, suffix);
} | [
"public",
"void",
"init",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"Nullable",
"final",
"String",
"suffix",
",",
"@",
"NonNull",
"final",
"Logger",
"log",
")",
"{",
"deviceDAO",
"=",
"new",
"DeviceDAO",
"(",
"context",
",",
"suffix",
... | Initialise Session Manager.
@param context Application context.
@param suffix Log tag suffix to extend the SDK details in a tag with any additional SDK module details.
@param log Logger instance for logging output. | [
"Initialise",
"Session",
"Manager",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/data/DataManager.java#L52-L57 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/data/DataManager.java | DataManager.logInfo | private void logInfo(@NonNull final Logger log) {
log.i("App ver. = " + deviceDAO.device().getAppVer());
log.i("Comapi device ID = " + deviceDAO.device().getDeviceId());
log.d("Firebase ID = " + deviceDAO.device().getInstanceId());
} | java | private void logInfo(@NonNull final Logger log) {
log.i("App ver. = " + deviceDAO.device().getAppVer());
log.i("Comapi device ID = " + deviceDAO.device().getDeviceId());
log.d("Firebase ID = " + deviceDAO.device().getInstanceId());
} | [
"private",
"void",
"logInfo",
"(",
"@",
"NonNull",
"final",
"Logger",
"log",
")",
"{",
"log",
".",
"i",
"(",
"\"App ver. = \"",
"+",
"deviceDAO",
".",
"device",
"(",
")",
".",
"getAppVer",
"(",
")",
")",
";",
"log",
".",
"i",
"(",
"\"Comapi device ID =... | Log basic information about initialisation environment. | [
"Log",
"basic",
"information",
"about",
"initialisation",
"environment",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/data/DataManager.java#L95-L99 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/tree/filtered/FilteredTreeNode.java | FilteredTreeNode.enumerationAsStream | private static <T> Stream<T> enumerationAsStream(Enumeration<? extends T> e)
{
Iterator<T> iterator = new Iterator<T>()
{
@Override
public T next()
{
return e.nextElement();
}
@Override
public boolean... | java | private static <T> Stream<T> enumerationAsStream(Enumeration<? extends T> e)
{
Iterator<T> iterator = new Iterator<T>()
{
@Override
public T next()
{
return e.nextElement();
}
@Override
public boolean... | [
"private",
"static",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"enumerationAsStream",
"(",
"Enumeration",
"<",
"?",
"extends",
"T",
">",
"e",
")",
"{",
"Iterator",
"<",
"T",
">",
"iterator",
"=",
"new",
"Iterator",
"<",
"T",
">",
"(",
")",
"{",
"@",
... | Returns a new stream that has the same contents as the given enumeration
@param e The enumeration
@return The stream | [
"Returns",
"a",
"new",
"stream",
"that",
"has",
"the",
"same",
"contents",
"as",
"the",
"given",
"enumeration"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/tree/filtered/FilteredTreeNode.java#L219-L238 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/ouput/asciitable/Row.java | Row.getRowWidth | public int getRowWidth() {
int overallWidth = 0;
for (int i = 0; i < data.length; i++) {
overallWidth += getTable().getColumnWidth(i);
}
return overallWidth;
} | java | public int getRowWidth() {
int overallWidth = 0;
for (int i = 0; i < data.length; i++) {
overallWidth += getTable().getColumnWidth(i);
}
return overallWidth;
} | [
"public",
"int",
"getRowWidth",
"(",
")",
"{",
"int",
"overallWidth",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"data",
".",
"length",
";",
"i",
"++",
")",
"{",
"overallWidth",
"+=",
"getTable",
"(",
")",
".",
"getColumnWidth"... | Returns the row's total width.
@return the width of the row. | [
"Returns",
"the",
"row",
"s",
"total",
"width",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/ouput/asciitable/Row.java#L54-L61 | train |
blackdoor/blackdoor | src/main/java/black/door/crypto/Hash.java | Hash.shuffle | public static byte[] shuffle(byte[] input){
for(int i=0; i<input.length; i++){
int i2 = input[i];
if(i2 < 0)
i2 = 127 + Math.abs(i2);
input[i] = shuffle[i2];
//result of more shuffles could just be mapped to the first
// i2 = input[i];
// if(i2 < 0)
// i2 = 127 + Math.abs(i2);
// input[i] = (... | java | public static byte[] shuffle(byte[] input){
for(int i=0; i<input.length; i++){
int i2 = input[i];
if(i2 < 0)
i2 = 127 + Math.abs(i2);
input[i] = shuffle[i2];
//result of more shuffles could just be mapped to the first
// i2 = input[i];
// if(i2 < 0)
// i2 = 127 + Math.abs(i2);
// input[i] = (... | [
"public",
"static",
"byte",
"[",
"]",
"shuffle",
"(",
"byte",
"[",
"]",
"input",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"input",
".",
"length",
";",
"i",
"++",
")",
"{",
"int",
"i2",
"=",
"input",
"[",
"i",
"]",
";",
"if... | a minimal perfect hash function for a 32 byte input
@param input
@return | [
"a",
"minimal",
"perfect",
"hash",
"function",
"for",
"a",
"32",
"byte",
"input"
] | 060c7a71dfafb85e10e8717736e6d3160262e96b | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/crypto/Hash.java#L60-L77 | train |
blackdoor/blackdoor | src/main/java/black/door/crypto/Hash.java | Hash.getSHA256 | public static byte[] getSHA256(byte[] input, boolean asSingleton){
if(SHA256_INSTANCE == null){
if(asSingleton){
try {
SHA256_INSTANCE = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}else{
return getHash("SHA-256", input);
}
... | java | public static byte[] getSHA256(byte[] input, boolean asSingleton){
if(SHA256_INSTANCE == null){
if(asSingleton){
try {
SHA256_INSTANCE = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}else{
return getHash("SHA-256", input);
}
... | [
"public",
"static",
"byte",
"[",
"]",
"getSHA256",
"(",
"byte",
"[",
"]",
"input",
",",
"boolean",
"asSingleton",
")",
"{",
"if",
"(",
"SHA256_INSTANCE",
"==",
"null",
")",
"{",
"if",
"(",
"asSingleton",
")",
"{",
"try",
"{",
"SHA256_INSTANCE",
"=",
"M... | Get the SHA256 Hash of input
@param input - the bytes to hash
@param asSingleton if true use a singleton MessageDigest instance, else create and destroy a MD instance just for this call.
@return 32 bytes that represent the SHA256 hash of input; | [
"Get",
"the",
"SHA256",
"Hash",
"of",
"input"
] | 060c7a71dfafb85e10e8717736e6d3160262e96b | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/crypto/Hash.java#L120-L133 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketFactory.java | SocketFactory.createSocket | SocketInterface createSocket(@NonNull final String token, @NonNull final WeakReference<SocketStateListener> stateListenerWeakReference) {
WebSocket socket = null;
WebSocketFactory factory = new WebSocketFactory();
// Configure proxy if provided
if (proxyAddress != null) {
... | java | SocketInterface createSocket(@NonNull final String token, @NonNull final WeakReference<SocketStateListener> stateListenerWeakReference) {
WebSocket socket = null;
WebSocketFactory factory = new WebSocketFactory();
// Configure proxy if provided
if (proxyAddress != null) {
... | [
"SocketInterface",
"createSocket",
"(",
"@",
"NonNull",
"final",
"String",
"token",
",",
"@",
"NonNull",
"final",
"WeakReference",
"<",
"SocketStateListener",
">",
"stateListenerWeakReference",
")",
"{",
"WebSocket",
"socket",
"=",
"null",
";",
"WebSocketFactory",
"... | Creates and configures web socket instance.
@param token Authentication token.
@param stateListenerWeakReference Weak reference to socket connection state callbacks. | [
"Creates",
"and",
"configures",
"web",
"socket",
"instance",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketFactory.java#L97-L128 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketFactory.java | SocketFactory.createWebSocketAdapter | protected WebSocketAdapter createWebSocketAdapter(@NonNull final WeakReference<SocketStateListener> stateListenerWeakReference) {
return new WebSocketAdapter() {
@Override
public void onConnected(WebSocket websocket, Map<String, List<String>> headers) throws Exception {
... | java | protected WebSocketAdapter createWebSocketAdapter(@NonNull final WeakReference<SocketStateListener> stateListenerWeakReference) {
return new WebSocketAdapter() {
@Override
public void onConnected(WebSocket websocket, Map<String, List<String>> headers) throws Exception {
... | [
"protected",
"WebSocketAdapter",
"createWebSocketAdapter",
"(",
"@",
"NonNull",
"final",
"WeakReference",
"<",
"SocketStateListener",
">",
"stateListenerWeakReference",
")",
"{",
"return",
"new",
"WebSocketAdapter",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"o... | Create adapter for websocket library events.
@param stateListenerWeakReference Listener for socket state changes.
@return Adapter for websocket library events. | [
"Create",
"adapter",
"for",
"websocket",
"library",
"events",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketFactory.java#L136-L180 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/element/BenchmarkMethod.java | BenchmarkMethod.getNumberOfAnnotatedRuns | public static int getNumberOfAnnotatedRuns(final Method meth) {
if (!isBenchmarkable(meth)) {
throw new IllegalArgumentException("Method " + meth
+ " must be a benchmarkable method.");
}
final Bench benchAnno = meth.getAnnotation(Bench.class);
final BenchClass benchClassAnno = meth.getDeclaringClass()
... | java | public static int getNumberOfAnnotatedRuns(final Method meth) {
if (!isBenchmarkable(meth)) {
throw new IllegalArgumentException("Method " + meth
+ " must be a benchmarkable method.");
}
final Bench benchAnno = meth.getAnnotation(Bench.class);
final BenchClass benchClassAnno = meth.getDeclaringClass()
... | [
"public",
"static",
"int",
"getNumberOfAnnotatedRuns",
"(",
"final",
"Method",
"meth",
")",
"{",
"if",
"(",
"!",
"isBenchmarkable",
"(",
"meth",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Method \"",
"+",
"meth",
"+",
"\" must be a benchm... | Getting the number of runs corresponding to a given method. The method
MUST be a benchmarkable method, otherwise an IllegalStateException
exception arises. The number of runs of an annotated method is more
powerful than the number of runs as denoted by the benchclass annotation.
@param meth
to be checked
@return the n... | [
"Getting",
"the",
"number",
"of",
"runs",
"corresponding",
"to",
"a",
"given",
"method",
".",
"The",
"method",
"MUST",
"be",
"a",
"benchmarkable",
"method",
"otherwise",
"an",
"IllegalStateException",
"exception",
"arises",
".",
"The",
"number",
"of",
"runs",
... | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/element/BenchmarkMethod.java#L83-L102 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/element/BenchmarkMethod.java | BenchmarkMethod.findAndCheckAnyMethodByAnnotation | public static Method findAndCheckAnyMethodByAnnotation(
final Class<?> clazz, final Class<? extends Annotation> anno)
throws PerfidixMethodCheckException {
// needed variables, one for check for duplicates
Method anyMethod = null;
// Scanning all methods
final Method[] possAnnoMethods = clazz.getDeclared... | java | public static Method findAndCheckAnyMethodByAnnotation(
final Class<?> clazz, final Class<? extends Annotation> anno)
throws PerfidixMethodCheckException {
// needed variables, one for check for duplicates
Method anyMethod = null;
// Scanning all methods
final Method[] possAnnoMethods = clazz.getDeclared... | [
"public",
"static",
"Method",
"findAndCheckAnyMethodByAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"anno",
")",
"throws",
"PerfidixMethodCheckException",
"{",
"// needed variables, one for c... | This class finds any method with a given annotation. The method is
allowed to occur only once in the class and should match the requirements
for Perfidix for an execution by reflection.
@param anno
of the method to be found
@param clazz
class to be searched
@return a method annotated by the annotation given. The metho... | [
"This",
"class",
"finds",
"any",
"method",
"with",
"a",
"given",
"annotation",
".",
"The",
"method",
"is",
"allowed",
"to",
"occur",
"only",
"once",
"in",
"the",
"class",
"and",
"should",
"match",
"the",
"requirements",
"for",
"Perfidix",
"for",
"an",
"exe... | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/element/BenchmarkMethod.java#L119-L152 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/element/BenchmarkMethod.java | BenchmarkMethod.isBenchmarkable | public static boolean isBenchmarkable(final Method meth) {
boolean returnVal = true;
// Check if bench-anno is given. For testing purposes against
// before/after annos
final Bench benchAnno = meth.getAnnotation(Bench.class);
// if method is annotated with SkipBench, the method is never
// benchmarkable.
... | java | public static boolean isBenchmarkable(final Method meth) {
boolean returnVal = true;
// Check if bench-anno is given. For testing purposes against
// before/after annos
final Bench benchAnno = meth.getAnnotation(Bench.class);
// if method is annotated with SkipBench, the method is never
// benchmarkable.
... | [
"public",
"static",
"boolean",
"isBenchmarkable",
"(",
"final",
"Method",
"meth",
")",
"{",
"boolean",
"returnVal",
"=",
"true",
";",
"// Check if bench-anno is given. For testing purposes against",
"// before/after annos",
"final",
"Bench",
"benchAnno",
"=",
"meth",
".",... | This method should act as a check to guarantee that only specific
Benchmarkables are used for benching.
@param meth
method to be checked.
@return true if an instance of this interface is benchmarkable, false
otherwise. | [
"This",
"method",
"should",
"act",
"as",
"a",
"check",
"to",
"guarantee",
"that",
"only",
"specific",
"Benchmarkables",
"are",
"used",
"for",
"benching",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/element/BenchmarkMethod.java#L163-L230 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/element/BenchmarkMethod.java | BenchmarkMethod.isReflectedExecutable | public static boolean isReflectedExecutable(final Method meth,
final Class<? extends Annotation> anno) {
boolean returnVal = true;
// Check if DataProvider is valid if set.
if (anno.equals(DataProvider.class)
&& !meth.getReturnType().isAssignableFrom(Object[][].class)) {
returnVal = false;
}
// for ... | java | public static boolean isReflectedExecutable(final Method meth,
final Class<? extends Annotation> anno) {
boolean returnVal = true;
// Check if DataProvider is valid if set.
if (anno.equals(DataProvider.class)
&& !meth.getReturnType().isAssignableFrom(Object[][].class)) {
returnVal = false;
}
// for ... | [
"public",
"static",
"boolean",
"isReflectedExecutable",
"(",
"final",
"Method",
"meth",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"anno",
")",
"{",
"boolean",
"returnVal",
"=",
"true",
";",
"// Check if DataProvider is valid if set.",
"if",
"(... | Checks if this method is executable via reflection for perfidix purposes.
That means that the method has no parameters (except for , no
return-value, is non-static, is public and throws no exceptions.
@param meth
method to be checked
@param anno
anno for method to be check, necessary since different
attributes are pos... | [
"Checks",
"if",
"this",
"method",
"is",
"executable",
"via",
"reflection",
"for",
"perfidix",
"purposes",
".",
"That",
"means",
"that",
"the",
"method",
"has",
"no",
"parameters",
"(",
"except",
"for",
"no",
"return",
"-",
"value",
"is",
"non",
"-",
"stati... | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/element/BenchmarkMethod.java#L244-L269 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/element/BenchmarkMethod.java | BenchmarkMethod.findDataProvider | private Method findDataProvider() throws PerfidixMethodCheckException {
final Bench benchAnno = getMethodToBench().getAnnotation(Bench.class);
Method dataProvider = null;
if (benchAnno != null && !benchAnno.dataProvider().equals("")) {
try {
// Getting the String name for the dataProvider
final String... | java | private Method findDataProvider() throws PerfidixMethodCheckException {
final Bench benchAnno = getMethodToBench().getAnnotation(Bench.class);
Method dataProvider = null;
if (benchAnno != null && !benchAnno.dataProvider().equals("")) {
try {
// Getting the String name for the dataProvider
final String... | [
"private",
"Method",
"findDataProvider",
"(",
")",
"throws",
"PerfidixMethodCheckException",
"{",
"final",
"Bench",
"benchAnno",
"=",
"getMethodToBench",
"(",
")",
".",
"getAnnotation",
"(",
"Bench",
".",
"class",
")",
";",
"Method",
"dataProvider",
"=",
"null",
... | This method checks whether a method uses a data provider for dynamic
input
@return true if method is parameterized, false otherwise
@throws PerfidixMethodCheckException | [
"This",
"method",
"checks",
"whether",
"a",
"method",
"uses",
"a",
"data",
"provider",
"for",
"dynamic",
"input"
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/element/BenchmarkMethod.java#L543-L594 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JSplitPanes.java | JSplitPanes.setDividerLocation | public static void setDividerLocation(
final JSplitPane splitPane, final double location)
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
splitPane.setDividerLocation(location);
splitPane... | java | public static void setDividerLocation(
final JSplitPane splitPane, final double location)
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
splitPane.setDividerLocation(location);
splitPane... | [
"public",
"static",
"void",
"setDividerLocation",
"(",
"final",
"JSplitPane",
"splitPane",
",",
"final",
"double",
"location",
")",
"{",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",... | Set the location of the the given split pane to the given
value later on the EDT, and validate the split pane
@param splitPane The split pane
@param location The location | [
"Set",
"the",
"location",
"of",
"the",
"the",
"given",
"split",
"pane",
"to",
"the",
"given",
"value",
"later",
"on",
"the",
"EDT",
"and",
"validate",
"the",
"split",
"pane"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JSplitPanes.java#L44-L56 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/data/SessionDAO.java | SessionDAO.loadSession | private SessionData loadSession() {
synchronized (sharedLock) {
SharedPreferences sharedPreferences = getSharedPreferences();
String id = sharedPreferences.getString(KEY_PROFILE_ID, null);
if (!TextUtils.isEmpty(id)) {
sharedLock.notifyAll();
... | java | private SessionData loadSession() {
synchronized (sharedLock) {
SharedPreferences sharedPreferences = getSharedPreferences();
String id = sharedPreferences.getString(KEY_PROFILE_ID, null);
if (!TextUtils.isEmpty(id)) {
sharedLock.notifyAll();
... | [
"private",
"SessionData",
"loadSession",
"(",
")",
"{",
"synchronized",
"(",
"sharedLock",
")",
"{",
"SharedPreferences",
"sharedPreferences",
"=",
"getSharedPreferences",
"(",
")",
";",
"String",
"id",
"=",
"sharedPreferences",
".",
"getString",
"(",
"KEY_PROFILE_I... | Loads active session details from internal storage.
@return Loaded session details. | [
"Loads",
"active",
"session",
"details",
"from",
"internal",
"storage",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/data/SessionDAO.java#L61-L78 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/data/SessionDAO.java | SessionDAO.clearSession | public String clearSession() {
synchronized (sharedLock) {
SessionData session = loadSession();
String id = session != null ? session.getSessionId() : null;
clearAll();
sharedLock.notifyAll();
return id;
}
} | java | public String clearSession() {
synchronized (sharedLock) {
SessionData session = loadSession();
String id = session != null ? session.getSessionId() : null;
clearAll();
sharedLock.notifyAll();
return id;
}
} | [
"public",
"String",
"clearSession",
"(",
")",
"{",
"synchronized",
"(",
"sharedLock",
")",
"{",
"SessionData",
"session",
"=",
"loadSession",
"(",
")",
";",
"String",
"id",
"=",
"session",
"!=",
"null",
"?",
"session",
".",
"getSessionId",
"(",
")",
":",
... | Deletes currently saved session.
@return SessionId for the deleted session or null if no session was active. | [
"Deletes",
"currently",
"saved",
"session",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/data/SessionDAO.java#L94-L103 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/data/SessionDAO.java | SessionDAO.startSession | public boolean startSession() {
synchronized (sharedLock) {
SessionData session = loadSession();
if (isSessionActive(session)) {
sharedLock.notifyAll();
return false;
} else {
clearAll();
}
sharedLock.no... | java | public boolean startSession() {
synchronized (sharedLock) {
SessionData session = loadSession();
if (isSessionActive(session)) {
sharedLock.notifyAll();
return false;
} else {
clearAll();
}
sharedLock.no... | [
"public",
"boolean",
"startSession",
"(",
")",
"{",
"synchronized",
"(",
"sharedLock",
")",
"{",
"SessionData",
"session",
"=",
"loadSession",
"(",
")",
";",
"if",
"(",
"isSessionActive",
"(",
"session",
")",
")",
"{",
"sharedLock",
".",
"notifyAll",
"(",
... | Creates session if no session is active.
@return True if session was created. If false there is a opened session already. End this session first. | [
"Creates",
"session",
"if",
"no",
"session",
"is",
"active",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/data/SessionDAO.java#L110-L124 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/data/SessionDAO.java | SessionDAO.updateSessionDetails | public boolean updateSessionDetails(final SessionData session) {
synchronized (sharedLock) {
if (session != null) {
SharedPreferences.Editor editor = getSharedPreferences().edit();
editor.putString(KEY_PROFILE_ID, session.getProfileId());
editor.putSt... | java | public boolean updateSessionDetails(final SessionData session) {
synchronized (sharedLock) {
if (session != null) {
SharedPreferences.Editor editor = getSharedPreferences().edit();
editor.putString(KEY_PROFILE_ID, session.getProfileId());
editor.putSt... | [
"public",
"boolean",
"updateSessionDetails",
"(",
"final",
"SessionData",
"session",
")",
"{",
"synchronized",
"(",
"sharedLock",
")",
"{",
"if",
"(",
"session",
"!=",
"null",
")",
"{",
"SharedPreferences",
".",
"Editor",
"editor",
"=",
"getSharedPreferences",
"... | Updates session details obtained frm the services.
@return True if session was updated. If false the update is for a different user or session is not started. | [
"Updates",
"session",
"details",
"obtained",
"frm",
"the",
"services",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/data/SessionDAO.java#L143-L160 | train |
blackdoor/blackdoor | src/main/java/black/door/json/Derulo.java | Derulo.fromJSON | public static Object fromJSON(String jsonString){
List<Token> tokens = Derulo.toTokens(jsonString);
return fromJSON(tokens);
} | java | public static Object fromJSON(String jsonString){
List<Token> tokens = Derulo.toTokens(jsonString);
return fromJSON(tokens);
} | [
"public",
"static",
"Object",
"fromJSON",
"(",
"String",
"jsonString",
")",
"{",
"List",
"<",
"Token",
">",
"tokens",
"=",
"Derulo",
".",
"toTokens",
"(",
"jsonString",
")",
";",
"return",
"fromJSON",
"(",
"tokens",
")",
";",
"}"
] | Get a java object from a JSON value
@param jsonString a JSON value in string form
@return a Number, Boolean, JsonObject, JsonArray or JsonNull
@throws JsonException | [
"Get",
"a",
"java",
"object",
"from",
"a",
"JSON",
"value"
] | 060c7a71dfafb85e10e8717736e6d3160262e96b | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/json/Derulo.java#L90-L93 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/example/list/IntList.java | IntList.add | final void add(final int e) {
if (size == list.length) list = Arrays.copyOf(list, newSize());
list[size++] = e;
} | java | final void add(final int e) {
if (size == list.length) list = Arrays.copyOf(list, newSize());
list[size++] = e;
} | [
"final",
"void",
"add",
"(",
"final",
"int",
"e",
")",
"{",
"if",
"(",
"size",
"==",
"list",
".",
"length",
")",
"list",
"=",
"Arrays",
".",
"copyOf",
"(",
"list",
",",
"newSize",
"(",
")",
")",
";",
"list",
"[",
"size",
"++",
"]",
"=",
"e",
... | Adds an entry to the array.
@param e entry to be added | [
"Adds",
"an",
"entry",
"to",
"the",
"array",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/example/list/IntList.java#L78-L81 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/example/list/IntList.java | IntList.contains | public final boolean contains(final int e) {
for (int i = 0; i < size; ++i)
if (list[i] == e) return true;
return false;
} | java | public final boolean contains(final int e) {
for (int i = 0; i < size; ++i)
if (list[i] == e) return true;
return false;
} | [
"public",
"final",
"boolean",
"contains",
"(",
"final",
"int",
"e",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"++",
"i",
")",
"if",
"(",
"list",
"[",
"i",
"]",
"==",
"e",
")",
"return",
"true",
";",
"return",
"fa... | Checks if the specified element is found in the list.
@param e element to be found
@return result of check | [
"Checks",
"if",
"the",
"specified",
"element",
"is",
"found",
"in",
"the",
"list",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/example/list/IntList.java#L111-L115 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/example/list/IntList.java | IntList.insert | public final void insert(final int i, final int[] e) {
final int l = e.length;
if (l == 0) return;
if (size + l > list.length) list = Arrays.copyOf(list, newSize(size + l));
Array.move(list, i, l, size - i);
System.arraycopy(e, 0, list, i, l);
size += l;
} | java | public final void insert(final int i, final int[] e) {
final int l = e.length;
if (l == 0) return;
if (size + l > list.length) list = Arrays.copyOf(list, newSize(size + l));
Array.move(list, i, l, size - i);
System.arraycopy(e, 0, list, i, l);
size += l;
} | [
"public",
"final",
"void",
"insert",
"(",
"final",
"int",
"i",
",",
"final",
"int",
"[",
"]",
"e",
")",
"{",
"final",
"int",
"l",
"=",
"e",
".",
"length",
";",
"if",
"(",
"l",
"==",
"0",
")",
"return",
";",
"if",
"(",
"size",
"+",
"l",
">",
... | Inserts elements at the specified index position.
@param i index
@param e elements to be inserted | [
"Inserts",
"elements",
"at",
"the",
"specified",
"index",
"position",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/example/list/IntList.java#L123-L130 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.expandAllFixedHeight | public static void expandAllFixedHeight(JTree tree)
{
// Determine a suitable row height for the tree, based on the
// size of the component that is used for rendering the root
TreeCellRenderer cellRenderer = tree.getCellRenderer();
Component treeCellRendererComponent =
... | java | public static void expandAllFixedHeight(JTree tree)
{
// Determine a suitable row height for the tree, based on the
// size of the component that is used for rendering the root
TreeCellRenderer cellRenderer = tree.getCellRenderer();
Component treeCellRendererComponent =
... | [
"public",
"static",
"void",
"expandAllFixedHeight",
"(",
"JTree",
"tree",
")",
"{",
"// Determine a suitable row height for the tree, based on the \r",
"// size of the component that is used for rendering the root \r",
"TreeCellRenderer",
"cellRenderer",
"=",
"tree",
".",
"getCellRen... | Expand all rows of the given tree, assuming a fixed height for
the rows.
@param tree The tree | [
"Expand",
"all",
"rows",
"of",
"the",
"given",
"tree",
"assuming",
"a",
"fixed",
"height",
"for",
"the",
"rows",
"."
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L84-L117 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.expandAllRecursively | private static void expandAllRecursively(JTree tree, TreePath treePath)
{
TreeModel model = tree.getModel();
Object lastPathComponent = treePath.getLastPathComponent();
int childCount = model.getChildCount(lastPathComponent);
if (childCount == 0)
{
return;
... | java | private static void expandAllRecursively(JTree tree, TreePath treePath)
{
TreeModel model = tree.getModel();
Object lastPathComponent = treePath.getLastPathComponent();
int childCount = model.getChildCount(lastPathComponent);
if (childCount == 0)
{
return;
... | [
"private",
"static",
"void",
"expandAllRecursively",
"(",
"JTree",
"tree",
",",
"TreePath",
"treePath",
")",
"{",
"TreeModel",
"model",
"=",
"tree",
".",
"getModel",
"(",
")",
";",
"Object",
"lastPathComponent",
"=",
"treePath",
".",
"getLastPathComponent",
"(",... | Recursively expand all paths in the given tree, starting with the
given path
@param tree The tree
@param treePath The current tree path | [
"Recursively",
"expand",
"all",
"paths",
"in",
"the",
"given",
"tree",
"starting",
"with",
"the",
"given",
"path"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L126-L155 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.collapseAll | public static void collapseAll(JTree tree, boolean omitRoot)
{
int rows = tree.getRowCount();
int limit = (omitRoot ? 1 : 0);
for (int i = rows - 1; i >= limit; i--)
{
tree.collapseRow(i);
}
} | java | public static void collapseAll(JTree tree, boolean omitRoot)
{
int rows = tree.getRowCount();
int limit = (omitRoot ? 1 : 0);
for (int i = rows - 1; i >= limit; i--)
{
tree.collapseRow(i);
}
} | [
"public",
"static",
"void",
"collapseAll",
"(",
"JTree",
"tree",
",",
"boolean",
"omitRoot",
")",
"{",
"int",
"rows",
"=",
"tree",
".",
"getRowCount",
"(",
")",
";",
"int",
"limit",
"=",
"(",
"omitRoot",
"?",
"1",
":",
"0",
")",
";",
"for",
"(",
"i... | Collapse all rows of the given tree
@param tree The tree
@param omitRoot Whether the root node should not be collapsed | [
"Collapse",
"all",
"rows",
"of",
"the",
"given",
"tree"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L163-L171 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.countNodes | private static int countNodes(TreeModel treeModel, Object node)
{
int sum = 1;
int n = treeModel.getChildCount(node);
for (int i=0; i<n; i++)
{
sum += countNodes(treeModel, treeModel.getChild(node, i));
}
return sum;
} | java | private static int countNodes(TreeModel treeModel, Object node)
{
int sum = 1;
int n = treeModel.getChildCount(node);
for (int i=0; i<n; i++)
{
sum += countNodes(treeModel, treeModel.getChild(node, i));
}
return sum;
} | [
"private",
"static",
"int",
"countNodes",
"(",
"TreeModel",
"treeModel",
",",
"Object",
"node",
")",
"{",
"int",
"sum",
"=",
"1",
";",
"int",
"n",
"=",
"treeModel",
".",
"getChildCount",
"(",
"node",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Recursively count the number of nodes in the given tree model,
starting with the given node
@param treeModel The tree model
@param node The node
@return The number of nodes | [
"Recursively",
"count",
"the",
"number",
"of",
"nodes",
"in",
"the",
"given",
"tree",
"model",
"starting",
"with",
"the",
"given",
"node"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L192-L201 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.getChildren | public static List<Object> getChildren(TreeModel treeModel, Object node)
{
List<Object> children = new ArrayList<Object>();
int n = treeModel.getChildCount(node);
for (int i=0; i<n; i++)
{
Object child = treeModel.getChild(node, i);
children.add(child);... | java | public static List<Object> getChildren(TreeModel treeModel, Object node)
{
List<Object> children = new ArrayList<Object>();
int n = treeModel.getChildCount(node);
for (int i=0; i<n; i++)
{
Object child = treeModel.getChild(node, i);
children.add(child);... | [
"public",
"static",
"List",
"<",
"Object",
">",
"getChildren",
"(",
"TreeModel",
"treeModel",
",",
"Object",
"node",
")",
"{",
"List",
"<",
"Object",
">",
"children",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")",
";",
"int",
"n",
"=",
"treeMod... | Returns the children of the given node in the given tree model
@param treeModel The tree model
@param node The node
@return The children | [
"Returns",
"the",
"children",
"of",
"the",
"given",
"node",
"in",
"the",
"given",
"tree",
"model"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L265-L275 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.getAllNodes | public static List<Object> getAllNodes(TreeModel treeModel)
{
List<Object> result = new ArrayList<Object>();
getAllDescendants(treeModel, treeModel.getRoot(), result);
result.add(0, treeModel.getRoot());
return result;
} | java | public static List<Object> getAllNodes(TreeModel treeModel)
{
List<Object> result = new ArrayList<Object>();
getAllDescendants(treeModel, treeModel.getRoot(), result);
result.add(0, treeModel.getRoot());
return result;
} | [
"public",
"static",
"List",
"<",
"Object",
">",
"getAllNodes",
"(",
"TreeModel",
"treeModel",
")",
"{",
"List",
"<",
"Object",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")",
";",
"getAllDescendants",
"(",
"treeModel",
",",
"treeModel... | Return all nodes of the given tree model
@param treeModel The tree model
@return The nodes | [
"Return",
"all",
"nodes",
"of",
"the",
"given",
"tree",
"model"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L326-L332 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.getAllDescendants | private static void getAllDescendants(
TreeModel treeModel, Object node, List<Object> result)
{
if (node == null)
{
return;
}
result.add(node);
List<Object> children = getChildren(treeModel, node);
for (Object child : children)
{
... | java | private static void getAllDescendants(
TreeModel treeModel, Object node, List<Object> result)
{
if (node == null)
{
return;
}
result.add(node);
List<Object> children = getChildren(treeModel, node);
for (Object child : children)
{
... | [
"private",
"static",
"void",
"getAllDescendants",
"(",
"TreeModel",
"treeModel",
",",
"Object",
"node",
",",
"List",
"<",
"Object",
">",
"result",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
";",
"}",
"result",
".",
"add",
"(",
"node... | Compute all descendants of the given node in the given tree model
@param treeModel The tree model
@param node The node
@param result The descendants | [
"Compute",
"all",
"descendants",
"of",
"the",
"given",
"node",
"in",
"the",
"given",
"tree",
"model"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L358-L371 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.getLeafNodes | public static List<Object> getLeafNodes(TreeModel treeModel, Object node)
{
List<Object> leafNodes = new ArrayList<Object>();
getLeafNodes(treeModel, node, leafNodes);
return leafNodes;
} | java | public static List<Object> getLeafNodes(TreeModel treeModel, Object node)
{
List<Object> leafNodes = new ArrayList<Object>();
getLeafNodes(treeModel, node, leafNodes);
return leafNodes;
} | [
"public",
"static",
"List",
"<",
"Object",
">",
"getLeafNodes",
"(",
"TreeModel",
"treeModel",
",",
"Object",
"node",
")",
"{",
"List",
"<",
"Object",
">",
"leafNodes",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")",
";",
"getLeafNodes",
"(",
"tre... | Returns a list containing all leaf nodes from the given tree model
that are descendants of the given node. These are the nodes that
have 0 children.
@param treeModel The tree model
@param node The node to start the search from
@return The leaf nodes | [
"Returns",
"a",
"list",
"containing",
"all",
"leaf",
"nodes",
"from",
"the",
"given",
"tree",
"model",
"that",
"are",
"descendants",
"of",
"the",
"given",
"node",
".",
"These",
"are",
"the",
"nodes",
"that",
"have",
"0",
"children",
"."
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L394-L399 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.getLeafNodes | private static void getLeafNodes(
TreeModel treeModel, Object node, Collection<Object> leafNodes)
{
if (node == null)
{
return;
}
int childCount = treeModel.getChildCount(node);
if (childCount == 0)
{
leafNodes.add(node);
... | java | private static void getLeafNodes(
TreeModel treeModel, Object node, Collection<Object> leafNodes)
{
if (node == null)
{
return;
}
int childCount = treeModel.getChildCount(node);
if (childCount == 0)
{
leafNodes.add(node);
... | [
"private",
"static",
"void",
"getLeafNodes",
"(",
"TreeModel",
"treeModel",
",",
"Object",
"node",
",",
"Collection",
"<",
"Object",
">",
"leafNodes",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
";",
"}",
"int",
"childCount",
"=",
"tre... | Recursively collect all leaf nodes in the given tree model that are
descendants of the given node.
@param treeModel The tree model
@param node The node to start the search from
@param leafNodes The leaf nodes | [
"Recursively",
"collect",
"all",
"leaf",
"nodes",
"in",
"the",
"given",
"tree",
"model",
"that",
"are",
"descendants",
"of",
"the",
"given",
"node",
"."
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L409-L429 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.createTreePathToRoot | public static TreePath createTreePathToRoot(
TreeModel treeModel, Object node)
{
List<Object> nodes = new ArrayList<Object>();
nodes.add(node);
Object current = node;
while (true)
{
Object parent = getParent(treeModel, current);
if (pa... | java | public static TreePath createTreePathToRoot(
TreeModel treeModel, Object node)
{
List<Object> nodes = new ArrayList<Object>();
nodes.add(node);
Object current = node;
while (true)
{
Object parent = getParent(treeModel, current);
if (pa... | [
"public",
"static",
"TreePath",
"createTreePathToRoot",
"(",
"TreeModel",
"treeModel",
",",
"Object",
"node",
")",
"{",
"List",
"<",
"Object",
">",
"nodes",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
")",
";",
"nodes",
".",
"add",
"(",
"node",
")"... | Returns the tree path from the given node to the root in the
given tree model
@param treeModel The tree model
@param node The node
@return The tree path | [
"Returns",
"the",
"tree",
"path",
"from",
"the",
"given",
"node",
"to",
"the",
"root",
"in",
"the",
"given",
"tree",
"model"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L440-L458 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.computeExpandedPaths | public static List<TreePath> computeExpandedPaths(JTree tree)
{
List<TreePath> treePaths = new ArrayList<TreePath>();
int rows = tree.getRowCount();
for (int i = 0; i < rows; i++)
{
TreePath treePath = tree.getPathForRow(i);
treePaths.add(treePath);
... | java | public static List<TreePath> computeExpandedPaths(JTree tree)
{
List<TreePath> treePaths = new ArrayList<TreePath>();
int rows = tree.getRowCount();
for (int i = 0; i < rows; i++)
{
TreePath treePath = tree.getPathForRow(i);
treePaths.add(treePath);
... | [
"public",
"static",
"List",
"<",
"TreePath",
">",
"computeExpandedPaths",
"(",
"JTree",
"tree",
")",
"{",
"List",
"<",
"TreePath",
">",
"treePaths",
"=",
"new",
"ArrayList",
"<",
"TreePath",
">",
"(",
")",
";",
"int",
"rows",
"=",
"tree",
".",
"getRowCou... | Compute the list of all tree paths in the given tree that are currently
expanded
@param tree The tree
@return The expanded paths | [
"Compute",
"the",
"list",
"of",
"all",
"tree",
"paths",
"in",
"the",
"given",
"tree",
"that",
"are",
"currently",
"expanded"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L467-L477 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.translatePath | public static TreePath translatePath(
TreeModel newTreeModel, TreePath oldPath)
{
return translatePath(newTreeModel, oldPath, Objects::equals);
} | java | public static TreePath translatePath(
TreeModel newTreeModel, TreePath oldPath)
{
return translatePath(newTreeModel, oldPath, Objects::equals);
} | [
"public",
"static",
"TreePath",
"translatePath",
"(",
"TreeModel",
"newTreeModel",
",",
"TreePath",
"oldPath",
")",
"{",
"return",
"translatePath",
"(",
"newTreeModel",
",",
"oldPath",
",",
"Objects",
"::",
"equals",
")",
";",
"}"
] | Translates one TreePath to a new TreeModel. This methods assumes
DefaultMutableTreeNodes.
@param newTreeModel The new tree model
@param oldPath The old tree path
@return The new tree path, or <code>null</code> if there is no
corresponding path in the new tree model | [
"Translates",
"one",
"TreePath",
"to",
"a",
"new",
"TreeModel",
".",
"This",
"methods",
"assumes",
"DefaultMutableTreeNodes",
"."
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L489-L493 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.translatePath | public static TreePath translatePath(
TreeModel newTreeModel, TreePath oldPath,
BiPredicate<Object, Object> equality)
{
Object newRoot = newTreeModel.getRoot();
List<Object> newPath = new ArrayList<Object>();
newPath.add(newRoot);
Object newPreviousElement = n... | java | public static TreePath translatePath(
TreeModel newTreeModel, TreePath oldPath,
BiPredicate<Object, Object> equality)
{
Object newRoot = newTreeModel.getRoot();
List<Object> newPath = new ArrayList<Object>();
newPath.add(newRoot);
Object newPreviousElement = n... | [
"public",
"static",
"TreePath",
"translatePath",
"(",
"TreeModel",
"newTreeModel",
",",
"TreePath",
"oldPath",
",",
"BiPredicate",
"<",
"Object",
",",
"Object",
">",
"equality",
")",
"{",
"Object",
"newRoot",
"=",
"newTreeModel",
".",
"getRoot",
"(",
")",
";",... | Translates one TreePath to a new TreeModel. This methods assumes
DefaultMutableTreeNodes, and identifies the path based on the
equality of user objects using the given equality predicate.
@param newTreeModel The new tree model
@param oldPath The old tree path
@param equality The equality predicate
@return The new tree... | [
"Translates",
"one",
"TreePath",
"to",
"a",
"new",
"TreeModel",
".",
"This",
"methods",
"assumes",
"DefaultMutableTreeNodes",
"and",
"identifies",
"the",
"path",
"based",
"on",
"the",
"equality",
"of",
"user",
"objects",
"using",
"the",
"given",
"equality",
"pre... | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L506-L528 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.getChildWith | private static Object getChildWith(Object node, Object userObject,
BiPredicate<Object, Object> equality)
{
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)node;
for (int j=0; j<treeNode.getChildCount(); j++)
{
TreeNode child = treeNode.getChildAt(j);
... | java | private static Object getChildWith(Object node, Object userObject,
BiPredicate<Object, Object> equality)
{
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode)node;
for (int j=0; j<treeNode.getChildCount(); j++)
{
TreeNode child = treeNode.getChildAt(j);
... | [
"private",
"static",
"Object",
"getChildWith",
"(",
"Object",
"node",
",",
"Object",
"userObject",
",",
"BiPredicate",
"<",
"Object",
",",
"Object",
">",
"equality",
")",
"{",
"DefaultMutableTreeNode",
"treeNode",
"=",
"(",
"DefaultMutableTreeNode",
")",
"node",
... | Returns the child of the given tree node that has a user object that
is equal to the given one, based on the given equality predicate.
Assumes DefaultMutableTreeNodes.
@param node The node
@param userObject The user object
@param equality The equality predicate
@return The child with the given user object, or <code>nu... | [
"Returns",
"the",
"child",
"of",
"the",
"given",
"tree",
"node",
"that",
"has",
"a",
"user",
"object",
"that",
"is",
"equal",
"to",
"the",
"given",
"one",
"based",
"on",
"the",
"given",
"equality",
"predicate",
".",
"Assumes",
"DefaultMutableTreeNodes",
"."
... | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L542-L556 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTrees.java | JTrees.computeIndexInParent | public static int computeIndexInParent(Object nodeObject)
{
if (nodeObject instanceof DefaultMutableTreeNode)
{
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)nodeObject;
TreeNode parent = node.getParent();
if (parent == null)
... | java | public static int computeIndexInParent(Object nodeObject)
{
if (nodeObject instanceof DefaultMutableTreeNode)
{
DefaultMutableTreeNode node =
(DefaultMutableTreeNode)nodeObject;
TreeNode parent = node.getParent();
if (parent == null)
... | [
"public",
"static",
"int",
"computeIndexInParent",
"(",
"Object",
"nodeObject",
")",
"{",
"if",
"(",
"nodeObject",
"instanceof",
"DefaultMutableTreeNode",
")",
"{",
"DefaultMutableTreeNode",
"node",
"=",
"(",
"DefaultMutableTreeNode",
")",
"nodeObject",
";",
"TreeNode... | Computes the index that the given node has in its parent node.
Returns -1 if the given node does not have a parent, or the
node is not a DefaultMutableTreeNode.
@param nodeObject The node
@return The index of the node in its parent | [
"Computes",
"the",
"index",
"that",
"the",
"given",
"node",
"has",
"in",
"its",
"parent",
"node",
".",
"Returns",
"-",
"1",
"if",
"the",
"given",
"node",
"does",
"not",
"have",
"a",
"parent",
"or",
"the",
"node",
"is",
"not",
"a",
"DefaultMutableTreeNode... | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTrees.java#L609-L631 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/layout/AspectLayout.java | AspectLayout.layoutChild | private void layoutChild(
Component component, int cellX, int cellY, int cellSizeX, int cellSizeY)
{
int maxAspectW = (int)(cellSizeY * aspect);
int maxAspectH = (int)(cellSizeX / aspect);
if (maxAspectW > cellSizeX)
{
int w = cellSizeX;
... | java | private void layoutChild(
Component component, int cellX, int cellY, int cellSizeX, int cellSizeY)
{
int maxAspectW = (int)(cellSizeY * aspect);
int maxAspectH = (int)(cellSizeX / aspect);
if (maxAspectW > cellSizeX)
{
int w = cellSizeX;
... | [
"private",
"void",
"layoutChild",
"(",
"Component",
"component",
",",
"int",
"cellX",
",",
"int",
"cellY",
",",
"int",
"cellSizeX",
",",
"int",
"cellSizeY",
")",
"{",
"int",
"maxAspectW",
"=",
"(",
"int",
")",
"(",
"cellSizeY",
"*",
"aspect",
")",
";",
... | Lay out the given child component inside its parent, obeying
the aspect ratio and alignment constraints of this layout.
@param component The child component
@param cellX The (pixel) x-coordinate of the cell inside the parent
@param cellY The (pixel) y-coordinate of the cell inside the parent
@param cellSizeX The cell ... | [
"Lay",
"out",
"the",
"given",
"child",
"component",
"inside",
"its",
"parent",
"obeying",
"the",
"aspect",
"ratio",
"and",
"alignment",
"constraints",
"of",
"this",
"layout",
"."
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/layout/AspectLayout.java#L140-L162 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/layout/AspectLayout.java | AspectLayout.computeWastedSpace | private static double computeWastedSpace(
double maxSizeX, double maxSizeY, double aspect)
{
int maxAspectX = (int) (maxSizeY * aspect);
int maxAspectY = (int) (maxSizeX / aspect);
if (maxAspectX > maxSizeX)
{
double sizeX = maxSizeX;
double si... | java | private static double computeWastedSpace(
double maxSizeX, double maxSizeY, double aspect)
{
int maxAspectX = (int) (maxSizeY * aspect);
int maxAspectY = (int) (maxSizeX / aspect);
if (maxAspectX > maxSizeX)
{
double sizeX = maxSizeX;
double si... | [
"private",
"static",
"double",
"computeWastedSpace",
"(",
"double",
"maxSizeX",
",",
"double",
"maxSizeY",
",",
"double",
"aspect",
")",
"{",
"int",
"maxAspectX",
"=",
"(",
"int",
")",
"(",
"maxSizeY",
"*",
"aspect",
")",
";",
"int",
"maxAspectY",
"=",
"("... | Compute the wasted space that is implied by the specified layout
@param maxSizeX The maximum size in x-direction
@param maxSizeY The maximum size in y-direction
@param aspect The aspect ratio
@return The wasted space | [
"Compute",
"the",
"wasted",
"space",
"that",
"is",
"implied",
"by",
"the",
"specified",
"layout"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/layout/AspectLayout.java#L217-L233 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/log/FormatterFileLog.java | FormatterFileLog.formatMessage | String formatMessage(int msgLogLevel, String tag, String msg, Throwable exception) {
if (exception != null) {
return DateHelper.getUTC(System.currentTimeMillis()) + "/" + getLevelTag(msgLogLevel) + tag + ": " + msg + "\n" + getStackTrace(exception) + "\n";
} else {
return DateHel... | java | String formatMessage(int msgLogLevel, String tag, String msg, Throwable exception) {
if (exception != null) {
return DateHelper.getUTC(System.currentTimeMillis()) + "/" + getLevelTag(msgLogLevel) + tag + ": " + msg + "\n" + getStackTrace(exception) + "\n";
} else {
return DateHel... | [
"String",
"formatMessage",
"(",
"int",
"msgLogLevel",
",",
"String",
"tag",
",",
"String",
"msg",
",",
"Throwable",
"exception",
")",
"{",
"if",
"(",
"exception",
"!=",
"null",
")",
"{",
"return",
"DateHelper",
".",
"getUTC",
"(",
"System",
".",
"currentTi... | Format log data into a log entry String.
@param msgLogLevel Log level of an entry.
@param tag Tag with SDK and version details.
@param msg Log message.
@param exception Exception with a stach
@return Formatted log entry. | [
"Format",
"log",
"data",
"into",
"a",
"log",
"entry",
"String",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/log/FormatterFileLog.java#L42-L48 | train |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/log/FormatterFileLog.java | FormatterFileLog.getStackTrace | private String getStackTrace(final Throwable exception) {
if (exception != null) {
StringBuilder sb = new StringBuilder();
StackTraceElement[] stackTrace = exception.getStackTrace();
for (StackTraceElement element : stackTrace) {
sb.append(element.toString(... | java | private String getStackTrace(final Throwable exception) {
if (exception != null) {
StringBuilder sb = new StringBuilder();
StackTraceElement[] stackTrace = exception.getStackTrace();
for (StackTraceElement element : stackTrace) {
sb.append(element.toString(... | [
"private",
"String",
"getStackTrace",
"(",
"final",
"Throwable",
"exception",
")",
"{",
"if",
"(",
"exception",
"!=",
"null",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"StackTraceElement",
"[",
"]",
"stackTrace",
"=",
"exce... | Gets stacktrace as a String.
@param exception Exception for which the stacktrace should be returned.
@return Stacktrace as a String. | [
"Gets",
"stacktrace",
"as",
"a",
"String",
"."
] | 53140a58d5a62afe196047ccc5120bfe090ef211 | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/log/FormatterFileLog.java#L56-L82 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java | SearchableTextComponent.doSearch | private void doSearch()
{
setSearchPanelVisible(true);
String selectedText = textComponent.getSelectedText();
if (selectedText != null)
{
searchPanel.setQuery(selectedText);
}
searchPanel.requestFocusForTextField();
} | java | private void doSearch()
{
setSearchPanelVisible(true);
String selectedText = textComponent.getSelectedText();
if (selectedText != null)
{
searchPanel.setQuery(selectedText);
}
searchPanel.requestFocusForTextField();
} | [
"private",
"void",
"doSearch",
"(",
")",
"{",
"setSearchPanelVisible",
"(",
"true",
")",
";",
"String",
"selectedText",
"=",
"textComponent",
".",
"getSelectedText",
"(",
")",
";",
"if",
"(",
"selectedText",
"!=",
"null",
")",
"{",
"searchPanel",
".",
"setQu... | Called to initiate the search. Will show the search panel, and
set the currently selected text as the query | [
"Called",
"to",
"initiate",
"the",
"search",
".",
"Will",
"show",
"the",
"search",
"panel",
"and",
"set",
"the",
"currently",
"selected",
"text",
"as",
"the",
"query"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java#L170-L179 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java | SearchableTextComponent.setSearchPanelVisible | void setSearchPanelVisible(boolean b)
{
if (!searchPanelVisible && b)
{
add(searchPanel, BorderLayout.NORTH);
revalidate();
}
else if (searchPanelVisible && !b)
{
remove(searchPanel);
revalidate();
}
... | java | void setSearchPanelVisible(boolean b)
{
if (!searchPanelVisible && b)
{
add(searchPanel, BorderLayout.NORTH);
revalidate();
}
else if (searchPanelVisible && !b)
{
remove(searchPanel);
revalidate();
}
... | [
"void",
"setSearchPanelVisible",
"(",
"boolean",
"b",
")",
"{",
"if",
"(",
"!",
"searchPanelVisible",
"&&",
"b",
")",
"{",
"add",
"(",
"searchPanel",
",",
"BorderLayout",
".",
"NORTH",
")",
";",
"revalidate",
"(",
")",
";",
"}",
"else",
"if",
"(",
"sea... | Set whether the search panel is currently visible
@param b The state | [
"Set",
"whether",
"the",
"search",
"panel",
"is",
"currently",
"visible"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java#L186-L199 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java | SearchableTextComponent.doFindNext | void doFindNext()
{
String query = searchPanel.getQuery();
if (query.isEmpty())
{
return;
}
String text = getDocumentText();
boolean ignoreCase = !searchPanel.isCaseSensitive();
int caretPosition = textComponent.getCaretPositio... | java | void doFindNext()
{
String query = searchPanel.getQuery();
if (query.isEmpty())
{
return;
}
String text = getDocumentText();
boolean ignoreCase = !searchPanel.isCaseSensitive();
int caretPosition = textComponent.getCaretPositio... | [
"void",
"doFindNext",
"(",
")",
"{",
"String",
"query",
"=",
"searchPanel",
".",
"getQuery",
"(",
")",
";",
"if",
"(",
"query",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"text",
"=",
"getDocumentText",
"(",
")",
";",
"boolean"... | Find the next appearance of the search panel query | [
"Find",
"the",
"next",
"appearance",
"of",
"the",
"search",
"panel",
"query"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java#L204-L226 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java | SearchableTextComponent.getDocumentText | private String getDocumentText()
{
try
{
Document document = textComponent.getDocument();
String text = document.getText(0, document.getLength());
return text;
}
catch (BadLocationException e)
{
logger.warning(e.toStri... | java | private String getDocumentText()
{
try
{
Document document = textComponent.getDocument();
String text = document.getText(0, document.getLength());
return text;
}
catch (BadLocationException e)
{
logger.warning(e.toStri... | [
"private",
"String",
"getDocumentText",
"(",
")",
"{",
"try",
"{",
"Document",
"document",
"=",
"textComponent",
".",
"getDocument",
"(",
")",
";",
"String",
"text",
"=",
"document",
".",
"getText",
"(",
"0",
",",
"document",
".",
"getLength",
"(",
")",
... | Return the text of the document of the text component
@return The text | [
"Return",
"the",
"text",
"of",
"the",
"document",
"of",
"the",
"text",
"component"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java#L264-L277 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java | SearchableTextComponent.addHighlights | private void addHighlights(Collection<? extends Point> points, Color color)
{
removeHighlights(points);
Map<Point, Object> newHighlights =
JTextComponents.addHighlights(textComponent, points, color);
highlights.putAll(newHighlights);
} | java | private void addHighlights(Collection<? extends Point> points, Color color)
{
removeHighlights(points);
Map<Point, Object> newHighlights =
JTextComponents.addHighlights(textComponent, points, color);
highlights.putAll(newHighlights);
} | [
"private",
"void",
"addHighlights",
"(",
"Collection",
"<",
"?",
"extends",
"Point",
">",
"points",
",",
"Color",
"color",
")",
"{",
"removeHighlights",
"(",
"points",
")",
";",
"Map",
"<",
"Point",
",",
"Object",
">",
"newHighlights",
"=",
"JTextComponents"... | Add highlights with the given color to the text component for all
the given points
@param points The points, containing start and end indices
@param color The color | [
"Add",
"highlights",
"with",
"the",
"given",
"color",
"to",
"the",
"text",
"component",
"for",
"all",
"the",
"given",
"points"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java#L375-L381 | train |
javagl/CommonUI | src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java | SearchableTextComponent.removeHighlights | private void removeHighlights(Collection<? extends Point> points)
{
Set<Object> highlightsToRemove = new LinkedHashSet<Object>();
for (Point point : points)
{
Object oldHighlight = highlights.remove(point);
if (oldHighlight != null)
{
... | java | private void removeHighlights(Collection<? extends Point> points)
{
Set<Object> highlightsToRemove = new LinkedHashSet<Object>();
for (Point point : points)
{
Object oldHighlight = highlights.remove(point);
if (oldHighlight != null)
{
... | [
"private",
"void",
"removeHighlights",
"(",
"Collection",
"<",
"?",
"extends",
"Point",
">",
"points",
")",
"{",
"Set",
"<",
"Object",
">",
"highlightsToRemove",
"=",
"new",
"LinkedHashSet",
"<",
"Object",
">",
"(",
")",
";",
"for",
"(",
"Point",
"point",
... | Remove the highlights that are associated with the given points
@param points The points | [
"Remove",
"the",
"highlights",
"that",
"are",
"associated",
"with",
"the",
"given",
"points"
] | b2c7a7637d4e288271392ba148dc17e4c9780255 | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/text/SearchableTextComponent.java#L388-L400 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/AbstractResult.java | AbstractResult.getResultSet | public final Collection<Double> getResultSet(final AbstractMeter meter) {
checkIfMeterExists(meter);
return this.meterResults.get(meter);
} | java | public final Collection<Double> getResultSet(final AbstractMeter meter) {
checkIfMeterExists(meter);
return this.meterResults.get(meter);
} | [
"public",
"final",
"Collection",
"<",
"Double",
">",
"getResultSet",
"(",
"final",
"AbstractMeter",
"meter",
")",
"{",
"checkIfMeterExists",
"(",
"meter",
")",
";",
"return",
"this",
".",
"meterResults",
".",
"get",
"(",
"meter",
")",
";",
"}"
] | an array of all data items in the structure.
@param meter for the results wanted
@return the result set. | [
"an",
"array",
"of",
"all",
"data",
"items",
"in",
"the",
"structure",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/AbstractResult.java#L79-L82 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/AbstractResult.java | AbstractResult.squareSum | public final double squareSum(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic sqrSum = new SumOfSquares();
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return sqrSum.evaluate(doubleCo... | java | public final double squareSum(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic sqrSum = new SumOfSquares();
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return sqrSum.evaluate(doubleCo... | [
"public",
"final",
"double",
"squareSum",
"(",
"final",
"AbstractMeter",
"meter",
")",
"{",
"checkIfMeterExists",
"(",
"meter",
")",
";",
"final",
"AbstractUnivariateStatistic",
"sqrSum",
"=",
"new",
"SumOfSquares",
"(",
")",
";",
"final",
"CollectionDoubleCollectio... | Computes the square sum of the elements.
@param meter the meter of the mean
@return the square sum. | [
"Computes",
"the",
"square",
"sum",
"of",
"the",
"elements",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/AbstractResult.java#L112-L117 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/AbstractResult.java | AbstractResult.getStandardDeviation | public final double getStandardDeviation(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic stdDev = new StandardDeviation();
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return stdDev.e... | java | public final double getStandardDeviation(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic stdDev = new StandardDeviation();
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return stdDev.e... | [
"public",
"final",
"double",
"getStandardDeviation",
"(",
"final",
"AbstractMeter",
"meter",
")",
"{",
"checkIfMeterExists",
"(",
"meter",
")",
";",
"final",
"AbstractUnivariateStatistic",
"stdDev",
"=",
"new",
"StandardDeviation",
"(",
")",
";",
"final",
"Collectio... | Computes the standard deviation.
@param meter the meter of the mean
@return the standard deviation | [
"Computes",
"the",
"standard",
"deviation",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/AbstractResult.java#L125-L130 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/AbstractResult.java | AbstractResult.sum | public final double sum(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic sum = new Sum();
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return sum.evaluate(doubleColl.toArray(), 0, doub... | java | public final double sum(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic sum = new Sum();
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return sum.evaluate(doubleColl.toArray(), 0, doub... | [
"public",
"final",
"double",
"sum",
"(",
"final",
"AbstractMeter",
"meter",
")",
"{",
"checkIfMeterExists",
"(",
"meter",
")",
";",
"final",
"AbstractUnivariateStatistic",
"sum",
"=",
"new",
"Sum",
"(",
")",
";",
"final",
"CollectionDoubleCollection",
"doubleColl"... | Computes the sum over all data items.
@param meter the meter of the mean
@return the sum of all runs. | [
"Computes",
"the",
"sum",
"over",
"all",
"data",
"items",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/AbstractResult.java#L138-L143 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/AbstractResult.java | AbstractResult.min | public final double min(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic min = new Min();
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return min.evaluate(doubleColl.toArray(), 0, doub... | java | public final double min(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic min = new Min();
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return min.evaluate(doubleColl.toArray(), 0, doub... | [
"public",
"final",
"double",
"min",
"(",
"final",
"AbstractMeter",
"meter",
")",
"{",
"checkIfMeterExists",
"(",
"meter",
")",
";",
"final",
"AbstractUnivariateStatistic",
"min",
"=",
"new",
"Min",
"(",
")",
";",
"final",
"CollectionDoubleCollection",
"doubleColl"... | Computes the minimum.
@param meter the meter of the mean
@return the minimum result value. | [
"Computes",
"the",
"minimum",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/AbstractResult.java#L151-L156 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/AbstractResult.java | AbstractResult.getConf05 | public final double getConf05(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic conf05 = new Percentile(5.0);
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return conf05.evaluate(doubleC... | java | public final double getConf05(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic conf05 = new Percentile(5.0);
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return conf05.evaluate(doubleC... | [
"public",
"final",
"double",
"getConf05",
"(",
"final",
"AbstractMeter",
"meter",
")",
"{",
"checkIfMeterExists",
"(",
"meter",
")",
";",
"final",
"AbstractUnivariateStatistic",
"conf05",
"=",
"new",
"Percentile",
"(",
"5.0",
")",
";",
"final",
"CollectionDoubleCo... | Computes the confidence 05 interval-factor. This value has to be combined with the mean to get the
confidence-interval.
@param meter the meter for the 05-confidence interval factor
@return the 99% confidence | [
"Computes",
"the",
"confidence",
"05",
"interval",
"-",
"factor",
".",
"This",
"value",
"has",
"to",
"be",
"combined",
"with",
"the",
"mean",
"to",
"get",
"the",
"confidence",
"-",
"interval",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/AbstractResult.java#L165-L171 | train |
sebastiangraf/perfidix | src/main/java/org/perfidix/result/AbstractResult.java | AbstractResult.getConf95 | public final double getConf95(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic conf95 = new Percentile(95.0);
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return conf95.evaluate(double... | java | public final double getConf95(final AbstractMeter meter) {
checkIfMeterExists(meter);
final AbstractUnivariateStatistic conf95 = new Percentile(95.0);
final CollectionDoubleCollection doubleColl = new CollectionDoubleCollection(this.meterResults.get(meter));
return conf95.evaluate(double... | [
"public",
"final",
"double",
"getConf95",
"(",
"final",
"AbstractMeter",
"meter",
")",
"{",
"checkIfMeterExists",
"(",
"meter",
")",
";",
"final",
"AbstractUnivariateStatistic",
"conf95",
"=",
"new",
"Percentile",
"(",
"95.0",
")",
";",
"final",
"CollectionDoubleC... | Computes the confidence 95 interval-factor. This value has to be combined with the mean to get the
confidence-interval.
@param meter the meter for the 95-confidence interval factor
@return the 95% confidence | [
"Computes",
"the",
"confidence",
"95",
"interval",
"-",
"factor",
".",
"This",
"value",
"has",
"to",
"be",
"combined",
"with",
"the",
"mean",
"to",
"get",
"the",
"confidence",
"-",
"interval",
"."
] | f13aa793b6a3055215ed4edbb946c1bb5d564886 | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/result/AbstractResult.java#L180-L185 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.