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
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/dict/MultiWordMatcher.java
MultiWordMatcher.multiWordsToSpans
public final Span[] multiWordsToSpans(final String[] tokens) { final List<Span> multiWordsFound = new LinkedList<Span>(); for (int offsetFrom = 0; offsetFrom < tokens.length; offsetFrom++) { Span multiwordFound = null; String tokensSearching[] = new String[] {}; for (int offsetTo = offsetFro...
java
public final Span[] multiWordsToSpans(final String[] tokens) { final List<Span> multiWordsFound = new LinkedList<Span>(); for (int offsetFrom = 0; offsetFrom < tokens.length; offsetFrom++) { Span multiwordFound = null; String tokensSearching[] = new String[] {}; for (int offsetTo = offsetFro...
[ "public", "final", "Span", "[", "]", "multiWordsToSpans", "(", "final", "String", "[", "]", "tokens", ")", "{", "final", "List", "<", "Span", ">", "multiWordsFound", "=", "new", "LinkedList", "<", "Span", ">", "(", ")", ";", "for", "(", "int", "offsetF...
Detects multiword expressions ignoring case. @param tokens the tokenized sentence @return spans of the multiword
[ "Detects", "multiword", "expressions", "ignoring", "case", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/dict/MultiWordMatcher.java#L184-L216
train
ManfredTremmel/gwt-commons-lang3
src/main/resources/org/apache/commons/jre/java/util/GregorianCalendar.java
GregorianCalendar.compareDate
private int compareDate(Date a, Date b) { final Date ta = new Date(a.getTime()); final Date tb = new Date(b.getTime()); final long d1 = setHourToZero(ta).getTime(); final long d2 = setHourToZero(tb).getTime(); return (int) Math.round((d2 - d1) / 1000.0 / 60.0 / 60.0 / 24.0); }
java
private int compareDate(Date a, Date b) { final Date ta = new Date(a.getTime()); final Date tb = new Date(b.getTime()); final long d1 = setHourToZero(ta).getTime(); final long d2 = setHourToZero(tb).getTime(); return (int) Math.round((d2 - d1) / 1000.0 / 60.0 / 60.0 / 24.0); }
[ "private", "int", "compareDate", "(", "Date", "a", ",", "Date", "b", ")", "{", "final", "Date", "ta", "=", "new", "Date", "(", "a", ".", "getTime", "(", ")", ")", ";", "final", "Date", "tb", "=", "new", "Date", "(", "b", ".", "getTime", "(", ")...
Calculate the number of days between two dates @param a Date @param b Date @return the difference in days between b and a (b - a)
[ "Calculate", "the", "number", "of", "days", "between", "two", "dates" ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/GregorianCalendar.java#L365-L371
train
ManfredTremmel/gwt-commons-lang3
src/main/resources/org/apache/commons/jre/java/util/GregorianCalendar.java
GregorianCalendar.setHourToZero
@SuppressWarnings("deprecation") private Date setHourToZero(Date in) { final Date d = new Date(in.getTime()); d.setHours(0); d.setMinutes(0); d.setSeconds(0); // a trick to set milliseconds to zero long t = d.getTime() / 1000; t = t * 1000; return new Date(t); }
java
@SuppressWarnings("deprecation") private Date setHourToZero(Date in) { final Date d = new Date(in.getTime()); d.setHours(0); d.setMinutes(0); d.setSeconds(0); // a trick to set milliseconds to zero long t = d.getTime() / 1000; t = t * 1000; return new Date(t); }
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "private", "Date", "setHourToZero", "(", "Date", "in", ")", "{", "final", "Date", "d", "=", "new", "Date", "(", "in", ".", "getTime", "(", ")", ")", ";", "d", ".", "setHours", "(", "0", ")", ";", ...
Set hour, minutes, second and milliseconds to zero. @param d Date @return Modified date
[ "Set", "hour", "minutes", "second", "and", "milliseconds", "to", "zero", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/GregorianCalendar.java#L379-L389
train
ManfredTremmel/gwt-commons-lang3
src/main/resources/org/apache/commons/jre/java/util/GregorianCalendar.java
GregorianCalendar.getWeekOne
@SuppressWarnings("deprecation") private Date getWeekOne(int year) { GregorianCalendar weekOne = new GregorianCalendar(); weekOne.setFirstDayOfWeek(getFirstDayOfWeek()); weekOne.setMinimalDaysInFirstWeek(getMinimalDaysInFirstWeek()); weekOne.setTime(new Date(year, 0, 1)); // can we use the week of 1/1/year a...
java
@SuppressWarnings("deprecation") private Date getWeekOne(int year) { GregorianCalendar weekOne = new GregorianCalendar(); weekOne.setFirstDayOfWeek(getFirstDayOfWeek()); weekOne.setMinimalDaysInFirstWeek(getMinimalDaysInFirstWeek()); weekOne.setTime(new Date(year, 0, 1)); // can we use the week of 1/1/year a...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "private", "Date", "getWeekOne", "(", "int", "year", ")", "{", "GregorianCalendar", "weekOne", "=", "new", "GregorianCalendar", "(", ")", ";", "weekOne", ".", "setFirstDayOfWeek", "(", "getFirstDayOfWeek", "(",...
Gets the date of the first week for the specified year. @param year This is year - 1900 as returned by Date.getYear() @return
[ "Gets", "the", "date", "of", "the", "first", "week", "for", "the", "specified", "year", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/GregorianCalendar.java#L396-L412
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/train/AbstractTaggerTrainer.java
AbstractTaggerTrainer.createTagDictionary
protected final void createTagDictionary(final String dictPath) { if (!dictPath.equalsIgnoreCase(Flags.DEFAULT_DICT_PATH)) { try { getPosTaggerFactory().setTagDictionary( getPosTaggerFactory().createTagDictionary(new File(dictPath))); } catch (final IOException e) { throw new...
java
protected final void createTagDictionary(final String dictPath) { if (!dictPath.equalsIgnoreCase(Flags.DEFAULT_DICT_PATH)) { try { getPosTaggerFactory().setTagDictionary( getPosTaggerFactory().createTagDictionary(new File(dictPath))); } catch (final IOException e) { throw new...
[ "protected", "final", "void", "createTagDictionary", "(", "final", "String", "dictPath", ")", "{", "if", "(", "!", "dictPath", ".", "equalsIgnoreCase", "(", "Flags", ".", "DEFAULT_DICT_PATH", ")", ")", "{", "try", "{", "getPosTaggerFactory", "(", ")", ".", "...
Create a tag dictionary with the dictionary contained in the dictPath. @param dictPath the string pointing to the tag dictionary
[ "Create", "a", "tag", "dictionary", "with", "the", "dictionary", "contained", "in", "the", "dictPath", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/train/AbstractTaggerTrainer.java#L140-L150
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/train/AbstractTaggerTrainer.java
AbstractTaggerTrainer.createAutomaticDictionary
protected final void createAutomaticDictionary( final ObjectStream<POSSample> aDictSamples, final int aDictCutOff) { if (aDictCutOff != Flags.DEFAULT_DICT_CUTOFF) { try { TagDictionary dict = getPosTaggerFactory().getTagDictionary(); if (dict == null) { dict = getPosTaggerFacto...
java
protected final void createAutomaticDictionary( final ObjectStream<POSSample> aDictSamples, final int aDictCutOff) { if (aDictCutOff != Flags.DEFAULT_DICT_CUTOFF) { try { TagDictionary dict = getPosTaggerFactory().getTagDictionary(); if (dict == null) { dict = getPosTaggerFacto...
[ "protected", "final", "void", "createAutomaticDictionary", "(", "final", "ObjectStream", "<", "POSSample", ">", "aDictSamples", ",", "final", "int", "aDictCutOff", ")", "{", "if", "(", "aDictCutOff", "!=", "Flags", ".", "DEFAULT_DICT_CUTOFF", ")", "{", "try", "{...
Automatically create a tag dictionary from training data. @param aDictSamples the dictSamples created from training data @param aDictCutOff the cutoff to create the dictionary
[ "Automatically", "create", "a", "tag", "dictionary", "from", "training", "data", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/train/AbstractTaggerTrainer.java#L160-L183
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/train/AbstractTaggerTrainer.java
AbstractTaggerTrainer.createNgramDictionary
protected final Dictionary createNgramDictionary( final ObjectStream<POSSample> aDictSamples, final int aNgramCutoff) { Dictionary ngramDict = null; if (aNgramCutoff != Flags.DEFAULT_DICT_CUTOFF) { System.err.print("Building ngram dictionary ... "); try { ngramDict = POSTaggerME ...
java
protected final Dictionary createNgramDictionary( final ObjectStream<POSSample> aDictSamples, final int aNgramCutoff) { Dictionary ngramDict = null; if (aNgramCutoff != Flags.DEFAULT_DICT_CUTOFF) { System.err.print("Building ngram dictionary ... "); try { ngramDict = POSTaggerME ...
[ "protected", "final", "Dictionary", "createNgramDictionary", "(", "final", "ObjectStream", "<", "POSSample", ">", "aDictSamples", ",", "final", "int", "aNgramCutoff", ")", "{", "Dictionary", "ngramDict", "=", "null", ";", "if", "(", "aNgramCutoff", "!=", "Flags", ...
Create ngram dictionary from training data. @param aDictSamples the training data @param aNgramCutoff the cutoff @return ngram dictionary
[ "Create", "ngram", "dictionary", "from", "training", "data", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/train/AbstractTaggerTrainer.java#L194-L210
train
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ColumnAnnotatedField.java
ColumnAnnotatedField.getQualifiedSurroundingClassName
@Override public String getQualifiedSurroundingClassName() { TypeElement typeElement = (TypeElement) field.getEnclosingElement(); return typeElement.getQualifiedName().toString(); }
java
@Override public String getQualifiedSurroundingClassName() { TypeElement typeElement = (TypeElement) field.getEnclosingElement(); return typeElement.getQualifiedName().toString(); }
[ "@", "Override", "public", "String", "getQualifiedSurroundingClassName", "(", ")", "{", "TypeElement", "typeElement", "=", "(", "TypeElement", ")", "field", ".", "getEnclosingElement", "(", ")", ";", "return", "typeElement", ".", "getQualifiedName", "(", ")", ".",...
Get the full qualified class name this field is part of. @return The full qualified class name
[ "Get", "the", "full", "qualified", "class", "name", "this", "field", "is", "part", "of", "." ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ColumnAnnotatedField.java#L101-L104
train
ManfredTremmel/gwt-commons-lang3
src/main/resources/org/apache/commons/jre/java/util/BitSet.java
BitSet.setInternal
private static void setInternal(int[] array, int fromIndex, int toIndex) { int first = wordIndex(fromIndex); int last = wordIndex(toIndex); maybeGrowArrayToIndex(array, last); int startBit = bitOffset(fromIndex); int endBit = bitOffset(toIndex); if (first == last) { // Set the bits in b...
java
private static void setInternal(int[] array, int fromIndex, int toIndex) { int first = wordIndex(fromIndex); int last = wordIndex(toIndex); maybeGrowArrayToIndex(array, last); int startBit = bitOffset(fromIndex); int endBit = bitOffset(toIndex); if (first == last) { // Set the bits in b...
[ "private", "static", "void", "setInternal", "(", "int", "[", "]", "array", ",", "int", "fromIndex", ",", "int", "toIndex", ")", "{", "int", "first", "=", "wordIndex", "(", "fromIndex", ")", ";", "int", "last", "=", "wordIndex", "(", "toIndex", ")", ";"...
Sets all bits to true within the given range. @param fromIndex The lower bit index. @param toIndex The upper bit index.
[ "Sets", "all", "bits", "to", "true", "within", "the", "given", "range", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/BitSet.java#L99-L123
train
ManfredTremmel/gwt-commons-lang3
src/main/resources/org/apache/commons/jre/java/util/BitSet.java
BitSet.lastSetWordIndex
private static int lastSetWordIndex(int[] array) { int i = array.length - 1; for (; i >= 0 && wordAt(array, i) == 0; --i) { } return i; }
java
private static int lastSetWordIndex(int[] array) { int i = array.length - 1; for (; i >= 0 && wordAt(array, i) == 0; --i) { } return i; }
[ "private", "static", "int", "lastSetWordIndex", "(", "int", "[", "]", "array", ")", "{", "int", "i", "=", "array", ".", "length", "-", "1", ";", "for", "(", ";", "i", ">=", "0", "&&", "wordAt", "(", "array", ",", "i", ")", "==", "0", ";", "--",...
Returns the index of the last word containing a true bit in an array, or -1 if none. @param array The array. @return The index of the last word containing a true bit, or -1 if none.
[ "Returns", "the", "index", "of", "the", "last", "word", "containing", "a", "true", "bit", "in", "an", "array", "or", "-", "1", "if", "none", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/BitSet.java#L141-L145
train
ManfredTremmel/gwt-commons-lang3
src/main/resources/org/apache/commons/jre/java/util/BitSet.java
BitSet.flipMaskedWord
private static void flipMaskedWord(int[] array, int index, int from, int to) { if (from == to) { return; } to = 32 - to; int word = wordAt(array, index); word ^= ((0xffffffff >>> from) << (from + to)) >>> to; array[index] = word & WORD_MASK; }
java
private static void flipMaskedWord(int[] array, int index, int from, int to) { if (from == to) { return; } to = 32 - to; int word = wordAt(array, index); word ^= ((0xffffffff >>> from) << (from + to)) >>> to; array[index] = word & WORD_MASK; }
[ "private", "static", "void", "flipMaskedWord", "(", "int", "[", "]", "array", ",", "int", "index", ",", "int", "from", ",", "int", "to", ")", "{", "if", "(", "from", "==", "to", ")", "{", "return", ";", "}", "to", "=", "32", "-", "to", ";", "in...
Flips all bits in a word within the given range. @param array The array. @param index The word index. @param from The lower bit index. @param to The upper bit index.
[ "Flips", "all", "bits", "in", "a", "word", "within", "the", "given", "range", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/BitSet.java#L155-L164
train
ManfredTremmel/gwt-commons-lang3
src/main/resources/org/apache/commons/jre/java/util/BitSet.java
BitSet.maskInWord
private static void maskInWord(int[] array, int index, int from, int to) { if (from == to) { return; } to = 32 - to; int word = wordAt(array, index); word |= ((0xffffffff >>> from) << (from + to)) >>> to; array[index] = word & WORD_MASK; }
java
private static void maskInWord(int[] array, int index, int from, int to) { if (from == to) { return; } to = 32 - to; int word = wordAt(array, index); word |= ((0xffffffff >>> from) << (from + to)) >>> to; array[index] = word & WORD_MASK; }
[ "private", "static", "void", "maskInWord", "(", "int", "[", "]", "array", ",", "int", "index", ",", "int", "from", ",", "int", "to", ")", "{", "if", "(", "from", "==", "to", ")", "{", "return", ";", "}", "to", "=", "32", "-", "to", ";", "int", ...
Sets all bits to true in a word within the given bit range. @param array The array. @param index The word index. @param from The lower bit index. @param to The upper bit index.
[ "Sets", "all", "bits", "to", "true", "in", "a", "word", "within", "the", "given", "bit", "range", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/BitSet.java#L174-L183
train
ManfredTremmel/gwt-commons-lang3
src/main/resources/org/apache/commons/jre/java/util/BitSet.java
BitSet.maskOutWord
private static void maskOutWord(int[] array, int index, int from, int to) { if (from == to) { return; } int word = wordAt(array, index); if (word == 0) { return; } int mask; if (from != 0) { mask = 0xffffffff >>> (32 - from); } else { mask = 0; } // Shif...
java
private static void maskOutWord(int[] array, int index, int from, int to) { if (from == to) { return; } int word = wordAt(array, index); if (word == 0) { return; } int mask; if (from != 0) { mask = 0xffffffff >>> (32 - from); } else { mask = 0; } // Shif...
[ "private", "static", "void", "maskOutWord", "(", "int", "[", "]", "array", ",", "int", "index", ",", "int", "from", ",", "int", "to", ")", "{", "if", "(", "from", "==", "to", ")", "{", "return", ";", "}", "int", "word", "=", "wordAt", "(", "array...
Sets all bits to false in a word within the given bit range. @param array The array. @param index The word index. @param from The lower bit index. @param to The upper bit index.
[ "Sets", "all", "bits", "to", "false", "in", "a", "word", "within", "the", "given", "bit", "range", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/BitSet.java#L193-L216
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/StatisticalTagger.java
StatisticalTagger.getMorphemes
public final List<Morpheme> getMorphemes(final String[] tokens) { final List<String> origPosTags = posAnnotate(tokens); final List<Morpheme> morphemes = getMorphemesFromStrings(origPosTags, tokens); return morphemes; }
java
public final List<Morpheme> getMorphemes(final String[] tokens) { final List<String> origPosTags = posAnnotate(tokens); final List<Morpheme> morphemes = getMorphemesFromStrings(origPosTags, tokens); return morphemes; }
[ "public", "final", "List", "<", "Morpheme", ">", "getMorphemes", "(", "final", "String", "[", "]", "tokens", ")", "{", "final", "List", "<", "String", ">", "origPosTags", "=", "posAnnotate", "(", "tokens", ")", ";", "final", "List", "<", "Morpheme", ">",...
Get morphological analysis from a tokenized sentence. @param tokens the tokenized sentence @return a list of {@code Morpheme} objects containing morphological info
[ "Get", "morphological", "analysis", "from", "a", "tokenized", "sentence", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/StatisticalTagger.java#L87-L92
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/StatisticalTagger.java
StatisticalTagger.posAnnotate
public final List<String> posAnnotate(final String[] tokens) { final String[] annotatedText = this.posTagger.tag(tokens); final List<String> posTags = new ArrayList<String>( Arrays.asList(annotatedText)); return posTags; }
java
public final List<String> posAnnotate(final String[] tokens) { final String[] annotatedText = this.posTagger.tag(tokens); final List<String> posTags = new ArrayList<String>( Arrays.asList(annotatedText)); return posTags; }
[ "public", "final", "List", "<", "String", ">", "posAnnotate", "(", "final", "String", "[", "]", "tokens", ")", "{", "final", "String", "[", "]", "annotatedText", "=", "this", ".", "posTagger", ".", "tag", "(", "tokens", ")", ";", "final", "List", "<", ...
Produce postags from a tokenized sentence. @param tokens the sentence @return a list containing the postags
[ "Produce", "postags", "from", "a", "tokenized", "sentence", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/StatisticalTagger.java#L101-L106
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/StatisticalTagger.java
StatisticalTagger.getAllPosTags
public final String[][] getAllPosTags(final String[] tokens) { final String[][] allPosTags = this.posTagger.tag(13, tokens); return allPosTags; }
java
public final String[][] getAllPosTags(final String[] tokens) { final String[][] allPosTags = this.posTagger.tag(13, tokens); return allPosTags; }
[ "public", "final", "String", "[", "]", "[", "]", "getAllPosTags", "(", "final", "String", "[", "]", "tokens", ")", "{", "final", "String", "[", "]", "[", "]", "allPosTags", "=", "this", ".", "posTagger", ".", "tag", "(", "13", ",", "tokens", ")", "...
Produces a multidimensional array containing all the tagging possible for a given sentence. @param tokens the tokens @return the array containing for each row the tags
[ "Produces", "a", "multidimensional", "array", "containing", "all", "the", "tagging", "possible", "for", "a", "given", "sentence", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/StatisticalTagger.java#L114-L117
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ObjectUtils.java
ObjectUtils.median
@GwtIncompatible("incompatible method") @SafeVarargs public static <T extends Comparable<? super T>> T median(final T... items) { Validate.notEmpty(items); Validate.noNullElements(items); final TreeSet<T> sort = new TreeSet<>(); Collections.addAll(sort, items); @SuppressW...
java
@GwtIncompatible("incompatible method") @SafeVarargs public static <T extends Comparable<? super T>> T median(final T... items) { Validate.notEmpty(items); Validate.noNullElements(items); final TreeSet<T> sort = new TreeSet<>(); Collections.addAll(sort, items); @SuppressW...
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "@", "SafeVarargs", "public", "static", "<", "T", "extends", "Comparable", "<", "?", "super", "T", ">", ">", "T", "median", "(", "final", "T", "...", "items", ")", "{", "Validate", ".", "notEmpty...
Find the "best guess" middle value among comparables. If there is an even number of total values, the lower of the two middle values will be returned. @param <T> type of values processed by this method @param items to compare @return T at middle position @throws NullPointerException if items is {@code null} @throws Ill...
[ "Find", "the", "best", "guess", "middle", "value", "among", "comparables", ".", "If", "there", "is", "an", "even", "number", "of", "total", "values", "the", "lower", "of", "the", "two", "middle", "values", "will", "be", "returned", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ObjectUtils.java#L588-L598
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ObjectUtils.java
ObjectUtils.mode
@SafeVarargs public static <T> T mode(final T... items) { if (ArrayUtils.isNotEmpty(items)) { final HashMap<T, MutableInt> occurrences = new HashMap<>(items.length); for (final T t : items) { final MutableInt count = occurrences.get(t); if (count == nu...
java
@SafeVarargs public static <T> T mode(final T... items) { if (ArrayUtils.isNotEmpty(items)) { final HashMap<T, MutableInt> occurrences = new HashMap<>(items.length); for (final T t : items) { final MutableInt count = occurrences.get(t); if (count == nu...
[ "@", "SafeVarargs", "public", "static", "<", "T", ">", "T", "mode", "(", "final", "T", "...", "items", ")", "{", "if", "(", "ArrayUtils", ".", "isNotEmpty", "(", "items", ")", ")", "{", "final", "HashMap", "<", "T", ",", "MutableInt", ">", "occurrenc...
Find the most frequently occurring item. @param <T> type of values processed by this method @param items to check @return most populous T, {@code null} if non-unique or no items supplied @since 3.0.1
[ "Find", "the", "most", "frequently", "occurring", "item", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ObjectUtils.java#L635-L661
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/eval/POSCrossValidator.java
POSCrossValidator.crossValidate
public final void crossValidate(final TrainingParameters params) { POSTaggerCrossValidator validator = null; try { validator = getPOSTaggerCrossValidator(params); validator.evaluate(this.trainSamples, this.folds); } catch (final IOException e) { System.err.println("IO error while loading ...
java
public final void crossValidate(final TrainingParameters params) { POSTaggerCrossValidator validator = null; try { validator = getPOSTaggerCrossValidator(params); validator.evaluate(this.trainSamples, this.folds); } catch (final IOException e) { System.err.println("IO error while loading ...
[ "public", "final", "void", "crossValidate", "(", "final", "TrainingParameters", "params", ")", "{", "POSTaggerCrossValidator", "validator", "=", "null", ";", "try", "{", "validator", "=", "getPOSTaggerCrossValidator", "(", "params", ")", ";", "validator", ".", "ev...
Cross validate when no separate testset is available. @param params the training parameters
[ "Cross", "validate", "when", "no", "separate", "testset", "is", "available", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/eval/POSCrossValidator.java#L121-L144
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/eval/POSCrossValidator.java
POSCrossValidator.getPOSTaggerCrossValidator
private POSTaggerCrossValidator getPOSTaggerCrossValidator( final TrainingParameters params) { final File dictPath = new File(Flags.getDictionaryFeatures(params)); // features if (this.posTaggerFactory == null) { throw new IllegalStateException( "You must create the POSTaggerFactory fe...
java
private POSTaggerCrossValidator getPOSTaggerCrossValidator( final TrainingParameters params) { final File dictPath = new File(Flags.getDictionaryFeatures(params)); // features if (this.posTaggerFactory == null) { throw new IllegalStateException( "You must create the POSTaggerFactory fe...
[ "private", "POSTaggerCrossValidator", "getPOSTaggerCrossValidator", "(", "final", "TrainingParameters", "params", ")", "{", "final", "File", "dictPath", "=", "new", "File", "(", "Flags", ".", "getDictionaryFeatures", "(", "params", ")", ")", ";", "// features", "if"...
Get the postagger cross validator. @param params the training parameters @return the pos tagger cross validator
[ "Get", "the", "postagger", "cross", "validator", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/eval/POSCrossValidator.java#L153-L188
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
TypeUtils.extractTypeArgumentsFrom
private static Type[] extractTypeArgumentsFrom(final Map<TypeVariable<?>, Type> mappings, final TypeVariable<?>[] variables) { final Type[] result = new Type[variables.length]; int index = 0; for (final TypeVariable<?> var : variables) { Validate.isTrue(mappings.containsKey(var), "mi...
java
private static Type[] extractTypeArgumentsFrom(final Map<TypeVariable<?>, Type> mappings, final TypeVariable<?>[] variables) { final Type[] result = new Type[variables.length]; int index = 0; for (final TypeVariable<?> var : variables) { Validate.isTrue(mappings.containsKey(var), "mi...
[ "private", "static", "Type", "[", "]", "extractTypeArgumentsFrom", "(", "final", "Map", "<", "TypeVariable", "<", "?", ">", ",", "Type", ">", "mappings", ",", "final", "TypeVariable", "<", "?", ">", "[", "]", "variables", ")", "{", "final", "Type", "[", ...
Helper method to establish the formal parameters for a parameterized type. @param mappings map containing the assignments @param variables expected map keys @return array of map values corresponding to specified keys
[ "Helper", "method", "to", "establish", "the", "formal", "parameters", "for", "a", "parameterized", "type", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java#L1537-L1545
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java
StrSubstitutor.replace
public static <V> String replace(final Object source, final Map<String, V> valueMap) { return new StrSubstitutor(valueMap).replace(source); }
java
public static <V> String replace(final Object source, final Map<String, V> valueMap) { return new StrSubstitutor(valueMap).replace(source); }
[ "public", "static", "<", "V", ">", "String", "replace", "(", "final", "Object", "source", ",", "final", "Map", "<", "String", ",", "V", ">", "valueMap", ")", "{", "return", "new", "StrSubstitutor", "(", "valueMap", ")", ".", "replace", "(", "source", "...
Replaces all the occurrences of variables in the given source object with their matching values from the map. @param <V> the type of the values in the map @param source the source text containing the variables to substitute, null returns null @param valueMap the map with the values, may be null @return the result of...
[ "Replaces", "all", "the", "occurrences", "of", "variables", "in", "the", "given", "source", "object", "with", "their", "matching", "values", "from", "the", "map", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L191-L193
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java
StrSubstitutor.replace
public static <V> String replace(final Object source, final Map<String, V> valueMap, final String prefix, final String suffix) { return new StrSubstitutor(valueMap, prefix, suffix).replace(source); }
java
public static <V> String replace(final Object source, final Map<String, V> valueMap, final String prefix, final String suffix) { return new StrSubstitutor(valueMap, prefix, suffix).replace(source); }
[ "public", "static", "<", "V", ">", "String", "replace", "(", "final", "Object", "source", ",", "final", "Map", "<", "String", ",", "V", ">", "valueMap", ",", "final", "String", "prefix", ",", "final", "String", "suffix", ")", "{", "return", "new", "Str...
Replaces all the occurrences of variables in the given source object with their matching values from the map. This method allows to specify a custom variable prefix and suffix @param <V> the type of the values in the map @param source the source text containing the variables to substitute, null returns null @param va...
[ "Replaces", "all", "the", "occurrences", "of", "variables", "in", "the", "given", "source", "object", "with", "their", "matching", "values", "from", "the", "map", ".", "This", "method", "allows", "to", "specify", "a", "custom", "variable", "prefix", "and", "...
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L208-L210
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java
StrSubstitutor.replace
public static String replace(final Object source, final Properties valueProperties) { if (valueProperties == null) { return source.toString(); } final Map<String,String> valueMap = new HashMap<>(); final Enumeration<?> propNames = valueProperties.propertyNames(); whil...
java
public static String replace(final Object source, final Properties valueProperties) { if (valueProperties == null) { return source.toString(); } final Map<String,String> valueMap = new HashMap<>(); final Enumeration<?> propNames = valueProperties.propertyNames(); whil...
[ "public", "static", "String", "replace", "(", "final", "Object", "source", ",", "final", "Properties", "valueProperties", ")", "{", "if", "(", "valueProperties", "==", "null", ")", "{", "return", "source", ".", "toString", "(", ")", ";", "}", "final", "Map...
Replaces all the occurrences of variables in the given source object with their matching values from the properties. @param source the source text containing the variables to substitute, null returns null @param valueProperties the properties with values, may be null @return the result of the replace operation
[ "Replaces", "all", "the", "occurrences", "of", "variables", "in", "the", "given", "source", "object", "with", "their", "matching", "values", "from", "the", "properties", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L220-L232
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java
StrSubstitutor.replace
public String replace(final CharSequence source) { if (source == null) { return null; } return replace(source, 0, source.length()); }
java
public String replace(final CharSequence source) { if (source == null) { return null; } return replace(source, 0, source.length()); }
[ "public", "String", "replace", "(", "final", "CharSequence", "source", ")", "{", "if", "(", "source", "==", "null", ")", "{", "return", "null", ";", "}", "return", "replace", "(", "source", ",", "0", ",", "source", ".", "length", "(", ")", ")", ";", ...
Replaces all the occurrences of variables with their matching values from the resolver using the given source as a template. The source is not altered by this method. @param source the buffer to use as a template, not changed, null returns null @return the result of the replace operation @since 3.2
[ "Replaces", "all", "the", "occurrences", "of", "variables", "with", "their", "matching", "values", "from", "the", "resolver", "using", "the", "given", "source", "as", "a", "template", ".", "The", "source", "is", "not", "altered", "by", "this", "method", "." ...
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L524-L529
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java
StrSubstitutor.replace
public String replace(final StrBuilder source) { if (source == null) { return null; } final StrBuilder buf = new StrBuilder(source.length()).append(source); substitute(buf, 0, buf.length()); return buf.toString(); }
java
public String replace(final StrBuilder source) { if (source == null) { return null; } final StrBuilder buf = new StrBuilder(source.length()).append(source); substitute(buf, 0, buf.length()); return buf.toString(); }
[ "public", "String", "replace", "(", "final", "StrBuilder", "source", ")", "{", "if", "(", "source", "==", "null", ")", "{", "return", "null", ";", "}", "final", "StrBuilder", "buf", "=", "new", "StrBuilder", "(", "source", ".", "length", "(", ")", ")",...
Replaces all the occurrences of variables with their matching values from the resolver using the given source builder as a template. The builder is not altered by this method. @param source the builder to use as a template, not changed, null returns null @return the result of the replace operation
[ "Replaces", "all", "the", "occurrences", "of", "variables", "with", "their", "matching", "values", "from", "the", "resolver", "using", "the", "given", "source", "builder", "as", "a", "template", ".", "The", "builder", "is", "not", "altered", "by", "this", "m...
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L563-L570
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java
StrSubstitutor.replaceIn
public boolean replaceIn(final StrBuilder source) { if (source == null) { return false; } return substitute(source, 0, source.length()); }
java
public boolean replaceIn(final StrBuilder source) { if (source == null) { return false; } return substitute(source, 0, source.length()); }
[ "public", "boolean", "replaceIn", "(", "final", "StrBuilder", "source", ")", "{", "if", "(", "source", "==", "null", ")", "{", "return", "false", ";", "}", "return", "substitute", "(", "source", ",", "0", ",", "source", ".", "length", "(", ")", ")", ...
Replaces all the occurrences of variables within the given source builder with their matching values from the resolver. @param source the builder to replace in, updated, null returns zero @return true if altered
[ "Replaces", "all", "the", "occurrences", "of", "variables", "within", "the", "given", "source", "builder", "with", "their", "matching", "values", "from", "the", "resolver", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L704-L709
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/tuple/ImmutableTriple.java
ImmutableTriple.nullTriple
@SuppressWarnings("unchecked") public static <L, M, R> ImmutableTriple<L, M, R> nullTriple() { return NULL; }
java
@SuppressWarnings("unchecked") public static <L, M, R> ImmutableTriple<L, M, R> nullTriple() { return NULL; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "L", ",", "M", ",", "R", ">", "ImmutableTriple", "<", "L", ",", "M", ",", "R", ">", "nullTriple", "(", ")", "{", "return", "NULL", ";", "}" ]
Returns an immutable triple of nulls. @param <L> the left element of this triple. Value is {@code null}. @param <M> the middle element of this triple. Value is {@code null}. @param <R> the right element of this triple. Value is {@code null}. @return an immutable triple of nulls. @since 3.6
[ "Returns", "an", "immutable", "triple", "of", "nulls", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/tuple/ImmutableTriple.java#L56-L59
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
DurationFormatUtils.lexx
static Token[] lexx(final String format) { final ArrayList<Token> list = new ArrayList<>(format.length()); boolean inLiteral = false; // Although the buffer is stored in a Token, the Tokens are only // used internally, so cannot be accessed by other threads StringBuilder buffer ...
java
static Token[] lexx(final String format) { final ArrayList<Token> list = new ArrayList<>(format.length()); boolean inLiteral = false; // Although the buffer is stored in a Token, the Tokens are only // used internally, so cannot be accessed by other threads StringBuilder buffer ...
[ "static", "Token", "[", "]", "lexx", "(", "final", "String", "format", ")", "{", "final", "ArrayList", "<", "Token", ">", "list", "=", "new", "ArrayList", "<>", "(", "format", ".", "length", "(", ")", ")", ";", "boolean", "inLiteral", "=", "false", "...
Parses a classic date format string into Tokens @param format the format to parse, not null @return array of Token[]
[ "Parses", "a", "classic", "date", "format", "string", "into", "Tokens" ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java#L499-L570
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.setNullText
public StrBuilder setNullText(String nullText) { if (nullText != null && nullText.isEmpty()) { nullText = null; } this.nullText = nullText; return this; }
java
public StrBuilder setNullText(String nullText) { if (nullText != null && nullText.isEmpty()) { nullText = null; } this.nullText = nullText; return this; }
[ "public", "StrBuilder", "setNullText", "(", "String", "nullText", ")", "{", "if", "(", "nullText", "!=", "null", "&&", "nullText", ".", "isEmpty", "(", ")", ")", "{", "nullText", "=", "null", ";", "}", "this", ".", "nullText", "=", "nullText", ";", "re...
Sets the text to be appended when null is added. @param nullText the null text, null means no append @return this, to enable chaining
[ "Sets", "the", "text", "to", "be", "appended", "when", "null", "is", "added", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L180-L186
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.setLength
public StrBuilder setLength(final int length) { if (length < 0) { throw new StringIndexOutOfBoundsException(length); } if (length < size) { size = length; } else if (length > size) { ensureCapacity(length); final int oldEnd = size; ...
java
public StrBuilder setLength(final int length) { if (length < 0) { throw new StringIndexOutOfBoundsException(length); } if (length < size) { size = length; } else if (length > size) { ensureCapacity(length); final int oldEnd = size; ...
[ "public", "StrBuilder", "setLength", "(", "final", "int", "length", ")", "{", "if", "(", "length", "<", "0", ")", "{", "throw", "new", "StringIndexOutOfBoundsException", "(", "length", ")", ";", "}", "if", "(", "length", "<", "size", ")", "{", "size", ...
Updates the length of the builder by either dropping the last characters or adding filler of Unicode zero. @param length the length to set to, must be zero or positive @return this, to enable chaining @throws IndexOutOfBoundsException if the length is negative
[ "Updates", "the", "length", "of", "the", "builder", "by", "either", "dropping", "the", "last", "characters", "or", "adding", "filler", "of", "Unicode", "zero", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L207-L223
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.ensureCapacity
public StrBuilder ensureCapacity(final int capacity) { if (capacity > buffer.length) { final char[] old = buffer; buffer = new char[capacity * 2]; System.arraycopy(old, 0, buffer, 0, size); } return this; }
java
public StrBuilder ensureCapacity(final int capacity) { if (capacity > buffer.length) { final char[] old = buffer; buffer = new char[capacity * 2]; System.arraycopy(old, 0, buffer, 0, size); } return this; }
[ "public", "StrBuilder", "ensureCapacity", "(", "final", "int", "capacity", ")", "{", "if", "(", "capacity", ">", "buffer", ".", "length", ")", "{", "final", "char", "[", "]", "old", "=", "buffer", ";", "buffer", "=", "new", "char", "[", "capacity", "*"...
Checks the capacity and ensures that it is at least the size specified. @param capacity the capacity to ensure @return this, to enable chaining
[ "Checks", "the", "capacity", "and", "ensures", "that", "it", "is", "at", "least", "the", "size", "specified", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L241-L248
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.minimizeCapacity
public StrBuilder minimizeCapacity() { if (buffer.length > length()) { final char[] old = buffer; buffer = new char[length()]; System.arraycopy(old, 0, buffer, 0, size); } return this; }
java
public StrBuilder minimizeCapacity() { if (buffer.length > length()) { final char[] old = buffer; buffer = new char[length()]; System.arraycopy(old, 0, buffer, 0, size); } return this; }
[ "public", "StrBuilder", "minimizeCapacity", "(", ")", "{", "if", "(", "buffer", ".", "length", ">", "length", "(", ")", ")", "{", "final", "char", "[", "]", "old", "=", "buffer", ";", "buffer", "=", "new", "char", "[", "length", "(", ")", "]", ";",...
Minimizes the capacity to the actual length of the string. @return this, to enable chaining
[ "Minimizes", "the", "capacity", "to", "the", "actual", "length", "of", "the", "string", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L255-L262
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.setCharAt
public StrBuilder setCharAt(final int index, final char ch) { if (index < 0 || index >= length()) { throw new StringIndexOutOfBoundsException(index); } buffer[index] = ch; return this; }
java
public StrBuilder setCharAt(final int index, final char ch) { if (index < 0 || index >= length()) { throw new StringIndexOutOfBoundsException(index); } buffer[index] = ch; return this; }
[ "public", "StrBuilder", "setCharAt", "(", "final", "int", "index", ",", "final", "char", "ch", ")", "{", "if", "(", "index", "<", "0", "||", "index", ">=", "length", "(", ")", ")", "{", "throw", "new", "StringIndexOutOfBoundsException", "(", "index", ")"...
Sets the character at the specified index. @see #charAt(int) @see #deleteCharAt(int) @param index the index to set @param ch the new character @return this, to enable chaining @throws IndexOutOfBoundsException if the index is invalid
[ "Sets", "the", "character", "at", "the", "specified", "index", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L333-L339
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.deleteCharAt
public StrBuilder deleteCharAt(final int index) { if (index < 0 || index >= size) { throw new StringIndexOutOfBoundsException(index); } deleteImpl(index, index + 1, 1); return this; }
java
public StrBuilder deleteCharAt(final int index) { if (index < 0 || index >= size) { throw new StringIndexOutOfBoundsException(index); } deleteImpl(index, index + 1, 1); return this; }
[ "public", "StrBuilder", "deleteCharAt", "(", "final", "int", "index", ")", "{", "if", "(", "index", "<", "0", "||", "index", ">=", "size", ")", "{", "throw", "new", "StringIndexOutOfBoundsException", "(", "index", ")", ";", "}", "deleteImpl", "(", "index",...
Deletes the character at the specified index. @see #charAt(int) @see #setCharAt(int, char) @param index the index to delete @return this, to enable chaining @throws IndexOutOfBoundsException if the index is invalid
[ "Deletes", "the", "character", "at", "the", "specified", "index", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L350-L356
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.toCharArray
public char[] toCharArray() { if (size == 0) { return ArrayUtils.EMPTY_CHAR_ARRAY; } final char chars[] = new char[size]; System.arraycopy(buffer, 0, chars, 0, size); return chars; }
java
public char[] toCharArray() { if (size == 0) { return ArrayUtils.EMPTY_CHAR_ARRAY; } final char chars[] = new char[size]; System.arraycopy(buffer, 0, chars, 0, size); return chars; }
[ "public", "char", "[", "]", "toCharArray", "(", ")", "{", "if", "(", "size", "==", "0", ")", "{", "return", "ArrayUtils", ".", "EMPTY_CHAR_ARRAY", ";", "}", "final", "char", "chars", "[", "]", "=", "new", "char", "[", "size", "]", ";", "System", "....
Copies the builder's character array into a new character array. @return a new array that represents the contents of the builder
[ "Copies", "the", "builder", "s", "character", "array", "into", "a", "new", "character", "array", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L364-L371
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.toCharArray
public char[] toCharArray(final int startIndex, int endIndex) { endIndex = validateRange(startIndex, endIndex); final int len = endIndex - startIndex; if (len == 0) { return ArrayUtils.EMPTY_CHAR_ARRAY; } final char chars[] = new char[len]; System.arraycopy(bu...
java
public char[] toCharArray(final int startIndex, int endIndex) { endIndex = validateRange(startIndex, endIndex); final int len = endIndex - startIndex; if (len == 0) { return ArrayUtils.EMPTY_CHAR_ARRAY; } final char chars[] = new char[len]; System.arraycopy(bu...
[ "public", "char", "[", "]", "toCharArray", "(", "final", "int", "startIndex", ",", "int", "endIndex", ")", "{", "endIndex", "=", "validateRange", "(", "startIndex", ",", "endIndex", ")", ";", "final", "int", "len", "=", "endIndex", "-", "startIndex", ";", ...
Copies part of the builder's character array into a new character array. @param startIndex the start index, inclusive, must be valid @param endIndex the end index, exclusive, must be valid except that if too large it is treated as end of string @return a new array that holds part of the contents of the builder @thro...
[ "Copies", "part", "of", "the", "builder", "s", "character", "array", "into", "a", "new", "character", "array", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L383-L392
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.append
public StrBuilder append(final boolean value) { if (value) { ensureCapacity(size + 4); buffer[size++] = 't'; buffer[size++] = 'r'; buffer[size++] = 'u'; buffer[size++] = 'e'; } else { ensureCapacity(size + 5); buffer[siz...
java
public StrBuilder append(final boolean value) { if (value) { ensureCapacity(size + 4); buffer[size++] = 't'; buffer[size++] = 'r'; buffer[size++] = 'u'; buffer[size++] = 'e'; } else { ensureCapacity(size + 5); buffer[siz...
[ "public", "StrBuilder", "append", "(", "final", "boolean", "value", ")", "{", "if", "(", "value", ")", "{", "ensureCapacity", "(", "size", "+", "4", ")", ";", "buffer", "[", "size", "++", "]", "=", "'", "'", ";", "buffer", "[", "size", "++", "]", ...
Appends a boolean value to the string builder. @param value the value to append @return this, to enable chaining
[ "Appends", "a", "boolean", "value", "to", "the", "string", "builder", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L882-L898
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.append
@Override public StrBuilder append(final char ch) { final int len = length(); ensureCapacity(len + 1); buffer[size++] = ch; return this; }
java
@Override public StrBuilder append(final char ch) { final int len = length(); ensureCapacity(len + 1); buffer[size++] = ch; return this; }
[ "@", "Override", "public", "StrBuilder", "append", "(", "final", "char", "ch", ")", "{", "final", "int", "len", "=", "length", "(", ")", ";", "ensureCapacity", "(", "len", "+", "1", ")", ";", "buffer", "[", "size", "++", "]", "=", "ch", ";", "retur...
Appends a char value to the string builder. @param ch the value to append @return this, to enable chaining @since 3.0
[ "Appends", "a", "char", "value", "to", "the", "string", "builder", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L907-L913
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.appendSeparator
public StrBuilder appendSeparator(final String standard, final String defaultIfEmpty) { final String str = isEmpty() ? defaultIfEmpty : standard; if (str != null) { append(str); } return this; }
java
public StrBuilder appendSeparator(final String standard, final String defaultIfEmpty) { final String str = isEmpty() ? defaultIfEmpty : standard; if (str != null) { append(str); } return this; }
[ "public", "StrBuilder", "appendSeparator", "(", "final", "String", "standard", ",", "final", "String", "defaultIfEmpty", ")", "{", "final", "String", "str", "=", "isEmpty", "(", ")", "?", "defaultIfEmpty", ":", "standard", ";", "if", "(", "str", "!=", "null"...
Appends one of both separators to the StrBuilder. If the builder is currently empty it will append the defaultIfEmpty-separator Otherwise it will append the standard-separator Appending a null separator will have no effect. The separator is appended using {@link #append(String)}. <p> This method is for example useful ...
[ "Appends", "one", "of", "both", "separators", "to", "the", "StrBuilder", ".", "If", "the", "builder", "is", "currently", "empty", "it", "will", "append", "the", "defaultIfEmpty", "-", "separator", "Otherwise", "it", "will", "append", "the", "standard", "-", ...
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1362-L1368
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.appendPadding
public StrBuilder appendPadding(final int length, final char padChar) { if (length >= 0) { ensureCapacity(size + length); for (int i = 0; i < length; i++) { buffer[size++] = padChar; } } return this; }
java
public StrBuilder appendPadding(final int length, final char padChar) { if (length >= 0) { ensureCapacity(size + length); for (int i = 0; i < length; i++) { buffer[size++] = padChar; } } return this; }
[ "public", "StrBuilder", "appendPadding", "(", "final", "int", "length", ",", "final", "char", "padChar", ")", "{", "if", "(", "length", ">=", "0", ")", "{", "ensureCapacity", "(", "size", "+", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";"...
Appends the pad character to the builder the specified number of times. @param length the length to append, negative means no append @param padChar the character to append @return this, to enable chaining
[ "Appends", "the", "pad", "character", "to", "the", "builder", "the", "specified", "number", "of", "times", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1480-L1488
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.insert
public StrBuilder insert(final int index, final Object obj) { if (obj == null) { return insert(index, nullText); } return insert(index, obj.toString()); }
java
public StrBuilder insert(final int index, final Object obj) { if (obj == null) { return insert(index, nullText); } return insert(index, obj.toString()); }
[ "public", "StrBuilder", "insert", "(", "final", "int", "index", ",", "final", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", ")", "{", "return", "insert", "(", "index", ",", "nullText", ")", ";", "}", "return", "insert", "(", "index", ","...
Inserts the string representation of an object into this builder. Inserting null will use the stored null text value. @param index the index to add at, must be valid @param obj the object to insert @return this, to enable chaining @throws IndexOutOfBoundsException if the index is invalid
[ "Inserts", "the", "string", "representation", "of", "an", "object", "into", "this", "builder", ".", "Inserting", "null", "will", "use", "the", "stored", "null", "text", "value", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1595-L1600
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.insert
public StrBuilder insert(final int index, String str) { validateIndex(index); if (str == null) { str = nullText; } if (str != null) { final int strLen = str.length(); if (strLen > 0) { final int newSize = size + strLen; ...
java
public StrBuilder insert(final int index, String str) { validateIndex(index); if (str == null) { str = nullText; } if (str != null) { final int strLen = str.length(); if (strLen > 0) { final int newSize = size + strLen; ...
[ "public", "StrBuilder", "insert", "(", "final", "int", "index", ",", "String", "str", ")", "{", "validateIndex", "(", "index", ")", ";", "if", "(", "str", "==", "null", ")", "{", "str", "=", "nullText", ";", "}", "if", "(", "str", "!=", "null", ")"...
Inserts the string into this builder. Inserting null will use the stored null text value. @param index the index to add at, must be valid @param str the string to insert @return this, to enable chaining @throws IndexOutOfBoundsException if the index is invalid
[ "Inserts", "the", "string", "into", "this", "builder", ".", "Inserting", "null", "will", "use", "the", "stored", "null", "text", "value", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1611-L1627
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.insert
public StrBuilder insert(final int index, final char chars[]) { validateIndex(index); if (chars == null) { return insert(index, nullText); } final int len = chars.length; if (len > 0) { ensureCapacity(size + len); System.arraycopy(buffer, index...
java
public StrBuilder insert(final int index, final char chars[]) { validateIndex(index); if (chars == null) { return insert(index, nullText); } final int len = chars.length; if (len > 0) { ensureCapacity(size + len); System.arraycopy(buffer, index...
[ "public", "StrBuilder", "insert", "(", "final", "int", "index", ",", "final", "char", "chars", "[", "]", ")", "{", "validateIndex", "(", "index", ")", ";", "if", "(", "chars", "==", "null", ")", "{", "return", "insert", "(", "index", ",", "nullText", ...
Inserts the character array into this builder. Inserting null will use the stored null text value. @param index the index to add at, must be valid @param chars the char array to insert @return this, to enable chaining @throws IndexOutOfBoundsException if the index is invalid
[ "Inserts", "the", "character", "array", "into", "this", "builder", ".", "Inserting", "null", "will", "use", "the", "stored", "null", "text", "value", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1638-L1651
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.insert
public StrBuilder insert(final int index, final char chars[], final int offset, final int length) { validateIndex(index); if (chars == null) { return insert(index, nullText); } if (offset < 0 || offset > chars.length) { throw new StringIndexOutOfBoundsException("I...
java
public StrBuilder insert(final int index, final char chars[], final int offset, final int length) { validateIndex(index); if (chars == null) { return insert(index, nullText); } if (offset < 0 || offset > chars.length) { throw new StringIndexOutOfBoundsException("I...
[ "public", "StrBuilder", "insert", "(", "final", "int", "index", ",", "final", "char", "chars", "[", "]", ",", "final", "int", "offset", ",", "final", "int", "length", ")", "{", "validateIndex", "(", "index", ")", ";", "if", "(", "chars", "==", "null", ...
Inserts part of the character array into this builder. Inserting null will use the stored null text value. @param index the index to add at, must be valid @param chars the char array to insert @param offset the offset into the character array to start at, must be valid @param length the length of the character arr...
[ "Inserts", "part", "of", "the", "character", "array", "into", "this", "builder", ".", "Inserting", "null", "will", "use", "the", "stored", "null", "text", "value", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1664-L1682
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.delete
public StrBuilder delete(final int startIndex, int endIndex) { endIndex = validateRange(startIndex, endIndex); final int len = endIndex - startIndex; if (len > 0) { deleteImpl(startIndex, endIndex, len); } return this; }
java
public StrBuilder delete(final int startIndex, int endIndex) { endIndex = validateRange(startIndex, endIndex); final int len = endIndex - startIndex; if (len > 0) { deleteImpl(startIndex, endIndex, len); } return this; }
[ "public", "StrBuilder", "delete", "(", "final", "int", "startIndex", ",", "int", "endIndex", ")", "{", "endIndex", "=", "validateRange", "(", "startIndex", ",", "endIndex", ")", ";", "final", "int", "len", "=", "endIndex", "-", "startIndex", ";", "if", "("...
Deletes the characters between the two specified indices. @param startIndex the start index, inclusive, must be valid @param endIndex the end index, exclusive, must be valid except that if too large it is treated as end of string @return this, to enable chaining @throws IndexOutOfBoundsException if the index is inva...
[ "Deletes", "the", "characters", "between", "the", "two", "specified", "indices", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1803-L1810
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.deleteAll
public StrBuilder deleteAll(final String str) { final int len = (str == null ? 0 : str.length()); if (len > 0) { int index = indexOf(str, 0); while (index >= 0) { deleteImpl(index, index + len, len); index = indexOf(str, index); } ...
java
public StrBuilder deleteAll(final String str) { final int len = (str == null ? 0 : str.length()); if (len > 0) { int index = indexOf(str, 0); while (index >= 0) { deleteImpl(index, index + len, len); index = indexOf(str, index); } ...
[ "public", "StrBuilder", "deleteAll", "(", "final", "String", "str", ")", "{", "final", "int", "len", "=", "(", "str", "==", "null", "?", "0", ":", "str", ".", "length", "(", ")", ")", ";", "if", "(", "len", ">", "0", ")", "{", "int", "index", "...
Deletes the string wherever it occurs in the builder. @param str the string to delete, null causes no action @return this, to enable chaining
[ "Deletes", "the", "string", "wherever", "it", "occurs", "in", "the", "builder", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1859-L1869
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.replace
public StrBuilder replace(final int startIndex, int endIndex, final String replaceStr) { endIndex = validateRange(startIndex, endIndex); final int insertLen = (replaceStr == null ? 0 : replaceStr.length()); replaceImpl(startIndex, endIndex, endIndex - startIndex, replaceStr, insertLen); ...
java
public StrBuilder replace(final int startIndex, int endIndex, final String replaceStr) { endIndex = validateRange(startIndex, endIndex); final int insertLen = (replaceStr == null ? 0 : replaceStr.length()); replaceImpl(startIndex, endIndex, endIndex - startIndex, replaceStr, insertLen); ...
[ "public", "StrBuilder", "replace", "(", "final", "int", "startIndex", ",", "int", "endIndex", ",", "final", "String", "replaceStr", ")", "{", "endIndex", "=", "validateRange", "(", "startIndex", ",", "endIndex", ")", ";", "final", "int", "insertLen", "=", "(...
Replaces a portion of the string builder with another string. The length of the inserted string does not have to match the removed length. @param startIndex the start index, inclusive, must be valid @param endIndex the end index, exclusive, must be valid except that if too large it is treated as end of string @param...
[ "Replaces", "a", "portion", "of", "the", "string", "builder", "with", "another", "string", ".", "The", "length", "of", "the", "inserted", "string", "does", "not", "have", "to", "match", "the", "removed", "length", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1951-L1956
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.replaceAll
public StrBuilder replaceAll(final char search, final char replace) { if (search != replace) { for (int i = 0; i < size; i++) { if (buffer[i] == search) { buffer[i] = replace; } } } return this; }
java
public StrBuilder replaceAll(final char search, final char replace) { if (search != replace) { for (int i = 0; i < size; i++) { if (buffer[i] == search) { buffer[i] = replace; } } } return this; }
[ "public", "StrBuilder", "replaceAll", "(", "final", "char", "search", ",", "final", "char", "replace", ")", "{", "if", "(", "search", "!=", "replace", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "i...
Replaces the search character with the replace character throughout the builder. @param search the search character @param replace the replace character @return this, to enable chaining
[ "Replaces", "the", "search", "character", "with", "the", "replace", "character", "throughout", "the", "builder", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1967-L1976
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.replaceFirst
public StrBuilder replaceFirst(final char search, final char replace) { if (search != replace) { for (int i = 0; i < size; i++) { if (buffer[i] == search) { buffer[i] = replace; break; } } } return th...
java
public StrBuilder replaceFirst(final char search, final char replace) { if (search != replace) { for (int i = 0; i < size; i++) { if (buffer[i] == search) { buffer[i] = replace; break; } } } return th...
[ "public", "StrBuilder", "replaceFirst", "(", "final", "char", "search", ",", "final", "char", "replace", ")", "{", "if", "(", "search", "!=", "replace", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", ...
Replaces the first instance of the search character with the replace character in the builder. @param search the search character @param replace the replace character @return this, to enable chaining
[ "Replaces", "the", "first", "instance", "of", "the", "search", "character", "with", "the", "replace", "character", "in", "the", "builder", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1986-L1996
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.replaceAll
public StrBuilder replaceAll(final String searchStr, final String replaceStr) { final int searchLen = (searchStr == null ? 0 : searchStr.length()); if (searchLen > 0) { final int replaceLen = (replaceStr == null ? 0 : replaceStr.length()); int index = indexOf(searchStr, 0); ...
java
public StrBuilder replaceAll(final String searchStr, final String replaceStr) { final int searchLen = (searchStr == null ? 0 : searchStr.length()); if (searchLen > 0) { final int replaceLen = (replaceStr == null ? 0 : replaceStr.length()); int index = indexOf(searchStr, 0); ...
[ "public", "StrBuilder", "replaceAll", "(", "final", "String", "searchStr", ",", "final", "String", "replaceStr", ")", "{", "final", "int", "searchLen", "=", "(", "searchStr", "==", "null", "?", "0", ":", "searchStr", ".", "length", "(", ")", ")", ";", "i...
Replaces the search string with the replace string throughout the builder. @param searchStr the search string, null causes no action to occur @param replaceStr the replace string, null is equivalent to an empty string @return this, to enable chaining
[ "Replaces", "the", "search", "string", "with", "the", "replace", "string", "throughout", "the", "builder", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2006-L2017
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.reverse
public StrBuilder reverse() { if (size == 0) { return this; } final int half = size / 2; final char[] buf = buffer; for (int leftIdx = 0, rightIdx = size - 1; leftIdx < half; leftIdx++,rightIdx--) { final char swap = buf[leftIdx]; buf[leftIdx]...
java
public StrBuilder reverse() { if (size == 0) { return this; } final int half = size / 2; final char[] buf = buffer; for (int leftIdx = 0, rightIdx = size - 1; leftIdx < half; leftIdx++,rightIdx--) { final char swap = buf[leftIdx]; buf[leftIdx]...
[ "public", "StrBuilder", "reverse", "(", ")", "{", "if", "(", "size", "==", "0", ")", "{", "return", "this", ";", "}", "final", "int", "half", "=", "size", "/", "2", ";", "final", "char", "[", "]", "buf", "=", "buffer", ";", "for", "(", "int", "...
Reverses the string builder placing each character in the opposite index. @return this, to enable chaining
[ "Reverses", "the", "string", "builder", "placing", "each", "character", "in", "the", "opposite", "index", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2136-L2149
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.trim
public StrBuilder trim() { if (size == 0) { return this; } int len = size; final char[] buf = buffer; int pos = 0; while (pos < len && buf[pos] <= ' ') { pos++; } while (pos < len && buf[len - 1] <= ' ') { len--; ...
java
public StrBuilder trim() { if (size == 0) { return this; } int len = size; final char[] buf = buffer; int pos = 0; while (pos < len && buf[pos] <= ' ') { pos++; } while (pos < len && buf[len - 1] <= ' ') { len--; ...
[ "public", "StrBuilder", "trim", "(", ")", "{", "if", "(", "size", "==", "0", ")", "{", "return", "this", ";", "}", "int", "len", "=", "size", ";", "final", "char", "[", "]", "buf", "=", "buffer", ";", "int", "pos", "=", "0", ";", "while", "(", ...
Trims the builder by removing characters less than or equal to a space from the beginning and end. @return this, to enable chaining
[ "Trims", "the", "builder", "by", "removing", "characters", "less", "than", "or", "equal", "to", "a", "space", "from", "the", "beginning", "and", "end", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2158-L2178
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.contains
public boolean contains(final char ch) { final char[] thisBuf = buffer; for (int i = 0; i < this.size; i++) { if (thisBuf[i] == ch) { return true; } } return false; }
java
public boolean contains(final char ch) { final char[] thisBuf = buffer; for (int i = 0; i < this.size; i++) { if (thisBuf[i] == ch) { return true; } } return false; }
[ "public", "boolean", "contains", "(", "final", "char", "ch", ")", "{", "final", "char", "[", "]", "thisBuf", "=", "buffer", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "size", ";", "i", "++", ")", "{", "if", "(", "thisBuf...
Checks if the string builder contains the specified char. @param ch the character to find @return true if the builder contains the character
[ "Checks", "if", "the", "string", "builder", "contains", "the", "specified", "char", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2364-L2372
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.indexOf
public int indexOf(final char ch, int startIndex) { startIndex = (startIndex < 0 ? 0 : startIndex); if (startIndex >= size) { return -1; } final char[] thisBuf = buffer; for (int i = startIndex; i < size; i++) { if (thisBuf[i] == ch) { retu...
java
public int indexOf(final char ch, int startIndex) { startIndex = (startIndex < 0 ? 0 : startIndex); if (startIndex >= size) { return -1; } final char[] thisBuf = buffer; for (int i = startIndex; i < size; i++) { if (thisBuf[i] == ch) { retu...
[ "public", "int", "indexOf", "(", "final", "char", "ch", ",", "int", "startIndex", ")", "{", "startIndex", "=", "(", "startIndex", "<", "0", "?", "0", ":", "startIndex", ")", ";", "if", "(", "startIndex", ">=", "size", ")", "{", "return", "-", "1", ...
Searches the string builder to find the first reference to the specified char. @param ch the character to find @param startIndex the index to start at, invalid index rounded to edge @return the first index of the character, or -1 if not found
[ "Searches", "the", "string", "builder", "to", "find", "the", "first", "reference", "to", "the", "specified", "char", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2417-L2429
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.lastIndexOf
public int lastIndexOf(final char ch, int startIndex) { startIndex = (startIndex >= size ? size - 1 : startIndex); if (startIndex < 0) { return -1; } for (int i = startIndex; i >= 0; i--) { if (buffer[i] == ch) { return i; } } ...
java
public int lastIndexOf(final char ch, int startIndex) { startIndex = (startIndex >= size ? size - 1 : startIndex); if (startIndex < 0) { return -1; } for (int i = startIndex; i >= 0; i--) { if (buffer[i] == ch) { return i; } } ...
[ "public", "int", "lastIndexOf", "(", "final", "char", "ch", ",", "int", "startIndex", ")", "{", "startIndex", "=", "(", "startIndex", ">=", "size", "?", "size", "-", "1", ":", "startIndex", ")", ";", "if", "(", "startIndex", "<", "0", ")", "{", "retu...
Searches the string builder to find the last reference to the specified char. @param ch the character to find @param startIndex the index to start at, invalid index rounded to edge @return the last index of the character, or -1 if not found
[ "Searches", "the", "string", "builder", "to", "find", "the", "last", "reference", "to", "the", "specified", "char", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2541-L2552
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.equalsIgnoreCase
public boolean equalsIgnoreCase(final StrBuilder other) { if (this == other) { return true; } if (this.size != other.size) { return false; } final char thisBuf[] = this.buffer; final char otherBuf[] = other.buffer; for (int i = size - 1; i ...
java
public boolean equalsIgnoreCase(final StrBuilder other) { if (this == other) { return true; } if (this.size != other.size) { return false; } final char thisBuf[] = this.buffer; final char otherBuf[] = other.buffer; for (int i = size - 1; i ...
[ "public", "boolean", "equalsIgnoreCase", "(", "final", "StrBuilder", "other", ")", "{", "if", "(", "this", "==", "other", ")", "{", "return", "true", ";", "}", "if", "(", "this", ".", "size", "!=", "other", ".", "size", ")", "{", "return", "false", "...
Checks the contents of this builder against another to see if they contain the same character content ignoring case. @param other the object to check, null returns false @return true if the builders contain the same characters in the same order
[ "Checks", "the", "contents", "of", "this", "builder", "against", "another", "to", "see", "if", "they", "contain", "the", "same", "character", "content", "ignoring", "case", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2766-L2783
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/StrBuilder.java
StrBuilder.validateRange
protected int validateRange(final int startIndex, int endIndex) { if (startIndex < 0) { throw new StringIndexOutOfBoundsException(startIndex); } if (endIndex > size) { endIndex = size; } if (startIndex > endIndex) { throw new StringIndexOutOfBo...
java
protected int validateRange(final int startIndex, int endIndex) { if (startIndex < 0) { throw new StringIndexOutOfBoundsException(startIndex); } if (endIndex > size) { endIndex = size; } if (startIndex > endIndex) { throw new StringIndexOutOfBo...
[ "protected", "int", "validateRange", "(", "final", "int", "startIndex", ",", "int", "endIndex", ")", "{", "if", "(", "startIndex", "<", "0", ")", "{", "throw", "new", "StringIndexOutOfBoundsException", "(", "startIndex", ")", ";", "}", "if", "(", "endIndex",...
Validates parameters defining a range of the builder. @param startIndex the start index, inclusive, must be valid @param endIndex the end index, exclusive, must be valid except that if too large it is treated as end of string @return the new string @throws IndexOutOfBoundsException if the index is invalid
[ "Validates", "parameters", "defining", "a", "range", "of", "the", "builder", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2897-L2908
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java
LazyInitializer.get
@Override public T get() throws ConcurrentException { // use a temporary variable to reduce the number of reads of the // volatile field T result = object; if (result == NO_INIT) { synchronized (this) { result = object; if (result == NO_IN...
java
@Override public T get() throws ConcurrentException { // use a temporary variable to reduce the number of reads of the // volatile field T result = object; if (result == NO_INIT) { synchronized (this) { result = object; if (result == NO_IN...
[ "@", "Override", "public", "T", "get", "(", ")", "throws", "ConcurrentException", "{", "// use a temporary variable to reduce the number of reads of the", "// volatile field", "T", "result", "=", "object", ";", "if", "(", "result", "==", "NO_INIT", ")", "{", "synchron...
Returns the object wrapped by this instance. On first access the object is created. After that it is cached and can be accessed pretty fast. @return the object initialized by this {@code LazyInitializer} @throws ConcurrentException if an error occurred during initialization of the object
[ "Returns", "the", "object", "wrapped", "by", "this", "instance", ".", "On", "first", "access", "the", "object", "is", "created", ".", "After", "that", "it", "is", "cached", "and", "can", "be", "accessed", "pretty", "fast", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/concurrent/LazyInitializer.java#L99-L115
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ThreadUtils.java
ThreadUtils.findThreadById
public static Thread findThreadById(final long threadId, final ThreadGroup threadGroup) { Validate.isTrue(threadGroup != null, "The thread group must not be null"); final Thread thread = findThreadById(threadId); if(thread != null && threadGroup.equals(thread.getThreadGroup())) { ...
java
public static Thread findThreadById(final long threadId, final ThreadGroup threadGroup) { Validate.isTrue(threadGroup != null, "The thread group must not be null"); final Thread thread = findThreadById(threadId); if(thread != null && threadGroup.equals(thread.getThreadGroup())) { ...
[ "public", "static", "Thread", "findThreadById", "(", "final", "long", "threadId", ",", "final", "ThreadGroup", "threadGroup", ")", "{", "Validate", ".", "isTrue", "(", "threadGroup", "!=", "null", ",", "\"The thread group must not be null\"", ")", ";", "final", "T...
Return the active thread with the specified id if it belongs to the specified thread group. @param threadId The thread id @param threadGroup The thread group @return The thread which belongs to a specified thread group and the thread's id match the specified id. {@code null} is returned if no such thread exists @throw...
[ "Return", "the", "active", "thread", "with", "the", "specified", "id", "if", "it", "belongs", "to", "the", "specified", "thread", "group", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ThreadUtils.java#L55-L62
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ThreadUtils.java
ThreadUtils.findThreadById
public static Thread findThreadById(final long threadId, final String threadGroupName) { Validate.isTrue(threadGroupName != null, "The thread group name must not be null"); final Thread thread = findThreadById(threadId); if(thread != null && thread.getThreadGroup() != null && thread.getThread...
java
public static Thread findThreadById(final long threadId, final String threadGroupName) { Validate.isTrue(threadGroupName != null, "The thread group name must not be null"); final Thread thread = findThreadById(threadId); if(thread != null && thread.getThreadGroup() != null && thread.getThread...
[ "public", "static", "Thread", "findThreadById", "(", "final", "long", "threadId", ",", "final", "String", "threadGroupName", ")", "{", "Validate", ".", "isTrue", "(", "threadGroupName", "!=", "null", ",", "\"The thread group name must not be null\"", ")", ";", "fina...
Return the active thread with the specified id if it belongs to a thread group with the specified group name. @param threadId The thread id @param threadGroupName The thread group name @return The threads which belongs to a thread group with the specified group name and the thread's id match the specified id. {@code n...
[ "Return", "the", "active", "thread", "with", "the", "specified", "id", "if", "it", "belongs", "to", "a", "thread", "group", "with", "the", "specified", "group", "name", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ThreadUtils.java#L78-L85
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ThreadUtils.java
ThreadUtils.findThreadsByName
public static Collection<Thread> findThreadsByName(final String threadName, final ThreadGroup threadGroup) { return findThreads(threadGroup, false, new NamePredicate(threadName)); }
java
public static Collection<Thread> findThreadsByName(final String threadName, final ThreadGroup threadGroup) { return findThreads(threadGroup, false, new NamePredicate(threadName)); }
[ "public", "static", "Collection", "<", "Thread", ">", "findThreadsByName", "(", "final", "String", "threadName", ",", "final", "ThreadGroup", "threadGroup", ")", "{", "return", "findThreads", "(", "threadGroup", ",", "false", ",", "new", "NamePredicate", "(", "t...
Return active threads with the specified name if they belong to a specified thread group. @param threadName The thread name @param threadGroup The thread group @return The threads which belongs to a thread group and the thread's name match the specified name, An empty collection is returned if no such thread exists. T...
[ "Return", "active", "threads", "with", "the", "specified", "name", "if", "they", "belong", "to", "a", "specified", "thread", "group", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ThreadUtils.java#L101-L103
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ThreadUtils.java
ThreadUtils.findThreadsByName
public static Collection<Thread> findThreadsByName(final String threadName, final String threadGroupName) { Validate.isTrue(threadName != null, "The thread name must not be null"); Validate.isTrue(threadGroupName != null, "The thread group name must not be null"); final Collection<ThreadGro...
java
public static Collection<Thread> findThreadsByName(final String threadName, final String threadGroupName) { Validate.isTrue(threadName != null, "The thread name must not be null"); Validate.isTrue(threadGroupName != null, "The thread group name must not be null"); final Collection<ThreadGro...
[ "public", "static", "Collection", "<", "Thread", ">", "findThreadsByName", "(", "final", "String", "threadName", ",", "final", "String", "threadGroupName", ")", "{", "Validate", ".", "isTrue", "(", "threadName", "!=", "null", ",", "\"The thread name must not be null...
Return active threads with the specified name if they belong to a thread group with the specified group name. @param threadName The thread name @param threadGroupName The thread group name @return The threads which belongs to a thread group with the specified group name and the thread's name match the specified name, ...
[ "Return", "active", "threads", "with", "the", "specified", "name", "if", "they", "belong", "to", "a", "thread", "group", "with", "the", "specified", "group", "name", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ThreadUtils.java#L119-L135
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ThreadUtils.java
ThreadUtils.findThreadById
public static Thread findThreadById(final long threadId) { final Collection<Thread> result = findThreads(new ThreadIdPredicate(threadId)); return result.isEmpty() ? null : result.iterator().next(); }
java
public static Thread findThreadById(final long threadId) { final Collection<Thread> result = findThreads(new ThreadIdPredicate(threadId)); return result.isEmpty() ? null : result.iterator().next(); }
[ "public", "static", "Thread", "findThreadById", "(", "final", "long", "threadId", ")", "{", "final", "Collection", "<", "Thread", ">", "result", "=", "findThreads", "(", "new", "ThreadIdPredicate", "(", "threadId", ")", ")", ";", "return", "result", ".", "is...
Return the active thread with the specified id. @param threadId The thread id @return The thread with the specified id or {@code null} if no such thread exists @throws IllegalArgumentException if the specified id is zero or negative @throws SecurityException if the current thread cannot access the system thread group...
[ "Return", "the", "active", "thread", "with", "the", "specified", "id", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ThreadUtils.java#L224-L227
train
alexheretic/dynamics
src/main/java/alexh/weak/OptionalWeak.java
OptionalWeak.as
public <T> Optional<T> as(Class<T> type) { return inner.filter(d -> d.is(type)).map(d -> d.as(type)); }
java
public <T> Optional<T> as(Class<T> type) { return inner.filter(d -> d.is(type)).map(d -> d.as(type)); }
[ "public", "<", "T", ">", "Optional", "<", "T", ">", "as", "(", "Class", "<", "T", ">", "type", ")", "{", "return", "inner", ".", "filter", "(", "d", "->", "d", ".", "is", "(", "type", ")", ")", ".", "map", "(", "d", "->", "d", ".", "as", ...
Returns inner value as optional of input type, if the inner value is absent or not an instance of the input type an empty optional is returned @param type cast type @param <T> cast type @return inner value as optional of input type
[ "Returns", "inner", "value", "as", "optional", "of", "input", "type", "if", "the", "inner", "value", "is", "absent", "or", "not", "an", "instance", "of", "the", "input", "type", "an", "empty", "optional", "is", "returned" ]
aa46ca76247d43f399eb9c2037c9b4c2549b3722
https://github.com/alexheretic/dynamics/blob/aa46ca76247d43f399eb9c2037c9b4c2549b3722/src/main/java/alexh/weak/OptionalWeak.java#L89-L91
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
ExceptionUtils.typeErasure
@SuppressWarnings("unchecked") private static <R, T extends Throwable> R typeErasure(final Throwable throwable) throws T { throw (T) throwable; }
java
@SuppressWarnings("unchecked") private static <R, T extends Throwable> R typeErasure(final Throwable throwable) throws T { throw (T) throwable; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "<", "R", ",", "T", "extends", "Throwable", ">", "R", "typeErasure", "(", "final", "Throwable", "throwable", ")", "throws", "T", "{", "throw", "(", "T", ")", "throwable", ";", "}" ]
Claim a Throwable is another Exception type using type erasure. This hides a checked exception from the java compiler, allowing a checked exception to be thrown without having the exception in the method's throw clause.
[ "Claim", "a", "Throwable", "is", "another", "Exception", "type", "using", "type", "erasure", ".", "This", "hides", "a", "checked", "exception", "from", "the", "java", "compiler", "allowing", "a", "checked", "exception", "to", "be", "thrown", "without", "having...
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java#L781-L784
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
ExceptionUtils.hasCause
@GwtIncompatible("incompatible method") public static boolean hasCause(Throwable chain, final Class<? extends Throwable> type) { if (chain instanceof UndeclaredThrowableException) { chain = chain.getCause(); } return type.isInstance(chain); }
java
@GwtIncompatible("incompatible method") public static boolean hasCause(Throwable chain, final Class<? extends Throwable> type) { if (chain instanceof UndeclaredThrowableException) { chain = chain.getCause(); } return type.isInstance(chain); }
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "public", "static", "boolean", "hasCause", "(", "Throwable", "chain", ",", "final", "Class", "<", "?", "extends", "Throwable", ">", "type", ")", "{", "if", "(", "chain", "instanceof", "UndeclaredThrowa...
Does the throwable's causal chain have an immediate or wrapped exception of the given type? @param chain The root of a Throwable causal chain. @param type The exception type to test. @return true, if chain is an instance of type or is an UndeclaredThrowableException wrapping a cause. @since 3.5 @see #wrapAndThrow(Thro...
[ "Does", "the", "throwable", "s", "causal", "chain", "have", "an", "immediate", "or", "wrapped", "exception", "of", "the", "given", "type?" ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java#L830-L837
train
StrongJoshua/libgdx-inGameConsole
src/com/strongjoshua/console/GUIConsole.java
GUIConsole.hasStage
private boolean hasStage (InputProcessor processor) { if (!(processor instanceof InputMultiplexer)) { return processor == stage; } InputMultiplexer im = (InputMultiplexer)processor; SnapshotArray<InputProcessor> ips = im.getProcessors(); for (InputProcessor ip : ips) { if (hasStage(ip)) { return tru...
java
private boolean hasStage (InputProcessor processor) { if (!(processor instanceof InputMultiplexer)) { return processor == stage; } InputMultiplexer im = (InputMultiplexer)processor; SnapshotArray<InputProcessor> ips = im.getProcessors(); for (InputProcessor ip : ips) { if (hasStage(ip)) { return tru...
[ "private", "boolean", "hasStage", "(", "InputProcessor", "processor", ")", "{", "if", "(", "!", "(", "processor", "instanceof", "InputMultiplexer", ")", ")", "{", "return", "processor", "==", "stage", ";", "}", "InputMultiplexer", "im", "=", "(", "InputMultipl...
Compares the given processor to the console's stage. If given a multiplexer, it is iterated through recursively to check all of the multiplexer's processors for comparison. @param processor @return processor == this.stage
[ "Compares", "the", "given", "processor", "to", "the", "console", "s", "stage", ".", "If", "given", "a", "multiplexer", "it", "is", "iterated", "through", "recursively", "to", "check", "all", "of", "the", "multiplexer", "s", "processors", "for", "comparison", ...
f8e3353b7084b686949192d5d415db37dba36df5
https://github.com/StrongJoshua/libgdx-inGameConsole/blob/f8e3353b7084b686949192d5d415db37dba36df5/src/com/strongjoshua/console/GUIConsole.java#L255-L267
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/dict/MorfologikTagger.java
MorfologikTagger.tag
public String tag(final String word, final String posTag) { final List<WordData> wdList = this.dictLookup.lookup(word.toLowerCase()); String newPosTag = null; for (final WordData wd : wdList) { newPosTag = wd.getTag().toString(); } if (newPosTag == null) { newPosTag = posTag; } r...
java
public String tag(final String word, final String posTag) { final List<WordData> wdList = this.dictLookup.lookup(word.toLowerCase()); String newPosTag = null; for (final WordData wd : wdList) { newPosTag = wd.getTag().toString(); } if (newPosTag == null) { newPosTag = posTag; } r...
[ "public", "String", "tag", "(", "final", "String", "word", ",", "final", "String", "posTag", ")", "{", "final", "List", "<", "WordData", ">", "wdList", "=", "this", ".", "dictLookup", ".", "lookup", "(", "word", ".", "toLowerCase", "(", ")", ")", ";", ...
Get the postag for a surface form from a FSA morfologik generated dictionary. @param word the surface form @return the hashmap with the word as key and the postag as value
[ "Get", "the", "postag", "for", "a", "surface", "form", "from", "a", "FSA", "morfologik", "generated", "dictionary", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/dict/MorfologikTagger.java#L67-L77
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.appendIfMissing
private static String appendIfMissing(final String str, final CharSequence suffix, final boolean ignoreCase, final CharSequence... suffixes) { if (str == null || isEmpty(suffix) || endsWith(str, suffix, ignoreCase)) { return str; } if (suffixes != null && suffixes.length > 0) { ...
java
private static String appendIfMissing(final String str, final CharSequence suffix, final boolean ignoreCase, final CharSequence... suffixes) { if (str == null || isEmpty(suffix) || endsWith(str, suffix, ignoreCase)) { return str; } if (suffixes != null && suffixes.length > 0) { ...
[ "private", "static", "String", "appendIfMissing", "(", "final", "String", "str", ",", "final", "CharSequence", "suffix", ",", "final", "boolean", "ignoreCase", ",", "final", "CharSequence", "...", "suffixes", ")", "{", "if", "(", "str", "==", "null", "||", "...
Appends the suffix to the end of the string if the string does not already end with the suffix. @param str The string. @param suffix The suffix to append to the end of the string. @param ignoreCase Indicates whether the compare should ignore case. @param suffixes Additional suffixes that are valid terminators (optiona...
[ "Appends", "the", "suffix", "to", "the", "end", "of", "the", "string", "if", "the", "string", "does", "not", "already", "end", "with", "the", "suffix", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L8766-L8778
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.appendIfMissing
public static String appendIfMissing(final String str, final CharSequence suffix, final CharSequence... suffixes) { return appendIfMissing(str, suffix, false, suffixes); }
java
public static String appendIfMissing(final String str, final CharSequence suffix, final CharSequence... suffixes) { return appendIfMissing(str, suffix, false, suffixes); }
[ "public", "static", "String", "appendIfMissing", "(", "final", "String", "str", ",", "final", "CharSequence", "suffix", ",", "final", "CharSequence", "...", "suffixes", ")", "{", "return", "appendIfMissing", "(", "str", ",", "suffix", ",", "false", ",", "suffi...
Appends the suffix to the end of the string if the string does not already end with any of the suffixes. <pre> StringUtils.appendIfMissing(null, null) = null StringUtils.appendIfMissing("abc", null) = "abc" StringUtils.appendIfMissing("", "xyz") = "xyz" StringUtils.appendIfMissing("abc", "xyz") = "abcxyz" StringUtils....
[ "Appends", "the", "suffix", "to", "the", "end", "of", "the", "string", "if", "the", "string", "does", "not", "already", "end", "with", "any", "of", "the", "suffixes", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L8814-L8816
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.appendIfMissingIgnoreCase
public static String appendIfMissingIgnoreCase(final String str, final CharSequence suffix, final CharSequence... suffixes) { return appendIfMissing(str, suffix, true, suffixes); }
java
public static String appendIfMissingIgnoreCase(final String str, final CharSequence suffix, final CharSequence... suffixes) { return appendIfMissing(str, suffix, true, suffixes); }
[ "public", "static", "String", "appendIfMissingIgnoreCase", "(", "final", "String", "str", ",", "final", "CharSequence", "suffix", ",", "final", "CharSequence", "...", "suffixes", ")", "{", "return", "appendIfMissing", "(", "str", ",", "suffix", ",", "true", ",",...
Appends the suffix to the end of the string if the string does not already end, case insensitive, with any of the suffixes. <pre> StringUtils.appendIfMissingIgnoreCase(null, null) = null StringUtils.appendIfMissingIgnoreCase("abc", null) = "abc" StringUtils.appendIfMissingIgnoreCase("", "xyz") = "xyz" StringUtils.appe...
[ "Appends", "the", "suffix", "to", "the", "end", "of", "the", "string", "if", "the", "string", "does", "not", "already", "end", "case", "insensitive", "with", "any", "of", "the", "suffixes", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L8852-L8854
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.prependIfMissingIgnoreCase
public static String prependIfMissingIgnoreCase(final String str, final CharSequence prefix, final CharSequence... prefixes) { return prependIfMissing(str, prefix, true, prefixes); }
java
public static String prependIfMissingIgnoreCase(final String str, final CharSequence prefix, final CharSequence... prefixes) { return prependIfMissing(str, prefix, true, prefixes); }
[ "public", "static", "String", "prependIfMissingIgnoreCase", "(", "final", "String", "str", ",", "final", "CharSequence", "prefix", ",", "final", "CharSequence", "...", "prefixes", ")", "{", "return", "prependIfMissing", "(", "str", ",", "prefix", ",", "true", ",...
Prepends the prefix to the start of the string if the string does not already start, case insensitive, with any of the prefixes. <pre> StringUtils.prependIfMissingIgnoreCase(null, null) = null StringUtils.prependIfMissingIgnoreCase("abc", null) = "abc" StringUtils.prependIfMissingIgnoreCase("", "xyz") = "xyz" StringUt...
[ "Prepends", "the", "prefix", "to", "the", "start", "of", "the", "string", "if", "the", "string", "does", "not", "already", "start", "case", "insensitive", "with", "any", "of", "the", "prefixes", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L8953-L8955
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/Annotate.java
Annotate.getAllTagsLemmasToNAF
public final void getAllTagsLemmasToNAF(final KAFDocument kaf) { final List<List<WF>> sentences = kaf.getSentences(); for (final List<WF> wfs : sentences) { final List<ixa.kaflib.Span<WF>> tokenSpans = new ArrayList<ixa.kaflib.Span<WF>>(); final String[] tokens = new String[wfs.size()]; for (...
java
public final void getAllTagsLemmasToNAF(final KAFDocument kaf) { final List<List<WF>> sentences = kaf.getSentences(); for (final List<WF> wfs : sentences) { final List<ixa.kaflib.Span<WF>> tokenSpans = new ArrayList<ixa.kaflib.Span<WF>>(); final String[] tokens = new String[wfs.size()]; for (...
[ "public", "final", "void", "getAllTagsLemmasToNAF", "(", "final", "KAFDocument", "kaf", ")", "{", "final", "List", "<", "List", "<", "WF", ">", ">", "sentences", "=", "kaf", ".", "getSentences", "(", ")", ";", "for", "(", "final", "List", "<", "WF", ">...
Add all postags and lemmas to morphofeat attribute. @param kaf the NAF document
[ "Add", "all", "postags", "and", "lemmas", "to", "morphofeat", "attribute", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/Annotate.java#L327-L358
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/Annotate.java
Annotate.getAllTagsLemmasToCoNLL
public final String getAllTagsLemmasToCoNLL(final KAFDocument kaf) { final StringBuilder sb = new StringBuilder(); final List<List<WF>> sentences = kaf.getSentences(); for (final List<WF> wfs : sentences) { final List<ixa.kaflib.Span<WF>> tokenSpans = new ArrayList<ixa.kaflib.Span<WF>>(); final...
java
public final String getAllTagsLemmasToCoNLL(final KAFDocument kaf) { final StringBuilder sb = new StringBuilder(); final List<List<WF>> sentences = kaf.getSentences(); for (final List<WF> wfs : sentences) { final List<ixa.kaflib.Span<WF>> tokenSpans = new ArrayList<ixa.kaflib.Span<WF>>(); final...
[ "public", "final", "String", "getAllTagsLemmasToCoNLL", "(", "final", "KAFDocument", "kaf", ")", "{", "final", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "final", "List", "<", "List", "<", "WF", ">", ">", "sentences", "=", "kaf", "....
Give all lemmas and tags possible for a sentence in conll tabulated format. @param kaf the NAF document @return the output in tabulated format
[ "Give", "all", "lemmas", "and", "tags", "possible", "for", "a", "sentence", "in", "conll", "tabulated", "format", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/Annotate.java#L365-L392
train
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableAnnotatedClass.java
ObjectMappableAnnotatedClass.isSetterForField
private boolean isSetterForField(ExecutableElement setter, VariableElement field) { return setter.getParameters() != null && setter.getParameters().size() == 1 && setter.getParameters().get(0).asType().equals(field.asType()); // TODO inheritance? TypeUtils is applicable? }
java
private boolean isSetterForField(ExecutableElement setter, VariableElement field) { return setter.getParameters() != null && setter.getParameters().size() == 1 && setter.getParameters().get(0).asType().equals(field.asType()); // TODO inheritance? TypeUtils is applicable? }
[ "private", "boolean", "isSetterForField", "(", "ExecutableElement", "setter", ",", "VariableElement", "field", ")", "{", "return", "setter", ".", "getParameters", "(", ")", "!=", "null", "&&", "setter", ".", "getParameters", "(", ")", ".", "size", "(", ")", ...
Checks if the setter method is valid for the given field @param setter The setter method @param field The field @return true if setter works for given field, otherwise false
[ "Checks", "if", "the", "setter", "method", "is", "valid", "for", "the", "given", "field" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableAnnotatedClass.java#L262-L267
train
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java
ObjectMappableProcessor.getSurroundingClass
private TypeElement getSurroundingClass(Element e) throws ProcessingException { if (e.getEnclosingElement().getKind() == ElementKind.CLASS) { return (TypeElement) e.getEnclosingElement(); } throw new ProcessingException(e, "Field %s is not part of a class. Only fields in a class can be annot...
java
private TypeElement getSurroundingClass(Element e) throws ProcessingException { if (e.getEnclosingElement().getKind() == ElementKind.CLASS) { return (TypeElement) e.getEnclosingElement(); } throw new ProcessingException(e, "Field %s is not part of a class. Only fields in a class can be annot...
[ "private", "TypeElement", "getSurroundingClass", "(", "Element", "e", ")", "throws", "ProcessingException", "{", "if", "(", "e", ".", "getEnclosingElement", "(", ")", ".", "getKind", "(", ")", "==", "ElementKind", ".", "CLASS", ")", "{", "return", "(", "Type...
Checks if a Element is in class and returns the TypeElement of the surrounding class @param e The element to check @return The TypeElement of the surroungin class @throws ProcessingException if surround class is not a element
[ "Checks", "if", "a", "Element", "is", "in", "class", "and", "returns", "the", "TypeElement", "of", "the", "surrounding", "class" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java#L71-L79
train
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java
ObjectMappableProcessor.checkAndGetClass
private TypeElement checkAndGetClass(Element e) throws ProcessingException { if (e.getKind() != ElementKind.CLASS) { throw new ProcessingException(e, "%s is annotated with @%s but only classes can be annotated with this annotation", e.toString(), ObjectMappable.class.getSimpleName()); ...
java
private TypeElement checkAndGetClass(Element e) throws ProcessingException { if (e.getKind() != ElementKind.CLASS) { throw new ProcessingException(e, "%s is annotated with @%s but only classes can be annotated with this annotation", e.toString(), ObjectMappable.class.getSimpleName()); ...
[ "private", "TypeElement", "checkAndGetClass", "(", "Element", "e", ")", "throws", "ProcessingException", "{", "if", "(", "e", ".", "getKind", "(", ")", "!=", "ElementKind", ".", "CLASS", ")", "{", "throw", "new", "ProcessingException", "(", "e", ",", "\"%s i...
Check the Element if it's a class and returns the corresponding TypeElement @param e The element to check @return The {@link TypeElement} representing the annotated class @throws ProcessingException If element is not a CLASS
[ "Check", "the", "Element", "if", "it", "s", "a", "class", "and", "returns", "the", "corresponding", "TypeElement" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java#L88-L97
train
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java
ObjectMappableProcessor.generateRxMappingMethod
private FieldSpec generateRxMappingMethod(ObjectMappableAnnotatedClass clazz) { String objectVarName = "item"; String cursorVarName = "cursor"; TypeName elementType = ClassName.get(clazz.getElement().asType()); // new Func1<Cursor, ListsItem>() CodeBlock.Builder initBlockBuilder = CodeBlock.buil...
java
private FieldSpec generateRxMappingMethod(ObjectMappableAnnotatedClass clazz) { String objectVarName = "item"; String cursorVarName = "cursor"; TypeName elementType = ClassName.get(clazz.getElement().asType()); // new Func1<Cursor, ListsItem>() CodeBlock.Builder initBlockBuilder = CodeBlock.buil...
[ "private", "FieldSpec", "generateRxMappingMethod", "(", "ObjectMappableAnnotatedClass", "clazz", ")", "{", "String", "objectVarName", "=", "\"item\"", ";", "String", "cursorVarName", "=", "\"cursor\"", ";", "TypeName", "elementType", "=", "ClassName", ".", "get", "(",...
Generates the field that can be used as RxJava method @param clazz The {@link ObjectMappableAnnotatedClass} @return MethodSpec
[ "Generates", "the", "field", "that", "can", "be", "used", "as", "RxJava", "method" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java#L172-L216
train
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java
ObjectMappableProcessor.generateContentValuesBuilderClass
private TypeSpec generateContentValuesBuilderClass(ObjectMappableAnnotatedClass clazz, String mapperClassName, String className) { String cvVarName = "contentValues"; MethodSpec constructor = MethodSpec.constructorBuilder() .addModifiers(Modifier.PRIVATE) .addStatement("$L = new $T()", c...
java
private TypeSpec generateContentValuesBuilderClass(ObjectMappableAnnotatedClass clazz, String mapperClassName, String className) { String cvVarName = "contentValues"; MethodSpec constructor = MethodSpec.constructorBuilder() .addModifiers(Modifier.PRIVATE) .addStatement("$L = new $T()", c...
[ "private", "TypeSpec", "generateContentValuesBuilderClass", "(", "ObjectMappableAnnotatedClass", "clazz", ",", "String", "mapperClassName", ",", "String", "className", ")", "{", "String", "cvVarName", "=", "\"contentValues\"", ";", "MethodSpec", "constructor", "=", "Metho...
Generates the ContentValues Builder Class @param clazz The class you want to create a builder for @param className The classname @return The Builder class
[ "Generates", "the", "ContentValues", "Builder", "Class" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java#L269-L302
train
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java
ObjectMappableProcessor.generateContentValuesMethod
private MethodSpec generateContentValuesMethod(ObjectMappableAnnotatedClass clazz, String mapperClassName, String className) { ClassName typeName = ClassName.get(getPackageName(clazz), mapperClassName, className); return MethodSpec.methodBuilder("contentValues") .addJavadoc("Get a typesafe Conte...
java
private MethodSpec generateContentValuesMethod(ObjectMappableAnnotatedClass clazz, String mapperClassName, String className) { ClassName typeName = ClassName.get(getPackageName(clazz), mapperClassName, className); return MethodSpec.methodBuilder("contentValues") .addJavadoc("Get a typesafe Conte...
[ "private", "MethodSpec", "generateContentValuesMethod", "(", "ObjectMappableAnnotatedClass", "clazz", ",", "String", "mapperClassName", ",", "String", "className", ")", "{", "ClassName", "typeName", "=", "ClassName", ".", "get", "(", "getPackageName", "(", "clazz", ")...
Generates a static file to get
[ "Generates", "a", "static", "file", "to", "get" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java#L307-L319
train
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java
ObjectMappableProcessor.getPackageName
private String getPackageName(ObjectMappableAnnotatedClass clazz) { PackageElement pkg = elements.getPackageOf(clazz.getElement()); return pkg.isUnnamed() ? "" : pkg.getQualifiedName().toString(); }
java
private String getPackageName(ObjectMappableAnnotatedClass clazz) { PackageElement pkg = elements.getPackageOf(clazz.getElement()); return pkg.isUnnamed() ? "" : pkg.getQualifiedName().toString(); }
[ "private", "String", "getPackageName", "(", "ObjectMappableAnnotatedClass", "clazz", ")", "{", "PackageElement", "pkg", "=", "elements", ".", "getPackageOf", "(", "clazz", ".", "getElement", "(", ")", ")", ";", "return", "pkg", ".", "isUnnamed", "(", ")", "?",...
Get the package name of a certain clazz @param clazz The class you want the packagename for @return The package name
[ "Get", "the", "package", "name", "of", "a", "certain", "clazz" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java#L327-L330
train
sockeqwe/sqlbrite-dao
dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java
Dao.rawQueryOnManyTables
protected QueryBuilder rawQueryOnManyTables(@Nullable final Iterable<String> tables, @NonNull final String sql) { return new QueryBuilder(tables, sql); }
java
protected QueryBuilder rawQueryOnManyTables(@Nullable final Iterable<String> tables, @NonNull final String sql) { return new QueryBuilder(tables, sql); }
[ "protected", "QueryBuilder", "rawQueryOnManyTables", "(", "@", "Nullable", "final", "Iterable", "<", "String", ">", "tables", ",", "@", "NonNull", "final", "String", "sql", ")", "{", "return", "new", "QueryBuilder", "(", "tables", ",", "sql", ")", ";", "}" ]
Creates a raw query and enables auto updates for the given tables @param tables The affected table. updates get triggered if the observed tables changes. Use {@code null} or {@link #rawQuery(String)} if you don't want to register for automatic updates @param sql The sql query statement @return Observable of this query
[ "Creates", "a", "raw", "query", "and", "enables", "auto", "updates", "for", "the", "given", "tables" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java#L169-L172
train
sockeqwe/sqlbrite-dao
dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java
Dao.executeQuery
private QueryObservable executeQuery(QueryBuilder queryBuilder) { // Raw query properties as default String sql = queryBuilder.rawStatement; Iterable<String> affectedTables = queryBuilder.rawStatementAffectedTables; // If SqlFinishedStatement is set then use that one if (queryBuilder.statement != ...
java
private QueryObservable executeQuery(QueryBuilder queryBuilder) { // Raw query properties as default String sql = queryBuilder.rawStatement; Iterable<String> affectedTables = queryBuilder.rawStatementAffectedTables; // If SqlFinishedStatement is set then use that one if (queryBuilder.statement != ...
[ "private", "QueryObservable", "executeQuery", "(", "QueryBuilder", "queryBuilder", ")", "{", "// Raw query properties as default", "String", "sql", "=", "queryBuilder", ".", "rawStatement", ";", "Iterable", "<", "String", ">", "affectedTables", "=", "queryBuilder", ".",...
Executes the a query
[ "Executes", "the", "a", "query" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java#L200-L222
train
sockeqwe/sqlbrite-dao
dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java
Dao.insert
@CheckResult protected Observable<Long> insert(final String table, final ContentValues contentValues) { return Observable.defer(new Func0<Observable<Long>>() { @Override public Observable<Long> call() { return Observable.just(db.insert(table, contentValues)); } }); }
java
@CheckResult protected Observable<Long> insert(final String table, final ContentValues contentValues) { return Observable.defer(new Func0<Observable<Long>>() { @Override public Observable<Long> call() { return Observable.just(db.insert(table, contentValues)); } }); }
[ "@", "CheckResult", "protected", "Observable", "<", "Long", ">", "insert", "(", "final", "String", "table", ",", "final", "ContentValues", "contentValues", ")", "{", "return", "Observable", ".", "defer", "(", "new", "Func0", "<", "Observable", "<", "Long", "...
Insert a row into the given table @param table the table name @param contentValues The content values @return An <b>deferred</b> observable with the row Id of the new inserted row
[ "Insert", "a", "row", "into", "the", "given", "table" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java#L231-L238
train
sockeqwe/sqlbrite-dao
dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java
Dao.delete
@CheckResult protected Observable<Integer> delete(@NonNull final String table) { return delete(table, null); }
java
@CheckResult protected Observable<Integer> delete(@NonNull final String table) { return delete(table, null); }
[ "@", "CheckResult", "protected", "Observable", "<", "Integer", ">", "delete", "(", "@", "NonNull", "final", "String", "table", ")", "{", "return", "delete", "(", "table", ",", "null", ")", ";", "}" ]
Deletes all rows from a table @param table The table to delete @return <b>deferred</b> Observable with the number of deleted rows
[ "Deletes", "all", "rows", "from", "a", "table" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java#L305-L307
train
sockeqwe/sqlbrite-dao
dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java
Dao.delete
@CheckResult protected Observable<Integer> delete(@NonNull final String table, @Nullable final String whereClause, @Nullable final String... whereArgs) { return Observable.defer(new Func0<Observable<Integer>>() { @Override public Observable<Integer> call() { return Observable.just(db.delet...
java
@CheckResult protected Observable<Integer> delete(@NonNull final String table, @Nullable final String whereClause, @Nullable final String... whereArgs) { return Observable.defer(new Func0<Observable<Integer>>() { @Override public Observable<Integer> call() { return Observable.just(db.delet...
[ "@", "CheckResult", "protected", "Observable", "<", "Integer", ">", "delete", "(", "@", "NonNull", "final", "String", "table", ",", "@", "Nullable", "final", "String", "whereClause", ",", "@", "Nullable", "final", "String", "...", "whereArgs", ")", "{", "ret...
Delete data from a table @param table The table name @param whereClause the where clause @param whereArgs the where clause arguments @return <b>deferred</b> Observable with the number of deleted rows
[ "Delete", "data", "from", "a", "table" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/Dao.java#L317-L325
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/LocaleUtils.java
LocaleUtils.parseLocale
private static Locale parseLocale(final String str) { if (isISO639LanguageCode(str)) { return new Locale(str); } final String[] segments = str.split("_", -1); final String language = segments[0]; if (segments.length == 2) { final String country = segments...
java
private static Locale parseLocale(final String str) { if (isISO639LanguageCode(str)) { return new Locale(str); } final String[] segments = str.split("_", -1); final String language = segments[0]; if (segments.length == 2) { final String country = segments...
[ "private", "static", "Locale", "parseLocale", "(", "final", "String", "str", ")", "{", "if", "(", "isISO639LanguageCode", "(", "str", ")", ")", "{", "return", "new", "Locale", "(", "str", ")", ";", "}", "final", "String", "[", "]", "segments", "=", "st...
Tries to parse a locale from the given String. @param str the String to parse a locale from. @return a Locale instance parsed from the given String. @throws IllegalArgumentException if the given String can not be parsed.
[ "Tries", "to", "parse", "a", "locale", "from", "the", "given", "String", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/LocaleUtils.java#L139-L162
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/LocaleUtils.java
LocaleUtils.isISO639LanguageCode
private static boolean isISO639LanguageCode(final String str) { return StringUtils.isAllLowerCase(str) && (str.length() == 2 || str.length() == 3); }
java
private static boolean isISO639LanguageCode(final String str) { return StringUtils.isAllLowerCase(str) && (str.length() == 2 || str.length() == 3); }
[ "private", "static", "boolean", "isISO639LanguageCode", "(", "final", "String", "str", ")", "{", "return", "StringUtils", ".", "isAllLowerCase", "(", "str", ")", "&&", "(", "str", ".", "length", "(", ")", "==", "2", "||", "str", ".", "length", "(", ")", ...
Checks whether the given String is a ISO 639 compliant language code. @param str the String to check. @return true, if the given String is a ISO 639 compliant language code.
[ "Checks", "whether", "the", "given", "String", "is", "a", "ISO", "639", "compliant", "language", "code", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/LocaleUtils.java#L170-L172
train
sockeqwe/sqlbrite-dao
objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ModifierUtils.java
ModifierUtils.compareModifierVisibility
public static int compareModifierVisibility(Element a, Element b) { // a better if (a.getModifiers().contains(Modifier.PUBLIC) && !b.getModifiers().contains(Modifier.PUBLIC)) { return -1; } if (isDefaultModifier(a.getModifiers()) && !isDefaultModifier(b.getModifiers())) { return -1; }...
java
public static int compareModifierVisibility(Element a, Element b) { // a better if (a.getModifiers().contains(Modifier.PUBLIC) && !b.getModifiers().contains(Modifier.PUBLIC)) { return -1; } if (isDefaultModifier(a.getModifiers()) && !isDefaultModifier(b.getModifiers())) { return -1; }...
[ "public", "static", "int", "compareModifierVisibility", "(", "Element", "a", ",", "Element", "b", ")", "{", "// a better", "if", "(", "a", ".", "getModifiers", "(", ")", ".", "contains", "(", "Modifier", ".", "PUBLIC", ")", "&&", "!", "b", ".", "getModif...
Compare the modifier of two elements @return -1 if element a has better visibility, 0 if both have the same visibility, +1 if b has the better visibility. The "best" visibility is PUBLIC
[ "Compare", "the", "modifier", "of", "two", "elements" ]
8d02b76f00bd2f8997a58d33146b98b2eec35452
https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ModifierUtils.java#L25-L57
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/eval/POSEvaluate.java
POSEvaluate.evaluate
public final void evaluate() { final POSEvaluator evaluator = new POSEvaluator(this.posTagger); try { evaluator.evaluate(this.testSamples); } catch (IOException e) { e.printStackTrace(); } System.out.println(evaluator.getWordAccuracy()); }
java
public final void evaluate() { final POSEvaluator evaluator = new POSEvaluator(this.posTagger); try { evaluator.evaluate(this.testSamples); } catch (IOException e) { e.printStackTrace(); } System.out.println(evaluator.getWordAccuracy()); }
[ "public", "final", "void", "evaluate", "(", ")", "{", "final", "POSEvaluator", "evaluator", "=", "new", "POSEvaluator", "(", "this", ".", "posTagger", ")", ";", "try", "{", "evaluator", ".", "evaluate", "(", "this", ".", "testSamples", ")", ";", "}", "ca...
Evaluate word accuracy.
[ "Evaluate", "word", "accuracy", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/eval/POSEvaluate.java#L96-L104
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/pos/eval/POSEvaluate.java
POSEvaluate.detailEvaluate
public final void detailEvaluate() { final List<EvaluationMonitor<POSSample>> listeners = new LinkedList<EvaluationMonitor<POSSample>>(); final POSTaggerFineGrainedReportListener detailedFListener = new POSTaggerFineGrainedReportListener( System.out); listeners.add(detailedFListener); final POSE...
java
public final void detailEvaluate() { final List<EvaluationMonitor<POSSample>> listeners = new LinkedList<EvaluationMonitor<POSSample>>(); final POSTaggerFineGrainedReportListener detailedFListener = new POSTaggerFineGrainedReportListener( System.out); listeners.add(detailedFListener); final POSE...
[ "public", "final", "void", "detailEvaluate", "(", ")", "{", "final", "List", "<", "EvaluationMonitor", "<", "POSSample", ">", ">", "listeners", "=", "new", "LinkedList", "<", "EvaluationMonitor", "<", "POSSample", ">", ">", "(", ")", ";", "final", "POSTagger...
Detail evaluation of a model, outputting the report a file.
[ "Detail", "evaluation", "of", "a", "model", "outputting", "the", "report", "a", "file", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/eval/POSEvaluate.java#L109-L122
train
alexheretic/dynamics
src/main/java/alexh/weak/XmlDynamic.java
XmlDynamic.streamChildNodes
private static Stream<Node> streamChildNodes(Node node) { int children = node.getChildNodes().getLength(); Node firstChild = node.getFirstChild(); if (firstChild == null) return Stream.empty(); return Stream.iterate(firstChild, prev -> prev != null ? prev.getNextSibling() : null) ...
java
private static Stream<Node> streamChildNodes(Node node) { int children = node.getChildNodes().getLength(); Node firstChild = node.getFirstChild(); if (firstChild == null) return Stream.empty(); return Stream.iterate(firstChild, prev -> prev != null ? prev.getNextSibling() : null) ...
[ "private", "static", "Stream", "<", "Node", ">", "streamChildNodes", "(", "Node", "node", ")", "{", "int", "children", "=", "node", ".", "getChildNodes", "(", ")", ".", "getLength", "(", ")", ";", "Node", "firstChild", "=", "node", ".", "getFirstChild", ...
Needs to be thread-safe, childNodes NodeList is not!
[ "Needs", "to", "be", "thread", "-", "safe", "childNodes", "NodeList", "is", "not!" ]
aa46ca76247d43f399eb9c2037c9b4c2549b3722
https://github.com/alexheretic/dynamics/blob/aa46ca76247d43f399eb9c2037c9b4c2549b3722/src/main/java/alexh/weak/XmlDynamic.java#L72-L79
train
alexheretic/dynamics
src/main/java/alexh/weak/XmlDynamic.java
XmlDynamic.streamAttributes
private static Stream<Node> streamAttributes(Node node) { final NamedNodeMap attributes = node.getAttributes(); if (attributes == null) return Stream.empty(); return IntStream.range(0, attributes.getLength()).mapToObj(attributes::item); }
java
private static Stream<Node> streamAttributes(Node node) { final NamedNodeMap attributes = node.getAttributes(); if (attributes == null) return Stream.empty(); return IntStream.range(0, attributes.getLength()).mapToObj(attributes::item); }
[ "private", "static", "Stream", "<", "Node", ">", "streamAttributes", "(", "Node", "node", ")", "{", "final", "NamedNodeMap", "attributes", "=", "node", ".", "getAttributes", "(", ")", ";", "if", "(", "attributes", "==", "null", ")", "return", "Stream", "."...
Needs to be thread-safe
[ "Needs", "to", "be", "thread", "-", "safe" ]
aa46ca76247d43f399eb9c2037c9b4c2549b3722
https://github.com/alexheretic/dynamics/blob/aa46ca76247d43f399eb9c2037c9b4c2549b3722/src/main/java/alexh/weak/XmlDynamic.java#L82-L86
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/concurrent/AbstractCircuitBreaker.java
AbstractCircuitBreaker.changeState
protected void changeState(final State newState) { if (state.compareAndSet(newState.oppositeState(), newState)) { changeSupport.firePropertyChange(PROPERTY_NAME, !isOpen(newState), isOpen(newState)); } }
java
protected void changeState(final State newState) { if (state.compareAndSet(newState.oppositeState(), newState)) { changeSupport.firePropertyChange(PROPERTY_NAME, !isOpen(newState), isOpen(newState)); } }
[ "protected", "void", "changeState", "(", "final", "State", "newState", ")", "{", "if", "(", "state", ".", "compareAndSet", "(", "newState", ".", "oppositeState", "(", ")", ",", "newState", ")", ")", "{", "changeSupport", ".", "firePropertyChange", "(", "PROP...
Changes the internal state of this circuit breaker. If there is actually a change of the state value, all registered change listeners are notified. @param newState the new state to be set
[ "Changes", "the", "internal", "state", "of", "this", "circuit", "breaker", ".", "If", "there", "is", "actually", "a", "change", "of", "the", "state", "value", "all", "registered", "change", "listeners", "are", "notified", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/concurrent/AbstractCircuitBreaker.java#L112-L116
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/WordUtils.java
WordUtils.isDelimiter
private static boolean isDelimiter(final char ch, final char[] delimiters) { if (delimiters == null) { return CharUtils.isWhitespace(ch); } for (final char delimiter : delimiters) { if (ch == delimiter) { return true; } } return...
java
private static boolean isDelimiter(final char ch, final char[] delimiters) { if (delimiters == null) { return CharUtils.isWhitespace(ch); } for (final char delimiter : delimiters) { if (ch == delimiter) { return true; } } return...
[ "private", "static", "boolean", "isDelimiter", "(", "final", "char", "ch", ",", "final", "char", "[", "]", "delimiters", ")", "{", "if", "(", "delimiters", "==", "null", ")", "{", "return", "CharUtils", ".", "isWhitespace", "(", "ch", ")", ";", "}", "f...
Is the character a delimiter. @param ch the character to check @param delimiters the delimiters @return true if it is a delimiter
[ "Is", "the", "character", "a", "delimiter", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/WordUtils.java#L743-L753
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/concurrent/AtomicInitializer.java
AtomicInitializer.get
@Override public T get() throws ConcurrentException { T result = reference.get(); if (result == null) { result = initialize(); if (!reference.compareAndSet(null, result)) { // another thread has initialized the reference result = reference.get...
java
@Override public T get() throws ConcurrentException { T result = reference.get(); if (result == null) { result = initialize(); if (!reference.compareAndSet(null, result)) { // another thread has initialized the reference result = reference.get...
[ "@", "Override", "public", "T", "get", "(", ")", "throws", "ConcurrentException", "{", "T", "result", "=", "reference", ".", "get", "(", ")", ";", "if", "(", "result", "==", "null", ")", "{", "result", "=", "initialize", "(", ")", ";", "if", "(", "...
Returns the object managed by this initializer. The object is created if it is not available yet and stored internally. This method always returns the same object. @return the object created by this {@code AtomicInitializer} @throws ConcurrentException if an error occurred during initialization of the object
[ "Returns", "the", "object", "managed", "by", "this", "initializer", ".", "The", "object", "is", "created", "if", "it", "is", "not", "available", "yet", "and", "stored", "internally", ".", "This", "method", "always", "returns", "the", "same", "object", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/concurrent/AtomicInitializer.java#L82-L95
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/lemma/StatisticalLemmatizer.java
StatisticalLemmatizer.getMorphemes
public final List<Morpheme> getMorphemes(final String[] tokens, final String[] posTags) { final List<String> lemmas = lemmatize(tokens, posTags); final List<Morpheme> morphemes = getMorphemesFromStrings(tokens, posTags, lemmas); return morphemes; }
java
public final List<Morpheme> getMorphemes(final String[] tokens, final String[] posTags) { final List<String> lemmas = lemmatize(tokens, posTags); final List<Morpheme> morphemes = getMorphemesFromStrings(tokens, posTags, lemmas); return morphemes; }
[ "public", "final", "List", "<", "Morpheme", ">", "getMorphemes", "(", "final", "String", "[", "]", "tokens", ",", "final", "String", "[", "]", "posTags", ")", "{", "final", "List", "<", "String", ">", "lemmas", "=", "lemmatize", "(", "tokens", ",", "po...
Get lemmas from a tokenized and pos tagged sentence. @param tokens the tokenized sentence @param posTags the pos tags of the sentence @return a list of {@code Morpheme} objects containing morphological info
[ "Get", "lemmas", "from", "a", "tokenized", "and", "pos", "tagged", "sentence", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/lemma/StatisticalLemmatizer.java#L91-L95
train
ixa-ehu/ixa-pipe-pos
src/main/java/eus/ixa/ixa/pipe/lemma/StatisticalLemmatizer.java
StatisticalLemmatizer.lemmatize
public List<String> lemmatize(String[] tokens, String[] posTags) { String[] annotatedLemmas = lemmatizer.lemmatize(tokens, posTags); String[] decodedLemmas = lemmatizer.decodeLemmas(tokens, annotatedLemmas); final List<String> lemmas = new ArrayList<String>(Arrays.asList(decodedLemmas)); return lemmas; ...
java
public List<String> lemmatize(String[] tokens, String[] posTags) { String[] annotatedLemmas = lemmatizer.lemmatize(tokens, posTags); String[] decodedLemmas = lemmatizer.decodeLemmas(tokens, annotatedLemmas); final List<String> lemmas = new ArrayList<String>(Arrays.asList(decodedLemmas)); return lemmas; ...
[ "public", "List", "<", "String", ">", "lemmatize", "(", "String", "[", "]", "tokens", ",", "String", "[", "]", "posTags", ")", "{", "String", "[", "]", "annotatedLemmas", "=", "lemmatizer", ".", "lemmatize", "(", "tokens", ",", "posTags", ")", ";", "St...
Produce lemmas from a tokenized sentence and its postags. @param tokens the tokens @param posTags the pos tags @return the lemmas
[ "Produce", "lemmas", "from", "a", "tokenized", "sentence", "and", "its", "postags", "." ]
083c986103f95ae8063b8ddc89a2caa8047d29b9
https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/lemma/StatisticalLemmatizer.java#L103-L108
train
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java
EventListenerSupport.initializeTransientFields
private void initializeTransientFields(final Class<L> listenerInterface, final ClassLoader classLoader) { @SuppressWarnings("unchecked") // Will throw CCE here if not correct final L[] array = (L[]) Array.newInstance(listenerInterface, 0); this.prototypeArray = array; createProxy...
java
private void initializeTransientFields(final Class<L> listenerInterface, final ClassLoader classLoader) { @SuppressWarnings("unchecked") // Will throw CCE here if not correct final L[] array = (L[]) Array.newInstance(listenerInterface, 0); this.prototypeArray = array; createProxy...
[ "private", "void", "initializeTransientFields", "(", "final", "Class", "<", "L", ">", "listenerInterface", ",", "final", "ClassLoader", "classLoader", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "// Will throw CCE here if not correct", "final", "L", ...
Initialize transient fields. @param listenerInterface the class of the listener interface @param classLoader the class loader to be used
[ "Initialize", "transient", "fields", "." ]
9e2dfbbda3668cfa5d935fe76479d1426c294504
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java#L291-L297
train