public interface BasedSequence extends CharSequence, Comparable<CharSequence>
| Modifier and Type | Interface and Description |
|---|---|
static class |
BasedSequence.EmptyBasedSequence |
| Modifier and Type | Field and Description |
|---|---|
static BasedSequence[] |
EMPTY_ARRAY |
static List<BasedSequence> |
EMPTY_LIST |
static BasedSequence[] |
EMPTY_SEGMENTS |
static BasedSequence |
EOL |
static char |
EOL_CHAR |
static char |
EOL_CHAR1 |
static char |
EOL_CHAR2 |
static String |
EOL_CHARS |
static BasedSequence |
NULL |
static BasedSequence |
SPACE |
static int |
SPLIT_INCLUDE_DELIM_PARTS |
static int |
SPLIT_INCLUDE_DELIMS |
static int |
SPLIT_SKIP_EMPTY |
static int |
SPLIT_TRIM_PARTS |
static int |
SPLIT_TRIM_SKIP_EMPTY |
static String |
WHITESPACE_CHARS |
static String |
WHITESPACE_NBSP_CHARS |
static String |
WHITESPACE_NO_EOL_CHARS |
| Modifier and Type | Method and Description |
|---|---|
BasedSequence |
append(CharSequence... others) |
BasedSequence |
appendTo(StringBuilder out) |
BasedSequence |
appendTo(StringBuilder out,
int start) |
BasedSequence |
appendTo(StringBuilder out,
int start,
int end) |
BasedSequence |
baseSubSequence(int start)
Get a portion of the original sequence that this sequence is based on
|
BasedSequence |
baseSubSequence(int start,
int end)
Get a portion of the original sequence that this sequence is based on
|
boolean |
containsAllOf(BasedSequence other)
start/end offset based containment, not textual
|
boolean |
containsSomeOf(BasedSequence other)
start/end offset based containment, not textual
|
int |
countChars(char c) |
int |
countChars(char c,
int startIndex) |
int |
countChars(char c,
int startIndex,
int endIndex) |
int |
countChars(CharSequence chars) |
int |
countChars(CharSequence chars,
int startIndex) |
int |
countChars(CharSequence chars,
int startIndex,
int endIndex) |
int |
countCharsReversed(char c) |
int |
countCharsReversed(char c,
int startIndex) |
int |
countCharsReversed(char c,
int startIndex,
int endIndex) |
int |
countCharsReversed(CharSequence chars) |
int |
countCharsReversed(CharSequence chars,
int startIndex) |
int |
countCharsReversed(CharSequence chars,
int startIndex,
int endIndex) |
int |
countLeading(char c) |
int |
countLeading(char c,
int startIndex) |
int |
countLeading(char c,
int startIndex,
int endIndex) |
int |
countLeading(CharSequence chars)
Count leading/trailing characters of this sequence
|
int |
countLeading(CharSequence chars,
int startIndex) |
int |
countLeading(CharSequence chars,
int startIndex,
int endIndex) |
int |
countLeadingColumns(int startColumn,
CharSequence chars) |
int |
countLeadingNot(char c) |
int |
countLeadingNot(char c,
int startIndex) |
int |
countLeadingNot(char c,
int startIndex,
int endIndex) |
int |
countLeadingNot(CharSequence chars) |
int |
countLeadingNot(CharSequence chars,
int startIndex) |
int |
countLeadingNot(CharSequence chars,
int startIndex,
int endIndex) |
int |
countNotChars(char c) |
int |
countNotChars(char c,
int startIndex) |
int |
countNotChars(char c,
int startIndex,
int endIndex) |
int |
countNotChars(CharSequence chars) |
int |
countNotChars(CharSequence chars,
int startIndex) |
int |
countNotChars(CharSequence chars,
int startIndex,
int endIndex) |
int |
countNotCharsReversed(char c) |
int |
countNotCharsReversed(char c,
int startIndex) |
int |
countNotCharsReversed(char c,
int startIndex,
int endIndex) |
int |
countNotCharsReversed(CharSequence chars) |
int |
countNotCharsReversed(CharSequence chars,
int startIndex) |
int |
countNotCharsReversed(CharSequence chars,
int startIndex,
int endIndex) |
int |
countTrailing(char c) |
int |
countTrailing(char c,
int startIndex) |
int |
countTrailing(char c,
int startIndex,
int endIndex) |
int |
countTrailing(CharSequence chars) |
int |
countTrailing(CharSequence chars,
int startIndex) |
int |
countTrailing(CharSequence chars,
int startIndex,
int endIndex) |
int |
countTrailingNot(char c) |
int |
countTrailingNot(char c,
int startIndex) |
int |
countTrailingNot(char c,
int startIndex,
int endIndex) |
int |
countTrailingNot(CharSequence chars) |
int |
countTrailingNot(CharSequence chars,
int startIndex) |
int |
countTrailingNot(CharSequence chars,
int startIndex,
int endIndex) |
char |
endCharAt(int index)
Convenience method to get characters offset from end of sequence.
|
int |
endOfDelimitedBy(CharSequence s,
int index)
Find start/end region in this sequence delimited by any characters in argument or the CharSequence
|
int |
endOfDelimitedByAny(CharSequence s,
int index) |
int |
endOfDelimitedByAnyNot(CharSequence s,
int index) |
int |
endOfLine(int index)
Get the offset of the end of line at given index, end of line delimited by \n or any of \n \r \r\n for Any methods.
|
int |
endOfLineAnyEOL(int index) |
BasedSequence |
endSequence(int start)
Convenience method to get characters offset from end of sequence.
|
BasedSequence |
endSequence(int start,
int end)
Convenience method to get characters offset from end of sequence.
|
boolean |
endsWith(CharSequence suffix)
test if this sequence ends with given characters
|
boolean |
endsWith(CharSequence suffix,
boolean ignoreCase)
test if this sequence ends with given characters
|
boolean |
endsWithIgnoreCase(CharSequence suffix)
test if this sequence ends with given characters, ignoring case differences
|
int |
eolLength()
Get the length of EOL character at the end of this sequence, if present.
|
int |
eolLength(int eolStart)
Get the length of EOL character at the given index of this sequence, if present.
|
boolean |
equals(Object other,
boolean ignoreCase)
Test the sequence for a match to another CharSequence
|
boolean |
equalsIgnoreCase(CharSequence other)
Test the sequence for a match to another CharSequence, ignoring case differences
|
char |
firstChar() |
Object |
getBase()
Get the underlying object on which this sequence contents are based
|
BasedSequence |
getBaseSequence()
Get the base sequence for the text
|
int |
getColumnAtIndex(int index) |
int |
getEndOffset()
Get the end offset of this sequence into
getBaseSequence() and getBase() original text source. |
int |
getIndexOffset(int index)
Get the offset of index in this sequence mapped to offset into
getBaseSequence() and getBase() original text source. |
Range |
getIndexRange(int startOffset,
int endOffset)
Get the range of indices that map into
getBaseSequence() with startOffset and endOffset |
Pair<Integer,Integer> |
getLineColumnAtIndex(int index)
Get the line and column information from index into sequence
|
Range |
getSourceRange()
Get the range of this sequence in original
getBaseSequence() and getBase() original text source. |
int |
getStartOffset()
Get the start offset of this sequence into
getBaseSequence() and getBase() original text source. |
BasedSequence |
ifNull(BasedSequence other)
If this sequence is the BasedSequence.NULL instance then returns other,
otherwise returns this sequence.
|
BasedSequence |
ifNullEmptyAfter(BasedSequence other)
If this sequence is the BasedSequence.NULL instance then returns an empty subSequence from the end of other,
otherwise returns this sequence.
|
BasedSequence |
ifNullEmptyBefore(BasedSequence other)
If this sequence is the BasedSequence.NULL instance then returns an empty subSequence from the start of other,
otherwise returns this sequence.
|
int |
indexOf(char c) |
int |
indexOf(char c,
int fromIndex) |
int |
indexOf(char c,
int fromIndex,
int endIndex) |
int |
indexOf(CharSequence s)
All index methods return the position or -1 if not found of the given character, characters or string.
|
int |
indexOf(CharSequence s,
int fromIndex) |
int |
indexOf(CharSequence s,
int fromIndex,
int endIndex) |
int[] |
indexOfAll(CharSequence s)
Get indices of all occurrences of a sequence
|
int |
indexOfAny(char c1,
char c2) |
int |
indexOfAny(char c1,
char c2,
char c3) |
int |
indexOfAny(char c1,
char c2,
char c3,
int fromIndex) |
int |
indexOfAny(char c1,
char c2,
char c3,
int fromIndex,
int endIndex) |
int |
indexOfAny(char c1,
char c2,
int fromIndex) |
int |
indexOfAny(char c1,
char c2,
int fromIndex,
int endIndex) |
int |
indexOfAny(CharSequence s) |
int |
indexOfAny(CharSequence s,
int fromIndex) |
int |
indexOfAny(CharSequence s,
int fromIndex,
int endIndex) |
int |
indexOfAnyNot(char c1,
char c2) |
int |
indexOfAnyNot(char c1,
char c2,
char c3) |
int |
indexOfAnyNot(char c1,
char c2,
char c3,
int fromIndex) |
int |
indexOfAnyNot(char c1,
char c2,
char c3,
int fromIndex,
int endIndex) |
int |
indexOfAnyNot(char c1,
char c2,
int fromIndex) |
int |
indexOfAnyNot(char c1,
char c2,
int fromIndex,
int endIndex) |
int |
indexOfAnyNot(CharSequence s) |
int |
indexOfAnyNot(CharSequence s,
int fromIndex) |
int |
indexOfAnyNot(CharSequence s,
int fromIndex,
int endIndex) |
int |
indexOfNot(char c) |
int |
indexOfNot(char c,
int fromIndex) |
int |
indexOfNot(char c,
int fromIndex,
int endIndex) |
BasedSequence |
intersect(BasedSequence other)
start/end offset based intersection, not textual
|
boolean |
isBlank() |
boolean |
isContinuationOf(BasedSequence other)
Test if this sequence is a continuation of the given sequence in original source text
|
boolean |
isContinuedBy(BasedSequence other)
Test if the given sequence is a continuation of this sequence in original source text
|
boolean |
isEmpty() |
boolean |
isNotNull() |
boolean |
isNull() |
char |
lastChar() |
int |
lastIndexOf(char c) |
int |
lastIndexOf(char c,
int fromIndex) |
int |
lastIndexOf(char c,
int startIndex,
int fromIndex) |
int |
lastIndexOf(CharSequence s) |
int |
lastIndexOf(CharSequence s,
int fromIndex) |
int |
lastIndexOf(CharSequence s,
int startIndex,
int fromIndex) |
int |
lastIndexOfAny(char c1,
char c2) |
int |
lastIndexOfAny(char c1,
char c2,
char c3) |
int |
lastIndexOfAny(char c1,
char c2,
char c3,
int fromIndex) |
int |
lastIndexOfAny(char c1,
char c2,
char c3,
int startIndex,
int fromIndex) |
int |
lastIndexOfAny(char c1,
char c2,
int fromIndex) |
int |
lastIndexOfAny(char c1,
char c2,
int startIndex,
int fromIndex) |
int |
lastIndexOfAny(CharSequence s) |
int |
lastIndexOfAny(CharSequence s,
int fromIndex) |
int |
lastIndexOfAny(CharSequence s,
int startIndex,
int fromIndex) |
int |
lastIndexOfAnyNot(char c1,
char c2) |
int |
lastIndexOfAnyNot(char c1,
char c2,
char c3) |
int |
lastIndexOfAnyNot(char c1,
char c2,
char c3,
int fromIndex) |
int |
lastIndexOfAnyNot(char c1,
char c2,
char c3,
int startIndex,
int fromIndex) |
int |
lastIndexOfAnyNot(char c1,
char c2,
int fromIndex) |
int |
lastIndexOfAnyNot(char c1,
char c2,
int startIndex,
int fromIndex) |
int |
lastIndexOfAnyNot(CharSequence s) |
int |
lastIndexOfAnyNot(CharSequence s,
int fromIndex) |
int |
lastIndexOfAnyNot(CharSequence s,
int startIndex,
int fromIndex) |
int |
lastIndexOfNot(char c) |
int |
lastIndexOfNot(char c,
int fromIndex) |
int |
lastIndexOfNot(char c,
int startIndex,
int fromIndex) |
BasedSequence |
lineAt(int index)
Get the line characters at given index, line delimited by \n
|
BasedSequence |
lineAtAnyEOL(int index)
Get the line characters at given index, line delimited by \n, \r or \r\n
|
boolean |
matchChars(CharSequence chars)
Test the sequence portion for a match to another CharSequence
|
boolean |
matchChars(CharSequence chars,
boolean ignoreCase)
Test the sequence portion for a match to another CharSequence
|
boolean |
matchChars(CharSequence chars,
int startIndex)
Test the sequence portion for a match to another CharSequence
|
boolean |
matchChars(CharSequence chars,
int startIndex,
boolean ignoreCase)
Test the sequence portion for a match to another CharSequence
|
boolean |
matchCharsIgnoreCase(CharSequence chars)
Test the sequence portion for a match to another CharSequence, ignoring case differences
|
boolean |
matchCharsIgnoreCase(CharSequence chars,
int startIndex)
Test the sequence portion for a match to another CharSequence, ignoring case differences
|
boolean |
matchCharsReversed(CharSequence chars,
int endIndex)
Test the sequence portion for a match to another CharSequence, reverse order
|
boolean |
matchCharsReversed(CharSequence chars,
int endIndex,
boolean ignoreCase)
Test the sequence portion for a match to another CharSequence, reverse order
|
boolean |
matchCharsReversedIgnoreCase(CharSequence chars,
int endIndex)
Test the sequence portion for a match to another CharSequence, reverse order, ignoring case differences
|
boolean |
matches(CharSequence chars)
Test the sequence for a match to another CharSequence
|
boolean |
matches(CharSequence chars,
boolean ignoreCase)
Test the sequence for a match to another CharSequence
|
boolean |
matchesIgnoreCase(CharSequence chars)
Test the sequence for a match to another CharSequence, ignoring case differences
|
char |
midCharAt(int index)
Convenience method to get characters offset from start or end of sequence.
|
BasedSequence |
midSequence(int start)
Convenience method to get characters offset from start or end of sequence.
|
BasedSequence |
midSequence(int start,
int end)
Convenience method to get characters offset from start or end of sequence.
|
String |
normalizeEndWithEOL()
replace any \r\n and \r by \n, append terminating EOL if one is not present
|
BasedSequence |
normalizeEndWithEOL(ReplacedTextMapper textMapper)
replace any \r\n and \r by \n, append terminating EOL if one is not present
|
String |
normalizeEOL()
replace any \r\n and \r by \n
|
BasedSequence |
normalizeEOL(ReplacedTextMapper textMapper)
replace any \r\n and \r by \n
|
BasedSequence |
nullIf(boolean condition)
If condition is true return BasedSequence.NULL otherwise returns this sequence.
|
BasedSequence |
nullIf(CharSequence... matches)
If this sequence matches one of given sequences return BasedSequence.NULL otherwise returns this sequence.
|
BasedSequence |
nullIfBlank()
If this sequence is blank return BasedSequence.NULL otherwise returns this sequence.
|
BasedSequence |
nullIfEmpty()
If this sequence is empty return BasedSequence.NULL otherwise returns this sequence.
|
BasedSequence |
nullIfEndsWith(CharSequence... matches)
If this sequence ends with one of given sequences return BasedSequence.NULL otherwise returns this sequence.
|
BasedSequence |
nullIfEndsWithNot(CharSequence... matches)
If this sequence does not end with one of given sequences return BasedSequence.NULL otherwise returns this sequence.
|
BasedSequence |
nullIfNot(CharSequence... matches)
If this sequence does not match one of given sequences return BasedSequence.NULL otherwise returns this sequence.
|
BasedSequence |
nullIfStartsWith(CharSequence... matches)
If this sequence starts with one of given sequences return BasedSequence.NULL otherwise returns this sequence.
|
BasedSequence |
nullIfStartsWithNot(CharSequence... matches)
If this sequence does not start with one of given sequences return BasedSequence.NULL otherwise returns this sequence.
|
BasedSequence |
prefixOf(BasedSequence other)
Get the prefix part of this from other, start/end offset based containment, not textual
|
BasedSequence |
removePrefix(CharSequence prefix)
Remove prefix if present
|
BasedSequence |
removePrefix(CharSequence prefix,
boolean ignoreCase)
Remove prefix if present
|
BasedSequence |
removePrefixIgnoreCase(CharSequence prefix)
Remove prefix if present, ignoring case differences
|
BasedSequence |
removeProperPrefix(CharSequence prefix)
Remove prefix if present but only if this sequence is longer than the suffix
|
BasedSequence |
removeProperPrefix(CharSequence prefix,
boolean ignoreCase)
Remove prefix if present but only if this sequence is longer than the suffix
|
BasedSequence |
removeProperPrefixIgnoreCase(CharSequence prefix)
Remove prefix if present but only if this sequence is longer than the suffix, ignoring case differences
|
BasedSequence |
removeProperSuffix(CharSequence suffix)
Remove suffix if present but only if this sequence is longer than the suffix
|
BasedSequence |
removeProperSuffix(CharSequence suffix,
boolean ignoreCase)
Remove suffix if present but only if this sequence is longer than the suffix
|
BasedSequence |
removeProperSuffixIgnoreCase(CharSequence suffix)
Remove suffix if present but only if this sequence is longer than the suffix, ignoring case differences
|
BasedSequence |
removeSuffix(CharSequence suffix)
Remove suffix if present
|
BasedSequence |
removeSuffix(CharSequence suffix,
boolean ignoreCase)
Remove suffix if present
|
BasedSequence |
removeSuffixIgnoreCase(CharSequence suffix)
Remove suffix if present, ignoring case differences
|
BasedSequence |
replace(CharSequence find,
CharSequence replace)
Replace all occurrences of one sequence with another
|
BasedSequence |
spliceAtEnd(BasedSequence other)
Splice the given sequence to the end of this one and return a BasedSequence of the result.
|
BasedSequence[] |
split(char delimiter) |
BasedSequence[] |
split(char delimiter,
int limit) |
BasedSequence[] |
split(char delimiter,
int limit,
int flags) |
BasedSequence[] |
split(char delimiter,
int limit,
int flags,
String trimChars)
Split helpers based on delimiter character sets contained in CharSequence
|
BasedSequence[] |
split(CharSequence delimiter) |
BasedSequence[] |
split(CharSequence delimiter,
int limit) |
BasedSequence[] |
split(CharSequence delimiter,
int limit,
int flags) |
BasedSequence[] |
split(CharSequence delimiter,
int limit,
int flags,
String trimChars) |
int |
startOfDelimitedBy(CharSequence s,
int index) |
int |
startOfDelimitedByAny(CharSequence s,
int index) |
int |
startOfDelimitedByAnyNot(CharSequence s,
int index) |
int |
startOfLine(int index) |
int |
startOfLineAnyEOL(int index) |
boolean |
startsWith(CharSequence prefix)
test if this sequence starts with given characters
|
boolean |
startsWith(CharSequence prefix,
boolean ignoreCase)
test if this sequence starts with given characters
|
boolean |
startsWithIgnoreCase(CharSequence prefix)
test if this sequence starts with given characters, ignoring case differences
|
BasedSequence |
subSequence(int start)
Get a portion of this sequence starting from a given offset to end of the sequence
|
BasedSequence |
subSequence(int start,
int end)
Get a portion of this sequence
|
BasedSequence |
subSequence(Range range)
Get a portion of this sequence
|
BasedSequence |
suffixOf(BasedSequence other)
Get the suffix part of this from other, start/end offset based containment, not textual
|
MappedSequence |
toLowerCase()
Map characters of this sequence to: Uppercase, Lowercase or use custom mapping
|
MappedSequence |
toLowerCase(Locale locale) |
MappedSequence |
toMapped(CharMapper mapper) |
MappedSequence |
toUpperCase() |
MappedSequence |
toUpperCase(Locale locale) |
String |
toVisibleWhitespaceString() |
BasedSequence |
trim() |
BasedSequence |
trim(CharSequence chars) |
BasedSequence |
trimEnd() |
BasedSequence |
trimEnd(CharSequence chars) |
BasedSequence |
trimEOL() |
BasedSequence |
trimLeadBlankLines() |
BasedSequence |
trimmedEnd() |
BasedSequence |
trimmedEnd(CharSequence chars) |
BasedSequence |
trimmedEOL() |
BasedSequence |
trimmedStart() |
BasedSequence |
trimmedStart(CharSequence chars)
Get the characters Trimmed, Trimmed from start/end of this sequence, characters to trim are passed in the sequence argument
|
BasedSequence |
trimStart() |
BasedSequence |
trimStart(CharSequence chars)
Trim, Trim start/end of this sequence, characters to trim are passed in the sequence argument
|
BasedSequence |
trimTailBlankLines()
Trim leading trailing blank lines in this sequence
|
String |
unescape()
Get the unescaped string of this sequence content
|
BasedSequence |
unescape(ReplacedTextMapper textMapper)
Get the unescaped string of this sequence content
|
String |
unescapeNoEntities()
Get the unescaped string of this sequence content without unescaping entities
|
charAt, chars, codePoints, length, toStringcompareTostatic final BasedSequence NULL
static final BasedSequence EOL
static final BasedSequence SPACE
static final List<BasedSequence> EMPTY_LIST
static final BasedSequence[] EMPTY_ARRAY
static final String WHITESPACE_NO_EOL_CHARS
static final String WHITESPACE_CHARS
static final String WHITESPACE_NBSP_CHARS
static final String EOL_CHARS
static final char EOL_CHAR
static final char EOL_CHAR1
static final char EOL_CHAR2
static final BasedSequence[] EMPTY_SEGMENTS
static final int SPLIT_INCLUDE_DELIMS
static final int SPLIT_TRIM_PARTS
static final int SPLIT_SKIP_EMPTY
static final int SPLIT_INCLUDE_DELIM_PARTS
static final int SPLIT_TRIM_SKIP_EMPTY
char lastChar()
char firstChar()
Object getBase()
BasedSequence getBaseSequence()
int getStartOffset()
getBaseSequence() and getBase() original text source.int getEndOffset()
getBaseSequence() and getBase() original text source.int getIndexOffset(int index)
getBaseSequence() and getBase() original text source.index - index for which to get the offset in original sourceRange getIndexRange(int startOffset, int endOffset)
getBaseSequence() with startOffset and endOffsetstartOffset - start offset into base sequenceendOffset - end offset into base sequenceRange getSourceRange()
getBaseSequence() and getBase() original text source.BasedSequence subSequence(int start, int end)
subSequence in interface CharSequencestart - offset from start of this sequenceend - offset from start of this sequenceBasedSequence subSequence(Range range)
range - range to get, coordinates offset form start of this sequenceBasedSequence subSequence(int start)
start - offset from start of this sequenceBasedSequence baseSubSequence(int start, int end)
start - offset from 0 of original sequenceend - offset from 0 of original sequenceBasedSequence baseSubSequence(int start)
start - offset from 0 of original sequenceBasedSequence endSequence(int start, int end)
start - offset from end of sequence [ 0..length() )end - offset from end of sequence [ 0..length() )BasedSequence endSequence(int start)
start - offset from end of sequence [ 0..length() )char endCharAt(int index)
index - offset from end of sequenceBasedSequence midSequence(int start, int end)
no exceptions are thrown, instead a \0 is returned for an invalid index positions
start - offset into this sequenceend - offset into this sequenceBasedSequence midSequence(int start)
no exceptions are thrown, instead a \0 is returned for an invalid index positions
start - offset into this sequencechar midCharAt(int index)
index - of character to getint indexOf(CharSequence s)
The basic methods have overloads for 1, 2, or 3 characters and CharSequence parameters. If fromIndex is not given then for forward searching methods 0 is taken as the value, for reverse searching methods length() is taken as the value
For forward searching methods fromIndex is the minimum start position for search and endIndex is the maximum end position, if not given the length() of string is assumed.
For reverse searching methods fromIndex is the maximum start position for search and startIndex is the minimum end position, if not given then 0 is assumed.
Variations of arguments are for convenience and speed when 1, 2 or 3 characters are needed to be tested. Methods that take a character set in the form of CharSequence will route their call to character based methods if the CharSequence is only 1, 2 or 3 characters long.
indexOf(CharSequence): returns the index of the next occurrence of given text in this sequence
indexOfAny(CharSequence): returns the index of the next occurrence of any of the characters in this sequence indexOfAny(char): returns the index of the next occurrence of any of the characters in this sequence indexOfAny(char,char): returns the index of the next occurrence of any of the characters in this sequence indexOfAny(char,char,char): returns the index of the next occurrence of any of the characters in this sequence
indexOfAnyNot(CharSequence): returns the index of the next occurrence of any of the characters not in this sequence indexOfAnyNot(char): returns the index of the next occurrence of any of the characters not in this sequence indexOfAnyNot(char,char): returns the index of the next occurrence of any of the characters not in this sequence indexOfAnyNot(char,char,char): returns the index of the next occurrence of any of the characters not in this sequence
lastIndexOf(CharSequence): returns the index of the previous occurrence of given text in this sequence, reversed search
lastIndexOfAny(CharSequence): returns the index of the previous occurrence of any of the characters in this sequence, reversed search lastIndexOfAny(char): returns the index of the previous occurrence of any of the characters in this sequence, reversed search lastIndexOfAny(char,char): returns the index of the previous occurrence of any of the characters in this sequence, reversed search lastIndexOfAny(char,char,char): returns the index of the previous occurrence of any of the characters in this sequence, reversed search
lastIndexOfAnyNot(CharSequence): returns the index of the previous occurrence of any of the characters not in this sequence, reversed search lastIndexOfAnyNot(Char): returns the index of the previous occurrence of any of the characters not in this sequence, reversed search lastIndexOfAnyNot(char,char): returns the index of the previous occurrence of any of the characters not in this sequence, reversed search lastIndexOfAnyNot(char,char,char): returns the index of the previous occurrence of any of the characters not in this sequence, reversed search
s - character sequence whose occurrence to findint indexOf(CharSequence s, int fromIndex)
int indexOf(CharSequence s, int fromIndex, int endIndex)
int indexOf(char c)
int indexOfAny(char c1,
char c2)
int indexOfAny(char c1,
char c2,
char c3)
int indexOfAny(CharSequence s)
int indexOf(char c,
int fromIndex)
int indexOfAny(char c1,
char c2,
int fromIndex)
int indexOfAny(char c1,
char c2,
char c3,
int fromIndex)
int indexOfAny(CharSequence s, int fromIndex)
int indexOf(char c,
int fromIndex,
int endIndex)
int indexOfAny(char c1,
char c2,
int fromIndex,
int endIndex)
int indexOfAny(char c1,
char c2,
char c3,
int fromIndex,
int endIndex)
int indexOfAny(CharSequence s, int fromIndex, int endIndex)
int indexOfNot(char c)
int indexOfAnyNot(char c1,
char c2)
int indexOfAnyNot(char c1,
char c2,
char c3)
int indexOfAnyNot(CharSequence s)
int indexOfNot(char c,
int fromIndex)
int indexOfAnyNot(char c1,
char c2,
int fromIndex)
int indexOfAnyNot(char c1,
char c2,
char c3,
int fromIndex)
int indexOfAnyNot(CharSequence s, int fromIndex)
int indexOfNot(char c,
int fromIndex,
int endIndex)
int indexOfAnyNot(char c1,
char c2,
int fromIndex,
int endIndex)
int indexOfAnyNot(char c1,
char c2,
char c3,
int fromIndex,
int endIndex)
int indexOfAnyNot(CharSequence s, int fromIndex, int endIndex)
int lastIndexOf(CharSequence s)
int lastIndexOf(CharSequence s, int fromIndex)
int lastIndexOf(CharSequence s, int startIndex, int fromIndex)
int lastIndexOf(char c)
int lastIndexOfAny(char c1,
char c2)
int lastIndexOfAny(char c1,
char c2,
char c3)
int lastIndexOfAny(CharSequence s)
int lastIndexOf(char c,
int fromIndex)
int lastIndexOfAny(char c1,
char c2,
int fromIndex)
int lastIndexOfAny(char c1,
char c2,
char c3,
int fromIndex)
int lastIndexOfAny(CharSequence s, int fromIndex)
int lastIndexOf(char c,
int startIndex,
int fromIndex)
int lastIndexOfAny(char c1,
char c2,
int startIndex,
int fromIndex)
int lastIndexOfAny(char c1,
char c2,
char c3,
int startIndex,
int fromIndex)
int lastIndexOfAny(CharSequence s, int startIndex, int fromIndex)
int lastIndexOfNot(char c)
int lastIndexOfAnyNot(char c1,
char c2)
int lastIndexOfAnyNot(char c1,
char c2,
char c3)
int lastIndexOfAnyNot(CharSequence s)
int lastIndexOfNot(char c,
int fromIndex)
int lastIndexOfAnyNot(char c1,
char c2,
int fromIndex)
int lastIndexOfAnyNot(char c1,
char c2,
char c3,
int fromIndex)
int lastIndexOfAnyNot(CharSequence s, int fromIndex)
int lastIndexOfNot(char c,
int startIndex,
int fromIndex)
int lastIndexOfAnyNot(char c1,
char c2,
int startIndex,
int fromIndex)
int lastIndexOfAnyNot(char c1,
char c2,
char c3,
int startIndex,
int fromIndex)
int lastIndexOfAnyNot(CharSequence s, int startIndex, int fromIndex)
int countLeading(CharSequence chars)
Parameters can be: 1, 2 or 3 characters or CharSequence. For character arguments counts any contiguous leading/trailing characters in the sequence.
For CharSequence counts counts any contiguous leading/trailing characters in the sequence which are contained in the given char sequence.
All functions have overloads: with no fromIndex then 0 is taken for leading and length() for trailing methods with fromIndex then this is taken as the start for leading and end for trailing methods with fromIndex and endIndex, counting will start at fromIndex and stop at endIndex
countLeading(CharSequence): count contiguous leading characters from set in this sequence countLeading(char): count contiguous leading characters from set in this sequence countLeading(char,char): count contiguous leading characters from set in this sequence countLeading(char,char,char): count contiguous leading characters from set in this sequence
countLeadingNot(CharSequence): count contiguous leading characters not from set in this sequence countLeadingNot(char): count contiguous leading characters not from set in this sequence countLeadingNot(char,char): count contiguous leading characters not from set in this sequence countLeadingNot(char,char,char): count contiguous leading characters not from set in this sequence
countTrailing(CharSequence): count contiguous leading characters from set in this sequence countTrailing(char): count contiguous leading characters from set in this sequence countTrailing(char,char): count contiguous leading characters from set in this sequence countTrailing(char,char,char): count contiguous leading characters from set in this sequence
countTrailingNot(CharSequence): count contiguous leading characters not from set in this sequence countTrailingNot(char): count contiguous leading characters not from set in this sequence countTrailingNot(char,char): count contiguous leading characters not from set in this sequence countTrailingNot(char,char,char): count contiguous leading characters not from set in this sequence
chars - set of contiguous characters which should be counted at start of sequenceint countLeadingNot(CharSequence chars)
int countLeading(CharSequence chars, int startIndex)
int countLeadingNot(CharSequence chars, int startIndex)
int countLeading(CharSequence chars, int startIndex, int endIndex)
int countLeadingNot(CharSequence chars, int startIndex, int endIndex)
int countTrailing(CharSequence chars)
int countTrailingNot(CharSequence chars)
int countTrailing(CharSequence chars, int startIndex)
int countTrailingNot(CharSequence chars, int startIndex)
int countTrailing(CharSequence chars, int startIndex, int endIndex)
int countTrailingNot(CharSequence chars, int startIndex, int endIndex)
int countLeading(char c)
int countLeadingNot(char c)
int countLeading(char c,
int startIndex)
int countLeadingNot(char c,
int startIndex)
int countLeading(char c,
int startIndex,
int endIndex)
int countLeadingNot(char c,
int startIndex,
int endIndex)
int countTrailing(char c)
int countTrailingNot(char c)
int countTrailing(char c,
int startIndex)
int countTrailingNot(char c,
int startIndex)
int countTrailing(char c,
int startIndex,
int endIndex)
int countTrailingNot(char c,
int startIndex,
int endIndex)
int countChars(char c)
int countCharsReversed(char c)
int countNotChars(char c)
int countNotCharsReversed(char c)
int countChars(char c,
int startIndex)
int countCharsReversed(char c,
int startIndex)
int countNotChars(char c,
int startIndex)
int countNotCharsReversed(char c,
int startIndex)
int countChars(char c,
int startIndex,
int endIndex)
int countNotChars(char c,
int startIndex,
int endIndex)
int countCharsReversed(char c,
int startIndex,
int endIndex)
int countNotCharsReversed(char c,
int startIndex,
int endIndex)
int countChars(CharSequence chars)
int countCharsReversed(CharSequence chars)
int countNotChars(CharSequence chars)
int countNotCharsReversed(CharSequence chars)
int countChars(CharSequence chars, int startIndex)
int countCharsReversed(CharSequence chars, int startIndex)
int countNotChars(CharSequence chars, int startIndex)
int countNotCharsReversed(CharSequence chars, int startIndex)
int countChars(CharSequence chars, int startIndex, int endIndex)
int countNotChars(CharSequence chars, int startIndex, int endIndex)
int countCharsReversed(CharSequence chars, int startIndex, int endIndex)
int countNotCharsReversed(CharSequence chars, int startIndex, int endIndex)
int countLeadingColumns(int startColumn,
CharSequence chars)
BasedSequence trimStart(CharSequence chars)
returns trimmed sequence or if nothing matched the original sequence
If character set in the form of character sequence is not passed in the WHITESPACE_CHARS are assumed.
chars - set of characters to trim from start of lineBasedSequence trimEnd(CharSequence chars)
BasedSequence trim(CharSequence chars)
BasedSequence trimStart()
BasedSequence trimEnd()
BasedSequence trim()
BasedSequence trimEOL()
BasedSequence trimmedStart(CharSequence chars)
returns trimmed sequence or if nothing matched the original sequence
chars - set of characters to trim from start of lineBasedSequence trimmedEnd(CharSequence chars)
BasedSequence trimmedStart()
BasedSequence trimmedEnd()
BasedSequence trimmedEOL()
int eolLength()
\n - 1 \r - 1 \r\n - 2
int eolLength(int eolStart)
\n - 1 \r - 1 \r\n - 2
boolean isEmpty()
boolean isBlank()
boolean isNull()
boolean isNotNull()
BasedSequence ifNull(BasedSequence other)
other - based sequence to return if this is BasedSequence.NULLBasedSequence ifNullEmptyAfter(BasedSequence other)
other - based sequence from which to take the empty sequenceBasedSequence ifNullEmptyBefore(BasedSequence other)
other - based sequence from which to take the empty sequenceBasedSequence nullIfEmpty()
BasedSequence nullIfBlank()
BasedSequence nullIf(boolean condition)
condition - when true return NULL else thisBasedSequence nullIf(CharSequence... matches)
matches - match sequence listBasedSequence nullIfNot(CharSequence... matches)
matches - match sequence listBasedSequence nullIfStartsWith(CharSequence... matches)
matches - match sequence listBasedSequence nullIfStartsWithNot(CharSequence... matches)
matches - match sequence listBasedSequence nullIfEndsWith(CharSequence... matches)
matches - match sequence listBasedSequence nullIfEndsWithNot(CharSequence... matches)
matches - match sequence listint endOfDelimitedBy(CharSequence s, int index)
For Any and AnyNot methods uses the CharSequence argument as a character set of possible delimiting characters
s - character sequence delimiting the regionindex - from which to start looking for end of regionint endOfDelimitedByAny(CharSequence s, int index)
int endOfDelimitedByAnyNot(CharSequence s, int index)
int startOfDelimitedBy(CharSequence s, int index)
int startOfDelimitedByAny(CharSequence s, int index)
int startOfDelimitedByAnyNot(CharSequence s, int index)
int endOfLine(int index)
index - index where to start searching for end of lineint endOfLineAnyEOL(int index)
int startOfLine(int index)
int startOfLineAnyEOL(int index)
BasedSequence lineAt(int index)
index - index at which to get the lineBasedSequence lineAtAnyEOL(int index)
index - index at which to get the lineString unescape()
String unescapeNoEntities()
BasedSequence unescape(ReplacedTextMapper textMapper)
textMapper - replaced text mapper which will be uses to map unescaped index to original source indexString normalizeEOL()
BasedSequence normalizeEOL(ReplacedTextMapper textMapper)
textMapper - replaced text mapper which will be uses to map unescaped index to original source indexString normalizeEndWithEOL()
BasedSequence normalizeEndWithEOL(ReplacedTextMapper textMapper)
textMapper - replaced text mapper which will be uses to map unescaped index to original source indexboolean matches(CharSequence chars)
chars - characters to match againstboolean matchesIgnoreCase(CharSequence chars)
chars - characters to match againstboolean equalsIgnoreCase(CharSequence other)
other - characters to match againstboolean matches(CharSequence chars, boolean ignoreCase)
chars - characters to match againstignoreCase - case ignored when trueboolean equals(Object other, boolean ignoreCase)
other - characters to match againstignoreCase - case ignored when trueboolean matchChars(CharSequence chars)
chars - characters to match againstboolean matchCharsIgnoreCase(CharSequence chars)
chars - characters to match againstboolean matchChars(CharSequence chars, boolean ignoreCase)
chars - characters to match againstignoreCase - case ignored when trueboolean matchChars(CharSequence chars, int startIndex)
chars - characters to match againststartIndex - index from which to start the matchboolean matchCharsIgnoreCase(CharSequence chars, int startIndex)
chars - characters to match againststartIndex - index from which to start the matchboolean matchChars(CharSequence chars, int startIndex, boolean ignoreCase)
chars - characters to match againststartIndex - index from which to start the matchignoreCase - case ignored when trueboolean matchCharsReversed(CharSequence chars, int endIndex)
chars - characters to match againstendIndex - index from which to start the match and proceed to 0boolean matchCharsReversedIgnoreCase(CharSequence chars, int endIndex)
chars - characters to match againstendIndex - index from which to start the match and proceed to 0boolean matchCharsReversed(CharSequence chars, int endIndex, boolean ignoreCase)
chars - characters to match againstendIndex - index from which to start the match and proceed to 0ignoreCase - case ignored when trueboolean endsWith(CharSequence suffix)
suffix - characters to testboolean endsWithIgnoreCase(CharSequence suffix)
suffix - characters to testboolean endsWith(CharSequence suffix, boolean ignoreCase)
suffix - characters to testignoreCase - case ignored when trueboolean startsWith(CharSequence prefix)
prefix - characters to testboolean startsWithIgnoreCase(CharSequence prefix)
prefix - characters to testboolean startsWith(CharSequence prefix, boolean ignoreCase)
prefix - characters to testignoreCase - case ignored when trueBasedSequence removeSuffix(CharSequence suffix)
suffix - characters to removeBasedSequence removeSuffixIgnoreCase(CharSequence suffix)
suffix - characters to removeBasedSequence removeSuffix(CharSequence suffix, boolean ignoreCase)
suffix - characters to removeignoreCase - case ignored when trueBasedSequence removePrefix(CharSequence prefix)
prefix - characters to removeBasedSequence removePrefixIgnoreCase(CharSequence prefix)
prefix - characters to removeBasedSequence removePrefix(CharSequence prefix, boolean ignoreCase)
prefix - characters to removeignoreCase - case ignored when trueBasedSequence removeProperSuffix(CharSequence suffix)
suffix - characters to removeBasedSequence removeProperSuffixIgnoreCase(CharSequence suffix)
suffix - characters to removeBasedSequence removeProperSuffix(CharSequence suffix, boolean ignoreCase)
suffix - characters to removeignoreCase - case ignored when trueBasedSequence removeProperPrefix(CharSequence prefix)
prefix - characters to removeBasedSequence removeProperPrefixIgnoreCase(CharSequence prefix)
prefix - characters to removeBasedSequence removeProperPrefix(CharSequence prefix, boolean ignoreCase)
prefix - characters to removeignoreCase - case ignored when trueMappedSequence toLowerCase()
MappedSequence toUpperCase()
MappedSequence toLowerCase(Locale locale)
MappedSequence toUpperCase(Locale locale)
MappedSequence toMapped(CharMapper mapper)
BasedSequence trimTailBlankLines()
BasedSequence trimLeadBlankLines()
String toVisibleWhitespaceString()
boolean isContinuedBy(BasedSequence other)
other - sequence to testboolean isContinuationOf(BasedSequence other)
other - sequence to testBasedSequence spliceAtEnd(BasedSequence other)
other - sequence to append to end of this oneassertion will fail if the other sequence is not a continuation of this one
boolean containsAllOf(BasedSequence other)
other - based sequence from the same baseboolean containsSomeOf(BasedSequence other)
other - based sequence from the same baseBasedSequence prefixOf(BasedSequence other)
other - based sequence from the same baseBasedSequence suffixOf(BasedSequence other)
other - based sequence from the same baseBasedSequence intersect(BasedSequence other)
other - based sequence from the same parentBasedSequence[] split(char delimiter, int limit, int flags, String trimChars)
delimiter - delimiter char or set of chars in CharSequence to split this sequence onlimit - max number of segments to splitflags - flags for desired options:
SPLIT_INCLUDE_DELIMS: include delimiters as part of split item
SPLIT_TRIM_PARTS: trim the segments
SPLIT_SKIP_EMPTY: skip empty segments (or empty after trimming if enabled)
SPLIT_INCLUDE_DELIM_PARTS: include delimiters as separate split item of its own
SPLIT_TRIM_SKIP_EMPTY: same as SPLIT_TRIM_PARTS | SPLIT_SKIP_EMPTYtrimChars - set of characters that should be used for trimming individual split resultsBasedSequence[] split(char delimiter)
BasedSequence[] split(char delimiter, int limit)
BasedSequence[] split(char delimiter, int limit, int flags)
BasedSequence[] split(CharSequence delimiter)
BasedSequence[] split(CharSequence delimiter, int limit)
BasedSequence[] split(CharSequence delimiter, int limit, int flags)
BasedSequence[] split(CharSequence delimiter, int limit, int flags, String trimChars)
int[] indexOfAll(CharSequence s)
s - sequence whose indices to findBasedSequence replace(CharSequence find, CharSequence replace)
find - sequence to findreplace - replacement sequenceBasedSequence appendTo(StringBuilder out)
BasedSequence appendTo(StringBuilder out, int start)
BasedSequence appendTo(StringBuilder out, int start, int end)
BasedSequence append(CharSequence... others)
Pair<Integer,Integer> getLineColumnAtIndex(int index)
index - index for which to get line informationint getColumnAtIndex(int index)
Copyright © 2019. All rights reserved.