public abstract class BasedSequenceImpl extends Object implements BasedSequence
BasedSequence.EmptyBasedSequence
EMPTY_ARRAY, EMPTY_LIST, EOL, EOL_CHAR, EOL_CHAR1, EOL_CHAR2, EOL_CHARS, NULL, SPACE, SPLIT_INCLUDE_DELIM_PARTS, SPLIT_INCLUDE_DELIMS, SPLIT_SKIP_EMPTY, SPLIT_TRIM_PARTS, SPLIT_TRIM_SKIP_EMPTY, WHITESPACE_CHARS, WHITESPACE_NBSP_CHARS, WHITESPACE_NO_EOL_CHARS
Constructor and Description |
---|
BasedSequenceImpl() |
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) |
static int |
columnsToNextTabStop(int column) |
int |
compareTo(CharSequence other) |
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 fromIndex) |
int |
countChars(char c,
int fromIndex,
int endIndex) |
int |
countChars(CharSequence chars) |
int |
countChars(CharSequence chars,
int fromIndex) |
int |
countChars(CharSequence chars,
int fromIndex,
int endIndex) |
int |
countCharsReversed(char c) |
int |
countCharsReversed(char c,
int fromIndex) |
int |
countCharsReversed(char c,
int startIndex,
int fromIndex) |
int |
countCharsReversed(CharSequence chars) |
int |
countCharsReversed(CharSequence chars,
int fromIndex) |
int |
countCharsReversed(CharSequence chars,
int startIndex,
int fromIndex) |
int |
countLeading(char c) |
int |
countLeading(char c,
int fromIndex) |
int |
countLeading(char c,
int fromIndex,
int endIndex) |
int |
countLeading(CharSequence chars)
Count leading/trailing characters of this sequence
|
int |
countLeading(CharSequence chars,
int fromIndex) |
int |
countLeading(CharSequence chars,
int fromIndex,
int endIndex) |
int |
countLeadingColumns(int startColumn,
CharSequence chars) |
int |
countLeadingNot(char c) |
int |
countLeadingNot(char c,
int fromIndex) |
int |
countLeadingNot(char c,
int fromIndex,
int endIndex) |
int |
countLeadingNot(CharSequence chars) |
int |
countLeadingNot(CharSequence chars,
int fromIndex) |
int |
countLeadingNot(CharSequence chars,
int fromIndex,
int endIndex) |
int |
countNotChars(char c) |
int |
countNotChars(char c,
int fromIndex) |
int |
countNotChars(char c,
int fromIndex,
int endIndex) |
int |
countNotChars(CharSequence chars) |
int |
countNotChars(CharSequence chars,
int fromIndex) |
int |
countNotChars(CharSequence chars,
int fromIndex,
int endIndex) |
int |
countNotCharsReversed(char c) |
int |
countNotCharsReversed(char c,
int fromIndex) |
int |
countNotCharsReversed(char c,
int startIndex,
int fromIndex) |
int |
countNotCharsReversed(CharSequence chars) |
int |
countNotCharsReversed(CharSequence chars,
int fromIndex) |
int |
countNotCharsReversed(CharSequence chars,
int startIndex,
int fromIndex) |
int |
countTrailing(char c) |
int |
countTrailing(char c,
int fromIndex) |
int |
countTrailing(char c,
int startIndex,
int fromIndex) |
int |
countTrailing(CharSequence chars) |
int |
countTrailing(CharSequence chars,
int fromIndex) |
int |
countTrailing(CharSequence chars,
int startIndex,
int fromIndex) |
int |
countTrailingNot(char c) |
int |
countTrailingNot(char c,
int fromIndex) |
int |
countTrailingNot(char c,
int startIndex,
int fromIndex) |
int |
countTrailingNot(CharSequence chars) |
int |
countTrailingNot(CharSequence chars,
int fromIndex) |
int |
countTrailingNot(CharSequence chars,
int startIndex,
int fromIndex) |
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 |
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
|
static int[] |
expandTo(int[] indices,
int length,
int step) |
char |
firstChar() |
static BasedSequence |
firstNonNull(BasedSequence... sequences) |
Range |
getIndexRange(int startOffset,
int endOffset)
Get the range of indices that map into
BasedSequence.getBaseSequence() with startOffset and endOffset |
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) |
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 index) |
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.
|
static BasedSequence |
of(CharSequence charSequence) |
static BasedSequence |
of(CharSequence charSequence,
int start) |
static BasedSequence |
of(CharSequence charSequence,
int start,
int end) |
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) |
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(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) |
String |
toString() |
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
|
static int[] |
truncateTo(int[] indices,
int length) |
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
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
baseSubSequence, getBase, getBaseSequence, getEndOffset, getIndexOffset, getSourceRange, getStartOffset, subSequence
charAt, chars, codePoints, length
public static BasedSequence firstNonNull(BasedSequence... sequences)
public Range getIndexRange(int startOffset, int endOffset)
BasedSequence
BasedSequence.getBaseSequence()
with startOffset and endOffsetgetIndexRange
in interface BasedSequence
startOffset
- start offset into base sequenceendOffset
- end offset into base sequencepublic BasedSequence endSequence(int start, int end)
BasedSequence
endSequence
in interface BasedSequence
start
- offset from end of sequence [ 0..length() )end
- offset from end of sequence [ 0..length() )public BasedSequence endSequence(int start)
BasedSequence
endSequence
in interface BasedSequence
start
- offset from end of sequence [ 0..length() )public char endCharAt(int index)
BasedSequence
endCharAt
in interface BasedSequence
index
- offset from end of sequencepublic BasedSequence midSequence(int start, int end)
BasedSequence
no exceptions are thrown, instead a \0 is returned for an invalid index positions
midSequence
in interface BasedSequence
start
- offset into this sequenceend
- offset into this sequencepublic BasedSequence midSequence(int start)
BasedSequence
no exceptions are thrown, instead a \0 is returned for an invalid index positions
midSequence
in interface BasedSequence
start
- offset into this sequencepublic char midCharAt(int index)
BasedSequence
midCharAt
in interface BasedSequence
index
- of character to getpublic char lastChar()
lastChar
in interface BasedSequence
public char firstChar()
firstChar
in interface BasedSequence
public int indexOf(CharSequence s)
BasedSequence
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
indexOf
in interface BasedSequence
s
- character sequence whose occurrence to findpublic int indexOf(CharSequence s, int fromIndex)
indexOf
in interface BasedSequence
public int indexOf(CharSequence s, int fromIndex, int endIndex)
indexOf
in interface BasedSequence
public int indexOf(char c)
indexOf
in interface BasedSequence
public int indexOfAny(char c1, char c2)
indexOfAny
in interface BasedSequence
public int indexOfAny(char c1, char c2, char c3)
indexOfAny
in interface BasedSequence
public int indexOfAny(CharSequence s)
indexOfAny
in interface BasedSequence
public int indexOf(char c, int fromIndex)
indexOf
in interface BasedSequence
public int indexOfAny(char c1, char c2, int fromIndex)
indexOfAny
in interface BasedSequence
public int indexOfAny(char c1, char c2, char c3, int fromIndex)
indexOfAny
in interface BasedSequence
public int indexOfAny(CharSequence s, int index)
indexOfAny
in interface BasedSequence
public int indexOf(char c, int fromIndex, int endIndex)
indexOf
in interface BasedSequence
public int indexOfAny(char c1, char c2, int fromIndex, int endIndex)
indexOfAny
in interface BasedSequence
public int indexOfAny(char c1, char c2, char c3, int fromIndex, int endIndex)
indexOfAny
in interface BasedSequence
public int indexOfAny(CharSequence s, int fromIndex, int endIndex)
indexOfAny
in interface BasedSequence
public int indexOfNot(char c)
indexOfNot
in interface BasedSequence
public int indexOfAnyNot(char c1, char c2)
indexOfAnyNot
in interface BasedSequence
public int indexOfAnyNot(char c1, char c2, char c3)
indexOfAnyNot
in interface BasedSequence
public int indexOfAnyNot(CharSequence s)
indexOfAnyNot
in interface BasedSequence
public int indexOfNot(char c, int fromIndex)
indexOfNot
in interface BasedSequence
public int indexOfAnyNot(char c1, char c2, int fromIndex)
indexOfAnyNot
in interface BasedSequence
public int indexOfAnyNot(char c1, char c2, char c3, int fromIndex)
indexOfAnyNot
in interface BasedSequence
public int indexOfAnyNot(CharSequence s, int fromIndex)
indexOfAnyNot
in interface BasedSequence
public int indexOfNot(char c, int fromIndex, int endIndex)
indexOfNot
in interface BasedSequence
public int indexOfAnyNot(char c1, char c2, int fromIndex, int endIndex)
indexOfAnyNot
in interface BasedSequence
public int indexOfAnyNot(char c1, char c2, char c3, int fromIndex, int endIndex)
indexOfAnyNot
in interface BasedSequence
public int indexOfAnyNot(CharSequence s, int fromIndex, int endIndex)
indexOfAnyNot
in interface BasedSequence
public int lastIndexOf(CharSequence s)
lastIndexOf
in interface BasedSequence
public int lastIndexOf(CharSequence s, int fromIndex)
lastIndexOf
in interface BasedSequence
public int lastIndexOf(CharSequence s, int startIndex, int fromIndex)
lastIndexOf
in interface BasedSequence
public int lastIndexOf(char c)
lastIndexOf
in interface BasedSequence
public int lastIndexOfAny(char c1, char c2)
lastIndexOfAny
in interface BasedSequence
public int lastIndexOfAny(char c1, char c2, char c3)
lastIndexOfAny
in interface BasedSequence
public int lastIndexOfAny(CharSequence s)
lastIndexOfAny
in interface BasedSequence
public int lastIndexOf(char c, int fromIndex)
lastIndexOf
in interface BasedSequence
public int lastIndexOfAny(char c1, char c2, int fromIndex)
lastIndexOfAny
in interface BasedSequence
public int lastIndexOfAny(char c1, char c2, char c3, int fromIndex)
lastIndexOfAny
in interface BasedSequence
public int lastIndexOfAny(CharSequence s, int fromIndex)
lastIndexOfAny
in interface BasedSequence
public int lastIndexOf(char c, int startIndex, int fromIndex)
lastIndexOf
in interface BasedSequence
public int lastIndexOfAny(char c1, char c2, int startIndex, int fromIndex)
lastIndexOfAny
in interface BasedSequence
public int lastIndexOfAny(char c1, char c2, char c3, int startIndex, int fromIndex)
lastIndexOfAny
in interface BasedSequence
public int lastIndexOfAny(CharSequence s, int startIndex, int fromIndex)
lastIndexOfAny
in interface BasedSequence
public int lastIndexOfNot(char c)
lastIndexOfNot
in interface BasedSequence
public int lastIndexOfAnyNot(char c1, char c2)
lastIndexOfAnyNot
in interface BasedSequence
public int lastIndexOfAnyNot(char c1, char c2, char c3)
lastIndexOfAnyNot
in interface BasedSequence
public int lastIndexOfAnyNot(CharSequence s)
lastIndexOfAnyNot
in interface BasedSequence
public int lastIndexOfNot(char c, int fromIndex)
lastIndexOfNot
in interface BasedSequence
public int lastIndexOfAnyNot(char c1, char c2, int fromIndex)
lastIndexOfAnyNot
in interface BasedSequence
public int lastIndexOfAnyNot(char c1, char c2, char c3, int fromIndex)
lastIndexOfAnyNot
in interface BasedSequence
public int lastIndexOfAnyNot(CharSequence s, int fromIndex)
lastIndexOfAnyNot
in interface BasedSequence
public int lastIndexOfNot(char c, int startIndex, int fromIndex)
lastIndexOfNot
in interface BasedSequence
public int lastIndexOfAnyNot(char c1, char c2, int startIndex, int fromIndex)
lastIndexOfAnyNot
in interface BasedSequence
public int lastIndexOfAnyNot(char c1, char c2, char c3, int startIndex, int fromIndex)
lastIndexOfAnyNot
in interface BasedSequence
public int lastIndexOfAnyNot(CharSequence s, int startIndex, int fromIndex)
lastIndexOfAnyNot
in interface BasedSequence
public int startOfDelimitedBy(CharSequence s, int index)
startOfDelimitedBy
in interface BasedSequence
public int startOfDelimitedByAny(CharSequence s, int index)
startOfDelimitedByAny
in interface BasedSequence
public int startOfDelimitedByAnyNot(CharSequence s, int index)
startOfDelimitedByAnyNot
in interface BasedSequence
public int endOfDelimitedBy(CharSequence s, int index)
BasedSequence
For Any and AnyNot methods uses the CharSequence argument as a character set of possible delimiting characters
endOfDelimitedBy
in interface BasedSequence
s
- character sequence delimiting the regionindex
- from which to start looking for end of regionpublic int endOfDelimitedByAny(CharSequence s, int index)
endOfDelimitedByAny
in interface BasedSequence
public int endOfDelimitedByAnyNot(CharSequence s, int index)
endOfDelimitedByAnyNot
in interface BasedSequence
public int endOfLine(int index)
BasedSequence
endOfLine
in interface BasedSequence
index
- index where to start searching for end of linepublic int endOfLineAnyEOL(int index)
endOfLineAnyEOL
in interface BasedSequence
public int startOfLine(int index)
startOfLine
in interface BasedSequence
public int startOfLineAnyEOL(int index)
startOfLineAnyEOL
in interface BasedSequence
public BasedSequence lineAt(int index)
BasedSequence
lineAt
in interface BasedSequence
index
- index at which to get the linepublic BasedSequence lineAtAnyEOL(int index)
BasedSequence
lineAtAnyEOL
in interface BasedSequence
index
- index at which to get the linepublic int countLeading(char c)
countLeading
in interface BasedSequence
public int countLeadingNot(char c)
countLeadingNot
in interface BasedSequence
public int countLeading(char c, int fromIndex)
countLeading
in interface BasedSequence
public int countLeadingNot(char c, int fromIndex)
countLeadingNot
in interface BasedSequence
public int countLeading(char c, int fromIndex, int endIndex)
countLeading
in interface BasedSequence
public int countLeadingNot(char c, int fromIndex, int endIndex)
countLeadingNot
in interface BasedSequence
public int countTrailing(char c)
countTrailing
in interface BasedSequence
public int countTrailingNot(char c)
countTrailingNot
in interface BasedSequence
public int countTrailing(char c, int fromIndex)
countTrailing
in interface BasedSequence
public int countTrailingNot(char c, int fromIndex)
countTrailingNot
in interface BasedSequence
public int countTrailing(char c, int startIndex, int fromIndex)
countTrailing
in interface BasedSequence
public int countTrailingNot(char c, int startIndex, int fromIndex)
countTrailingNot
in interface BasedSequence
public int countChars(char c)
countChars
in interface BasedSequence
public int countNotChars(char c)
countNotChars
in interface BasedSequence
public int countChars(char c, int fromIndex)
countChars
in interface BasedSequence
public int countNotChars(char c, int fromIndex)
countNotChars
in interface BasedSequence
public int countCharsReversed(char c)
countCharsReversed
in interface BasedSequence
public int countNotCharsReversed(char c)
countNotCharsReversed
in interface BasedSequence
public int countCharsReversed(char c, int fromIndex)
countCharsReversed
in interface BasedSequence
public int countNotCharsReversed(char c, int fromIndex)
countNotCharsReversed
in interface BasedSequence
public int countChars(char c, int fromIndex, int endIndex)
countChars
in interface BasedSequence
public int countCharsReversed(char c, int startIndex, int fromIndex)
countCharsReversed
in interface BasedSequence
public int countNotChars(char c, int fromIndex, int endIndex)
countNotChars
in interface BasedSequence
public int countNotCharsReversed(char c, int startIndex, int fromIndex)
countNotCharsReversed
in interface BasedSequence
public int countLeading(CharSequence chars)
BasedSequence
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
countLeading
in interface BasedSequence
chars
- set of contiguous characters which should be counted at start of sequencepublic int countLeadingNot(CharSequence chars)
countLeadingNot
in interface BasedSequence
public int countLeading(CharSequence chars, int fromIndex)
countLeading
in interface BasedSequence
public int countLeadingNot(CharSequence chars, int fromIndex)
countLeadingNot
in interface BasedSequence
public int countLeading(CharSequence chars, int fromIndex, int endIndex)
countLeading
in interface BasedSequence
public int countLeadingNot(CharSequence chars, int fromIndex, int endIndex)
countLeadingNot
in interface BasedSequence
public int countTrailing(CharSequence chars)
countTrailing
in interface BasedSequence
public int countTrailingNot(CharSequence chars)
countTrailingNot
in interface BasedSequence
public int countTrailing(CharSequence chars, int fromIndex)
countTrailing
in interface BasedSequence
public int countTrailingNot(CharSequence chars, int fromIndex)
countTrailingNot
in interface BasedSequence
public int countTrailing(CharSequence chars, int startIndex, int fromIndex)
countTrailing
in interface BasedSequence
public int countTrailingNot(CharSequence chars, int startIndex, int fromIndex)
countTrailingNot
in interface BasedSequence
public int countChars(CharSequence chars)
countChars
in interface BasedSequence
public int countNotChars(CharSequence chars)
countNotChars
in interface BasedSequence
public int countChars(CharSequence chars, int fromIndex)
countChars
in interface BasedSequence
public int countNotChars(CharSequence chars, int fromIndex)
countNotChars
in interface BasedSequence
public int countCharsReversed(CharSequence chars)
countCharsReversed
in interface BasedSequence
public int countNotCharsReversed(CharSequence chars)
countNotCharsReversed
in interface BasedSequence
public int countCharsReversed(CharSequence chars, int fromIndex)
countCharsReversed
in interface BasedSequence
public int countNotCharsReversed(CharSequence chars, int fromIndex)
countNotCharsReversed
in interface BasedSequence
public int countChars(CharSequence chars, int fromIndex, int endIndex)
countChars
in interface BasedSequence
public static int columnsToNextTabStop(int column)
public int countLeadingColumns(int startColumn, CharSequence chars)
countLeadingColumns
in interface BasedSequence
public int countCharsReversed(CharSequence chars, int startIndex, int fromIndex)
countCharsReversed
in interface BasedSequence
public int countNotChars(CharSequence chars, int fromIndex, int endIndex)
countNotChars
in interface BasedSequence
public int countNotCharsReversed(CharSequence chars, int startIndex, int fromIndex)
countNotCharsReversed
in interface BasedSequence
public BasedSequence trimStart(CharSequence chars)
BasedSequence
returns trimmed sequence or if nothing matched the original sequence
If character set in the form of character sequence is not passed in the BasedSequence.WHITESPACE_CHARS
are assumed.
trimStart
in interface BasedSequence
chars
- set of characters to trim from start of linepublic BasedSequence trimmedStart(CharSequence chars)
BasedSequence
returns trimmed sequence or if nothing matched the original sequence
trimmedStart
in interface BasedSequence
chars
- set of characters to trim from start of linepublic BasedSequence trimEnd(CharSequence chars)
trimEnd
in interface BasedSequence
public BasedSequence trimmedEnd(CharSequence chars)
trimmedEnd
in interface BasedSequence
public BasedSequence trim(CharSequence chars)
trim
in interface BasedSequence
public BasedSequence trimStart()
trimStart
in interface BasedSequence
public BasedSequence trimmedStart()
trimmedStart
in interface BasedSequence
public BasedSequence trimEnd()
trimEnd
in interface BasedSequence
public BasedSequence trimmedEnd()
trimmedEnd
in interface BasedSequence
public int eolLength()
BasedSequence
\n - 1 \r - 1 \r\n - 2
eolLength
in interface BasedSequence
public int eolLength(int eolStart)
BasedSequence
\n - 1 \r - 1 \r\n - 2
eolLength
in interface BasedSequence
public BasedSequence trimEOL()
trimEOL
in interface BasedSequence
public BasedSequence trimmedEOL()
trimmedEOL
in interface BasedSequence
public BasedSequence trim()
trim
in interface BasedSequence
public BasedSequence ifNull(BasedSequence other)
BasedSequence
ifNull
in interface BasedSequence
other
- based sequence to return if this is BasedSequence.NULLpublic BasedSequence ifNullEmptyAfter(BasedSequence other)
BasedSequence
ifNullEmptyAfter
in interface BasedSequence
other
- based sequence from which to take the empty sequencepublic BasedSequence ifNullEmptyBefore(BasedSequence other)
BasedSequence
ifNullEmptyBefore
in interface BasedSequence
other
- based sequence from which to take the empty sequencepublic BasedSequence nullIfEmpty()
BasedSequence
nullIfEmpty
in interface BasedSequence
public BasedSequence nullIfBlank()
BasedSequence
nullIfBlank
in interface BasedSequence
public BasedSequence nullIf(boolean condition)
BasedSequence
nullIf
in interface BasedSequence
condition
- when true return NULL else thispublic BasedSequence nullIf(CharSequence... matches)
BasedSequence
nullIf
in interface BasedSequence
matches
- match sequence listpublic BasedSequence nullIfNot(CharSequence... matches)
BasedSequence
nullIfNot
in interface BasedSequence
matches
- match sequence listpublic BasedSequence nullIfStartsWith(CharSequence... matches)
BasedSequence
nullIfStartsWith
in interface BasedSequence
matches
- match sequence listpublic BasedSequence nullIfStartsWithNot(CharSequence... matches)
BasedSequence
nullIfStartsWithNot
in interface BasedSequence
matches
- match sequence listpublic BasedSequence nullIfEndsWith(CharSequence... matches)
BasedSequence
nullIfEndsWith
in interface BasedSequence
matches
- match sequence listpublic BasedSequence nullIfEndsWithNot(CharSequence... matches)
BasedSequence
nullIfEndsWithNot
in interface BasedSequence
matches
- match sequence listpublic boolean isEmpty()
isEmpty
in interface BasedSequence
public boolean isBlank()
isBlank
in interface BasedSequence
public boolean isNull()
isNull
in interface BasedSequence
public boolean isNotNull()
isNotNull
in interface BasedSequence
public boolean endsWith(CharSequence suffix)
BasedSequence
endsWith
in interface BasedSequence
suffix
- characters to testpublic boolean startsWith(CharSequence prefix)
BasedSequence
startsWith
in interface BasedSequence
prefix
- characters to testpublic BasedSequence removeSuffix(CharSequence suffix)
BasedSequence
removeSuffix
in interface BasedSequence
suffix
- characters to removepublic BasedSequence removePrefix(CharSequence prefix)
BasedSequence
removePrefix
in interface BasedSequence
prefix
- characters to removepublic BasedSequence removeProperSuffix(CharSequence suffix)
BasedSequence
removeProperSuffix
in interface BasedSequence
suffix
- characters to removepublic BasedSequence removeProperPrefix(CharSequence prefix)
BasedSequence
removeProperPrefix
in interface BasedSequence
prefix
- characters to removepublic boolean endsWithIgnoreCase(CharSequence suffix)
BasedSequence
endsWithIgnoreCase
in interface BasedSequence
suffix
- characters to testpublic boolean startsWithIgnoreCase(CharSequence prefix)
BasedSequence
startsWithIgnoreCase
in interface BasedSequence
prefix
- characters to testpublic BasedSequence removeSuffixIgnoreCase(CharSequence suffix)
BasedSequence
removeSuffixIgnoreCase
in interface BasedSequence
suffix
- characters to removepublic BasedSequence removePrefixIgnoreCase(CharSequence prefix)
BasedSequence
removePrefixIgnoreCase
in interface BasedSequence
prefix
- characters to removepublic BasedSequence removeProperSuffixIgnoreCase(CharSequence suffix)
BasedSequence
removeProperSuffixIgnoreCase
in interface BasedSequence
suffix
- characters to removepublic BasedSequence removeProperPrefixIgnoreCase(CharSequence prefix)
BasedSequence
removeProperPrefixIgnoreCase
in interface BasedSequence
prefix
- characters to removepublic boolean endsWith(CharSequence suffix, boolean ignoreCase)
BasedSequence
endsWith
in interface BasedSequence
suffix
- characters to testignoreCase
- case ignored when truepublic boolean startsWith(CharSequence prefix, boolean ignoreCase)
BasedSequence
startsWith
in interface BasedSequence
prefix
- characters to testignoreCase
- case ignored when truepublic BasedSequence removeSuffix(CharSequence suffix, boolean ignoreCase)
BasedSequence
removeSuffix
in interface BasedSequence
suffix
- characters to removeignoreCase
- case ignored when truepublic BasedSequence removePrefix(CharSequence prefix, boolean ignoreCase)
BasedSequence
removePrefix
in interface BasedSequence
prefix
- characters to removeignoreCase
- case ignored when truepublic BasedSequence removeProperSuffix(CharSequence suffix, boolean ignoreCase)
BasedSequence
removeProperSuffix
in interface BasedSequence
suffix
- characters to removeignoreCase
- case ignored when truepublic BasedSequence removeProperPrefix(CharSequence prefix, boolean ignoreCase)
BasedSequence
removeProperPrefix
in interface BasedSequence
prefix
- characters to removeignoreCase
- case ignored when truepublic MappedSequence toLowerCase()
BasedSequence
toLowerCase
in interface BasedSequence
public MappedSequence toUpperCase()
toUpperCase
in interface BasedSequence
public MappedSequence toLowerCase(Locale locale)
toLowerCase
in interface BasedSequence
public MappedSequence toUpperCase(Locale locale)
toUpperCase
in interface BasedSequence
public final MappedSequence toMapped(CharMapper mapper)
toMapped
in interface BasedSequence
public boolean matches(CharSequence chars)
BasedSequence
matches
in interface BasedSequence
chars
- characters to match againstpublic boolean matchesIgnoreCase(CharSequence chars)
BasedSequence
matchesIgnoreCase
in interface BasedSequence
chars
- characters to match againstpublic boolean matches(CharSequence chars, boolean ignoreCase)
BasedSequence
matches
in interface BasedSequence
chars
- characters to match againstignoreCase
- case ignored when truepublic boolean matchChars(CharSequence chars)
BasedSequence
matchChars
in interface BasedSequence
chars
- characters to match againstpublic boolean matchCharsIgnoreCase(CharSequence chars)
BasedSequence
matchCharsIgnoreCase
in interface BasedSequence
chars
- characters to match againstpublic boolean matchChars(CharSequence chars, boolean ignoreCase)
BasedSequence
matchChars
in interface BasedSequence
chars
- characters to match againstignoreCase
- case ignored when truepublic boolean matchChars(CharSequence chars, int startIndex)
BasedSequence
matchChars
in interface BasedSequence
chars
- characters to match againststartIndex
- index from which to start the matchpublic boolean matchCharsIgnoreCase(CharSequence chars, int startIndex)
BasedSequence
matchCharsIgnoreCase
in interface BasedSequence
chars
- characters to match againststartIndex
- index from which to start the matchpublic boolean matchChars(CharSequence chars, int startIndex, boolean ignoreCase)
BasedSequence
matchChars
in interface BasedSequence
chars
- characters to match againststartIndex
- index from which to start the matchignoreCase
- case ignored when truepublic boolean matchCharsReversed(CharSequence chars, int endIndex)
BasedSequence
matchCharsReversed
in interface BasedSequence
chars
- characters to match againstendIndex
- index from which to start the match and proceed to 0public boolean matchCharsReversedIgnoreCase(CharSequence chars, int endIndex)
BasedSequence
matchCharsReversedIgnoreCase
in interface BasedSequence
chars
- characters to match againstendIndex
- index from which to start the match and proceed to 0public boolean matchCharsReversed(CharSequence chars, int endIndex, boolean ignoreCase)
BasedSequence
matchCharsReversed
in interface BasedSequence
chars
- characters to match againstendIndex
- index from which to start the match and proceed to 0ignoreCase
- case ignored when truepublic BasedSequence subSequence(Range range)
BasedSequence
subSequence
in interface BasedSequence
range
- range to get, coordinates offset form start of this sequencepublic BasedSequence subSequence(int start)
BasedSequence
subSequence
in interface BasedSequence
start
- offset from start of this sequencepublic BasedSequence trimTailBlankLines()
BasedSequence
trimTailBlankLines
in interface BasedSequence
public BasedSequence trimLeadBlankLines()
trimLeadBlankLines
in interface BasedSequence
public String toString()
toString
in interface CharSequence
toString
in class Object
public String unescape()
BasedSequence
unescape
in interface BasedSequence
public String unescapeNoEntities()
BasedSequence
unescapeNoEntities
in interface BasedSequence
public BasedSequence unescape(ReplacedTextMapper textMapper)
BasedSequence
unescape
in interface BasedSequence
textMapper
- replaced text mapper which will be uses to map unescaped index to original source indexpublic String normalizeEOL()
BasedSequence
normalizeEOL
in interface BasedSequence
public BasedSequence normalizeEOL(ReplacedTextMapper textMapper)
BasedSequence
normalizeEOL
in interface BasedSequence
textMapper
- replaced text mapper which will be uses to map unescaped index to original source indexpublic String normalizeEndWithEOL()
BasedSequence
normalizeEndWithEOL
in interface BasedSequence
public BasedSequence normalizeEndWithEOL(ReplacedTextMapper textMapper)
BasedSequence
normalizeEndWithEOL
in interface BasedSequence
textMapper
- replaced text mapper which will be uses to map unescaped index to original source indexpublic String toVisibleWhitespaceString()
toVisibleWhitespaceString
in interface BasedSequence
public boolean isContinuedBy(BasedSequence other)
BasedSequence
isContinuedBy
in interface BasedSequence
other
- sequence to testpublic boolean isContinuationOf(BasedSequence other)
BasedSequence
isContinuationOf
in interface BasedSequence
other
- sequence to testpublic BasedSequence spliceAtEnd(BasedSequence other)
BasedSequence
spliceAtEnd
in interface BasedSequence
other
- sequence to append to end of this oneassertion will fail if the other sequence is not a continuation of this one
public boolean containsAllOf(BasedSequence other)
BasedSequence
containsAllOf
in interface BasedSequence
other
- based sequence from the same basepublic boolean containsSomeOf(BasedSequence other)
BasedSequence
containsSomeOf
in interface BasedSequence
other
- based sequence from the same basepublic BasedSequence intersect(BasedSequence other)
BasedSequence
intersect
in interface BasedSequence
other
- based sequence from the same parentpublic BasedSequence prefixOf(BasedSequence other)
BasedSequence
prefixOf
in interface BasedSequence
other
- based sequence from the same basepublic BasedSequence suffixOf(BasedSequence other)
BasedSequence
suffixOf
in interface BasedSequence
other
- based sequence from the same basepublic BasedSequence[] split(char delimiter)
split
in interface BasedSequence
public BasedSequence[] split(char delimiter, int limit)
split
in interface BasedSequence
public BasedSequence[] split(char delimiter, int limit, int flags)
split
in interface BasedSequence
public BasedSequence[] split(CharSequence delimiter)
split
in interface BasedSequence
public BasedSequence[] split(CharSequence delimiter, int limit)
split
in interface BasedSequence
public BasedSequence[] split(CharSequence delimiter, int limit, int flags)
split
in interface BasedSequence
public BasedSequence[] split(char delimiter, int limit, int flags, String trimChars)
BasedSequence
split
in interface BasedSequence
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 resultspublic BasedSequence[] split(CharSequence delimiter, int limit, int flags, String trimChars)
split
in interface BasedSequence
public BasedSequence appendTo(StringBuilder out)
appendTo
in interface BasedSequence
public BasedSequence appendTo(StringBuilder out, int start)
appendTo
in interface BasedSequence
public BasedSequence appendTo(StringBuilder out, int start, int end)
appendTo
in interface BasedSequence
public static int[] expandTo(int[] indices, int length, int step)
public static int[] truncateTo(int[] indices, int length)
public int[] indexOfAll(CharSequence s)
indexOfAll
in interface BasedSequence
public BasedSequence replace(CharSequence find, CharSequence replace)
replace
in interface BasedSequence
public BasedSequence append(CharSequence... others)
append
in interface BasedSequence
public boolean equalsIgnoreCase(CharSequence other)
BasedSequence
equalsIgnoreCase
in interface BasedSequence
other
- characters to match againstpublic boolean equals(Object other, boolean ignoreCase)
BasedSequence
equals
in interface BasedSequence
other
- characters to match againstignoreCase
- case ignored when truepublic int compareTo(CharSequence other)
compareTo
in interface Comparable<CharSequence>
public static BasedSequence of(CharSequence charSequence)
public static BasedSequence of(CharSequence charSequence, int start)
public static BasedSequence of(CharSequence charSequence, int start, int end)
Copyright © 2017. All rights reserved.