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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.daleChallScore | public static double daleChallScore(String strText) {
strText = cleanText(strText);
int intDifficultWordCount = 0;
List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText);
int intWordCount = arrWords.size();
for (int i = 0; i < intWordCount; ++i) {
if (!... | java | public static double daleChallScore(String strText) {
strText = cleanText(strText);
int intDifficultWordCount = 0;
List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText);
int intWordCount = arrWords.size();
for (int i = 0; i < intWordCount; ++i) {
if (!... | [
"public",
"static",
"double",
"daleChallScore",
"(",
"String",
"strText",
")",
"{",
"strText",
"=",
"cleanText",
"(",
"strText",
")",
";",
"int",
"intDifficultWordCount",
"=",
"0",
";",
"List",
"<",
"String",
">",
"arrWords",
"=",
"(",
"new",
"WhitespaceToke... | Returns the Dale Chall Score of the text.
@param strText
@return | [
"Returns",
"the",
"Dale",
"Chall",
"Score",
"of",
"the",
"text",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L125-L144 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.daleChallGrade | public static double daleChallGrade(String strText) {
//http://rfptemplates.technologyevaluation.com/dale-chall-list-of-3000-simple-words.html
double score=daleChallScore(strText);
if(score<5.0) {
return 2.5;
}
else if(score<6.0) {
return 5.5;
}
... | java | public static double daleChallGrade(String strText) {
//http://rfptemplates.technologyevaluation.com/dale-chall-list-of-3000-simple-words.html
double score=daleChallScore(strText);
if(score<5.0) {
return 2.5;
}
else if(score<6.0) {
return 5.5;
}
... | [
"public",
"static",
"double",
"daleChallGrade",
"(",
"String",
"strText",
")",
"{",
"//http://rfptemplates.technologyevaluation.com/dale-chall-list-of-3000-simple-words.html",
"double",
"score",
"=",
"daleChallScore",
"(",
"strText",
")",
";",
"if",
"(",
"score",
"<",
"5.... | Returns the Dale Chall Grade of the text.
@param strText
@return | [
"Returns",
"the",
"Dale",
"Chall",
"Grade",
"of",
"the",
"text",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L152-L176 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.spacheScore | public static double spacheScore(String strText) {
//http://simple.wikipedia.org/wiki/Spache_Readability_Formula
strText = cleanText(strText);
int intUniqueUnfamiliarWordCount = 0;
Set<String> arrWords = new HashSet<>((new WhitespaceTokenizer()).tokenize(strText));
for(String wor... | java | public static double spacheScore(String strText) {
//http://simple.wikipedia.org/wiki/Spache_Readability_Formula
strText = cleanText(strText);
int intUniqueUnfamiliarWordCount = 0;
Set<String> arrWords = new HashSet<>((new WhitespaceTokenizer()).tokenize(strText));
for(String wor... | [
"public",
"static",
"double",
"spacheScore",
"(",
"String",
"strText",
")",
"{",
"//http://simple.wikipedia.org/wiki/Spache_Readability_Formula",
"strText",
"=",
"cleanText",
"(",
"strText",
")",
";",
"int",
"intUniqueUnfamiliarWordCount",
"=",
"0",
";",
"Set",
"<",
"... | Returns the Spache Score of the text.
@param strText
@return | [
"Returns",
"the",
"Spache",
"Score",
"of",
"the",
"text",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L184-L198 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.sentenceCount | private static int sentenceCount(String strText) {
int numberOfDots=PHPMethods.substr_count(strText, '.');
// Will be tripped up by "Mr." or "U.K.". Not a major concern at this point.
if(strText.charAt(strText.length()-1)!='.') { //missing the final dot, count it too
++numberOfDots;
... | java | private static int sentenceCount(String strText) {
int numberOfDots=PHPMethods.substr_count(strText, '.');
// Will be tripped up by "Mr." or "U.K.". Not a major concern at this point.
if(strText.charAt(strText.length()-1)!='.') { //missing the final dot, count it too
++numberOfDots;
... | [
"private",
"static",
"int",
"sentenceCount",
"(",
"String",
"strText",
")",
"{",
"int",
"numberOfDots",
"=",
"PHPMethods",
".",
"substr_count",
"(",
"strText",
",",
"'",
"'",
")",
";",
"// Will be tripped up by \"Mr.\" or \"U.K.\". Not a major concern at this point.",
"... | Returns sentence count for text.
@param strText Text to be measured
@return | [
"Returns",
"sentence",
"count",
"for",
"text",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L227-L234 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.cleanText | private static String cleanText(String strText) {
strText = HTMLParser.unsafeRemoveAllTags(strText);
strText = strText.toLowerCase(Locale.ENGLISH);
strText = StringCleaner.unifyTerminators(strText);
strText = strText.replaceAll(" [0-9]+ ", " "); // Remove "words" compri... | java | private static String cleanText(String strText) {
strText = HTMLParser.unsafeRemoveAllTags(strText);
strText = strText.toLowerCase(Locale.ENGLISH);
strText = StringCleaner.unifyTerminators(strText);
strText = strText.replaceAll(" [0-9]+ ", " "); // Remove "words" compri... | [
"private",
"static",
"String",
"cleanText",
"(",
"String",
"strText",
")",
"{",
"strText",
"=",
"HTMLParser",
".",
"unsafeRemoveAllTags",
"(",
"strText",
")",
";",
"strText",
"=",
"strText",
".",
"toLowerCase",
"(",
"Locale",
".",
"ENGLISH",
")",
";",
"strTe... | Trims, removes line breaks, multiple spaces and generally cleans text before processing.
@param strText Text to be transformed
@return | [
"Trims",
"removes",
"line",
"breaks",
"multiple",
"spaces",
"and",
"generally",
"cleans",
"text",
"before",
"processing",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L242-L252 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.averageWordsPerSentence | private static double averageWordsPerSentence(String strText) {
int intSentenceCount = sentenceCount(strText);
int intWordCount = wordCount(strText);
return (intWordCount / (double)intSentenceCount);
} | java | private static double averageWordsPerSentence(String strText) {
int intSentenceCount = sentenceCount(strText);
int intWordCount = wordCount(strText);
return (intWordCount / (double)intSentenceCount);
} | [
"private",
"static",
"double",
"averageWordsPerSentence",
"(",
"String",
"strText",
")",
"{",
"int",
"intSentenceCount",
"=",
"sentenceCount",
"(",
"strText",
")",
";",
"int",
"intWordCount",
"=",
"wordCount",
"(",
"strText",
")",
";",
"return",
"(",
"intWordCou... | Returns average words per sentence for text.
@param strText Text to be measured
@return | [
"Returns",
"average",
"words",
"per",
"sentence",
"for",
"text",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L260-L264 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.totalSyllables | private static int totalSyllables(String strText) {
int intSyllableCount = 0;
List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText);
int intWordCount = arrWords.size();
for (int i = 0; i < intWordCount; ++i) {
intSyllableCount += syllableCount(arrWord... | java | private static int totalSyllables(String strText) {
int intSyllableCount = 0;
List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText);
int intWordCount = arrWords.size();
for (int i = 0; i < intWordCount; ++i) {
intSyllableCount += syllableCount(arrWord... | [
"private",
"static",
"int",
"totalSyllables",
"(",
"String",
"strText",
")",
"{",
"int",
"intSyllableCount",
"=",
"0",
";",
"List",
"<",
"String",
">",
"arrWords",
"=",
"(",
"new",
"WhitespaceTokenizer",
"(",
")",
")",
".",
"tokenize",
"(",
"strText",
")",... | Returns total syllable count for text.
@param strText Text to be measured
@return | [
"Returns",
"total",
"syllable",
"count",
"for",
"text",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L272-L281 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.averageSyllablesPerWord | private static double averageSyllablesPerWord(String strText) {
int intSyllableCount = totalSyllables(strText);
int intWordCount = wordCount(strText);
return (intSyllableCount / (double)intWordCount);
} | java | private static double averageSyllablesPerWord(String strText) {
int intSyllableCount = totalSyllables(strText);
int intWordCount = wordCount(strText);
return (intSyllableCount / (double)intWordCount);
} | [
"private",
"static",
"double",
"averageSyllablesPerWord",
"(",
"String",
"strText",
")",
"{",
"int",
"intSyllableCount",
"=",
"totalSyllables",
"(",
"strText",
")",
";",
"int",
"intWordCount",
"=",
"wordCount",
"(",
"strText",
")",
";",
"return",
"(",
"intSyllab... | Returns average syllables per word for text.
@param strText Text to be measured
@return | [
"Returns",
"average",
"syllables",
"per",
"word",
"for",
"text",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L289-L294 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.wordsWithThreeSyllables | private static int wordsWithThreeSyllables(String strText) {
int intLongWordCount = 0;
List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText);
int intWordCount = arrWords.size();
for (int i = 0; i < intWordCount; ++i) {
if(syllableCount(arrWords.get(i)... | java | private static int wordsWithThreeSyllables(String strText) {
int intLongWordCount = 0;
List<String> arrWords = (new WhitespaceTokenizer()).tokenize(strText);
int intWordCount = arrWords.size();
for (int i = 0; i < intWordCount; ++i) {
if(syllableCount(arrWords.get(i)... | [
"private",
"static",
"int",
"wordsWithThreeSyllables",
"(",
"String",
"strText",
")",
"{",
"int",
"intLongWordCount",
"=",
"0",
";",
"List",
"<",
"String",
">",
"arrWords",
"=",
"(",
"new",
"WhitespaceTokenizer",
"(",
")",
")",
".",
"tokenize",
"(",
"strText... | Returns the number of words with more than three syllables.
@param strText Text to be measured
@return | [
"Returns",
"the",
"number",
"of",
"words",
"with",
"more",
"than",
"three",
"syllables",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L302-L314 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.percentageWordsWithThreeSyllables | private static double percentageWordsWithThreeSyllables(String strText) {
int intWordCount = wordCount(strText);
int intLongWordCount = wordsWithThreeSyllables(strText);
double percentage = ((intLongWordCount / (double)intWordCount) * 100.0);
return percentage;
} | java | private static double percentageWordsWithThreeSyllables(String strText) {
int intWordCount = wordCount(strText);
int intLongWordCount = wordsWithThreeSyllables(strText);
double percentage = ((intLongWordCount / (double)intWordCount) * 100.0);
return percentage;
} | [
"private",
"static",
"double",
"percentageWordsWithThreeSyllables",
"(",
"String",
"strText",
")",
"{",
"int",
"intWordCount",
"=",
"wordCount",
"(",
"strText",
")",
";",
"int",
"intLongWordCount",
"=",
"wordsWithThreeSyllables",
"(",
"strText",
")",
";",
"double",
... | Returns the percentage of words with more than three syllables.
@param strText Text to be measured
@return | [
"Returns",
"the",
"percentage",
"of",
"words",
"with",
"more",
"than",
"three",
"syllables",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L322-L327 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/PHPSimilarText.java | PHPSimilarText.similarityChars | public static int similarityChars(String txt1, String txt2) {
int sim = similar_char(txt1, txt1.length(), txt2, txt2.length());
return sim;
} | java | public static int similarityChars(String txt1, String txt2) {
int sim = similar_char(txt1, txt1.length(), txt2, txt2.length());
return sim;
} | [
"public",
"static",
"int",
"similarityChars",
"(",
"String",
"txt1",
",",
"String",
"txt2",
")",
"{",
"int",
"sim",
"=",
"similar_char",
"(",
"txt1",
",",
"txt1",
".",
"length",
"(",
")",
",",
"txt2",
",",
"txt2",
".",
"length",
"(",
")",
")",
";",
... | Checks the similarity of two strings and returns the number of matching
chars in both strings.
@param txt1
@param txt2
@return | [
"Checks",
"the",
"similarity",
"of",
"two",
"strings",
"and",
"returns",
"the",
"number",
"of",
"matching",
"chars",
"in",
"both",
"strings",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/PHPSimilarText.java#L67-L70 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/PHPSimilarText.java | PHPSimilarText.similarityPercentage | public static double similarityPercentage(String txt1, String txt2) {
double sim = similarityChars(txt1, txt2);
return sim * 200.0 / (txt1.length() + txt2.length());
} | java | public static double similarityPercentage(String txt1, String txt2) {
double sim = similarityChars(txt1, txt2);
return sim * 200.0 / (txt1.length() + txt2.length());
} | [
"public",
"static",
"double",
"similarityPercentage",
"(",
"String",
"txt1",
",",
"String",
"txt2",
")",
"{",
"double",
"sim",
"=",
"similarityChars",
"(",
"txt1",
",",
"txt2",
")",
";",
"return",
"sim",
"*",
"200.0",
"/",
"(",
"txt1",
".",
"length",
"("... | Checks the similarity of two strings and returns their similarity percentage.
@param txt1
@param txt2
@return | [
"Checks",
"the",
"similarity",
"of",
"two",
"strings",
"and",
"returns",
"their",
"similarity",
"percentage",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/PHPSimilarText.java#L79-L82 | train |
datumbox/datumbox-framework | datumbox-framework-applications/src/main/java/com/datumbox/framework/applications/nlp/CETR.java | CETR.extract | public String extract(String html, CETR.Parameters parameters) {
html = clearText(html); //preprocess the Document by removing irrelevant HTML tags and empty lines and break the document to its lines
List<String> rows = extractRows(html); //
List<Integer> selectedRowIds = selectRows(row... | java | public String extract(String html, CETR.Parameters parameters) {
html = clearText(html); //preprocess the Document by removing irrelevant HTML tags and empty lines and break the document to its lines
List<String> rows = extractRows(html); //
List<Integer> selectedRowIds = selectRows(row... | [
"public",
"String",
"extract",
"(",
"String",
"html",
",",
"CETR",
".",
"Parameters",
"parameters",
")",
"{",
"html",
"=",
"clearText",
"(",
"html",
")",
";",
"//preprocess the Document by removing irrelevant HTML tags and empty lines and break the document to its lines",
"... | Extracts the main content for an HTML page.
@param html
@param parameters
@return | [
"Extracts",
"the",
"main",
"content",
"for",
"an",
"HTML",
"page",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-applications/src/main/java/com/datumbox/framework/applications/nlp/CETR.java#L137-L156 | train |
datumbox/datumbox-framework | datumbox-framework-storage/datumbox-framework-storage-inmemory/src/main/java/com/datumbox/framework/storage/inmemory/DeepCopy.java | DeepCopy.serialize | public static byte[] serialize(Object obj) {
try(ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos)) {
oos.writeObject(obj);
return bos.toByteArray();
}
catch (IOException ex) {
throw new ... | java | public static byte[] serialize(Object obj) {
try(ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos)) {
oos.writeObject(obj);
return bos.toByteArray();
}
catch (IOException ex) {
throw new ... | [
"public",
"static",
"byte",
"[",
"]",
"serialize",
"(",
"Object",
"obj",
")",
"{",
"try",
"(",
"ByteArrayOutputStream",
"bos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStream",
"oos",
"=",
"new",
"ObjectOutputStream",
"(",
"bos",
")",
... | Serialized the Object to byte array.
@param obj
@return | [
"Serialized",
"the",
"Object",
"to",
"byte",
"array",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-storage/datumbox-framework-storage-inmemory/src/main/java/com/datumbox/framework/storage/inmemory/DeepCopy.java#L34-L43 | train |
datumbox/datumbox-framework | datumbox-framework-storage/datumbox-framework-storage-inmemory/src/main/java/com/datumbox/framework/storage/inmemory/DeepCopy.java | DeepCopy.deserialize | public static Object deserialize(byte[] arr) {
try (InputStream bis = new ByteArrayInputStream(arr);
ObjectInputStream ois = new ObjectInputStream(bis)) {
return ois.readObject();
}
catch (IOException ex) {
throw new UncheckedIOException(ex);
}
... | java | public static Object deserialize(byte[] arr) {
try (InputStream bis = new ByteArrayInputStream(arr);
ObjectInputStream ois = new ObjectInputStream(bis)) {
return ois.readObject();
}
catch (IOException ex) {
throw new UncheckedIOException(ex);
}
... | [
"public",
"static",
"Object",
"deserialize",
"(",
"byte",
"[",
"]",
"arr",
")",
"{",
"try",
"(",
"InputStream",
"bis",
"=",
"new",
"ByteArrayInputStream",
"(",
"arr",
")",
";",
"ObjectInputStream",
"ois",
"=",
"new",
"ObjectInputStream",
"(",
"bis",
")",
"... | Deserializes the byte array.
@param arr
@return | [
"Deserializes",
"the",
"byte",
"array",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-storage/datumbox-framework-storage-inmemory/src/main/java/com/datumbox/framework/storage/inmemory/DeepCopy.java#L51-L62 | train |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray.java | AssociativeArray.copy2Unmodifiable | public static AssociativeArray copy2Unmodifiable(AssociativeArray original) {
Map<Object, Object> internalData = new LinkedHashMap<>();
internalData.putAll(original.internalData);
internalData = Collections.unmodifiableMap(internalData);
return new AssociativeArray(internalData);
} | java | public static AssociativeArray copy2Unmodifiable(AssociativeArray original) {
Map<Object, Object> internalData = new LinkedHashMap<>();
internalData.putAll(original.internalData);
internalData = Collections.unmodifiableMap(internalData);
return new AssociativeArray(internalData);
} | [
"public",
"static",
"AssociativeArray",
"copy2Unmodifiable",
"(",
"AssociativeArray",
"original",
")",
"{",
"Map",
"<",
"Object",
",",
"Object",
">",
"internalData",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"internalData",
".",
"putAll",
"(",
"original"... | Copies the provided AssociativeArray and builds a new which is unmodifiable.
@param original
@return | [
"Copies",
"the",
"provided",
"AssociativeArray",
"and",
"builds",
"a",
"new",
"which",
"is",
"unmodifiable",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray.java#L35-L40 | train |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray.java | AssociativeArray.overwrite | public final void overwrite(Map<Object, Object> data) {
internalData.clear();
internalData.putAll(data);
} | java | public final void overwrite(Map<Object, Object> data) {
internalData.clear();
internalData.putAll(data);
} | [
"public",
"final",
"void",
"overwrite",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"data",
")",
"{",
"internalData",
".",
"clear",
"(",
")",
";",
"internalData",
".",
"putAll",
"(",
"data",
")",
";",
"}"
] | Overwrites the contents of the internal data of this object with the ones
of the provided map.
@param data | [
"Overwrites",
"the",
"contents",
"of",
"the",
"internal",
"data",
"of",
"this",
"object",
"with",
"the",
"ones",
"of",
"the",
"provided",
"map",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray.java#L85-L88 | train |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray.java | AssociativeArray.multiplyValues | public final void multiplyValues(double multiplier) {
for(Map.Entry<Object, Object> entry : internalData.entrySet()) {
Double previousValue = TypeInference.toDouble(entry.getValue());
if(previousValue==null) {
continue;
}
internalData.put(entry.get... | java | public final void multiplyValues(double multiplier) {
for(Map.Entry<Object, Object> entry : internalData.entrySet()) {
Double previousValue = TypeInference.toDouble(entry.getValue());
if(previousValue==null) {
continue;
}
internalData.put(entry.get... | [
"public",
"final",
"void",
"multiplyValues",
"(",
"double",
"multiplier",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Object",
",",
"Object",
">",
"entry",
":",
"internalData",
".",
"entrySet",
"(",
")",
")",
"{",
"Double",
"previousValue",
"=",
"Ty... | Multiplies the values of the object with a particular multiplier. All the columns
of this object should be numeric or boolean or else an exception is thrown.
@param multiplier | [
"Multiplies",
"the",
"values",
"of",
"the",
"object",
"with",
"a",
"particular",
"multiplier",
".",
"All",
"the",
"columns",
"of",
"this",
"object",
"should",
"be",
"numeric",
"or",
"boolean",
"or",
"else",
"an",
"exception",
"is",
"thrown",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray.java#L131-L139 | train |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray.java | AssociativeArray.toFlatDataList | @SuppressWarnings("unchecked")
public FlatDataList toFlatDataList() {
Collection<Object> values = internalData.values();
List<Object> list;
if (values instanceof List<?>) {
list = (List<Object>)values;
}
else {
list = new ArrayList(values);
}
... | java | @SuppressWarnings("unchecked")
public FlatDataList toFlatDataList() {
Collection<Object> values = internalData.values();
List<Object> list;
if (values instanceof List<?>) {
list = (List<Object>)values;
}
else {
list = new ArrayList(values);
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"FlatDataList",
"toFlatDataList",
"(",
")",
"{",
"Collection",
"<",
"Object",
">",
"values",
"=",
"internalData",
".",
"values",
"(",
")",
";",
"List",
"<",
"Object",
">",
"list",
";",
"if",
"("... | Returns a FlatDataList with the values of the internal map. The method
might require to copy the data.
@return | [
"Returns",
"a",
"FlatDataList",
"with",
"the",
"values",
"of",
"the",
"internal",
"map",
".",
"The",
"method",
"might",
"require",
"to",
"copy",
"the",
"data",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray.java#L238-L249 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.save | public void save(String storageName) {
//store the objects on storage
storageEngine.saveObject("data", data);
//rename the storage
storageEngine.rename(storageName);
//reload the data of the object
data = storageEngine.loadObject("data", Data.class);
//mark it ... | java | public void save(String storageName) {
//store the objects on storage
storageEngine.saveObject("data", data);
//rename the storage
storageEngine.rename(storageName);
//reload the data of the object
data = storageEngine.loadObject("data", Data.class);
//mark it ... | [
"public",
"void",
"save",
"(",
"String",
"storageName",
")",
"{",
"//store the objects on storage",
"storageEngine",
".",
"saveObject",
"(",
"\"data\"",
",",
"data",
")",
";",
"//rename the storage",
"storageEngine",
".",
"rename",
"(",
"storageName",
")",
";",
"/... | Saves the Dataframe to disk.
@param storageName | [
"Saves",
"the",
"Dataframe",
"to",
"disk",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L326-L338 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.clear | @Override
public void clear() {
data.yDataType = null;
data.atomicNextAvailableRecordId.set(0);
data.xDataTypes.clear();
data.records.clear();
} | java | @Override
public void clear() {
data.yDataType = null;
data.atomicNextAvailableRecordId.set(0);
data.xDataTypes.clear();
data.records.clear();
} | [
"@",
"Override",
"public",
"void",
"clear",
"(",
")",
"{",
"data",
".",
"yDataType",
"=",
"null",
";",
"data",
".",
"atomicNextAvailableRecordId",
".",
"set",
"(",
"0",
")",
";",
"data",
".",
"xDataTypes",
".",
"clear",
"(",
")",
";",
"data",
".",
"r... | Clears all the internal Records of the Dataframe. The Dataframe can be used
after you clear it. | [
"Clears",
"all",
"the",
"internal",
"Records",
"of",
"the",
"Dataframe",
".",
"The",
"Dataframe",
"can",
"be",
"used",
"after",
"you",
"clear",
"it",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L405-L411 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.remove | @Override
public boolean remove(Object o) {
Integer id = indexOf((Record) o);
if(id == null) {
return false;
}
remove(id);
return true;
} | java | @Override
public boolean remove(Object o) {
Integer id = indexOf((Record) o);
if(id == null) {
return false;
}
remove(id);
return true;
} | [
"@",
"Override",
"public",
"boolean",
"remove",
"(",
"Object",
"o",
")",
"{",
"Integer",
"id",
"=",
"indexOf",
"(",
"(",
"Record",
")",
"o",
")",
";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"remove",
"(",
"id",
")",... | Removes the first occurrence of the specified element from this Dataframe,
if it is present and it does not update the metadata.
@param o
@return | [
"Removes",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"element",
"from",
"this",
"Dataframe",
"if",
"it",
"is",
"present",
"and",
"it",
"does",
"not",
"update",
"the",
"metadata",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L503-L511 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.retainAll | @Override
public boolean retainAll(Collection<?> c) {
boolean modified = false;
for(Map.Entry<Integer, Record> e : entries()) {
Integer rId = e.getKey();
Record r = e.getValue();
if(!c.contains(r)) {
remove(rId);
modified = true;
... | java | @Override
public boolean retainAll(Collection<?> c) {
boolean modified = false;
for(Map.Entry<Integer, Record> e : entries()) {
Integer rId = e.getKey();
Record r = e.getValue();
if(!c.contains(r)) {
remove(rId);
modified = true;
... | [
"@",
"Override",
"public",
"boolean",
"retainAll",
"(",
"Collection",
"<",
"?",
">",
"c",
")",
"{",
"boolean",
"modified",
"=",
"false",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Record",
">",
"e",
":",
"entries",
"(",
")",
")",
"... | Retains only the elements in this collection that are contained in the
specified collection and updates the meta data.
@param c
@return | [
"Retains",
"only",
"the",
"elements",
"in",
"this",
"collection",
"that",
"are",
"contained",
"in",
"the",
"specified",
"collection",
"and",
"updates",
"the",
"meta",
"data",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L539-L554 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.addRecord | public Integer addRecord(Record r) {
Integer rId = _unsafe_add(r);
updateMeta(r);
return rId;
} | java | public Integer addRecord(Record r) {
Integer rId = _unsafe_add(r);
updateMeta(r);
return rId;
} | [
"public",
"Integer",
"addRecord",
"(",
"Record",
"r",
")",
"{",
"Integer",
"rId",
"=",
"_unsafe_add",
"(",
"r",
")",
";",
"updateMeta",
"(",
"r",
")",
";",
"return",
"rId",
";",
"}"
] | Adds a Record in the Dataframe and returns its id.
@param r
@return | [
"Adds",
"a",
"Record",
"in",
"the",
"Dataframe",
"and",
"returns",
"its",
"id",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L608-L612 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.set | public Integer set(Integer rId, Record r) {
_unsafe_set(rId, r);
updateMeta(r);
return rId;
} | java | public Integer set(Integer rId, Record r) {
_unsafe_set(rId, r);
updateMeta(r);
return rId;
} | [
"public",
"Integer",
"set",
"(",
"Integer",
"rId",
",",
"Record",
"r",
")",
"{",
"_unsafe_set",
"(",
"rId",
",",
"r",
")",
";",
"updateMeta",
"(",
"r",
")",
";",
"return",
"rId",
";",
"}"
] | Sets the record of a particular id in the dataset. If the record does not
exist it will be added with the specific id and the next added record will
have as id the next integer.
Note that the meta-data are partially updated. This means that if the replaced
Record contained a column which is now no longer available in ... | [
"Sets",
"the",
"record",
"of",
"a",
"particular",
"id",
"in",
"the",
"dataset",
".",
"If",
"the",
"record",
"does",
"not",
"exist",
"it",
"will",
"be",
"added",
"with",
"the",
"specific",
"id",
"and",
"the",
"next",
"added",
"record",
"will",
"have",
"... | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L629-L633 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.getXColumn | public FlatDataList getXColumn(Object column) {
FlatDataList flatDataList = new FlatDataList();
for(Record r : values()) {
flatDataList.add(r.getX().get(column));
}
return flatDataList;
} | java | public FlatDataList getXColumn(Object column) {
FlatDataList flatDataList = new FlatDataList();
for(Record r : values()) {
flatDataList.add(r.getX().get(column));
}
return flatDataList;
} | [
"public",
"FlatDataList",
"getXColumn",
"(",
"Object",
"column",
")",
"{",
"FlatDataList",
"flatDataList",
"=",
"new",
"FlatDataList",
"(",
")",
";",
"for",
"(",
"Record",
"r",
":",
"values",
"(",
")",
")",
"{",
"flatDataList",
".",
"add",
"(",
"r",
".",... | It extracts the values of a particular column from all records and
stores them into an FlatDataList.
@param column
@return | [
"It",
"extracts",
"the",
"values",
"of",
"a",
"particular",
"column",
"from",
"all",
"records",
"and",
"stores",
"them",
"into",
"an",
"FlatDataList",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L669-L677 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.getYColumn | public FlatDataList getYColumn() {
FlatDataList flatDataList = new FlatDataList();
for(Record r : values()) {
flatDataList.add(r.getY());
}
return flatDataList;
} | java | public FlatDataList getYColumn() {
FlatDataList flatDataList = new FlatDataList();
for(Record r : values()) {
flatDataList.add(r.getY());
}
return flatDataList;
} | [
"public",
"FlatDataList",
"getYColumn",
"(",
")",
"{",
"FlatDataList",
"flatDataList",
"=",
"new",
"FlatDataList",
"(",
")",
";",
"for",
"(",
"Record",
"r",
":",
"values",
"(",
")",
")",
"{",
"flatDataList",
".",
"add",
"(",
"r",
".",
"getY",
"(",
")",... | It extracts the values of the response variables from all observations and
stores them into an FlatDataList.
@return | [
"It",
"extracts",
"the",
"values",
"of",
"the",
"response",
"variables",
"from",
"all",
"observations",
"and",
"stores",
"them",
"into",
"an",
"FlatDataList",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L685-L693 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.dropXColumns | public void dropXColumns(Set<Object> columnSet) {
columnSet.retainAll(data.xDataTypes.keySet()); //keep only those columns that are already known to the Meta data of the Dataframe
if(columnSet.isEmpty()) {
return;
}
//remove all the columns from the Meta data
data.x... | java | public void dropXColumns(Set<Object> columnSet) {
columnSet.retainAll(data.xDataTypes.keySet()); //keep only those columns that are already known to the Meta data of the Dataframe
if(columnSet.isEmpty()) {
return;
}
//remove all the columns from the Meta data
data.x... | [
"public",
"void",
"dropXColumns",
"(",
"Set",
"<",
"Object",
">",
"columnSet",
")",
"{",
"columnSet",
".",
"retainAll",
"(",
"data",
".",
"xDataTypes",
".",
"keySet",
"(",
")",
")",
";",
"//keep only those columns that are already known to the Meta data of the Datafra... | Removes completely a list of columns from the dataset. The meta-data of
the Dataframe are updated. The method internally uses threads.
@param columnSet | [
"Removes",
"completely",
"a",
"list",
"of",
"columns",
"from",
"the",
"dataset",
".",
"The",
"meta",
"-",
"data",
"of",
"the",
"Dataframe",
"are",
"updated",
".",
"The",
"method",
"internally",
"uses",
"threads",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L701-L726 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.getSubset | public Dataframe getSubset(FlatDataList idsCollection) {
Dataframe d = new Dataframe(configuration);
for(Object id : idsCollection) {
d.add(get((Integer)id));
}
return d;
} | java | public Dataframe getSubset(FlatDataList idsCollection) {
Dataframe d = new Dataframe(configuration);
for(Object id : idsCollection) {
d.add(get((Integer)id));
}
return d;
} | [
"public",
"Dataframe",
"getSubset",
"(",
"FlatDataList",
"idsCollection",
")",
"{",
"Dataframe",
"d",
"=",
"new",
"Dataframe",
"(",
"configuration",
")",
";",
"for",
"(",
"Object",
"id",
":",
"idsCollection",
")",
"{",
"d",
".",
"add",
"(",
"get",
"(",
"... | It generates and returns a new Dataframe which contains a subset of this Dataframe.
All the Records of the returned Dataframe are copies of the original Records.
The method is used for k-fold cross validation and sampling. Note that the
Records in the new Dataframe have DIFFERENT ids from the original ones.
@param ids... | [
"It",
"generates",
"and",
"returns",
"a",
"new",
"Dataframe",
"which",
"contains",
"a",
"subset",
"of",
"this",
"Dataframe",
".",
"All",
"the",
"Records",
"of",
"the",
"returned",
"Dataframe",
"are",
"copies",
"of",
"the",
"original",
"Records",
".",
"The",
... | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L737-L744 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.recalculateMeta | public void recalculateMeta() {
data.yDataType = null;
data.xDataTypes.clear();
for(Record r : values()) {
updateMeta(r);
}
} | java | public void recalculateMeta() {
data.yDataType = null;
data.xDataTypes.clear();
for(Record r : values()) {
updateMeta(r);
}
} | [
"public",
"void",
"recalculateMeta",
"(",
")",
"{",
"data",
".",
"yDataType",
"=",
"null",
";",
"data",
".",
"xDataTypes",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Record",
"r",
":",
"values",
"(",
")",
")",
"{",
"updateMeta",
"(",
"r",
")",
";",
... | It forces the recalculation of Meta data using the Records of the dataset. | [
"It",
"forces",
"the",
"recalculation",
"of",
"Meta",
"data",
"using",
"the",
"Records",
"of",
"the",
"dataset",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L749-L755 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.entries | public Iterable<Map.Entry<Integer, Record>> entries() {
return () -> new Iterator<Map.Entry<Integer, Record>>() {
private final Iterator<Map.Entry<Integer, Record>> it = data.records.entrySet().iterator();
/** {@inheritDoc} */
@Override
public boolean hasNext() {... | java | public Iterable<Map.Entry<Integer, Record>> entries() {
return () -> new Iterator<Map.Entry<Integer, Record>>() {
private final Iterator<Map.Entry<Integer, Record>> it = data.records.entrySet().iterator();
/** {@inheritDoc} */
@Override
public boolean hasNext() {... | [
"public",
"Iterable",
"<",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Record",
">",
">",
"entries",
"(",
")",
"{",
"return",
"(",
")",
"->",
"new",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Record",
">",
">",
"(",
")",
"{",
"pri... | Returns a read-only Iterable on the keys and Records of the Dataframe.
@return | [
"Returns",
"a",
"read",
"-",
"only",
"Iterable",
"on",
"the",
"keys",
"and",
"Records",
"of",
"the",
"Dataframe",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L775-L797 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.index | public Iterable<Integer> index() {
return () -> new Iterator<Integer>() {
private final Iterator<Integer> it = data.records.keySet().iterator();
/** {@inheritDoc} */
@Override
public boolean hasNext() {
return it.hasNext();
}
... | java | public Iterable<Integer> index() {
return () -> new Iterator<Integer>() {
private final Iterator<Integer> it = data.records.keySet().iterator();
/** {@inheritDoc} */
@Override
public boolean hasNext() {
return it.hasNext();
}
... | [
"public",
"Iterable",
"<",
"Integer",
">",
"index",
"(",
")",
"{",
"return",
"(",
")",
"->",
"new",
"Iterator",
"<",
"Integer",
">",
"(",
")",
"{",
"private",
"final",
"Iterator",
"<",
"Integer",
">",
"it",
"=",
"data",
".",
"records",
".",
"keySet",... | Returns a read-only Iterable on the keys of the Dataframe.
@return | [
"Returns",
"a",
"read",
"-",
"only",
"Iterable",
"on",
"the",
"keys",
"of",
"the",
"Dataframe",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L804-L826 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.values | public Iterable<Record> values() {
return () -> new Iterator<Record>(){
private final Iterator<Record> it = data.records.values().iterator();
/** {@inheritDoc} */
@Override
public boolean hasNext() {
return it.hasNext();
}
... | java | public Iterable<Record> values() {
return () -> new Iterator<Record>(){
private final Iterator<Record> it = data.records.values().iterator();
/** {@inheritDoc} */
@Override
public boolean hasNext() {
return it.hasNext();
}
... | [
"public",
"Iterable",
"<",
"Record",
">",
"values",
"(",
")",
"{",
"return",
"(",
")",
"->",
"new",
"Iterator",
"<",
"Record",
">",
"(",
")",
"{",
"private",
"final",
"Iterator",
"<",
"Record",
">",
"it",
"=",
"data",
".",
"records",
".",
"values",
... | Returns a read-only Iterable on the values of the Dataframe.
@return | [
"Returns",
"a",
"read",
"-",
"only",
"Iterable",
"on",
"the",
"values",
"of",
"the",
"Dataframe",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L833-L855 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe._unsafe_add | private Integer _unsafe_add(Record r) {
Integer newId = data.atomicNextAvailableRecordId.getAndIncrement();
data.records.put(newId, r);
return newId;
} | java | private Integer _unsafe_add(Record r) {
Integer newId = data.atomicNextAvailableRecordId.getAndIncrement();
data.records.put(newId, r);
return newId;
} | [
"private",
"Integer",
"_unsafe_add",
"(",
"Record",
"r",
")",
"{",
"Integer",
"newId",
"=",
"data",
".",
"atomicNextAvailableRecordId",
".",
"getAndIncrement",
"(",
")",
";",
"data",
".",
"records",
".",
"put",
"(",
"newId",
",",
"r",
")",
";",
"return",
... | Adds the record in the dataset without updating the Meta. The add method
returns the id of the new record.
@param r
@return | [
"Adds",
"the",
"record",
"in",
"the",
"dataset",
"without",
"updating",
"the",
"Meta",
".",
"The",
"add",
"method",
"returns",
"the",
"id",
"of",
"the",
"new",
"record",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L884-L889 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java | Dataframe.updateMeta | private void updateMeta(Record r) {
for(Map.Entry<Object, Object> entry : r.getX().entrySet()) {
Object column = entry.getKey();
Object value = entry.getValue();
if(value!=null) {
data.xDataTypes.putIfAbsent(column, TypeInference.getDataType(value));
... | java | private void updateMeta(Record r) {
for(Map.Entry<Object, Object> entry : r.getX().entrySet()) {
Object column = entry.getKey();
Object value = entry.getValue();
if(value!=null) {
data.xDataTypes.putIfAbsent(column, TypeInference.getDataType(value));
... | [
"private",
"void",
"updateMeta",
"(",
"Record",
"r",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Object",
",",
"Object",
">",
"entry",
":",
"r",
".",
"getX",
"(",
")",
".",
"entrySet",
"(",
")",
")",
"{",
"Object",
"column",
"=",
"entry",
".... | Updates the meta data of the Dataframe using the provided Record.
The Meta-data include the supported columns and their DataTypes.
@param r | [
"Updates",
"the",
"meta",
"data",
"of",
"the",
"Dataframe",
"using",
"the",
"provided",
"Record",
".",
"The",
"Meta",
"-",
"data",
"include",
"the",
"supported",
"columns",
"and",
"their",
"DataTypes",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/dataobjects/Dataframe.java#L897-L913 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/Lilliefors.java | Lilliefors.normalDistributionGetParams | public static AssociativeArray normalDistributionGetParams(FlatDataCollection flatDataCollection) {
AssociativeArray params = new AssociativeArray();
params.put("mean", Descriptives.mean(flatDataCollection));
params.put("variance", Descriptives.variance(flatDataCollection, true));
return... | java | public static AssociativeArray normalDistributionGetParams(FlatDataCollection flatDataCollection) {
AssociativeArray params = new AssociativeArray();
params.put("mean", Descriptives.mean(flatDataCollection));
params.put("variance", Descriptives.variance(flatDataCollection, true));
return... | [
"public",
"static",
"AssociativeArray",
"normalDistributionGetParams",
"(",
"FlatDataCollection",
"flatDataCollection",
")",
"{",
"AssociativeArray",
"params",
"=",
"new",
"AssociativeArray",
"(",
")",
";",
"params",
".",
"put",
"(",
"\"mean\"",
",",
"Descriptives",
"... | Estimate Parameters of Normal based on Sample. This method is called via reflection.
@param flatDataCollection
@return | [
"Estimate",
"Parameters",
"of",
"Normal",
"based",
"on",
"Sample",
".",
"This",
"method",
"is",
"called",
"via",
"reflection",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/Lilliefors.java#L112-L117 | train |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/ConfigurableFactory.java | ConfigurableFactory.getConfiguration | public static <C extends Configurable> C getConfiguration(Class<C> klass) {
String defaultPropertyFile = "datumbox." + klass.getSimpleName().toLowerCase(Locale.ENGLISH) + DEFAULT_POSTFIX + ".properties";
Properties properties = new Properties();
ClassLoader cl = klass.getClassLoader();... | java | public static <C extends Configurable> C getConfiguration(Class<C> klass) {
String defaultPropertyFile = "datumbox." + klass.getSimpleName().toLowerCase(Locale.ENGLISH) + DEFAULT_POSTFIX + ".properties";
Properties properties = new Properties();
ClassLoader cl = klass.getClassLoader();... | [
"public",
"static",
"<",
"C",
"extends",
"Configurable",
">",
"C",
"getConfiguration",
"(",
"Class",
"<",
"C",
">",
"klass",
")",
"{",
"String",
"defaultPropertyFile",
"=",
"\"datumbox.\"",
"+",
"klass",
".",
"getSimpleName",
"(",
")",
".",
"toLowerCase",
"(... | Initializes the Configuration Object based on the configuration file.
@param <C>
@param klass
@return | [
"Initializes",
"the",
"Configuration",
"Object",
"based",
"on",
"the",
"configuration",
"file",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/ConfigurableFactory.java#L48-L80 | train |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/ConfigurableFactory.java | ConfigurableFactory.getConfiguration | public static <C extends Configurable> C getConfiguration(Class<C> klass, Properties properties) {
//Initialize configuration object
C configuration;
try {
Constructor<C> constructor = klass.getDeclaredConstructor();
constructor.setAccessible(true);
configurat... | java | public static <C extends Configurable> C getConfiguration(Class<C> klass, Properties properties) {
//Initialize configuration object
C configuration;
try {
Constructor<C> constructor = klass.getDeclaredConstructor();
constructor.setAccessible(true);
configurat... | [
"public",
"static",
"<",
"C",
"extends",
"Configurable",
">",
"C",
"getConfiguration",
"(",
"Class",
"<",
"C",
">",
"klass",
",",
"Properties",
"properties",
")",
"{",
"//Initialize configuration object",
"C",
"configuration",
";",
"try",
"{",
"Constructor",
"<"... | Initializes the Configuration Object using a properties object.
@param klass
@param properties
@param <C>
@return | [
"Initializes",
"the",
"Configuration",
"Object",
"using",
"a",
"properties",
"object",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/ConfigurableFactory.java#L90-L105 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/relatedsamples/SignRelatedSamples.java | SignRelatedSamples.getPvalue | public static double getPvalue(TransposeDataList transposeDataList) {
Object[] keys = transposeDataList.keySet().toArray();
if(keys.length!=2) {
throw new IllegalArgumentException("The collection must contain observations from 2 groups.");
}
Object keyX = keys[0];
... | java | public static double getPvalue(TransposeDataList transposeDataList) {
Object[] keys = transposeDataList.keySet().toArray();
if(keys.length!=2) {
throw new IllegalArgumentException("The collection must contain observations from 2 groups.");
}
Object keyX = keys[0];
... | [
"public",
"static",
"double",
"getPvalue",
"(",
"TransposeDataList",
"transposeDataList",
")",
"{",
"Object",
"[",
"]",
"keys",
"=",
"transposeDataList",
".",
"keySet",
"(",
")",
".",
"toArray",
"(",
")",
";",
"if",
"(",
"keys",
".",
"length",
"!=",
"2",
... | Estimates the p-value of the sign test for the provided data.
@param transposeDataList
@return | [
"Estimates",
"the",
"p",
"-",
"value",
"of",
"the",
"sign",
"test",
"for",
"the",
"provided",
"data",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/relatedsamples/SignRelatedSamples.java#L35-L67 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/relatedsamples/SpearmanCorrelation.java | SpearmanCorrelation.calculateCorrelation | public static double calculateCorrelation(TransposeDataList transposeDataList) {
Object[] keys = transposeDataList.keySet().toArray();
if(keys.length!=2) {
throw new IllegalArgumentException("The collection must contain observations from 2 groups.");
}
Object keyX = keys[0];... | java | public static double calculateCorrelation(TransposeDataList transposeDataList) {
Object[] keys = transposeDataList.keySet().toArray();
if(keys.length!=2) {
throw new IllegalArgumentException("The collection must contain observations from 2 groups.");
}
Object keyX = keys[0];... | [
"public",
"static",
"double",
"calculateCorrelation",
"(",
"TransposeDataList",
"transposeDataList",
")",
"{",
"Object",
"[",
"]",
"keys",
"=",
"transposeDataList",
".",
"keySet",
"(",
")",
".",
"toArray",
"(",
")",
";",
"if",
"(",
"keys",
".",
"length",
"!=... | Estimates Spearman's Correlation for the provided data.
@param transposeDataList
@return | [
"Estimates",
"Spearman",
"s",
"Correlation",
"for",
"the",
"provided",
"data",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/relatedsamples/SpearmanCorrelation.java#L38-L94 | train |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/relatedsamples/SpearmanCorrelation.java | SpearmanCorrelation.scoreToPvalue | private static double scoreToPvalue(double score, int n) {
double Zs= score*Math.sqrt(n-1.0);
double Ts= score*Math.sqrt((n-Zs)/(1.0-score*score));
return ContinuousDistributions.studentsCdf(Ts, n-2);
} | java | private static double scoreToPvalue(double score, int n) {
double Zs= score*Math.sqrt(n-1.0);
double Ts= score*Math.sqrt((n-Zs)/(1.0-score*score));
return ContinuousDistributions.studentsCdf(Ts, n-2);
} | [
"private",
"static",
"double",
"scoreToPvalue",
"(",
"double",
"score",
",",
"int",
"n",
")",
"{",
"double",
"Zs",
"=",
"score",
"*",
"Math",
".",
"sqrt",
"(",
"n",
"-",
"1.0",
")",
";",
"double",
"Ts",
"=",
"score",
"*",
"Math",
".",
"sqrt",
"(",
... | Returns the Pvalue for a particular score.
@param score
@param n
@return | [
"Returns",
"the",
"Pvalue",
"for",
"a",
"particular",
"score",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/relatedsamples/SpearmanCorrelation.java#L137-L141 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/ParagraphUtil.java | ParagraphUtil.create | public static P create(String... texts) {
P p = objectFactory.createP();
for (String text : texts) {
R r = RunUtil.create(text, p);
p.getContent().add(r);
}
return p;
} | java | public static P create(String... texts) {
P p = objectFactory.createP();
for (String text : texts) {
R r = RunUtil.create(text, p);
p.getContent().add(r);
}
return p;
} | [
"public",
"static",
"P",
"create",
"(",
"String",
"...",
"texts",
")",
"{",
"P",
"p",
"=",
"objectFactory",
".",
"createP",
"(",
")",
";",
"for",
"(",
"String",
"text",
":",
"texts",
")",
"{",
"R",
"r",
"=",
"RunUtil",
".",
"create",
"(",
"text",
... | Creates a new paragraph.
@param texts the text of this paragraph. If more than one text is specified each text will be placed within its own Run.
@return a new paragraph containing the given text. | [
"Creates",
"a",
"new",
"paragraph",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/ParagraphUtil.java#L22-L29 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/el/ExpressionResolver.java | ExpressionResolver.resolveExpression | public Object resolveExpression(String expressionString, Object contextRoot) {
if ((expressionString.startsWith("${") || expressionString.startsWith("#{")) && expressionString.endsWith("}")) {
expressionString = expressionUtil.stripExpression(expressionString);
}
ExpressionParser par... | java | public Object resolveExpression(String expressionString, Object contextRoot) {
if ((expressionString.startsWith("${") || expressionString.startsWith("#{")) && expressionString.endsWith("}")) {
expressionString = expressionUtil.stripExpression(expressionString);
}
ExpressionParser par... | [
"public",
"Object",
"resolveExpression",
"(",
"String",
"expressionString",
",",
"Object",
"contextRoot",
")",
"{",
"if",
"(",
"(",
"expressionString",
".",
"startsWith",
"(",
"\"${\"",
")",
"||",
"expressionString",
".",
"startsWith",
"(",
"\"#{\"",
")",
")",
... | Runs the given expression against the given context object and returns the result of the evaluated expression.
@param expressionString the expression to evaluate.
@param contextRoot the context object against which the expression is evaluated.
@return the result of the evaluated expression. | [
"Runs",
"the",
"given",
"expression",
"against",
"the",
"given",
"context",
"object",
"and",
"returns",
"the",
"result",
"of",
"the",
"evaluated",
"expression",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/el/ExpressionResolver.java#L30-L39 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/processor/CommentProcessorRegistry.java | CommentProcessorRegistry.runProcessors | public <T> void runProcessors(final WordprocessingMLPackage document, final ProxyBuilder<T> proxyBuilder) {
final Map<BigInteger, CommentWrapper> comments = CommentUtil.getComments(document);
CoordinatesWalker walker = new BaseCoordinatesWalker(document) {
@Override
protected void onParagraph(Para... | java | public <T> void runProcessors(final WordprocessingMLPackage document, final ProxyBuilder<T> proxyBuilder) {
final Map<BigInteger, CommentWrapper> comments = CommentUtil.getComments(document);
CoordinatesWalker walker = new BaseCoordinatesWalker(document) {
@Override
protected void onParagraph(Para... | [
"public",
"<",
"T",
">",
"void",
"runProcessors",
"(",
"final",
"WordprocessingMLPackage",
"document",
",",
"final",
"ProxyBuilder",
"<",
"T",
">",
"proxyBuilder",
")",
"{",
"final",
"Map",
"<",
"BigInteger",
",",
"CommentWrapper",
">",
"comments",
"=",
"Comme... | Lets each registered ICommentProcessor have a run on the specified docx
document. At the end of the document the commit method is called for each
ICommentProcessor. The ICommentProcessors are run in the order they were
registered.
@param document the docx document over which to run the registered ICommentProcessors... | [
"Lets",
"each",
"registered",
"ICommentProcessor",
"have",
"a",
"run",
"on",
"the",
"specified",
"docx",
"document",
".",
"At",
"the",
"end",
"of",
"the",
"document",
"the",
"commit",
"method",
"is",
"called",
"for",
"each",
"ICommentProcessor",
".",
"The",
... | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/processor/CommentProcessorRegistry.java#L77-L102 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/proxy/ProxyBuilder.java | ProxyBuilder.withInterface | public ProxyBuilder<T> withInterface(Class<?> interfaceClass, Object interfaceImpl) {
this.interfacesToImplementations.put(interfaceClass, interfaceImpl);
return this;
} | java | public ProxyBuilder<T> withInterface(Class<?> interfaceClass, Object interfaceImpl) {
this.interfacesToImplementations.put(interfaceClass, interfaceImpl);
return this;
} | [
"public",
"ProxyBuilder",
"<",
"T",
">",
"withInterface",
"(",
"Class",
"<",
"?",
">",
"interfaceClass",
",",
"Object",
"interfaceImpl",
")",
"{",
"this",
".",
"interfacesToImplementations",
".",
"put",
"(",
"interfaceClass",
",",
"interfaceImpl",
")",
";",
"r... | Specifies an interfaces and an implementation of an interface by which the root object
shall be extended.
@param interfaceClass the class of the interface
@param interfaceImpl an implementation of the interface
@return this builder for chaining. | [
"Specifies",
"an",
"interfaces",
"and",
"an",
"implementation",
"of",
"an",
"interface",
"by",
"which",
"the",
"root",
"object",
"shall",
"be",
"extended",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/proxy/ProxyBuilder.java#L38-L41 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/proxy/ProxyBuilder.java | ProxyBuilder.build | public T build() throws ProxyException {
if (this.root == null) {
throw new IllegalArgumentException("root must not be null!");
}
if (this.interfacesToImplementations.isEmpty()) {
// nothing to proxy
return this.root;
}
try {
ProxyMethodHandler methodHandler = new ProxyMet... | java | public T build() throws ProxyException {
if (this.root == null) {
throw new IllegalArgumentException("root must not be null!");
}
if (this.interfacesToImplementations.isEmpty()) {
// nothing to proxy
return this.root;
}
try {
ProxyMethodHandler methodHandler = new ProxyMet... | [
"public",
"T",
"build",
"(",
")",
"throws",
"ProxyException",
"{",
"if",
"(",
"this",
".",
"root",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"root must not be null!\"",
")",
";",
"}",
"if",
"(",
"this",
".",
"interfacesToImpl... | Creates a proxy object out of the specified root object and the specified interfaces
and implementations.
@return a proxy object that is still of type T but additionally implements all specified
interfaces.
@throws ProxyException if the proxy could not be created. | [
"Creates",
"a",
"proxy",
"object",
"out",
"of",
"the",
"specified",
"root",
"object",
"and",
"the",
"specified",
"interfaces",
"and",
"implementations",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/proxy/ProxyBuilder.java#L51-L72 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/CommentUtil.java | CommentUtil.getCommentAround | public static Comments.Comment getCommentAround(R run,
WordprocessingMLPackage document) {
try {
if (run instanceof Child) {
Child child = (Child) run;
ContentAccessor parent = (ContentAccessor) child.getParent();
if (parent == null)
return null;
CommentRangeStart possibleComment = null;
... | java | public static Comments.Comment getCommentAround(R run,
WordprocessingMLPackage document) {
try {
if (run instanceof Child) {
Child child = (Child) run;
ContentAccessor parent = (ContentAccessor) child.getParent();
if (parent == null)
return null;
CommentRangeStart possibleComment = null;
... | [
"public",
"static",
"Comments",
".",
"Comment",
"getCommentAround",
"(",
"R",
"run",
",",
"WordprocessingMLPackage",
"document",
")",
"{",
"try",
"{",
"if",
"(",
"run",
"instanceof",
"Child",
")",
"{",
"Child",
"child",
"=",
"(",
"Child",
")",
"run",
";",
... | Returns the comment the given DOCX4J run is commented with.
@param run the DOCX4J run whose comment to retrieve.
@param document the document that contains the run.
@return the comment, if found, null otherwise. | [
"Returns",
"the",
"comment",
"the",
"given",
"DOCX4J",
"run",
"is",
"commented",
"with",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/CommentUtil.java#L40-L93 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/CommentUtil.java | CommentUtil.getCommentFor | public static Comments.Comment getCommentFor(ContentAccessor object,
WordprocessingMLPackage document) {
try {
for (Object contentObject : object.getContent()) {
if (contentObject instanceof CommentRangeStart) {
try {
BigInteger id = ((CommentRangeStart) contentObject).getId();
CommentsPart... | java | public static Comments.Comment getCommentFor(ContentAccessor object,
WordprocessingMLPackage document) {
try {
for (Object contentObject : object.getContent()) {
if (contentObject instanceof CommentRangeStart) {
try {
BigInteger id = ((CommentRangeStart) contentObject).getId();
CommentsPart... | [
"public",
"static",
"Comments",
".",
"Comment",
"getCommentFor",
"(",
"ContentAccessor",
"object",
",",
"WordprocessingMLPackage",
"document",
")",
"{",
"try",
"{",
"for",
"(",
"Object",
"contentObject",
":",
"object",
".",
"getContent",
"(",
")",
")",
"{",
"i... | Returns the first comment found for the given docx object. Note that an object is
only considered commented if the comment STARTS within the object. Comments
spanning several objects are not supported by this method.
@param object the object whose comment to load.
@param document the document in which the object is em... | [
"Returns",
"the",
"first",
"comment",
"found",
"for",
"the",
"given",
"docx",
"object",
".",
"Note",
"that",
"an",
"object",
"is",
"only",
"considered",
"commented",
"if",
"the",
"comment",
"STARTS",
"within",
"the",
"object",
".",
"Comments",
"spanning",
"s... | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/CommentUtil.java#L107-L136 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/CommentUtil.java | CommentUtil.getCommentString | public static String getCommentString(Comments.Comment comment) {
StringBuilder builder = new StringBuilder();
for (Object commentChildObject : comment.getContent()) {
if (commentChildObject instanceof P) {
builder.append(new ParagraphWrapper((P) commentChildObject).getText());
}
}
return builder.toSt... | java | public static String getCommentString(Comments.Comment comment) {
StringBuilder builder = new StringBuilder();
for (Object commentChildObject : comment.getContent()) {
if (commentChildObject instanceof P) {
builder.append(new ParagraphWrapper((P) commentChildObject).getText());
}
}
return builder.toSt... | [
"public",
"static",
"String",
"getCommentString",
"(",
"Comments",
".",
"Comment",
"comment",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Object",
"commentChildObject",
":",
"comment",
".",
"getContent",
"(",
... | Returns the string value of the specified comment object. | [
"Returns",
"the",
"string",
"value",
"of",
"the",
"specified",
"comment",
"object",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/CommentUtil.java#L147-L155 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/RunUtil.java | RunUtil.getText | public static String getText(R run) {
String result = "";
for (Object content : run.getContent()) {
if (content instanceof JAXBElement) {
JAXBElement element = (JAXBElement) content;
if (element.getValue() instanceof Text) {
Text textObj = ... | java | public static String getText(R run) {
String result = "";
for (Object content : run.getContent()) {
if (content instanceof JAXBElement) {
JAXBElement element = (JAXBElement) content;
if (element.getValue() instanceof Text) {
Text textObj = ... | [
"public",
"static",
"String",
"getText",
"(",
"R",
"run",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"for",
"(",
"Object",
"content",
":",
"run",
".",
"getContent",
"(",
")",
")",
"{",
"if",
"(",
"content",
"instanceof",
"JAXBElement",
")",
"{",
... | Returns the text string of a run.
@param run the run whose text to get.
@return String representation of the run. | [
"Returns",
"the",
"text",
"string",
"of",
"a",
"run",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/RunUtil.java#L23-L45 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/RunUtil.java | RunUtil.setText | public static void setText(R run, String text) {
run.getContent().clear();
Text textObj = factory.createText();
textObj.setSpace("preserve");
textObj.setValue(text);
textObj.setSpace("preserve"); // make the text preserve spaces
run.getContent().add(textObj);
} | java | public static void setText(R run, String text) {
run.getContent().clear();
Text textObj = factory.createText();
textObj.setSpace("preserve");
textObj.setValue(text);
textObj.setSpace("preserve"); // make the text preserve spaces
run.getContent().add(textObj);
} | [
"public",
"static",
"void",
"setText",
"(",
"R",
"run",
",",
"String",
"text",
")",
"{",
"run",
".",
"getContent",
"(",
")",
".",
"clear",
"(",
")",
";",
"Text",
"textObj",
"=",
"factory",
".",
"createText",
"(",
")",
";",
"textObj",
".",
"setSpace",... | Sets the text of the given run to the given value.
@param run the run whose text to change.
@param text the text to set. | [
"Sets",
"the",
"text",
"of",
"the",
"given",
"run",
"to",
"the",
"given",
"value",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/RunUtil.java#L67-L74 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/RunUtil.java | RunUtil.create | public static R create(String text) {
R run = factory.createR();
setText(run, text);
return run;
} | java | public static R create(String text) {
R run = factory.createR();
setText(run, text);
return run;
} | [
"public",
"static",
"R",
"create",
"(",
"String",
"text",
")",
"{",
"R",
"run",
"=",
"factory",
".",
"createR",
"(",
")",
";",
"setText",
"(",
"run",
",",
"text",
")",
";",
"return",
"run",
";",
"}"
] | Creates a new run with the specified text.
@param text the initial text of the run.
@return the newly created run. | [
"Creates",
"a",
"new",
"run",
"with",
"the",
"specified",
"text",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/RunUtil.java#L82-L86 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/RunUtil.java | RunUtil.create | public static R create(Object content){
R run = factory.createR();
run.getContent().add(content);
return run;
} | java | public static R create(Object content){
R run = factory.createR();
run.getContent().add(content);
return run;
} | [
"public",
"static",
"R",
"create",
"(",
"Object",
"content",
")",
"{",
"R",
"run",
"=",
"factory",
".",
"createR",
"(",
")",
";",
"run",
".",
"getContent",
"(",
")",
".",
"add",
"(",
"content",
")",
";",
"return",
"run",
";",
"}"
] | Creates a new run with the given object as content.
@param content the content of the run.
@return the newly created run. | [
"Creates",
"a",
"new",
"run",
"with",
"the",
"given",
"object",
"as",
"content",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/RunUtil.java#L93-L97 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/RunUtil.java | RunUtil.create | public static R create(String text, P parentParagraph) {
R run = create(text);
applyParagraphStyle(parentParagraph, run);
return run;
} | java | public static R create(String text, P parentParagraph) {
R run = create(text);
applyParagraphStyle(parentParagraph, run);
return run;
} | [
"public",
"static",
"R",
"create",
"(",
"String",
"text",
",",
"P",
"parentParagraph",
")",
"{",
"R",
"run",
"=",
"create",
"(",
"text",
")",
";",
"applyParagraphStyle",
"(",
"parentParagraph",
",",
"run",
")",
";",
"return",
"run",
";",
"}"
] | Creates a new run with the specified text and inherits the style of the parent paragraph.
@param text the initial text of the run.
@param parentParagraph the parent paragraph whose style to inherit.
@return the newly created run. | [
"Creates",
"a",
"new",
"run",
"with",
"the",
"specified",
"text",
"and",
"inherits",
"the",
"style",
"of",
"the",
"parent",
"paragraph",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/RunUtil.java#L106-L110 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/DocxStamperConfiguration.java | DocxStamperConfiguration.addCommentProcessor | public DocxStamperConfiguration addCommentProcessor(Class<?> interfaceClass,
ICommentProcessor commentProcessor) {
this.commentProcessors.put(interfaceClass, commentProcessor);
return this;
} | java | public DocxStamperConfiguration addCommentProcessor(Class<?> interfaceClass,
ICommentProcessor commentProcessor) {
this.commentProcessors.put(interfaceClass, commentProcessor);
return this;
} | [
"public",
"DocxStamperConfiguration",
"addCommentProcessor",
"(",
"Class",
"<",
"?",
">",
"interfaceClass",
",",
"ICommentProcessor",
"commentProcessor",
")",
"{",
"this",
".",
"commentProcessors",
".",
"put",
"(",
"interfaceClass",
",",
"commentProcessor",
")",
";",
... | Registers the specified ICommentProcessor as an implementation of the
specified interface.
@param interfaceClass the Interface which is implemented by the commentProcessor.
@param commentProcessor the commentProcessor implementing the specified interface. | [
"Registers",
"the",
"specified",
"ICommentProcessor",
"as",
"an",
"implementation",
"of",
"the",
"specified",
"interface",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/DocxStamperConfiguration.java#L75-L79 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/DocxStamperConfiguration.java | DocxStamperConfiguration.exposeInterfaceToExpressionLanguage | public DocxStamperConfiguration exposeInterfaceToExpressionLanguage(Class<?> interfaceClass, Object implementation) {
this.expressionFunctions.put(interfaceClass, implementation);
return this;
} | java | public DocxStamperConfiguration exposeInterfaceToExpressionLanguage(Class<?> interfaceClass, Object implementation) {
this.expressionFunctions.put(interfaceClass, implementation);
return this;
} | [
"public",
"DocxStamperConfiguration",
"exposeInterfaceToExpressionLanguage",
"(",
"Class",
"<",
"?",
">",
"interfaceClass",
",",
"Object",
"implementation",
")",
"{",
"this",
".",
"expressionFunctions",
".",
"put",
"(",
"interfaceClass",
",",
"implementation",
")",
";... | Exposes all methods of a given interface to the expression language.
@param interfaceClass the interface whose methods should be exposed in the expression language.
@param implementation the implementation that should be called to evaluate invocations of the interface methods
within the expression language. Must imple... | [
"Exposes",
"all",
"methods",
"of",
"a",
"given",
"interface",
"to",
"the",
"expression",
"language",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/DocxStamperConfiguration.java#L106-L109 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/api/typeresolver/TypeResolverRegistry.java | TypeResolverRegistry.getResolverForType | public <T> ITypeResolver getResolverForType(Class<T> type) {
ITypeResolver resolver = typeResolversByType.get(type);
if (resolver == null) {
return defaultResolver;
} else {
return resolver;
}
} | java | public <T> ITypeResolver getResolverForType(Class<T> type) {
ITypeResolver resolver = typeResolversByType.get(type);
if (resolver == null) {
return defaultResolver;
} else {
return resolver;
}
} | [
"public",
"<",
"T",
">",
"ITypeResolver",
"getResolverForType",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"ITypeResolver",
"resolver",
"=",
"typeResolversByType",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"resolver",
"==",
"null",
")",
"{",
"ret... | Gets the ITypeResolver that was registered for the specified type.
@param type the class for which to find the ITypeResolver.
@param <T> the type resolved by the ITypeResolver.
@return the ITypeResolver implementation that was earlier registered for the given class, or the default ITypeResolver
if none is found. | [
"Gets",
"the",
"ITypeResolver",
"that",
"was",
"registered",
"for",
"the",
"specified",
"type",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/api/typeresolver/TypeResolverRegistry.java#L31-L38 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/ParagraphWrapper.java | ParagraphWrapper.addRun | private void addRun(R run, int index) {
int startIndex = currentPosition;
int endIndex = currentPosition + RunUtil.getText(run).length() - 1;
runs.add(new IndexedRun(startIndex, endIndex, index, run));
currentPosition = endIndex + 1;
} | java | private void addRun(R run, int index) {
int startIndex = currentPosition;
int endIndex = currentPosition + RunUtil.getText(run).length() - 1;
runs.add(new IndexedRun(startIndex, endIndex, index, run));
currentPosition = endIndex + 1;
} | [
"private",
"void",
"addRun",
"(",
"R",
"run",
",",
"int",
"index",
")",
"{",
"int",
"startIndex",
"=",
"currentPosition",
";",
"int",
"endIndex",
"=",
"currentPosition",
"+",
"RunUtil",
".",
"getText",
"(",
"run",
")",
".",
"length",
"(",
")",
"-",
"1"... | Adds a run to the aggregation.
@param run the run to add. | [
"Adds",
"a",
"run",
"to",
"the",
"aggregation",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/ParagraphWrapper.java#L50-L55 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/ParagraphWrapper.java | ParagraphWrapper.getRuns | public List<R> getRuns() {
List<R> resultList = new ArrayList<>();
for (IndexedRun run : runs) {
resultList.add(run.getRun());
}
return resultList;
} | java | public List<R> getRuns() {
List<R> resultList = new ArrayList<>();
for (IndexedRun run : runs) {
resultList.add(run.getRun());
}
return resultList;
} | [
"public",
"List",
"<",
"R",
">",
"getRuns",
"(",
")",
"{",
"List",
"<",
"R",
">",
"resultList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"IndexedRun",
"run",
":",
"runs",
")",
"{",
"resultList",
".",
"add",
"(",
"run",
".",
"getR... | Returns the list of runs that are aggregated. Depending on what modifications were done to the aggregated text
this list may not return the same runs that were initially added to the aggregator.
@return the list of aggregated runs. | [
"Returns",
"the",
"list",
"of",
"runs",
"that",
"are",
"aggregated",
".",
"Depending",
"on",
"what",
"modifications",
"were",
"done",
"to",
"the",
"aggregated",
"text",
"this",
"list",
"may",
"not",
"return",
"the",
"same",
"runs",
"that",
"were",
"initially... | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/ParagraphWrapper.java#L165-L171 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/IndexedRun.java | IndexedRun.isTouchedByRange | public boolean isTouchedByRange(int globalStartIndex, int globalEndIndex) {
return ((startIndex >= globalStartIndex) && (startIndex <= globalEndIndex))
|| ((endIndex >= globalStartIndex) && (endIndex <= globalEndIndex))
|| ((startIndex <= globalStartIndex) && (endIndex >= globalE... | java | public boolean isTouchedByRange(int globalStartIndex, int globalEndIndex) {
return ((startIndex >= globalStartIndex) && (startIndex <= globalEndIndex))
|| ((endIndex >= globalStartIndex) && (endIndex <= globalEndIndex))
|| ((startIndex <= globalStartIndex) && (endIndex >= globalE... | [
"public",
"boolean",
"isTouchedByRange",
"(",
"int",
"globalStartIndex",
",",
"int",
"globalEndIndex",
")",
"{",
"return",
"(",
"(",
"startIndex",
">=",
"globalStartIndex",
")",
"&&",
"(",
"startIndex",
"<=",
"globalEndIndex",
")",
")",
"||",
"(",
"(",
"endInd... | Determines whether the specified range of start and end index touches this run. | [
"Determines",
"whether",
"the",
"specified",
"range",
"of",
"start",
"and",
"end",
"index",
"touches",
"this",
"run",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/IndexedRun.java#L46-L51 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/util/IndexedRun.java | IndexedRun.replace | public void replace(int globalStartIndex, int globalEndIndex, String replacement) {
int localStartIndex = globalIndexToLocalIndex(globalStartIndex);
int localEndIndex = globalIndexToLocalIndex(globalEndIndex);
String text = RunUtil.getText(run);
text = text.substring(0, localStartIndex);... | java | public void replace(int globalStartIndex, int globalEndIndex, String replacement) {
int localStartIndex = globalIndexToLocalIndex(globalStartIndex);
int localEndIndex = globalIndexToLocalIndex(globalEndIndex);
String text = RunUtil.getText(run);
text = text.substring(0, localStartIndex);... | [
"public",
"void",
"replace",
"(",
"int",
"globalStartIndex",
",",
"int",
"globalEndIndex",
",",
"String",
"replacement",
")",
"{",
"int",
"localStartIndex",
"=",
"globalIndexToLocalIndex",
"(",
"globalStartIndex",
")",
";",
"int",
"localEndIndex",
"=",
"globalIndexT... | Replaces the substring starting at the given index with the given replacement string.
@param globalStartIndex the global index (meaning the index relative to multiple aggregated runs) at which to start the replacement.
@param globalEndIndex the global index (meaning the index relative to multiple aggregated runs) at... | [
"Replaces",
"the",
"substring",
"starting",
"at",
"the",
"given",
"index",
"with",
"the",
"given",
"replacement",
"string",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/util/IndexedRun.java#L60-L71 | train |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/replace/PlaceholderReplacer.java | PlaceholderReplacer.resolveExpressions | public void resolveExpressions(final WordprocessingMLPackage document, ProxyBuilder<T> proxyBuilder) {
try {
final T expressionContext = proxyBuilder.build();
CoordinatesWalker walker = new BaseCoordinatesWalker(document) {
@Override
protected void onParagraph(ParagraphCoordinates paragr... | java | public void resolveExpressions(final WordprocessingMLPackage document, ProxyBuilder<T> proxyBuilder) {
try {
final T expressionContext = proxyBuilder.build();
CoordinatesWalker walker = new BaseCoordinatesWalker(document) {
@Override
protected void onParagraph(ParagraphCoordinates paragr... | [
"public",
"void",
"resolveExpressions",
"(",
"final",
"WordprocessingMLPackage",
"document",
",",
"ProxyBuilder",
"<",
"T",
">",
"proxyBuilder",
")",
"{",
"try",
"{",
"final",
"T",
"expressionContext",
"=",
"proxyBuilder",
".",
"build",
"(",
")",
";",
"Coordinat... | Finds expressions in a document and resolves them against the specified context object. The expressions in the
document are then replaced by the resolved values.
@param document the document in which to replace all expressions.
@param proxyBuilder builder for a proxy around the context root to customize ... | [
"Finds",
"expressions",
"in",
"a",
"document",
"and",
"resolves",
"them",
"against",
"the",
"specified",
"context",
"object",
".",
"The",
"expressions",
"in",
"the",
"document",
"are",
"then",
"replaced",
"by",
"the",
"resolved",
"values",
"."
] | f1a7e3e92a59abaffac299532fe49450c3b041eb | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/replace/PlaceholderReplacer.java#L75-L88 | train |
jpardogo/FlabbyListView | library/src/main/java/com/jpardogo/android/flabbylistview/lib/FlabbyListView.java | FlabbyListView.onScrollChanged | @Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
if (mTrackedChild == null) {
if (getChildCount() > 0) {
mTrackedChild = getChildInTheMiddle();
mTrackedChildPrevTop = mTrackedChild.getT... | java | @Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
if (mTrackedChild == null) {
if (getChildCount() > 0) {
mTrackedChild = getChildInTheMiddle();
mTrackedChildPrevTop = mTrackedChild.getT... | [
"@",
"Override",
"protected",
"void",
"onScrollChanged",
"(",
"int",
"l",
",",
"int",
"t",
",",
"int",
"oldl",
",",
"int",
"oldt",
")",
"{",
"super",
".",
"onScrollChanged",
"(",
"l",
",",
"t",
",",
"oldl",
",",
"oldt",
")",
";",
"if",
"(",
"mTrack... | Calculate the scroll distance comparing the distance with the top of the list of the current
child and the last one tracked
@param l - Current horizontal scroll origin.
@param t - Current vertical scroll origin.
@param oldl - Previous horizontal scroll origin.
@param oldt - Previous vertical scroll origin. | [
"Calculate",
"the",
"scroll",
"distance",
"comparing",
"the",
"distance",
"with",
"the",
"top",
"of",
"the",
"list",
"of",
"the",
"current",
"child",
"and",
"the",
"last",
"one",
"tracked"
] | 2988f9182c98717a9c66326177c3ee1d7f42975f | https://github.com/jpardogo/FlabbyListView/blob/2988f9182c98717a9c66326177c3ee1d7f42975f/library/src/main/java/com/jpardogo/android/flabbylistview/lib/FlabbyListView.java#L63-L97 | train |
JakeWharton/flip-tables | src/main/java/com/jakewharton/fliptables/FlipTable.java | FlipTable.of | public static String of(String[] headers, String[][] data) {
if (headers == null) throw new NullPointerException("headers == null");
if (headers.length == 0) throw new IllegalArgumentException("Headers must not be empty.");
if (data == null) throw new NullPointerException("data == null");
return new Fli... | java | public static String of(String[] headers, String[][] data) {
if (headers == null) throw new NullPointerException("headers == null");
if (headers.length == 0) throw new IllegalArgumentException("Headers must not be empty.");
if (data == null) throw new NullPointerException("data == null");
return new Fli... | [
"public",
"static",
"String",
"of",
"(",
"String",
"[",
"]",
"headers",
",",
"String",
"[",
"]",
"[",
"]",
"data",
")",
"{",
"if",
"(",
"headers",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"headers == null\"",
")",
";",
"if",
"(... | Create a new table with the specified headers and row data. | [
"Create",
"a",
"new",
"table",
"with",
"the",
"specified",
"headers",
"and",
"row",
"data",
"."
] | 174f2ca893f858e9bef5f215f4b94526b0393649 | https://github.com/JakeWharton/flip-tables/blob/174f2ca893f858e9bef5f215f4b94526b0393649/src/main/java/com/jakewharton/fliptables/FlipTable.java#L32-L37 | train |
JakeWharton/flip-tables | src/main/java/com/jakewharton/fliptables/FlipTableConverters.java | FlipTableConverters.fromIterable | public static <T> String fromIterable(Iterable<T> rows, Class<T> rowType) {
if (rows == null) throw new NullPointerException("rows == null");
if (rowType == null) throw new NullPointerException("rowType == null");
Method[] declaredMethods = rowType.getDeclaredMethods();
Arrays.sort(declaredMethods, MET... | java | public static <T> String fromIterable(Iterable<T> rows, Class<T> rowType) {
if (rows == null) throw new NullPointerException("rows == null");
if (rowType == null) throw new NullPointerException("rowType == null");
Method[] declaredMethods = rowType.getDeclaredMethods();
Arrays.sort(declaredMethods, MET... | [
"public",
"static",
"<",
"T",
">",
"String",
"fromIterable",
"(",
"Iterable",
"<",
"T",
">",
"rows",
",",
"Class",
"<",
"T",
">",
"rowType",
")",
"{",
"if",
"(",
"rows",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"rows == null\"",
... | Create a table from a group of objects. Public accessor methods on the class type with no
arguments will be used as the columns. | [
"Create",
"a",
"table",
"from",
"a",
"group",
"of",
"objects",
".",
"Public",
"accessor",
"methods",
"on",
"the",
"class",
"type",
"with",
"no",
"arguments",
"will",
"be",
"used",
"as",
"the",
"columns",
"."
] | 174f2ca893f858e9bef5f215f4b94526b0393649 | https://github.com/JakeWharton/flip-tables/blob/174f2ca893f858e9bef5f215f4b94526b0393649/src/main/java/com/jakewharton/fliptables/FlipTableConverters.java#L60-L97 | train |
paypal/SeLion | codegen/src/main/java/com/paypal/selion/plugins/DataReader.java | DataReader.getBaseClassName | public String getBaseClassName() {
CodeGeneratorLoggerFactory.getLogger().debug(
String.format("Reading base class name from data file [%s]", fileName));
String baseClass = reader.getBaseClassName();
if (baseClass == null) {
String path = new File(fileName).getAbsolut... | java | public String getBaseClassName() {
CodeGeneratorLoggerFactory.getLogger().debug(
String.format("Reading base class name from data file [%s]", fileName));
String baseClass = reader.getBaseClassName();
if (baseClass == null) {
String path = new File(fileName).getAbsolut... | [
"public",
"String",
"getBaseClassName",
"(",
")",
"{",
"CodeGeneratorLoggerFactory",
".",
"getLogger",
"(",
")",
".",
"debug",
"(",
"String",
".",
"format",
"(",
"\"Reading base class name from data file [%s]\"",
",",
"fileName",
")",
")",
";",
"String",
"baseClass"... | Return the base page class name from the PageYaml input
@return A {@link String} representation of the base page class. | [
"Return",
"the",
"base",
"page",
"class",
"name",
"from",
"the",
"PageYaml",
"input"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/codegen/src/main/java/com/paypal/selion/plugins/DataReader.java#L46-L55 | train |
paypal/SeLion | codegen/src/main/java/com/paypal/selion/plugins/DataReader.java | DataReader.platform | public TestPlatform platform() {
CodeGeneratorLoggerFactory.getLogger().debug(
String.format("Specified platform in data file [%s] : [%s] ", fileName, reader.getPlatform()));
TestPlatform currentPlatform = reader.getPlatform();
if (currentPlatform == null) {
String da... | java | public TestPlatform platform() {
CodeGeneratorLoggerFactory.getLogger().debug(
String.format("Specified platform in data file [%s] : [%s] ", fileName, reader.getPlatform()));
TestPlatform currentPlatform = reader.getPlatform();
if (currentPlatform == null) {
String da... | [
"public",
"TestPlatform",
"platform",
"(",
")",
"{",
"CodeGeneratorLoggerFactory",
".",
"getLogger",
"(",
")",
".",
"debug",
"(",
"String",
".",
"format",
"(",
"\"Specified platform in data file [%s] : [%s] \"",
",",
"fileName",
",",
"reader",
".",
"getPlatform",
"(... | Return the platform specified in the PageYaml input
@return {@link TestPlatform} | [
"Return",
"the",
"platform",
"specified",
"in",
"the",
"PageYaml",
"input"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/codegen/src/main/java/com/paypal/selion/plugins/DataReader.java#L62-L71 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/configuration/ListenerManager.java | ListenerManager.registerListener | public static void registerListener(ListenerInfo information) {
if (isServiceLoaderDisabled()) {
// Donot even attempt register any listeners if the user doesnt want them to be managed.
return;
}
logger.entering(information);
listenerMap.put(information.getListene... | java | public static void registerListener(ListenerInfo information) {
if (isServiceLoaderDisabled()) {
// Donot even attempt register any listeners if the user doesnt want them to be managed.
return;
}
logger.entering(information);
listenerMap.put(information.getListene... | [
"public",
"static",
"void",
"registerListener",
"(",
"ListenerInfo",
"information",
")",
"{",
"if",
"(",
"isServiceLoaderDisabled",
"(",
")",
")",
"{",
"// Donot even attempt register any listeners if the user doesnt want them to be managed.",
"return",
";",
"}",
"logger",
... | Register your Listener using this method.
@param information
- A {@link ListenerInfo} object that contains information pertaining to your listener. | [
"Register",
"your",
"Listener",
"using",
"this",
"method",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/configuration/ListenerManager.java#L62-L69 | train |
paypal/SeLion | server/src/main/java/com/paypal/selion/utils/ServletHelper.java | ServletHelper.getParameters | public static Map<String, String> getParameters(HttpServletRequest request) {
Map<String, String> parameters = new HashMap<>();
Enumeration<?> names = request.getParameterNames();
while (names.hasMoreElements()) {
String key = (String) names.nextElement();
String value = ... | java | public static Map<String, String> getParameters(HttpServletRequest request) {
Map<String, String> parameters = new HashMap<>();
Enumeration<?> names = request.getParameterNames();
while (names.hasMoreElements()) {
String key = (String) names.nextElement();
String value = ... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getParameters",
"(",
"HttpServletRequest",
"request",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Enumeration",
"<",
"?",
">... | Helps retrieve the parameters and its values as a Map
@param request
A {@link HttpServletRequest} that represents the request from which the parameters and their
corresponding values are to be extracted.
@return A {@link Map} that represents the parameters and their values | [
"Helps",
"retrieve",
"the",
"parameters",
"and",
"its",
"values",
"as",
"a",
"Map"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/utils/ServletHelper.java#L50-L61 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/reports/runtime/Gatherer.java | Gatherer.saveGetLocation | static String saveGetLocation(WebDriver driver) {
logger.entering(driver);
String location = "n/a";
try {
if (driver != null) {
location = driver.getCurrentUrl();
}
} catch (Exception exception) {
logger.log(Level.FINER, "Current locati... | java | static String saveGetLocation(WebDriver driver) {
logger.entering(driver);
String location = "n/a";
try {
if (driver != null) {
location = driver.getCurrentUrl();
}
} catch (Exception exception) {
logger.log(Level.FINER, "Current locati... | [
"static",
"String",
"saveGetLocation",
"(",
"WebDriver",
"driver",
")",
"{",
"logger",
".",
"entering",
"(",
"driver",
")",
";",
"String",
"location",
"=",
"\"n/a\"",
";",
"try",
"{",
"if",
"(",
"driver",
"!=",
"null",
")",
"{",
"location",
"=",
"driver"... | getCurrentURL will throw Exception | [
"getCurrentURL",
"will",
"throw",
"Exception"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/reports/runtime/Gatherer.java#L39-L52 | train |
paypal/SeLion | codegen/src/main/java/com/paypal/selion/plugins/GUIObjectDetails.java | GUIObjectDetails.returnArg | public String returnArg(String key) {
SeLionElement element = HtmlSeLionElementSet.getInstance().findMatch(key);
if (element == null) {
return key;
}
if (!element.isUIElement()) {
return key;
}
return key.substring(0, key.indexOf(element.getElementC... | java | public String returnArg(String key) {
SeLionElement element = HtmlSeLionElementSet.getInstance().findMatch(key);
if (element == null) {
return key;
}
if (!element.isUIElement()) {
return key;
}
return key.substring(0, key.indexOf(element.getElementC... | [
"public",
"String",
"returnArg",
"(",
"String",
"key",
")",
"{",
"SeLionElement",
"element",
"=",
"HtmlSeLionElementSet",
".",
"getInstance",
"(",
")",
".",
"findMatch",
"(",
"key",
")",
";",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"return",
"key",
... | DO NOT tamper with this method | [
"DO",
"NOT",
"tamper",
"with",
"this",
"method"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/codegen/src/main/java/com/paypal/selion/plugins/GUIObjectDetails.java#L68-L77 | train |
paypal/SeLion | codegen/src/main/java/com/paypal/selion/plugins/GUIObjectDetails.java | GUIObjectDetails.transformKeys | public static List<GUIObjectDetails> transformKeys(List<String> keys, TestPlatform platform) {
List<GUIObjectDetails> htmlObjectDetailsList = null;
// Get the HTML object list based on the platform.
// Note: This part is reached only when there is a valid platform specified. So it's safe to pro... | java | public static List<GUIObjectDetails> transformKeys(List<String> keys, TestPlatform platform) {
List<GUIObjectDetails> htmlObjectDetailsList = null;
// Get the HTML object list based on the platform.
// Note: This part is reached only when there is a valid platform specified. So it's safe to pro... | [
"public",
"static",
"List",
"<",
"GUIObjectDetails",
">",
"transformKeys",
"(",
"List",
"<",
"String",
">",
"keys",
",",
"TestPlatform",
"platform",
")",
"{",
"List",
"<",
"GUIObjectDetails",
">",
"htmlObjectDetailsList",
"=",
"null",
";",
"// Get the HTML object ... | This method convert each key in the data sheet into corresponding HtmlObjectDetails object and returns list of
HtmlObjectDetails
@param keys
keys for which {@link GUIObjectDetails} is to be created.
@return list of HtmlObjectDetails | [
"This",
"method",
"convert",
"each",
"key",
"in",
"the",
"data",
"sheet",
"into",
"corresponding",
"HtmlObjectDetails",
"object",
"and",
"returns",
"list",
"of",
"HtmlObjectDetails"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/codegen/src/main/java/com/paypal/selion/plugins/GUIObjectDetails.java#L93-L114 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/TextField.java | TextField.type | public void type(String value) {
getDispatcher().beforeType(this, value);
RemoteWebElement element = getElement();
element.clear();
element.sendKeys(value);
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIActions(UIActions.ENTERED,... | java | public void type(String value) {
getDispatcher().beforeType(this, value);
RemoteWebElement element = getElement();
element.clear();
element.sendKeys(value);
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIActions(UIActions.ENTERED,... | [
"public",
"void",
"type",
"(",
"String",
"value",
")",
"{",
"getDispatcher",
"(",
")",
".",
"beforeType",
"(",
"this",
",",
"value",
")",
";",
"RemoteWebElement",
"element",
"=",
"getElement",
"(",
")",
";",
"element",
".",
"clear",
"(",
")",
";",
"ele... | The TextField type function
It invokes SeLion session to handle the type action against the element. | [
"The",
"TextField",
"type",
"function"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/TextField.java#L103-L114 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/TextField.java | TextField.type | public void type(String value, boolean isKeepExistingText) {
if (isKeepExistingText) {
getDispatcher().beforeType(this, value);
getElement().sendKeys(value);
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIActions(UIAct... | java | public void type(String value, boolean isKeepExistingText) {
if (isKeepExistingText) {
getDispatcher().beforeType(this, value);
getElement().sendKeys(value);
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIActions(UIAct... | [
"public",
"void",
"type",
"(",
"String",
"value",
",",
"boolean",
"isKeepExistingText",
")",
"{",
"if",
"(",
"isKeepExistingText",
")",
"{",
"getDispatcher",
"(",
")",
".",
"beforeType",
"(",
"this",
",",
"value",
")",
";",
"getElement",
"(",
")",
".",
"... | The TextField type function which allow users to keep the TextField and append the input text to it.
It invokes SeLion session to handle the type action against the element. | [
"The",
"TextField",
"type",
"function",
"which",
"allow",
"users",
"to",
"keep",
"the",
"TextField",
"and",
"append",
"the",
"input",
"text",
"to",
"it",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/TextField.java#L121-L134 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/TextField.java | TextField.clear | public void clear() {
getElement().clear();
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIAction(UIActions.CLEARED);
}
} | java | public void clear() {
getElement().clear();
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIAction(UIActions.CLEARED);
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"getElement",
"(",
")",
".",
"clear",
"(",
")",
";",
"if",
"(",
"Config",
".",
"getBoolConfigProperty",
"(",
"ConfigProperty",
".",
"ENABLE_GUI_LOGGING",
")",
")",
"{",
"logUIAction",
"(",
"UIActions",
".",
"CLEARE... | Text TextField clear function
To clear the text box. | [
"Text",
"TextField",
"clear",
"function"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/TextField.java#L141-L146 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/TextField.java | TextField.getText | public String getText() {
String text = getElement().getText();
if (text.isEmpty()) {
text = getValue();
}
return text;
} | java | public String getText() {
String text = getElement().getText();
if (text.isEmpty()) {
text = getValue();
}
return text;
} | [
"public",
"String",
"getText",
"(",
")",
"{",
"String",
"text",
"=",
"getElement",
"(",
")",
".",
"getText",
"(",
")",
";",
"if",
"(",
"text",
".",
"isEmpty",
"(",
")",
")",
"{",
"text",
"=",
"getValue",
"(",
")",
";",
"}",
"return",
"text",
";",... | Get the text value from a TextField object.
@return text is the text in the TextField box. | [
"Get",
"the",
"text",
"value",
"from",
"a",
"TextField",
"object",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/TextField.java#L162-L168 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/TextField.java | TextField.uploadFile | public void uploadFile(String filePath) {
SeLionLogger.getLogger().entering(filePath);
Preconditions.checkArgument(StringUtils.isNotBlank(filePath), "Please provide a valid file path to work with.");
String filePathToUse = new File(filePath).getAbsolutePath();
LocalFileDetector detector ... | java | public void uploadFile(String filePath) {
SeLionLogger.getLogger().entering(filePath);
Preconditions.checkArgument(StringUtils.isNotBlank(filePath), "Please provide a valid file path to work with.");
String filePathToUse = new File(filePath).getAbsolutePath();
LocalFileDetector detector ... | [
"public",
"void",
"uploadFile",
"(",
"String",
"filePath",
")",
"{",
"SeLionLogger",
".",
"getLogger",
"(",
")",
".",
"entering",
"(",
"filePath",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"filePath",
")",
"... | A Utility method that helps with uploading a File to a Web Application.
@param filePath
- A String that represents the file name to be uploaded along with its path.
<pre>
TextField txtBox = new TextField("upfile");
// Here the html snippet for the above text box would be
// {@literal <}input type=file nam... | [
"A",
"Utility",
"method",
"that",
"helps",
"with",
"uploading",
"a",
"File",
"to",
"a",
"Web",
"Application",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/TextField.java#L186-L195 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/CheckBox.java | CheckBox.check | public void check() {
getDispatcher().beforeCheck(this);
RemoteWebElement e = (RemoteWebElement) getElement();
while (!e.isSelected()) {
e.click();
}
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIAction(UIActions.CHEC... | java | public void check() {
getDispatcher().beforeCheck(this);
RemoteWebElement e = (RemoteWebElement) getElement();
while (!e.isSelected()) {
e.click();
}
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIAction(UIActions.CHEC... | [
"public",
"void",
"check",
"(",
")",
"{",
"getDispatcher",
"(",
")",
".",
"beforeCheck",
"(",
"this",
")",
";",
"RemoteWebElement",
"e",
"=",
"(",
"RemoteWebElement",
")",
"getElement",
"(",
")",
";",
"while",
"(",
"!",
"e",
".",
"isSelected",
"(",
")"... | The CheckBox check function It invokes selenium session to handle the check action against the element. | [
"The",
"CheckBox",
"check",
"function",
"It",
"invokes",
"selenium",
"session",
"to",
"handle",
"the",
"check",
"action",
"against",
"the",
"element",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/CheckBox.java#L97-L109 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/CheckBox.java | CheckBox.check | public void check(String locator) {
getDispatcher().beforeCheck(this, locator);
this.check();
validatePresenceOfAlert();
WebDriverWaitUtils.waitUntilElementIsPresent(locator);
getDispatcher().afterUncheck(this, locator);
} | java | public void check(String locator) {
getDispatcher().beforeCheck(this, locator);
this.check();
validatePresenceOfAlert();
WebDriverWaitUtils.waitUntilElementIsPresent(locator);
getDispatcher().afterUncheck(this, locator);
} | [
"public",
"void",
"check",
"(",
"String",
"locator",
")",
"{",
"getDispatcher",
"(",
")",
".",
"beforeCheck",
"(",
"this",
",",
"locator",
")",
";",
"this",
".",
"check",
"(",
")",
";",
"validatePresenceOfAlert",
"(",
")",
";",
"WebDriverWaitUtils",
".",
... | The CheckBox check function It invokes selenium session to handle the check action against the element. Waits
until element is found with given locator. | [
"The",
"CheckBox",
"check",
"function",
"It",
"invokes",
"selenium",
"session",
"to",
"handle",
"the",
"check",
"action",
"against",
"the",
"element",
".",
"Waits",
"until",
"element",
"is",
"found",
"with",
"given",
"locator",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/CheckBox.java#L115-L123 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/CheckBox.java | CheckBox.uncheck | public void uncheck() {
getDispatcher().beforeUncheck(this);
RemoteWebElement e = (RemoteWebElement) getElement();
while (e.isSelected()) {
e.click();
}
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIAction(UIActions.U... | java | public void uncheck() {
getDispatcher().beforeUncheck(this);
RemoteWebElement e = (RemoteWebElement) getElement();
while (e.isSelected()) {
e.click();
}
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIAction(UIActions.U... | [
"public",
"void",
"uncheck",
"(",
")",
"{",
"getDispatcher",
"(",
")",
".",
"beforeUncheck",
"(",
"this",
")",
";",
"RemoteWebElement",
"e",
"=",
"(",
"RemoteWebElement",
")",
"getElement",
"(",
")",
";",
"while",
"(",
"e",
".",
"isSelected",
"(",
")",
... | The CheckBox uncheck function It invokes SeLion session to handle the uncheck action against the element. | [
"The",
"CheckBox",
"uncheck",
"function",
"It",
"invokes",
"SeLion",
"session",
"to",
"handle",
"the",
"uncheck",
"action",
"against",
"the",
"element",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/CheckBox.java#L128-L140 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/CheckBox.java | CheckBox.uncheck | public void uncheck(String locator) {
getDispatcher().beforeUncheck(this, locator);
this.uncheck();
validatePresenceOfAlert();
WebDriverWaitUtils.waitUntilElementIsPresent(locator);
getDispatcher().afterUncheck(this, locator);
} | java | public void uncheck(String locator) {
getDispatcher().beforeUncheck(this, locator);
this.uncheck();
validatePresenceOfAlert();
WebDriverWaitUtils.waitUntilElementIsPresent(locator);
getDispatcher().afterUncheck(this, locator);
} | [
"public",
"void",
"uncheck",
"(",
"String",
"locator",
")",
"{",
"getDispatcher",
"(",
")",
".",
"beforeUncheck",
"(",
"this",
",",
"locator",
")",
";",
"this",
".",
"uncheck",
"(",
")",
";",
"validatePresenceOfAlert",
"(",
")",
";",
"WebDriverWaitUtils",
... | The CheckBox uncheck function It invokes SeLion session to handle the uncheck action against the element. Waits
until element is found with given locator. | [
"The",
"CheckBox",
"uncheck",
"function",
"It",
"invokes",
"SeLion",
"session",
"to",
"handle",
"the",
"uncheck",
"action",
"against",
"the",
"element",
".",
"Waits",
"until",
"element",
"is",
"found",
"with",
"given",
"locator",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/CheckBox.java#L146-L154 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/CheckBox.java | CheckBox.click | public void click() {
getDispatcher().beforeClick(this);
getElement().click();
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIAction(UIActions.CLICKED);
}
getDispatcher().afterClick(this);
} | java | public void click() {
getDispatcher().beforeClick(this);
getElement().click();
if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
logUIAction(UIActions.CLICKED);
}
getDispatcher().afterClick(this);
} | [
"public",
"void",
"click",
"(",
")",
"{",
"getDispatcher",
"(",
")",
".",
"beforeClick",
"(",
"this",
")",
";",
"getElement",
"(",
")",
".",
"click",
"(",
")",
";",
"if",
"(",
"Config",
".",
"getBoolConfigProperty",
"(",
"ConfigProperty",
".",
"ENABLE_GU... | The CheckBox click function and wait for page to load | [
"The",
"CheckBox",
"click",
"function",
"and",
"wait",
"for",
"page",
"to",
"load"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/CheckBox.java#L159-L168 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/CheckBox.java | CheckBox.click | public void click(String locator) {
getDispatcher().beforeClick(this, locator);
click();
validatePresenceOfAlert();
WebDriverWaitUtils.waitUntilElementIsPresent(locator);
getDispatcher().afterClick(this, locator);
} | java | public void click(String locator) {
getDispatcher().beforeClick(this, locator);
click();
validatePresenceOfAlert();
WebDriverWaitUtils.waitUntilElementIsPresent(locator);
getDispatcher().afterClick(this, locator);
} | [
"public",
"void",
"click",
"(",
"String",
"locator",
")",
"{",
"getDispatcher",
"(",
")",
".",
"beforeClick",
"(",
"this",
",",
"locator",
")",
";",
"click",
"(",
")",
";",
"validatePresenceOfAlert",
"(",
")",
";",
"WebDriverWaitUtils",
".",
"waitUntilElemen... | The CheckBox click function and wait for object to load | [
"The",
"CheckBox",
"click",
"function",
"and",
"wait",
"for",
"object",
"to",
"load"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/CheckBox.java#L173-L181 | train |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/servlets/transfer/DownloadRequestProcessor.java | DownloadRequestProcessor.getArtifact | public ManagedArtifact getArtifact(String pathInfo) {
LOGGER.entering();
ManagedArtifact managedArtifact = serverRepository.getArtifact(pathInfo);
LOGGER.exiting(managedArtifact);
return managedArtifact;
} | java | public ManagedArtifact getArtifact(String pathInfo) {
LOGGER.entering();
ManagedArtifact managedArtifact = serverRepository.getArtifact(pathInfo);
LOGGER.exiting(managedArtifact);
return managedArtifact;
} | [
"public",
"ManagedArtifact",
"getArtifact",
"(",
"String",
"pathInfo",
")",
"{",
"LOGGER",
".",
"entering",
"(",
")",
";",
"ManagedArtifact",
"managedArtifact",
"=",
"serverRepository",
".",
"getArtifact",
"(",
"pathInfo",
")",
";",
"LOGGER",
".",
"exiting",
"("... | Returns the managed artifact requested in the HTTP call.
@param pathInfo
the path inferred from the GET HTTP URL.
@return the artifact. | [
"Returns",
"the",
"managed",
"artifact",
"requested",
"in",
"the",
"HTTP",
"call",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/servlets/transfer/DownloadRequestProcessor.java#L40-L45 | train |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/FileDownloader.java | FileDownloader.cleanup | static void cleanup() {
LOGGER.entering();
for (String temp : files) {
new File(temp).delete();
}
// Cleaning up the files list
files.clear();
LOGGER.exiting();
} | java | static void cleanup() {
LOGGER.entering();
for (String temp : files) {
new File(temp).delete();
}
// Cleaning up the files list
files.clear();
LOGGER.exiting();
} | [
"static",
"void",
"cleanup",
"(",
")",
"{",
"LOGGER",
".",
"entering",
"(",
")",
";",
"for",
"(",
"String",
"temp",
":",
"files",
")",
"{",
"new",
"File",
"(",
"temp",
")",
".",
"delete",
"(",
")",
";",
"}",
"// Cleaning up the files list",
"files",
... | Cleanup all the files already downloaded within the same JVM process. Automatically called internally. | [
"Cleanup",
"all",
"the",
"files",
"already",
"downloaded",
"within",
"the",
"same",
"JVM",
"process",
".",
"Automatically",
"called",
"internally",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/FileDownloader.java#L62-L72 | train |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/FileDownloader.java | FileDownloader.checkForDownloads | static void checkForDownloads(List<String> artifactNames, boolean checkTimeStamp, boolean cleanup) {
LOGGER.entering();
if (checkTimeStamp && (lastModifiedTime == DOWNLOAD_FILE.lastModified())) {
return;
}
lastModifiedTime = DOWNLOAD_FILE.lastModified();
if (cleanup... | java | static void checkForDownloads(List<String> artifactNames, boolean checkTimeStamp, boolean cleanup) {
LOGGER.entering();
if (checkTimeStamp && (lastModifiedTime == DOWNLOAD_FILE.lastModified())) {
return;
}
lastModifiedTime = DOWNLOAD_FILE.lastModified();
if (cleanup... | [
"static",
"void",
"checkForDownloads",
"(",
"List",
"<",
"String",
">",
"artifactNames",
",",
"boolean",
"checkTimeStamp",
",",
"boolean",
"cleanup",
")",
"{",
"LOGGER",
".",
"entering",
"(",
")",
";",
"if",
"(",
"checkTimeStamp",
"&&",
"(",
"lastModifiedTime"... | Check download.json and download files based on artifact names
@param artifactNames
the artifact names to download
@param checkTimeStamp
whether to check the last modified time stamp of the downlaod.json file. Returns immediately on
subsequent calls if <code>true</code> and last modified is unchanged.
@param cleanup
w... | [
"Check",
"download",
".",
"json",
"and",
"download",
"files",
"based",
"on",
"artifact",
"names"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/FileDownloader.java#L111-L134 | train |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/FileDownloader.java | FileDownloader.downloadFile | static String downloadFile(String artifactUrl, String checksum) {
LOGGER.entering(new Object[] { artifactUrl, checksum });
Preconditions.checkArgument(StringUtils.isNotBlank(artifactUrl), "Invalid URL: Cannot be null or empty");
Preconditions.checkArgument(StringUtils.isNotBlank(checksum), "Inva... | java | static String downloadFile(String artifactUrl, String checksum) {
LOGGER.entering(new Object[] { artifactUrl, checksum });
Preconditions.checkArgument(StringUtils.isNotBlank(artifactUrl), "Invalid URL: Cannot be null or empty");
Preconditions.checkArgument(StringUtils.isNotBlank(checksum), "Inva... | [
"static",
"String",
"downloadFile",
"(",
"String",
"artifactUrl",
",",
"String",
"checksum",
")",
"{",
"LOGGER",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"artifactUrl",
",",
"checksum",
"}",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
... | Download a file from the specified url
@param artifactUrl
url of the file to be downloaded.
@param checksum
checksum to downloaded file.
@return the downloaded file path. | [
"Download",
"a",
"file",
"from",
"the",
"specified",
"url"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/FileDownloader.java#L292-L307 | train |
paypal/SeLion | codegen/src/main/java/com/paypal/selion/plugins/JavaCodeInjector.java | JavaCodeInjector.insertCode | public void insertCode() throws IOException, ParseException {
CompilationUnit cuResult = JavaParser.parse(baseFile);
if (cuResult.getImports() != null) {
List<ImportDeclaration> importsFromBaseFile = cuResult.getImports();
for (ImportDeclaration eachImport : importsFromExtendedFi... | java | public void insertCode() throws IOException, ParseException {
CompilationUnit cuResult = JavaParser.parse(baseFile);
if (cuResult.getImports() != null) {
List<ImportDeclaration> importsFromBaseFile = cuResult.getImports();
for (ImportDeclaration eachImport : importsFromExtendedFi... | [
"public",
"void",
"insertCode",
"(",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"CompilationUnit",
"cuResult",
"=",
"JavaParser",
".",
"parse",
"(",
"baseFile",
")",
";",
"if",
"(",
"cuResult",
".",
"getImports",
"(",
")",
"!=",
"null",
")",
... | This method will add methods, fields and import statement to existing java file
@throws IOException
@throws ParseException | [
"This",
"method",
"will",
"add",
"methods",
"fields",
"and",
"import",
"statement",
"to",
"existing",
"java",
"file"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/codegen/src/main/java/com/paypal/selion/plugins/JavaCodeInjector.java#L59-L76 | train |
paypal/SeLion | codegen/src/main/java/com/paypal/selion/elements/SeLionElementSet.java | SeLionElementSet.add | public boolean add(SeLionElement element) {
// if already initialized, add the new elements to the front of the list.
if (initialized) {
CodeGeneratorLogger logger = CodeGeneratorLoggerFactory.getLogger();
// info messages are only displayed after initialization happens
... | java | public boolean add(SeLionElement element) {
// if already initialized, add the new elements to the front of the list.
if (initialized) {
CodeGeneratorLogger logger = CodeGeneratorLoggerFactory.getLogger();
// info messages are only displayed after initialization happens
... | [
"public",
"boolean",
"add",
"(",
"SeLionElement",
"element",
")",
"{",
"// if already initialized, add the new elements to the front of the list.",
"if",
"(",
"initialized",
")",
"{",
"CodeGeneratorLogger",
"logger",
"=",
"CodeGeneratorLoggerFactory",
".",
"getLogger",
"(",
... | Add an element to the list
@param element the element | [
"Add",
"an",
"element",
"to",
"the",
"list"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/codegen/src/main/java/com/paypal/selion/elements/SeLionElementSet.java#L112-L131 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java | ExcelReport.generateReport | public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String sOpDirectory) {
logger.entering(new Object[] { xmlSuites, suites, sOpDirectory });
if (ListenerManager.isCurrentMethodSkipped(this)) {
logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
return;
... | java | public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String sOpDirectory) {
logger.entering(new Object[] { xmlSuites, suites, sOpDirectory });
if (ListenerManager.isCurrentMethodSkipped(this)) {
logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
return;
... | [
"public",
"void",
"generateReport",
"(",
"List",
"<",
"XmlSuite",
">",
"xmlSuites",
",",
"List",
"<",
"ISuite",
">",
"suites",
",",
"String",
"sOpDirectory",
")",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"xmlSuites",
",",
"sui... | The first method that gets called when generating the report. Generates data in way the Excel should appear.
Creates the Excel Report and writes it to a file. | [
"The",
"first",
"method",
"that",
"gets",
"called",
"when",
"generating",
"the",
"report",
".",
"Generates",
"data",
"in",
"way",
"the",
"Excel",
"should",
"appear",
".",
"Creates",
"the",
"Excel",
"Report",
"and",
"writes",
"it",
"to",
"a",
"file",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java#L98-L137 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java | ExcelReport.setExcelFileName | public void setExcelFileName(String fileName) {
Preconditions.checkArgument(StringUtils.endsWith(fileName, ".xls"), "Excel file name must end with '.xls'.");
reportFileName = fileName;
} | java | public void setExcelFileName(String fileName) {
Preconditions.checkArgument(StringUtils.endsWith(fileName, ".xls"), "Excel file name must end with '.xls'.");
reportFileName = fileName;
} | [
"public",
"void",
"setExcelFileName",
"(",
"String",
"fileName",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"endsWith",
"(",
"fileName",
",",
"\".xls\"",
")",
",",
"\"Excel file name must end with '.xls'.\"",
")",
";",
"reportFileName",
... | Sets the output file name for the Excel Report. The file should have 'xls' extension.
@param fileName
The file name without any path. | [
"Sets",
"the",
"output",
"file",
"name",
"for",
"the",
"Excel",
"Report",
".",
"The",
"file",
"should",
"have",
"xls",
"extension",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java#L145-L148 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java | ExcelReport.createExcelReport | @SuppressWarnings("rawtypes")
private void createExcelReport() {
logger.entering();
wb = new HSSFWorkbook();
Styles.initStyles(wb);
// Report Details
this.createReportInfo();
// Map of sheet names - individual reports and corresponding data
this.createRepor... | java | @SuppressWarnings("rawtypes")
private void createExcelReport() {
logger.entering();
wb = new HSSFWorkbook();
Styles.initStyles(wb);
// Report Details
this.createReportInfo();
// Map of sheet names - individual reports and corresponding data
this.createRepor... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"private",
"void",
"createExcelReport",
"(",
")",
"{",
"logger",
".",
"entering",
"(",
")",
";",
"wb",
"=",
"new",
"HSSFWorkbook",
"(",
")",
";",
"Styles",
".",
"initStyles",
"(",
"wb",
")",
";",
"// Rep... | Initialized styles used in the workbook. Generates the report related info. Creates the structure of the Excel
Reports | [
"Initialized",
"styles",
"used",
"in",
"the",
"workbook",
".",
"Generates",
"the",
"report",
"related",
"info",
".",
"Creates",
"the",
"structure",
"of",
"the",
"Excel",
"Reports"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java#L154-L174 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java | ExcelReport.createReportInfo | private void createReportInfo() {
logger.entering();
HSSFSheet summarySheet = wb.createSheet(ReportSheetNames.TESTSUMMARYREPORT.getName());
Map<String, String> reportInfo = new LinkedHashMap<String, String>();
for (Entry<String, String> temp : ConfigSummaryData.getConfigSummary().entr... | java | private void createReportInfo() {
logger.entering();
HSSFSheet summarySheet = wb.createSheet(ReportSheetNames.TESTSUMMARYREPORT.getName());
Map<String, String> reportInfo = new LinkedHashMap<String, String>();
for (Entry<String, String> temp : ConfigSummaryData.getConfigSummary().entr... | [
"private",
"void",
"createReportInfo",
"(",
")",
"{",
"logger",
".",
"entering",
"(",
")",
";",
"HSSFSheet",
"summarySheet",
"=",
"wb",
".",
"createSheet",
"(",
"ReportSheetNames",
".",
"TESTSUMMARYREPORT",
".",
"getName",
"(",
")",
")",
";",
"Map",
"<",
"... | Create Run details like owner of run, time and stage used. | [
"Create",
"Run",
"details",
"like",
"owner",
"of",
"run",
"time",
"and",
"stage",
"used",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java#L179-L208 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java | ExcelReport.generateSummaryData | private void generateSummaryData(List<ISuite> suites) {
logger.entering(suites);
SummarizedData tempSuite;
SummarizedData tempTest;
SummarizedData tempGroups;
this.generateTestCaseResultData(suites);
// Generating Group Summary data
for (ISuite suite : suites) {... | java | private void generateSummaryData(List<ISuite> suites) {
logger.entering(suites);
SummarizedData tempSuite;
SummarizedData tempTest;
SummarizedData tempGroups;
this.generateTestCaseResultData(suites);
// Generating Group Summary data
for (ISuite suite : suites) {... | [
"private",
"void",
"generateSummaryData",
"(",
"List",
"<",
"ISuite",
">",
"suites",
")",
"{",
"logger",
".",
"entering",
"(",
"suites",
")",
";",
"SummarizedData",
"tempSuite",
";",
"SummarizedData",
"tempTest",
";",
"SummarizedData",
"tempGroups",
";",
"this",... | Generates all summarized counts for various reports
@param suites
the {@link List} of {@link ISuite} | [
"Generates",
"all",
"summarized",
"counts",
"for",
"various",
"reports"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java#L293-L356 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java | ExcelReport.createResultFromMap | private List<TestCaseResult> createResultFromMap(IResultMap resultMap) {
logger.entering(resultMap);
List<TestCaseResult> statusWiseResults = new ArrayList<TestCaseResult>();
for (ITestResult singleMethodResult : resultMap.getAllResults()) {
TestCaseResult tcresult1 = new TestCaseRe... | java | private List<TestCaseResult> createResultFromMap(IResultMap resultMap) {
logger.entering(resultMap);
List<TestCaseResult> statusWiseResults = new ArrayList<TestCaseResult>();
for (ITestResult singleMethodResult : resultMap.getAllResults()) {
TestCaseResult tcresult1 = new TestCaseRe... | [
"private",
"List",
"<",
"TestCaseResult",
">",
"createResultFromMap",
"(",
"IResultMap",
"resultMap",
")",
"{",
"logger",
".",
"entering",
"(",
"resultMap",
")",
";",
"List",
"<",
"TestCaseResult",
">",
"statusWiseResults",
"=",
"new",
"ArrayList",
"<",
"TestCas... | Generates individual TestCase Results based on map of passed, failed and skipped methods Returns the list of
TestCaseResult objects generated. | [
"Generates",
"individual",
"TestCase",
"Results",
"based",
"on",
"map",
"of",
"passed",
"failed",
"and",
"skipped",
"methods",
"Returns",
"the",
"list",
"of",
"TestCaseResult",
"objects",
"generated",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/internal/reports/excelreport/ExcelReport.java#L388-L401 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/asserts/SeLionSoftAssert.java | SeLionSoftAssert.showAssertInfo | private void showAssertInfo(IAssert<?> assertCommand, AssertionError ex, boolean failedTest) {
ITestResult testResult = Reporter.getCurrentTestResult();
// Checks whether the soft assert was called in a TestNG test run or else within a Java application.
String methodName = "main";
if (t... | java | private void showAssertInfo(IAssert<?> assertCommand, AssertionError ex, boolean failedTest) {
ITestResult testResult = Reporter.getCurrentTestResult();
// Checks whether the soft assert was called in a TestNG test run or else within a Java application.
String methodName = "main";
if (t... | [
"private",
"void",
"showAssertInfo",
"(",
"IAssert",
"<",
"?",
">",
"assertCommand",
",",
"AssertionError",
"ex",
",",
"boolean",
"failedTest",
")",
"{",
"ITestResult",
"testResult",
"=",
"Reporter",
".",
"getCurrentTestResult",
"(",
")",
";",
"// Checks whether t... | Shows a message in Reporter based on the assert result and also includes the stacktrace for failed assert.
@param assertCommand
The assert conditions for current test.
@param ex
An {@link AssertionError} in case of failed assert, else null.
@param failedTest
A boolean {@code true} when the assert has failed. | [
"Shows",
"a",
"message",
"in",
"Reporter",
"based",
"on",
"the",
"assert",
"result",
"and",
"also",
"includes",
"the",
"stacktrace",
"for",
"failed",
"assert",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/asserts/SeLionSoftAssert.java#L71-L95 | train |
paypal/SeLion | appium-provider/src/main/java/com/paypal/selion/appium/platform/grid/SeLionAppiumProvider.java | SeLionAppiumProvider.createDriver | @Override
public RemoteWebDriver createDriver(WebDriverPlatform platform, CommandExecutor commandExecutor,
URL url, Capabilities caps) {
if (platform.equals(WebDriverPlatform.ANDROID)) {
if (commandExecutor == null) {
return new SeLionAp... | java | @Override
public RemoteWebDriver createDriver(WebDriverPlatform platform, CommandExecutor commandExecutor,
URL url, Capabilities caps) {
if (platform.equals(WebDriverPlatform.ANDROID)) {
if (commandExecutor == null) {
return new SeLionAp... | [
"@",
"Override",
"public",
"RemoteWebDriver",
"createDriver",
"(",
"WebDriverPlatform",
"platform",
",",
"CommandExecutor",
"commandExecutor",
",",
"URL",
"url",
",",
"Capabilities",
"caps",
")",
"{",
"if",
"(",
"platform",
".",
"equals",
"(",
"WebDriverPlatform",
... | create an instance of SeLionAppiumIOSDriver or SeLionAppiumAndroidDriver | [
"create",
"an",
"instance",
"of",
"SeLionAppiumIOSDriver",
"or",
"SeLionAppiumAndroidDriver"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/appium-provider/src/main/java/com/paypal/selion/appium/platform/grid/SeLionAppiumProvider.java#L47-L66 | train |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/InstallHelper.java | InstallHelper.copyFileFromResources | static void copyFileFromResources(String sourcePath, String destPath) throws IOException {
LOGGER.entering(new Object[] { sourcePath, destPath });
File downloadFile = new File(destPath);
if (!downloadFile.exists()) {
InputStream stream = JarSpawner.class.getResourceAsStream(sourceP... | java | static void copyFileFromResources(String sourcePath, String destPath) throws IOException {
LOGGER.entering(new Object[] { sourcePath, destPath });
File downloadFile = new File(destPath);
if (!downloadFile.exists()) {
InputStream stream = JarSpawner.class.getResourceAsStream(sourceP... | [
"static",
"void",
"copyFileFromResources",
"(",
"String",
"sourcePath",
",",
"String",
"destPath",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"sourcePath",
",",
"destPath",
"}",
")",
";",
"File",
"downl... | Copy file from source path to destination location
@param sourcePath
Resource path of the source file
@param destPath
Path of the destination file
@throws IOException | [
"Copy",
"file",
"from",
"source",
"path",
"to",
"destination",
"location"
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/InstallHelper.java#L72-L83 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/DatePicker.java | DatePicker.getDateText | public String getDateText() {
String value = null;
value = HtmlElementUtils.locateElement(dateTextLocator).getText();
return value;
} | java | public String getDateText() {
String value = null;
value = HtmlElementUtils.locateElement(dateTextLocator).getText();
return value;
} | [
"public",
"String",
"getDateText",
"(",
")",
"{",
"String",
"value",
"=",
"null",
";",
"value",
"=",
"HtmlElementUtils",
".",
"locateElement",
"(",
"dateTextLocator",
")",
".",
"getText",
"(",
")",
";",
"return",
"value",
";",
"}"
] | Gets the current setting month and year from the calendar header.
@return current setting month and year | [
"Gets",
"the",
"current",
"setting",
"month",
"and",
"year",
"from",
"the",
"calendar",
"header",
"."
] | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/DatePicker.java#L168-L172 | train |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/DatePicker.java | DatePicker.setDate | public void setDate(Calendar to) {
// Navigate from the current date
// to the new date
navigateMonth(calendar, to);
// Select the day-of-month.
clickDay(to.get(Calendar.DATE));
Calendar cal = calendar;
cal.set(Calendar.YEAR, to.get(Calendar.YEAR));
cal.... | java | public void setDate(Calendar to) {
// Navigate from the current date
// to the new date
navigateMonth(calendar, to);
// Select the day-of-month.
clickDay(to.get(Calendar.DATE));
Calendar cal = calendar;
cal.set(Calendar.YEAR, to.get(Calendar.YEAR));
cal.... | [
"public",
"void",
"setDate",
"(",
"Calendar",
"to",
")",
"{",
"// Navigate from the current date",
"// to the new date",
"navigateMonth",
"(",
"calendar",
",",
"to",
")",
";",
"// Select the day-of-month.",
"clickDay",
"(",
"to",
".",
"get",
"(",
"Calendar",
".",
... | This is the main function of the DatePicker object to select the date specified by the input parameter. It will
calculate how many time needed to click on the "next month" or "previous month" button to arrive at the correct
month and year in the input parameters. It then click on the day-of-month tablet to select the c... | [
"This",
"is",
"the",
"main",
"function",
"of",
"the",
"DatePicker",
"object",
"to",
"select",
"the",
"date",
"specified",
"by",
"the",
"input",
"parameter",
".",
"It",
"will",
"calculate",
"how",
"many",
"time",
"needed",
"to",
"click",
"on",
"the",
"next"... | 694d12d0df76db48d0360b16192770c6a4fbdfd2 | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/DatePicker.java#L210-L222 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.