public interface StringMapFunctions extends Column<String>
This code was developed as part of Apache Commons Text.
Modifier and Type | Method and Description |
---|---|
default StringColumn |
abbreviate(int maxWidth)
Abbreviates a String using ellipses.
|
default StringColumn |
capitalize()
Capitalizes each String changing the first character of each to title case as per
Character.toTitleCase(int) , as if in a sentence. |
default StringColumn |
commonPrefix(Column<String> column2) |
default StringColumn |
commonSuffix(Column<String> column2) |
default StringColumn |
concatenate(Column... stringColumns)
Return a copy of this column with the corresponding value of each column argument appended to
each element.
|
default StringColumn |
concatenate(Object... stringsToAppend)
Return a copy of this column with the given string appended to each element
|
default DoubleColumn |
countTokens(String separator) |
default DoubleColumn |
distance(Column<String> column2)
Returns a column containing the levenshtein distance between the two given string columns
|
default StringColumn |
format(String formatString) |
default StringColumn |
join(String separator,
Column... columns)
Return a copy of this column with the given string appended
|
default DoubleColumn |
length()
Returns a column containing the character length of each string in this column The returned
column is the same size as the original
|
default StringColumn |
lowerCase() |
default StringColumn |
padEnd(int minLength,
char padChar) |
default StringColumn |
padStart(int minLength,
char padChar) |
default DoubleColumn |
parseDouble()
Returns an Double containing all the values of this string column as doubles, assuming all the
values are stringified doubles in the first place.
|
default FloatColumn |
parseFloat()
Returns an Float containing all the values of this string column as floats, assuming all the
values are stringified floats in the first place.
|
default IntColumn |
parseInt()
Returns an IntColumn containing all the values of this string column as integers, assuming all
the values are stringified ints in the first place.
|
default StringColumn |
repeat(int times)
Repeats each the column's values elementwise, concatinating the results into a new StringColumn
|
default StringColumn |
replaceAll(String[] regexArray,
String replacement)
Creates a new column, replacing each string in this column with a new string formed by
replacing any substring that matches the regex
|
default StringColumn |
replaceAll(String regex,
String replacement) |
default StringColumn |
replaceFirst(String regex,
String replacement) |
default StringColumn |
substring(int start)
Returns a column containing the substrings from start to the end of the input
|
default StringColumn |
substring(int start,
int end) |
default StringColumn |
tokenizeAndRemoveDuplicates(String separator) |
default StringColumn |
tokenizeAndSort()
Splits on Whitespace and returns the lexicographically sorted result.
|
default StringColumn |
tokenizeAndSort(String separator) |
default StringColumn |
tokens(String separator)
Returns a column of arbitrary size containing each token in this column, where a token is
defined using the given separator.
|
default StringColumn |
trim() |
default StringColumn |
uniqueTokens(String separator)
Returns a column of arbitrary size containing each unique token in this column, where a token
is defined using the given separator, and uniqueness is calculated across the entire column
|
default StringColumn |
upperCase() |
allMatch, anyMatch, append, append, append, appendCell, appendCell, appendMissing, appendObj, asBytes, asList, asObjectArray, asStringColumn, byteSize, clear, columnWidth, contains, copy, count, count, countMissing, countUnique, emptyCopy, emptyCopy, filter, first, get, getString, getUnformattedString, inRange, interpolate, isEmpty, isMissing, isMissing, isNotMissing, lag, last, lead, map, map, mapInto, max, max, min, min, name, noneMatch, print, reduce, reduce, removeMissing, rolling, rowComparator, sampleN, sampleX, set, set, set, set, set, set, setMissing, setMissingTo, setName, size, sortAscending, sortDescending, sorted, subset, summary, title, type, unique, where
forEach, iterator, spliterator
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
default StringColumn upperCase()
default StringColumn lowerCase()
default StringColumn capitalize()
Character.toTitleCase(int)
, as if in a sentence. No other characters are changed.
capitalize(null) = null capitalize("") = "" capitalize("cat") = "Cat" capitalize("cAt") = "CAt" capitalize("'cat'") = "'cat'"
default StringColumn repeat(int times)
times
- The number of repeat desired
repeat("", 2) = "" repeat("cat", 3) = "catcatcat"
default StringColumn trim()
default StringColumn replaceAll(String regex, String replacement)
default StringColumn replaceFirst(String regex, String replacement)
default StringColumn substring(int start, int end)
default StringColumn substring(int start)
StringIndexOutOfBoundsException
- if any string in the column is shorter than
startdefault StringColumn abbreviate(int maxWidth)
maxWidth
- the maximum width of the resulting strings, including the elipses.default StringColumn format(String formatString)
default IntColumn parseInt()
default DoubleColumn parseDouble()
default FloatColumn parseFloat()
default StringColumn padEnd(int minLength, char padChar)
default StringColumn padStart(int minLength, char padChar)
default StringColumn commonPrefix(Column<String> column2)
default StringColumn commonSuffix(Column<String> column2)
default DoubleColumn distance(Column<String> column2)
default StringColumn join(String separator, Column... columns)
columns
- the column to appenddefault StringColumn concatenate(Object... stringsToAppend)
stringsToAppend
- the stringified objects to appenddefault StringColumn concatenate(Column... stringColumns)
stringColumns
- the string columns to appenddefault StringColumn replaceAll(String[] regexArray, String replacement)
regexArray
- the regex array to replacereplacement
- the replacement arraydefault StringColumn tokenizeAndSort(String separator)
default DoubleColumn countTokens(String separator)
default StringColumn uniqueTokens(String separator)
NOTE: Unlike other map functions, this method produces a column whose size may be different from the source, so they cannot safely be combined in a table.
separator
- the delimiter used in the tokenizing operationdefault StringColumn tokens(String separator)
NOTE: Unlike other map functions, this method produces a column whose size may be different from the source, so they cannot safely be combined in a table.
separator
- the delimiter used in the tokenizing operationdefault DoubleColumn length()
default StringColumn tokenizeAndSort()
StringColumn
default StringColumn tokenizeAndRemoveDuplicates(String separator)
Copyright © 2020. All rights reserved.