Class IRichSequenceBase<T extends IRichSequence<T>>
- All Implemented Interfaces:
IRichSequence<T>
,SequenceUtils
,CharSequence
,Comparable<CharSequence>
- Direct Known Subclasses:
BasedSequenceImpl
,MappedRichSequence
,RichSequenceImpl
-
Field Summary
FieldsFields inherited from interface com.vladsch.flexmark.util.sequence.SequenceUtils
ANY_EOL, ANY_EOL_SET, BACKSLASH_SET, DECIMAL_DIGITS, EMPTY_INDICES, ENC_NUL, EOL, EOL_CHAR, EOL_CHAR1, EOL_CHAR2, EOL_CHARS, EOL_SET, HASH_SET, HEXADECIMAL_DIGITS, LINE_SEP, LS, LSEP, NBSP, NBSP_CHARS, NUL, OCTAL_DIGITS, SPACE, SPACE_EOL, SPACE_EOL_SET, SPACE_SET, SPACE_TAB, SPACE_TAB_EOL_SET, SPACE_TAB_NBSP_SET, SPACE_TAB_SET, SPC, SPLIT_INCLUDE_DELIM_PARTS, SPLIT_INCLUDE_DELIMS, SPLIT_SKIP_EMPTY, SPLIT_TRIM_PARTS, SPLIT_TRIM_SKIP_EMPTY, TAB_SET, US, US_CHARS, US_SET, visibleSpacesMap, WHITESPACE, WHITESPACE_CHARS, WHITESPACE_NBSP, WHITESPACE_NBSP_CHARS, WHITESPACE_NBSP_SET, WHITESPACE_NO_EOL_CHARS, WHITESPACE_SET
-
Constructor Summary
ConstructorsConstructorDescriptionIRichSequenceBase
(int hash) Constructor with pre-computed hash if available, 0 for lazy computation if length() not 0 -
Method Summary
Modifier and TypeMethodDescriptionfinal T
append
(CharSequence... sequences) Concatenate this sequence and list of others, returning sequence of resultfinal T
append
(Iterable<? extends CharSequence> sequences) final T
final T
appendRangesTo
(@NotNull StringBuilder out, @Nullable CharMapper charMapper, Range... ranges) Append given ranges of this sequence to string builderfinal T
appendRangesTo
(@NotNull StringBuilder out, @Nullable CharMapper charMapper, Iterable<? extends Range> ranges) final T
appendRangesTo
(@NotNull StringBuilder out, Range... ranges) final T
appendRangesTo
(@NotNull StringBuilder out, Iterable<? extends Range> ranges) final T
final T
appendSpaces
(int count) final T
appendTo
(@NotNull StringBuilder out) final T
appendTo
(@NotNull StringBuilder out, int startIndex) final T
appendTo
(@NotNull StringBuilder out, int startIndex, int endIndex) final T
appendTo
(@NotNull StringBuilder out, @Nullable CharMapper charMapper) final T
appendTo
(@NotNull StringBuilder out, @Nullable CharMapper charMapper, int startIndex) final T
appendTo
(@NotNull StringBuilder out, @Nullable CharMapper charMapper, int startIndex, int endIndex) Append helpersblankLinesRemovedRanges
(int fromIndex) blankLinesRemovedRanges
(int fromIndex, int endIndex) blankLinesRemovedRanges
(@NotNull CharPredicate eolChars, int fromIndex, int endIndex) final int
columnAtIndex
(int index) int
compareTo
(@NotNull CharSequence o) final int
countLeading
(@NotNull CharPredicate chars) Count leading/trailing characters of this sequencefinal int
countLeading
(@NotNull CharPredicate chars, int fromIndex) final int
countLeading
(@NotNull CharPredicate chars, int fromIndex, int endIndex) final int
countLeadingColumns
(int startColumn, @NotNull CharPredicate chars) Count column of indent given by chars in the set in this sequence, expanding tabs to 4th columnfinal int
countLeadingNot
(@NotNull CharPredicate chars) final int
countLeadingNot
(@NotNull CharPredicate chars, int fromIndex) final int
countLeadingNot
(@NotNull CharPredicate chars, int startIndex, int endIndex) final int
final int
countLeadingNotSpace
(int startIndex) final int
countLeadingNotSpace
(int startIndex, int endIndex) final int
final int
countLeadingNotSpaceTab
(int startIndex) final int
countLeadingNotSpaceTab
(int startIndex, int endIndex) final int
final int
countLeadingNotWhitespace
(int startIndex) final int
countLeadingNotWhitespace
(int startIndex, int endIndex) final int
final int
countLeadingSpace
(int startIndex) final int
countLeadingSpace
(int startIndex, int endIndex) final int
final int
countLeadingSpaceTab
(int startIndex) final int
countLeadingSpaceTab
(int startIndex, int endIndex) final int
final int
countLeadingWhitespace
(int startIndex) final int
countLeadingWhitespace
(int startIndex, int endIndex) final int
countOfAny
(@NotNull CharPredicate chars) final int
countOfAny
(@NotNull CharPredicate chars, int fromIndex) final int
countOfAny
(@NotNull CharPredicate s, int fromIndex, int endIndex) final int
countOfAnyNot
(@NotNull CharPredicate chars) final int
countOfAnyNot
(@NotNull CharPredicate chars, int fromIndex) final int
countOfAnyNot
(@NotNull CharPredicate chars, int startIndex, int endIndex) final int
final int
final int
final int
final int
countTrailing
(@NotNull CharPredicate chars) final int
countTrailing
(@NotNull CharPredicate chars, int fromIndex) final int
countTrailing
(@NotNull CharPredicate chars, int startIndex, int fromIndex) final int
countTrailingNot
(@NotNull CharPredicate chars) final int
countTrailingNot
(@NotNull CharPredicate chars, int fromIndex) final int
countTrailingNot
(@NotNull CharPredicate chars, int startIndex, int endIndex) final int
final int
countTrailingNotSpace
(int fromIndex) final int
countTrailingNotSpace
(int startIndex, int fromIndex) final int
final int
countTrailingNotSpaceTab
(int fromIndex) final int
countTrailingNotSpaceTab
(int startIndex, int fromIndex) final int
final int
countTrailingNotWhitespace
(int fromIndex) final int
countTrailingNotWhitespace
(int startIndex, int fromIndex) final int
final int
countTrailingSpace
(int fromIndex) final int
countTrailingSpace
(int startIndex, int fromIndex) final int
final int
countTrailingSpaceTab
(int fromIndex) final int
countTrailingSpaceTab
(int startIndex, int fromIndex) final int
final int
countTrailingWhitespace
(int fromIndex) final int
countTrailingWhitespace
(int startIndex, int fromIndex) delete
(int startIndex, int endIndex) Delete range in sequencefinal char
endCharAt
(int index) Convenience method to get characters offset from end of sequence.final int
endOfDelimitedBy
(@NotNull CharSequence s, int index) Find start/end region in this sequence delimited by any characters in argument or the CharSequencefinal int
endOfDelimitedByAny
(@NotNull CharPredicate s, int index) final int
endOfDelimitedByAnyNot
(@NotNull CharPredicate s, int index) final int
endOfLine
(int index) Get the offset of the end of line at given index, end of line delimited by \nfinal int
endOfLineAnyEOL
(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.final T
endSequence
(int startIndex) Convenience method to get characters offset from endIndex of sequence.final T
endSequence
(int startIndex, int endIndex) Convenience method to get characters offset from endIndex of sequence.final boolean
endsWith
(@NotNull CharPredicate chars) final boolean
endsWith
(@NotNull CharSequence suffix) test if this sequence ends with given charactersfinal boolean
endsWith
(@NotNull CharSequence suffix, boolean ignoreCase) test if this sequence ends with given charactersfinal boolean
final boolean
final boolean
endsWithIgnoreCase
(@NotNull CharSequence suffix) test if this sequence ends with given characters, ignoring case differencesfinal boolean
final boolean
final boolean
final int
Get the length of EOL character at the end of this sequence, if present.final int
eolEndLength
(int eolEnd) Get the length of EOL character at the given index of this sequence, if present.final @NotNull Range
eolEndRange
(int eolEnd) Return Range of eol at given indexfinal int
eolStartLength
(int eolStart) Get the length of EOL character at the given index of this sequence, if present.@NotNull Range
eolStartRange
(int eolStart) Return Range of eol at given indexfinal boolean
Test the sequence for a match to another CharSequencefinal boolean
Equality comparison based on character content of this sequence, with quick fail resorting to content comparison only if length and hashCodes are equalfinal boolean
equalsIgnoreCase
(@Nullable Object other) Test the sequence for a match to another CharSequence, ignoring case differencesfinal T
extractRanges
(Range... ranges) Build a sequence of ranges in this sequencefinal T
extractRanges
(Iterable<Range> ranges) final char
final int
hashCode()
String hash code computationfinal T
If this sequence is the nullSequence() instance then returns other, otherwise returns this sequence.final T
ifNullEmptyAfter
(T other) If this sequence is the nullSequence() instance then returns an empty subSequence from the end of other, otherwise returns this sequence.final T
ifNullEmptyBefore
(T other) If this sequence is the nullSequence() instance then returns an empty subSequence from the start of other, otherwise returns this sequence.final int
indexOf
(char c) final int
indexOf
(char c, int fromIndex) final int
indexOf
(char c, int fromIndex, int endIndex) final int
indexOf
(@NotNull CharSequence s) All index methods return the position or -1 if not found of the given character, characters or string.final int
indexOf
(@NotNull CharSequence s, int fromIndex) final int
indexOf
(@NotNull CharSequence s, int fromIndex, int endIndex) final @org.jetbrains.annotations.NotNull int[]
indexOfAll
(@NotNull CharSequence s) Get indices of all occurrences of a sequencefinal int
indexOfAny
(@NotNull CharPredicate s) final int
indexOfAny
(@NotNull CharPredicate s, int index) final int
indexOfAny
(@NotNull CharPredicate s, int fromIndex, int endIndex) final int
indexOfAnyNot
(@NotNull CharPredicate s) final int
indexOfAnyNot
(@NotNull CharPredicate s, int fromIndex) final int
indexOfAnyNot
(@NotNull CharPredicate s, int fromIndex, int endIndex) final int
indexOfNot
(char c) final int
indexOfNot
(char c, int fromIndex) final int
indexOfNot
(char c, int fromIndex, int endIndex) insert
(int index, @NotNull CharSequence chars) Insert char sequence at given indexfinal boolean
isBlank()
boolean
isCharAt
(int index, @NotNull CharPredicate predicate) Safe, if index out of range returns '\0'final boolean
isEmpty()
boolean
boolean
isIn
(@NotNull Collection<? extends CharSequence> texts) final boolean
final boolean
final boolean
final boolean
isNull()
final char
lastChar()
final int
lastIndexOf
(char c) final int
lastIndexOf
(char c, int fromIndex) final int
lastIndexOf
(char c, int startIndex, int fromIndex) final int
lastIndexOf
(@NotNull CharSequence s) final int
lastIndexOf
(@NotNull CharSequence s, int fromIndex) final int
lastIndexOf
(@NotNull CharSequence s, int startIndex, int fromIndex) final int
lastIndexOfAny
(@NotNull CharPredicate s) final int
lastIndexOfAny
(@NotNull CharPredicate s, int fromIndex) final int
lastIndexOfAny
(@NotNull CharPredicate s, int startIndex, int fromIndex) final int
lastIndexOfAnyNot
(@NotNull CharPredicate s) final int
lastIndexOfAnyNot
(@NotNull CharPredicate s, int fromIndex) final int
lastIndexOfAnyNot
(@NotNull CharPredicate s, int startIndex, int fromIndex) final int
lastIndexOfNot
(char c) final int
lastIndexOfNot
(char c, int fromIndex) final int
lastIndexOfNot
(char c, int startIndex, int fromIndex) final @NotNull Range
final @NotNull Range
leadingBlankLinesRange
(int startIndex) final @NotNull Range
leadingBlankLinesRange
(int fromIndex, int endIndex) final @NotNull Range
leadingBlankLinesRange
(@NotNull CharPredicate eolChars, int fromIndex, int endIndex) Get Range of leading blank lines at given index offsets in sequencefinal T
lineAt
(int index) Get the line characters at given index, line delimited by \nfinal T
lineAtAnyEOL
(int index) Get the line characters at given index, line delimited by \n, \r or \r\nlineColumnAtIndex
(int index) Get the line and column information from index into sequencefinal @NotNull Range
lineRangeAt
(int index) Get the line characters at given index, line delimited by \nfinal @NotNull Range
lineRangeAtAnyEOL
(int index) Get the line characters at given index, line delimited by \n, \r or \r\nfinal boolean
matchChars
(@NotNull CharSequence chars) Test the sequence portion for a match to another CharSequencefinal boolean
matchChars
(@NotNull CharSequence chars, boolean ignoreCase) final boolean
matchChars
(@NotNull CharSequence chars, int startIndex) final boolean
matchChars
(@NotNull CharSequence chars, int startIndex, boolean ignoreCase) Test the sequence portion for a match to another CharSequencefinal boolean
matchCharsIgnoreCase
(@NotNull CharSequence chars) final boolean
matchCharsIgnoreCase
(@NotNull CharSequence chars, int startIndex) final boolean
matchCharsReversed
(@NotNull CharSequence chars, int endIndex) final boolean
matchCharsReversed
(@NotNull CharSequence chars, int endIndex, boolean ignoreCase) Test the sequence portion for a match to another CharSequence, reverse orderfinal boolean
matchCharsReversedIgnoreCase
(@NotNull CharSequence chars, int endIndex) final int
matchedCharCount
(@NotNull CharSequence chars, int startIndex) final int
matchedCharCount
(@NotNull CharSequence chars, int startIndex, boolean ignoreCase) final int
matchedCharCount
(@NotNull CharSequence chars, int startIndex, int endIndex) final int
matchedCharCount
(@NotNull CharSequence chars, int startIndex, int endIndex, boolean ignoreCase) final int
matchedCharCount
(@NotNull CharSequence chars, int startIndex, int endIndex, boolean fullMatchOnly, boolean ignoreCase) Test the sequence portion for a match to another CharSequencefinal int
matchedCharCountIgnoreCase
(@NotNull CharSequence chars, int startIndex) final int
matchedCharCountIgnoreCase
(@NotNull CharSequence chars, int startIndex, int endIndex) final int
matchedCharCountReversed
(@NotNull CharSequence chars, int fromIndex) final int
matchedCharCountReversed
(@NotNull CharSequence chars, int fromIndex, boolean ignoreCase) final int
matchedCharCountReversed
(@NotNull CharSequence chars, int startIndex, int fromIndex) final int
matchedCharCountReversed
(@NotNull CharSequence chars, int startIndex, int fromIndex, boolean ignoreCase) Test the sequence portion for a match to another CharSequence, equivalent to taking this.subSequence(startIndex, fromIndex) and then count matching chars going from end of both sequencesfinal int
matchedCharCountReversedIgnoreCase
(@NotNull CharSequence chars, int fromIndex) final int
matchedCharCountReversedIgnoreCase
(@NotNull CharSequence chars, int startIndex, int fromIndex) final boolean
matches
(@NotNull CharSequence chars) Test the sequence for a match to another CharSequencefinal boolean
matches
(@NotNull CharSequence chars, boolean ignoreCase) final boolean
matchesIgnoreCase
(@NotNull CharSequence chars) final char
midCharAt
(int index) Convenience method to get characters offset from start or end of sequence.final T
midSequence
(int startIndex) Convenience method to get characters offset from start or end of sequence.final T
midSequence
(int startIndex, int endIndex) Convenience method to get characters offset from start or end of sequence.final @NotNull String
replace any \r\n and \r by \n, append terminating EOL if one is not presentfinal @NotNull String
replace any \r\n and \r by \nfinal T
nullIf
(boolean condition) If condition is true return nullSequence() otherwise returns this sequence.final T
nullIf
(CharSequence... matches) If this sequence matches one of given sequences return nullSequence() otherwise returns this sequence.final T
nullIf
(@NotNull BiPredicate<? super T, ? super CharSequence> predicate, CharSequence... matches) If predicate returns true for this sequence and one of given sequences return nullSequence() otherwise returns this sequence.final T
nullIf
(@NotNull Predicate<? super CharSequence> predicate, CharSequence... matches) If predicate returns true for one of given sequences return nullSequence() otherwise returns this sequence.final T
If this sequence is blank return nullSequence() otherwise returns this sequence.final T
If this sequence is empty return nullSequence() otherwise returns this sequence.final T
nullIfEndsWith
(boolean ignoreCase, CharSequence... matches) final T
nullIfEndsWith
(CharSequence... matches) final T
nullIfEndsWithIgnoreCase
(CharSequence... matches) final T
nullIfNot
(CharSequence... matches) final T
nullIfNot
(@NotNull BiPredicate<? super T, ? super CharSequence> predicate, CharSequence... matches) final T
nullIfNot
(@NotNull Predicate<? super CharSequence> predicate, CharSequence... matches) final T
nullIfNotEndsWith
(boolean ignoreCase, CharSequence... matches) final T
nullIfNotEndsWith
(CharSequence... matches) final T
nullIfNotEndsWithIgnoreCase
(CharSequence... matches) final T
nullIfNotStartsWith
(boolean ignoreCase, CharSequence... matches) final T
nullIfNotStartsWith
(CharSequence... matches) final T
nullIfNotStartsWithIgnoreCase
(CharSequence... matches) final T
nullIfStartsWith
(boolean ignoreCase, CharSequence... matches) final T
nullIfStartsWith
(CharSequence... matches) final T
nullIfStartsWithIgnoreCase
(CharSequence... matches) final T
padding
(int length) final T
padding
(int length, char pad) Get the chars needed for padding to lengthpadEnd
(int length) padEnd
(int length, char pad) padStart
(int length) padStart
(int length, char pad) Pad this sequence to given lengthfinal T
prefixOnceWith
(@Nullable CharSequence prefix) Prefix this sequence with a char sequence if not already starting with prefixfinal T
final T
prefixWith
(@Nullable CharSequence prefix) Prefix this sequence with a char sequencefinal T
final T
final T
prefixWithSpaces
(int count) final T
removePrefix
(@NotNull CharSequence prefix) Remove prefix if presentfinal T
removePrefix
(@NotNull CharSequence prefix, boolean ignoreCase) Remove prefix if presentfinal T
removePrefixIgnoreCase
(@NotNull CharSequence prefix) Remove prefix if present, ignoring case differencesfinal T
removeProperPrefix
(@NotNull CharSequence prefix) Remove prefix if present but only if this sequence is longer than the suffixfinal T
removeProperPrefix
(@NotNull CharSequence prefix, boolean ignoreCase) Remove prefix if present but only if this sequence is longer than the suffixfinal T
removeProperPrefixIgnoreCase
(@NotNull CharSequence prefix) Remove prefix if present but only if this sequence is longer than the suffix, ignoring case differencesfinal T
removeProperSuffix
(@NotNull CharSequence suffix) Remove suffix if present but only if this sequence is longer than the suffixfinal T
removeProperSuffix
(@NotNull CharSequence suffix, boolean ignoreCase) Remove suffix if present but only if this sequence is longer than the suffixfinal T
removeProperSuffixIgnoreCase
(@NotNull CharSequence suffix) Remove suffix if present but only if this sequence is longer than the suffix, ignoring case differencesfinal T
removeSuffix
(@NotNull CharSequence suffix) Remove suffix if presentfinal T
removeSuffix
(@NotNull CharSequence suffix, boolean ignoreCase) Remove suffix if presentfinal T
removeSuffixIgnoreCase
(@NotNull CharSequence suffix) Remove suffix if present, ignoring case differencesfinal T
replace
(int startIndex, int endIndex, @NotNull CharSequence replacement) Replace part of the sequence with a char sequencefinal T
replace
(@NotNull CharSequence find, @NotNull CharSequence replace) Replace all occurrences of one sequence with anotherchar
safeCharAt
(int index) return char at index or '\0' if index <0 or >=length()safeSubSequence
(int startIndex) Get a portion of this sequence, if index < 0 use 0, if > length() use lengthsafeSubSequence
(int startIndex, int endIndex) Get a portion of this sequence, if index < 0 use 0, if > length() use lengthfinal T
sequenceOf
(@Nullable CharSequence charSequence) Factory functionfinal T
sequenceOf
(@Nullable CharSequence charSequence, int startIndex) Factory functionfinal T[]
split
(@NotNull CharSequence delimiter) final T[]
split
(@NotNull CharSequence delimiter, boolean includeDelims, @Nullable CharPredicate trimChars) final T[]
split
(@NotNull CharSequence delimiter, int limit, boolean includeDelims, @Nullable CharPredicate trimChars) final T[]
split
(@NotNull CharSequence delimiter, int limit, int flags) final T[]
split
(@NotNull CharSequence delimiter, int limit, int flags, @Nullable CharPredicate trimChars) final T[]
splitEOL()
final T[]
splitEOL
(boolean includeDelims) splitList
(@NotNull CharSequence delimiter) splitList
(@NotNull CharSequence delimiter, boolean includeDelims, @Nullable CharPredicate trimChars) splitList
(@NotNull CharSequence delimiter, int limit, boolean includeDelims, @Nullable CharPredicate trimChars) Split helpers based on delimiter character sets contained in CharPredicatesplitList
(@NotNull CharSequence delimiter, int limit, int flags) splitList
(@NotNull CharSequence delimiter, int limit, int flags, @Nullable CharPredicate trimChars) Split helpers based on delimiter character sets contained in CharSequencesplitListEOL
(boolean includeDelims) splitListEOL
(boolean includeDelims, @Nullable CharPredicate trimChars) final int
startOfDelimitedBy
(@NotNull CharSequence s, int index) final int
startOfDelimitedByAny
(@NotNull CharPredicate s, int index) final int
startOfDelimitedByAnyNot
(@NotNull CharPredicate s, int index) final int
startOfLine
(int index) Get the offset of the start of line at given index, start of line delimited by \nfinal int
startOfLineAnyEOL
(int index) Get the offset of the start of line at given index, start of line delimited by \n or any of \n \r \r\n for Any methods.final boolean
startsWith
(@NotNull CharPredicate chars) final boolean
startsWith
(@NotNull CharSequence prefix) test if this sequence starts with given charactersfinal boolean
startsWith
(@NotNull CharSequence prefix, boolean ignoreCase) test if this sequence starts with given charactersfinal boolean
final boolean
final boolean
startsWithIgnoreCase
(@NotNull CharSequence prefix) test if this sequence starts with given characters, ignoring case differencesfinal boolean
final boolean
final boolean
final T
subSequence
(int startIndex) Get a portion of this sequence starting from a given offset to endIndex of the sequencefinal T
subSequence
(@NotNull Range range) Get a portion of this sequence selected by rangefinal T
subSequenceAfter
(@NotNull Range range) Get a portion of this sequence after one selected by rangefinal T
subSequenceBefore
(@NotNull Range range) Get a portion of this sequence before one selected by rangesubSequenceBeforeAfter
(Range range) Get a portions of this sequence before and after one selected by rangefinal T
suffixOnceWith
(@Nullable CharSequence suffix) Suffix this sequence with a char sequence if not already ending with suffixfinal T
final T
suffixWith
(@Nullable CharSequence suffix) Prefix this sequence with a char sequencefinal T
final T
final T
suffixWithSpaces
(int count) final T
Map characters of this sequence to: Uppercase, Lowercase or use custom mappingfinal T
toNbSp()
Map spaces to non break spacesfinal T
toSpc()
Map non break spaces to spaces@NotNull String
toString()
@Nullable String
Return string or null if BaseSequence.NULLfinal T
final @NotNull String
final @NotNull Range
final @NotNull Range
trailingBlankLinesRange
(int fromIndex) final @NotNull Range
trailingBlankLinesRange
(int startIndex, int fromIndex) final @NotNull Range
trailingBlankLinesRange
(CharPredicate eolChars, int startIndex, int fromIndex) Get Range of trailing blank lines at given index offsets in sequencefinal T
trim()
final T
trim
(int keep) final T
trim
(int keep, @NotNull CharPredicate chars) final T
trim
(@NotNull CharPredicate chars) final T
trimEnd()
final T
trimEnd
(int keep) final T
trimEnd
(int keep, @NotNull CharPredicate chars) final T
trimEnd
(@NotNull CharPredicate chars) final @NotNull Range
final @NotNull Range
trimEndRange
(int keep) final @NotNull Range
trimEndRange
(int keep, @NotNull CharPredicate chars) final @NotNull Range
trimEndRange
(@NotNull CharPredicate chars) final T
trimEOL()
Trim last eol at the end of this sequence,final T
trimmed()
trimmed
(int keep) trimmed
(int keep, @NotNull CharPredicate chars) trimmed
(@NotNull CharPredicate chars) final T
final T
trimmedEnd
(int keep) final T
trimmedEnd
(int keep, @NotNull CharPredicate chars) final T
trimmedEnd
(@NotNull CharPredicate chars) final T
Get Trimmed part byIRichSequence.trimEOL()
final T
final T
trimmedStart
(int keep) final T
trimmedStart
(int keep, @NotNull CharPredicate chars) Get the characters Trimmed, Trimmed from start/end of this sequence, characters to trim are passed in the sequence argumentfinal T
trimmedStart
(@NotNull CharPredicate chars) final @NotNull Range
final @NotNull Range
trimRange
(int keep) final @NotNull Range
trimRange
(int keep, @NotNull CharPredicate chars) final @NotNull Range
trimRange
(@NotNull CharPredicate chars) final T
final T
trimStart
(int keep) final T
trimStart
(int keep, @NotNull CharPredicate chars) Trim, Trim start/end of this sequence, characters to trim are passed in the sequence argumentfinal T
trimStart
(@NotNull CharPredicate chars) final @NotNull Range
final @NotNull Range
trimStartRange
(int keep) final @NotNull Range
trimStartRange
(int keep, @NotNull CharPredicate chars) Range of kept sequence when trim start/end of this sequence is performed, characters to trim are passed in the sequence argumentfinal @NotNull Range
trimStartRange
(@NotNull CharPredicate chars) final T
Trim leading trailing blank lines in this sequencetrimToEndOfLine
(boolean includeEol) trimToEndOfLine
(boolean includeEol, int index) trimToEndOfLine
(int index) trimToEndOfLine
(@NotNull CharPredicate eolChars, boolean includeEol, int index) Trim end to end of line containing indextrimToStartOfLine
(boolean includeEol) trimToStartOfLine
(boolean includeEol, int index) trimToStartOfLine
(int index) trimToStartOfLine
(@NotNull CharPredicate eolChars, boolean includeEol, int index) Trim start to start of line containing indexfinal void
validateIndex
(int index) final void
validateIndexInclusiveEnd
(int index) final void
validateStartEnd
(int startIndex, int endIndex) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, length
Methods inherited from interface com.vladsch.flexmark.util.sequence.IRichSequence
countLeading, countLeading, countOf, countTrailing, emptyArray, eolLength, eolStartLength, getBuilder, getColumnAtIndex, getLineColumnAtIndex, insert, nullIfEndsWithNot, nullIfStartsWithNot, nullSequence, sequenceOf, split, split, split, subSequence, toMapped
-
Field Details
-
hash
private int hash
-
-
Constructor Details
-
IRichSequenceBase
public IRichSequenceBase(int hash) Constructor with pre-computed hash if available, 0 for lazy computation if length() not 0NOTE: the hash code computed for this class is equivalent to the string hash of the same characters to ensure that equals can use the hash code for quick failure. CharSequence hash code is not specified therefore when in doubt about how it is computed then 0 should be passed to this constructor to compute one that is equal to the string content.
- Parameters:
hash
- hash code for the char sequence.
-
-
Method Details
-
equals
Equality comparison based on character content of this sequence, with quick fail resorting to content comparison only if length and hashCodes are equal- Specified by:
equals
in interfaceIRichSequence<T extends IRichSequence<T>>
- Overrides:
equals
in classObject
- Parameters:
o
- any char sequence- Returns:
- true if character contents are equal
-
hashCode
@Contract(pure=true) public final int hashCode()String hash code computation- Specified by:
hashCode
in interfaceIRichSequence<T extends IRichSequence<T>>
- Overrides:
hashCode
in classObject
- Returns:
- hash code of equivalent string
-
equalsIgnoreCase
@Contract(pure=true, value="null -> false") public final boolean equalsIgnoreCase(@Nullable @Nullable Object other) Description copied from interface:IRichSequence
Test the sequence for a match to another CharSequence, ignoring case differences- Specified by:
equalsIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
other
- characters to match against- Returns:
- true if match
-
equals
@Contract(pure=true, value="null, _ ->false") public final boolean equals(@Nullable @Nullable Object other, boolean ignoreCase) Description copied from interface:IRichSequence
Test the sequence for a match to another CharSequence- Specified by:
equals
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
other
- characters to match againstignoreCase
- case ignored when true- Returns:
- true if match
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T extends IRichSequence<T>>
-
sequenceOf
Description copied from interface:IRichSequence
Factory function- Specified by:
sequenceOf
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
charSequence
- char sequence from which to construct a rich char sequence- Returns:
- rich char sequence from given inputs
-
sequenceOf
Description copied from interface:IRichSequence
Factory function- Specified by:
sequenceOf
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
charSequence
- char sequence from which to construct a rich char sequencestartIndex
- start index of the sequence to use- Returns:
- rich char sequence from given inputs
-
subSequence
Description copied from interface:IRichSequence
Get a portion of this sequence starting from a given offset to endIndex of the sequence- Specified by:
subSequence
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startIndex
- offset from startIndex of this sequence- Returns:
- based sequence whose contents reflect the selected portion
-
subSequence
Get a portion of this sequence selected by range- Specified by:
subSequence
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
range
- range to get, coordinates offset form start of this sequence- Returns:
- sequence whose contents reflect the selected portion, if range.isNull() then this is returned
-
subSequenceBefore
Get a portion of this sequence before one selected by range- Specified by:
subSequenceBefore
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
range
- range to get, coordinates offset form start of this sequence- Returns:
- sequence whose contents come before the selected range, if range.isNull() then
IRichSequence.nullSequence()
-
subSequenceAfter
Get a portion of this sequence after one selected by range- Specified by:
subSequenceAfter
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
range
- range to get, coordinates offset form start of this sequence- Returns:
- sequence whose contents come after the selected range, if range.isNull() then
IRichSequence.nullSequence()
-
subSequenceBeforeAfter
Get a portions of this sequence before and after one selected by range- Parameters:
range
- range to get, coordinates offset form start of this sequence- Returns:
- sequence whose contents come before and after the selected range, if range.isNull() then
IRichSequence.nullSequence()
-
endSequence
Description copied from interface:IRichSequence
Convenience method to get characters offset from endIndex of sequence. no exceptions are thrown, instead a \0 is returned for an invalid index positions- Specified by:
endSequence
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startIndex
- offset from endIndex of sequence [ 0..length() )endIndex
- offset from endIndex of sequence [ 0..length() )- Returns:
- selected portion spanning length() - startIndex to length() - endIndex of this sequence
-
endSequence
Description copied from interface:IRichSequence
Convenience method to get characters offset from endIndex of sequence. no exceptions are thrown, instead a \0 is returned for an invalid index positions- Specified by:
endSequence
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startIndex
- offset from endIndex of sequence [ 0..length() )- Returns:
- selected portion spanning length() - startIndex to length() of this sequence
-
endCharAt
public final char endCharAt(int index) Description copied from interface:IRichSequence
Convenience method to get characters offset from end of sequence. no exceptions are thrown, instead a \0 is returned for an invalid index positions- Specified by:
endCharAt
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- offset from end of sequence- Returns:
- character located at length() - index in this sequence
-
midSequence
Description copied from interface:IRichSequence
Convenience method to get characters offset from start or end of sequence. when offset >=0 then it is offset from the start of the sequence, when <0 then from the endno exceptions are thrown, instead a \0 is returned for an invalid index positions
- Specified by:
midSequence
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startIndex
- offset into this sequenceendIndex
- offset into this sequence- Returns:
- selected portion spanning startIndex to endIndex of this sequence. If offset is <0 then it is taken as relative to length()
-
midSequence
Description copied from interface:IRichSequence
Convenience method to get characters offset from start or end of sequence. when offset >= then it is offset from the start of the sequence, when <0 then from the endno exceptions are thrown, instead a \0 is returned for an invalid index positions
- Specified by:
midSequence
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startIndex
- offset into this sequence- Returns:
- selected portion spanning startIndex to length() of this sequence. If offset is <0 then it is taken as relative to length()
-
midCharAt
public final char midCharAt(int index) Description copied from interface:IRichSequence
Convenience method to get characters offset from start or end of sequence. when index >= then it is offset from the start of the sequence, when <0 then from the end no exceptions are thrown, instead a \0 is returned for an invalid index positions- Specified by:
midCharAt
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- of character to get- Returns:
- character at index or \0 if index is outside valid range for this sequence
-
lastChar
public final char lastChar()- Specified by:
lastChar
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- the last character of the sequence or '\0' if empty
-
firstChar
public final char firstChar()- Specified by:
firstChar
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- the first character of the sequence or '\0' if empty
-
validateIndex
public final void validateIndex(int index) -
validateIndexInclusiveEnd
public final void validateIndexInclusiveEnd(int index) -
validateStartEnd
public final void validateStartEnd(int startIndex, int endIndex) -
safeCharAt
public char safeCharAt(int index) Description copied from interface:IRichSequence
return char at index or '\0' if index <0 or >=length()- Specified by:
safeCharAt
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index- Returns:
- char or '\0'
-
safeSubSequence
Description copied from interface:IRichSequence
Get a portion of this sequence, if index < 0 use 0, if > length() use lengthNOTE: the returned value should only depend on start/end indices. If a subsequence of this sequence with matching start/end should equal (using equals()) all such subsequences of this sequence.
- Specified by:
safeSubSequence
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startIndex
- offset from startIndex of this sequenceendIndex
- offset from startIndex of this sequence- Returns:
- based sequence whose contents reflect the selected portion
-
safeSubSequence
Description copied from interface:IRichSequence
Get a portion of this sequence, if index < 0 use 0, if > length() use lengthNOTE: the returned value should only depend on start/end indices. If a subsequence of this sequence with matching start/end should equal (using equals()) all such subsequences of this sequence.
- Specified by:
safeSubSequence
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startIndex
- offset from startIndex of this sequence- Returns:
- based sequence whose contents reflect the selected portion
-
isCharAt
Description copied from interface:IRichSequence
Safe, if index out of range returns '\0'- Specified by:
isCharAt
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index in stringpredicate
- character set predicate- Returns:
- true if character at index tests true
-
toStringOrNull
Description copied from interface:IRichSequence
Return string or null if BaseSequence.NULL- Specified by:
toStringOrNull
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- string or null if BaseSequence.NULL
-
indexOf
Description copied from interface:IRichSequence
All index methods return the position or -1 if not found of the given character, characters or string.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.
- Specified by:
indexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
s
- character pre whose occurrence to find- Returns:
- index where found or -1
-
indexOf
- Specified by:
indexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOf
- Specified by:
indexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOf
public final int indexOf(char c) - Specified by:
indexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOf
public final int indexOf(char c, int fromIndex) - Specified by:
indexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAny
- Specified by:
indexOfAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAny
- Specified by:
indexOfAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAnyNot
- Specified by:
indexOfAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAnyNot
- Specified by:
indexOfAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAnyNot
- Specified by:
indexOfAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfNot
public final int indexOfNot(char c) - Specified by:
indexOfNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfNot
public final int indexOfNot(char c, int fromIndex) - Specified by:
indexOfNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
public final int lastIndexOf(char c) - Specified by:
lastIndexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
public final int lastIndexOf(char c, int fromIndex) - Specified by:
lastIndexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfNot
public final int lastIndexOfNot(char c) - Specified by:
lastIndexOfNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfNot
public final int lastIndexOfNot(char c, int fromIndex) - Specified by:
lastIndexOfNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAny
- Specified by:
lastIndexOfAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAny
- Specified by:
lastIndexOfAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAnyNot
- Specified by:
lastIndexOfAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAnyNot
- Specified by:
lastIndexOfAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAnyNot
public final int lastIndexOfAnyNot(@NotNull @NotNull CharPredicate s, int startIndex, int fromIndex) - Specified by:
lastIndexOfAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOf
public final int indexOf(char c, int fromIndex, int endIndex) - Specified by:
indexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfNot
public final int indexOfNot(char c, int fromIndex, int endIndex) - Specified by:
indexOfNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAny
- Specified by:
indexOfAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
public final int lastIndexOf(char c, int startIndex, int fromIndex) - Specified by:
lastIndexOf
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfNot
public final int lastIndexOfNot(char c, int startIndex, int fromIndex) - Specified by:
lastIndexOfNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAny
- Specified by:
lastIndexOfAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfSpaceTab
public final int countOfSpaceTab()- Specified by:
countOfSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfNotSpaceTab
public final int countOfNotSpaceTab()- Specified by:
countOfNotSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfWhitespace
public final int countOfWhitespace()- Specified by:
countOfWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfNotWhitespace
public final int countOfNotWhitespace()- Specified by:
countOfNotWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAny
- Specified by:
countOfAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAny
- Specified by:
countOfAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAnyNot
- Specified by:
countOfAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAnyNot
- Specified by:
countOfAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAny
- Specified by:
countOfAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAnyNot
- Specified by:
countOfAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeading
Description copied from interface:IRichSequence
Count leading/trailing characters of this sequenceParameters can be CharPredicate, counts any contiguous leading/trailing characters in the sequence which are contained in the given char set.
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(CharPredicate): count contiguous leading characters from set in this sequence countLeadingNot(CharPredicate): count contiguous leading characters not from set in this sequence countTrailing(CharPredicate): count contiguous leading characters from set in this sequence countTrailingNot(CharPredicate): count contiguous leading characters not from set in this sequence
- Specified by:
countLeading
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
chars
- predicate for set of contiguous characters which should be counted- Returns:
- number of chars in contiguous span at start of sequence
-
countLeading
- Specified by:
countLeading
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNot
- Specified by:
countLeadingNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNot
- Specified by:
countLeadingNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailing
- Specified by:
countTrailing
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailing
- Specified by:
countTrailing
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNot
- Specified by:
countTrailingNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNot
- Specified by:
countTrailingNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNot
public final int countLeadingNot(@NotNull @NotNull CharPredicate chars, int startIndex, int endIndex) - Specified by:
countLeadingNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNot
public final int countTrailingNot(@NotNull @NotNull CharPredicate chars, int startIndex, int endIndex) - Specified by:
countTrailingNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeading
- Specified by:
countLeading
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingColumns
Description copied from interface:IRichSequence
Count column of indent given by chars in the set in this sequence, expanding tabs to 4th column- Specified by:
countLeadingColumns
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startColumn
- column of where this sequence startschars
- whitespace characters- Returns:
- column of first non-whitespace as given by chars
-
countTrailing
public final int countTrailing(@NotNull @NotNull CharPredicate chars, int startIndex, int fromIndex) - Specified by:
countTrailing
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpace
public final int countLeadingSpace()- Specified by:
countLeadingSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpace
public final int countLeadingNotSpace()- Specified by:
countLeadingNotSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpace
public final int countLeadingSpace(int startIndex) - Specified by:
countLeadingSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpace
public final int countLeadingNotSpace(int startIndex) - Specified by:
countLeadingNotSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpace
public final int countLeadingSpace(int startIndex, int endIndex) - Specified by:
countLeadingSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpace
public final int countLeadingNotSpace(int startIndex, int endIndex) - Specified by:
countLeadingNotSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpace
public final int countTrailingSpace()- Specified by:
countTrailingSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpace
public final int countTrailingNotSpace()- Specified by:
countTrailingNotSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpace
public final int countTrailingSpace(int fromIndex) - Specified by:
countTrailingSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpace
public final int countTrailingNotSpace(int fromIndex) - Specified by:
countTrailingNotSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpace
public final int countTrailingSpace(int startIndex, int fromIndex) - Specified by:
countTrailingSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpace
public final int countTrailingNotSpace(int startIndex, int fromIndex) - Specified by:
countTrailingNotSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpaceTab
public final int countLeadingSpaceTab()- Specified by:
countLeadingSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpaceTab
public final int countLeadingNotSpaceTab()- Specified by:
countLeadingNotSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpaceTab
public final int countLeadingSpaceTab(int startIndex) - Specified by:
countLeadingSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpaceTab
public final int countLeadingNotSpaceTab(int startIndex) - Specified by:
countLeadingNotSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpaceTab
public final int countLeadingSpaceTab(int startIndex, int endIndex) - Specified by:
countLeadingSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpaceTab
public final int countLeadingNotSpaceTab(int startIndex, int endIndex) - Specified by:
countLeadingNotSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpaceTab
public final int countTrailingSpaceTab()- Specified by:
countTrailingSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpaceTab
public final int countTrailingNotSpaceTab()- Specified by:
countTrailingNotSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpaceTab
public final int countTrailingSpaceTab(int fromIndex) - Specified by:
countTrailingSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpaceTab
public final int countTrailingNotSpaceTab(int fromIndex) - Specified by:
countTrailingNotSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpaceTab
public final int countTrailingSpaceTab(int startIndex, int fromIndex) - Specified by:
countTrailingSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpaceTab
public final int countTrailingNotSpaceTab(int startIndex, int fromIndex) - Specified by:
countTrailingNotSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingWhitespace
public final int countLeadingWhitespace()- Specified by:
countLeadingWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotWhitespace
public final int countLeadingNotWhitespace()- Specified by:
countLeadingNotWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingWhitespace
public final int countLeadingWhitespace(int startIndex) - Specified by:
countLeadingWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotWhitespace
public final int countLeadingNotWhitespace(int startIndex) - Specified by:
countLeadingNotWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingWhitespace
public final int countLeadingWhitespace(int startIndex, int endIndex) - Specified by:
countLeadingWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotWhitespace
public final int countLeadingNotWhitespace(int startIndex, int endIndex) - Specified by:
countLeadingNotWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingWhitespace
public final int countTrailingWhitespace()- Specified by:
countTrailingWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotWhitespace
public final int countTrailingNotWhitespace()- Specified by:
countTrailingNotWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingWhitespace
public final int countTrailingWhitespace(int fromIndex) - Specified by:
countTrailingWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotWhitespace
public final int countTrailingNotWhitespace(int fromIndex) - Specified by:
countTrailingNotWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingWhitespace
public final int countTrailingWhitespace(int startIndex, int fromIndex) - Specified by:
countTrailingWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotWhitespace
public final int countTrailingNotWhitespace(int startIndex, int fromIndex) - Specified by:
countTrailingNotWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStart
- Specified by:
trimStart
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedStart
- Specified by:
trimmedStart
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEnd
- Specified by:
trimEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedEnd
- Specified by:
trimmedEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trim
- Specified by:
trim
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmed
- Specified by:
trimmed
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStart
- Specified by:
trimStart
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedStart
- Specified by:
trimmedStart
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEnd
- Specified by:
trimEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedEnd
- Specified by:
trimmedEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trim
- Specified by:
trim
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmed
- Specified by:
trimmed
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStart
- Specified by:
trimStart
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedStart
- Specified by:
trimmedStart
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEnd
- Specified by:
trimEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedEnd
- Specified by:
trimmedEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trim
- Specified by:
trim
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmed
- Specified by:
trimmed
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStart
Description copied from interface:IRichSequence
Trim, Trim start/end of this sequence, characters to trim are passed in the sequence argumentreturns trimmed sequence or if nothing matched the original sequence
If character set in the form of character sequence is not passed in the
SequenceUtils.WHITESPACE
are assumed.- Specified by:
trimStart
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
keep
- minimum length of would be trimmed characters to keep. ie. keep 4, will leave 0..4 as is but remove any >4chars
- set of characters to trim from start of line- Returns:
- sequence after it is trimmed
-
trimmedStart
Description copied from interface:IRichSequence
Get the characters Trimmed, Trimmed from start/end of this sequence, characters to trim are passed in the sequence argumentreturns trimmed sequence or if nothing matched the original sequence
The pair returning functions return before and after sequence
- Specified by:
trimmedStart
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
keep
- minimum length of would be trimmed characters to keep. ie. keep 4, will leave 0..4 as is but remove any >4chars
- set of characters to trim from start of line- Returns:
- part of the sequence that was trimmed from the start
-
trimEnd
- Specified by:
trimEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedEnd
- Specified by:
trimmedEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trim
- Specified by:
trim
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmed
- Specified by:
trimmed
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStartRange
@NotNull public final @NotNull Range trimStartRange(int keep, @NotNull @NotNull CharPredicate chars) Description copied from interface:IRichSequence
Range of kept sequence when trim start/end of this sequence is performed, characters to trim are passed in the sequence argumentreturns range of kept sequence or if nothing matched then Range.NULL is returned, meaning keep all
If character set in the form of character sequence is not passed in the
SequenceUtils.WHITESPACE
are assumed.- Specified by:
trimStartRange
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
keep
- minimum length of would be trimmed characters to keep. ie. keep 4, will leave 0..4 as is but remove any >4chars
- set of characters to trim from start of line- Returns:
- range in this sequence to keep or Range.NULL if to keep all
-
trimEndRange
- Specified by:
trimEndRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimRange
- Specified by:
trimRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStartRange
- Specified by:
trimStartRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEndRange
- Specified by:
trimEndRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimRange
- Specified by:
trimRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStartRange
- Specified by:
trimStartRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEndRange
- Specified by:
trimEndRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimRange
- Specified by:
trimRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStartRange
- Specified by:
trimStartRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEndRange
- Specified by:
trimEndRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimRange
- Specified by:
trimRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
padding
Description copied from interface:IRichSequence
Get the chars needed for padding to length- Specified by:
padding
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
length
- lengthpad
- char to use for padding- Returns:
- padding chars
-
padding
- Specified by:
padding
in interfaceIRichSequence<T extends IRichSequence<T>>
-
padStart
Description copied from interface:IRichSequence
Pad this sequence to given length- Specified by:
padStart
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
length
- length to padpad
- char to use for padding- Returns:
- sequence padded
-
padEnd
- Specified by:
padEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
padStart
- Specified by:
padStart
in interfaceIRichSequence<T extends IRichSequence<T>>
-
padEnd
- Specified by:
padEnd
in interfaceIRichSequence<T extends IRichSequence<T>>
-
eolEndLength
public final int eolEndLength()Description copied from interface:IRichSequence
Get the length of EOL character at the end of this sequence, if present.\n - 1 \r - 1 \r\n - 2
- Specified by:
eolEndLength
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- 0 if no EOL, 1, or 2 depending on the EOL suffix of this sequence
-
eolEndLength
public final int eolEndLength(int eolEnd) Description copied from interface:IRichSequence
Get the length of EOL character at the given index of this sequence, if present.\n - 1 \r - 1 \r\n - 2
- Specified by:
eolEndLength
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
eolEnd
- index where the EOL ends, if any, any value can be passed for this argument. If > length of this sequence then it is the same as passing length(), if 0 or less then 0 is returned.- Returns:
- 0 if no EOL, 1, or 2 depending on the EOL suffix of this sequence
-
eolStartLength
public final int eolStartLength(int eolStart) Description copied from interface:IRichSequence
Get the length of EOL character at the given index of this sequence, if present.\n - 1 \r - 1 \r\n - 2
- Specified by:
eolStartLength
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
eolStart
- index where the EOL starts, if any, any value can be passed for this argument. If >= length of this sequence then 0 is returned if 0 or less then it is the same as 0- Returns:
- 0 if no EOL, 1, or 2 depending on the EOL suffix of this sequence
-
endOfLine
public final int endOfLine(int index) Description copied from interface:IRichSequence
Get the offset of the end of line at given index, end of line delimited by \n- Specified by:
endOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index where to start searching for end of line- Returns:
- index of end of line delimited by \n
-
endOfLineAnyEOL
public final int endOfLineAnyEOL(int index) Description copied from interface:IRichSequence
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.- Specified by:
endOfLineAnyEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index where to start searching for end of line- Returns:
- index of end of line delimited by \n
-
startOfLine
public final int startOfLine(int index) Description copied from interface:IRichSequence
Get the offset of the start of line at given index, start of line delimited by \n- Specified by:
startOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index where to start searching for end of line- Returns:
- index of end of line delimited by \n
-
startOfLineAnyEOL
public final int startOfLineAnyEOL(int index) Description copied from interface:IRichSequence
Get the offset of the start of line at given index, start of line delimited by \n or any of \n \r \r\n for Any methods.- Specified by:
startOfLineAnyEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index where to start searching for end of line- Returns:
- index of end of line delimited by \n
-
startOfDelimitedByAnyNot
- Specified by:
startOfDelimitedByAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
endOfDelimitedByAnyNot
- Specified by:
endOfDelimitedByAnyNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
startOfDelimitedBy
- Specified by:
startOfDelimitedBy
in interfaceIRichSequence<T extends IRichSequence<T>>
-
startOfDelimitedByAny
- Specified by:
startOfDelimitedByAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
endOfDelimitedBy
Description copied from interface:IRichSequence
Find start/end region in this sequence delimited by any characters in argument or the CharSequenceFor Any and AnyNot methods uses the CharSequence argument as a character set of possible delimiting characters
- Specified by:
endOfDelimitedBy
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
s
- character sequence delimiting the regionindex
- from which to start looking for end of region- Returns:
- index of end of region delimited by s
-
endOfDelimitedByAny
- Specified by:
endOfDelimitedByAny
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lineRangeAt
Description copied from interface:IRichSequence
Get the line characters at given index, line delimited by \n- Specified by:
lineRangeAt
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index at which to get the line- Returns:
- range in sequence for the line delimited by '\n', containing index
-
lineRangeAtAnyEOL
Description copied from interface:IRichSequence
Get the line characters at given index, line delimited by \n, \r or \r\n- Specified by:
lineRangeAtAnyEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index at which to get the line- Returns:
- range in sequence for the line delimited by end of line, containing index
-
lineAt
Description copied from interface:IRichSequence
Get the line characters at given index, line delimited by \n- Specified by:
lineAt
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index at which to get the line- Returns:
- sub-sequence for the line containing index
-
lineAtAnyEOL
Description copied from interface:IRichSequence
Get the line characters at given index, line delimited by \n, \r or \r\n- Specified by:
lineAtAnyEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index at which to get the line- Returns:
- sub-sequence for the line containing index
-
eolEndRange
Description copied from interface:IRichSequence
Return Range of eol at given index- Specified by:
eolEndRange
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
eolEnd
- index where the EOL ends, if any, any value can be passed for this argument. If > length of this sequence then it is the same as passing length(), if 0 or less then 0 is returned.- Returns:
- range of eol given by index of its end or Range.NULL if no eol ends at index
-
eolStartRange
Description copied from interface:IRichSequence
Return Range of eol at given index- Specified by:
eolStartRange
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
eolStart
- index where the EOL starts, if any, any value can be passed for this argument. If >= length of this sequence then 0 is returned if 0 or less then it is the same as 0- Returns:
- range of eol given by index of its end or Range.NULL if no eol starts at index
-
trimEOL
Description copied from interface:IRichSequence
Trim last eol at the end of this sequence,- Specified by:
trimEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- sequence with one EOL trimmed off if it had one
-
trimmedEOL
Description copied from interface:IRichSequence
Get Trimmed part byIRichSequence.trimEOL()
- Specified by:
trimmedEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- trimmed off EOL if sequence had one or
IRichSequence.nullSequence()
-
trimTailBlankLines
Description copied from interface:IRichSequence
Trim leading trailing blank lines in this sequence- Specified by:
trimTailBlankLines
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- return sequence with trailing blank lines trimmed off
-
trimLeadBlankLines
- Specified by:
trimLeadBlankLines
in interfaceIRichSequence<T extends IRichSequence<T>>
-
leadingBlankLinesRange
- Specified by:
leadingBlankLinesRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
leadingBlankLinesRange
- Specified by:
leadingBlankLinesRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
leadingBlankLinesRange
- Specified by:
leadingBlankLinesRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trailingBlankLinesRange
- Specified by:
trailingBlankLinesRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trailingBlankLinesRange
- Specified by:
trailingBlankLinesRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trailingBlankLinesRange
- Specified by:
trailingBlankLinesRange
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trailingBlankLinesRange
@NotNull public final @NotNull Range trailingBlankLinesRange(CharPredicate eolChars, int startIndex, int fromIndex) Description copied from interface:IRichSequence
Get Range of trailing blank lines at given index offsets in sequence- Specified by:
trailingBlankLinesRange
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
eolChars
- characters to consider as EOL, noteIRichSequence.eolStartLength(int)
should report length of EOL found if length > 1startIndex
- index in sequence from which to start blank line search, also maximum index to include in blank lines range can be any value, if less than 0 it is the same as 0, if greater than length() it is the same as length()fromIndex
- maximum index in sequence to check and include in range of blank lines can be any value, if less than 0 it is the same as 0, if greater than length() it is the same as length()- Returns:
- range of blank lines at or before fromIndex and ranging to minimum of startIndex if the range in sequence contains only whitespace characters then the whole range will be returned even if contains no EOL characters
-
leadingBlankLinesRange
@NotNull public final @NotNull Range leadingBlankLinesRange(@NotNull @NotNull CharPredicate eolChars, int fromIndex, int endIndex) Description copied from interface:IRichSequence
Get Range of leading blank lines at given index offsets in sequence- Specified by:
leadingBlankLinesRange
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
eolChars
- characters to consider as EOL, noteIRichSequence.eolStartLength(int)
should report length of EOL found if length > 1fromIndex
- minimum index in sequence to check and include in range of blank lines can be any value, if less than 0 it is the same as 0, if greater than length() it is the same as length()endIndex
- index in sequence from which to start blank line search, also maximum index to include in blank lines range can be any value, if less than 0 it is the same as 0, if greater than length() it is the same as length()- Returns:
- range of blank lines at or before fromIndex and ranging to minimum of startIndex, Range.NULL if none found if the range in sequence contains only whitespace characters then the whole range will be returned even if contains no EOL characters
-
blankLinesRemovedRanges
- Specified by:
blankLinesRemovedRanges
in interfaceIRichSequence<T extends IRichSequence<T>>
-
blankLinesRemovedRanges
- Specified by:
blankLinesRemovedRanges
in interfaceIRichSequence<T extends IRichSequence<T>>
-
blankLinesRemovedRanges
- Specified by:
blankLinesRemovedRanges
in interfaceIRichSequence<T extends IRichSequence<T>>
-
blankLinesRemovedRanges
@NotNull public final @NotNull List<Range> blankLinesRemovedRanges(@NotNull @NotNull CharPredicate eolChars, int fromIndex, int endIndex) - Specified by:
blankLinesRemovedRanges
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
- Specified by:
trimToEndOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
- Specified by:
trimToEndOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
- Specified by:
trimToEndOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
- Specified by:
trimToEndOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToStartOfLine
- Specified by:
trimToStartOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToStartOfLine
- Specified by:
trimToStartOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToStartOfLine
- Specified by:
trimToStartOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToStartOfLine
- Specified by:
trimToStartOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
@NotNull public T trimToEndOfLine(@NotNull @NotNull CharPredicate eolChars, boolean includeEol, int index) Description copied from interface:IRichSequence
Trim end to end of line containing index- Specified by:
trimToEndOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
eolChars
- characters to consider as EOL, noteIRichSequence.eolStartLength(int)
should report length of EOL found if length > 1includeEol
- true if EOL is to be included in the lineindex
- index for offset contained by the line can be any value, if less than 0 it is the same as 0, if greater than length() it is the same as length()- Returns:
- trimmed version of the sequence to given EOL or the original sequence
-
trimToStartOfLine
@NotNull public T trimToStartOfLine(@NotNull @NotNull CharPredicate eolChars, boolean includeEol, int index) Description copied from interface:IRichSequence
Trim start to start of line containing index- Specified by:
trimToStartOfLine
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
eolChars
- characters to consider as EOL, noteIRichSequence.eolStartLength(int)
should report length of EOL found if length > 1includeEol
- true if EOL is to be included in the lineindex
- index for offset contained by the line can be any value, if less than 0 it is the same as 0, if greater than length() it is the same as length()- Returns:
- trimmed version of the sequence to given EOL or the original sequence
-
ifNull
Description copied from interface:IRichSequence
If this sequence is the nullSequence() instance then returns other, otherwise returns this sequence.- Specified by:
ifNull
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
other
- based sequence to return if this is nullSequence()- Returns:
- this or other
-
ifNullEmptyAfter
Description copied from interface:IRichSequence
If this sequence is the nullSequence() instance then returns an empty subSequence from the end of other, otherwise returns this sequence.- Specified by:
ifNullEmptyAfter
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
other
- based sequence from which to take the empty sequence- Returns:
- this or other.subSequence(other.length(), other.length())
-
ifNullEmptyBefore
Description copied from interface:IRichSequence
If this sequence is the nullSequence() instance then returns an empty subSequence from the start of other, otherwise returns this sequence.- Specified by:
ifNullEmptyBefore
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
other
- based sequence from which to take the empty sequence- Returns:
- this or other.subSequence(0, 0)
-
nullIfEmpty
Description copied from interface:IRichSequence
If this sequence is empty return nullSequence() otherwise returns this sequence.- Specified by:
nullIfEmpty
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- this or nullSequence()
-
nullIfBlank
Description copied from interface:IRichSequence
If this sequence is blank return nullSequence() otherwise returns this sequence.- Specified by:
nullIfBlank
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- this or nullSequence()
-
nullIf
Description copied from interface:IRichSequence
If condition is true return nullSequence() otherwise returns this sequence.- Specified by:
nullIf
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
condition
- when true return NULL else this- Returns:
- this or nullSequence()
-
nullIfNot
@NotNull public final T nullIfNot(@NotNull @NotNull BiPredicate<? super T, ? super CharSequence> predicate, CharSequence... matches) - Specified by:
nullIfNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIf
@NotNull public final T nullIf(@NotNull @NotNull Predicate<? super CharSequence> predicate, CharSequence... matches) Description copied from interface:IRichSequence
If predicate returns true for one of given sequences return nullSequence() otherwise returns this sequence.- Specified by:
nullIf
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
predicate
- sequence predicatematches
- match sequence list- Returns:
- this or nullSequence()
-
nullIfNot
@NotNull public final T nullIfNot(@NotNull @NotNull Predicate<? super CharSequence> predicate, CharSequence... matches) - Specified by:
nullIfNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIf
Description copied from interface:IRichSequence
If this sequence matches one of given sequences return nullSequence() otherwise returns this sequence.- Specified by:
nullIf
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
matches
- match sequence list- Returns:
- this or nullSequence()
-
nullIfNot
- Specified by:
nullIfNot
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfStartsWith
- Specified by:
nullIfStartsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotStartsWith
- Specified by:
nullIfNotStartsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfEndsWith
- Specified by:
nullIfEndsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotEndsWith
- Specified by:
nullIfNotEndsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfStartsWithIgnoreCase
- Specified by:
nullIfStartsWithIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotStartsWithIgnoreCase
- Specified by:
nullIfNotStartsWithIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfEndsWithIgnoreCase
- Specified by:
nullIfEndsWithIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotEndsWithIgnoreCase
- Specified by:
nullIfNotEndsWithIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfStartsWith
- Specified by:
nullIfStartsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotStartsWith
- Specified by:
nullIfNotStartsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfEndsWith
- Specified by:
nullIfEndsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotEndsWith
- Specified by:
nullIfNotEndsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIf
@NotNull public final T nullIf(@NotNull @NotNull BiPredicate<? super T, ? super CharSequence> predicate, CharSequence... matches) Description copied from interface:IRichSequence
If predicate returns true for this sequence and one of given sequences return nullSequence() otherwise returns this sequence.- Specified by:
nullIf
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
predicate
- bi predicate for test, first argument is always this, second is one of the match sequencesmatches
- match sequence list- Returns:
- this or nullSequence()
-
isNull
public final boolean isNull()- Specified by:
isNull
in interfaceIRichSequence<T extends IRichSequence<T>>
-
isNotNull
public final boolean isNotNull()- Specified by:
isNotNull
in interfaceIRichSequence<T extends IRichSequence<T>>
-
isEmpty
public final boolean isEmpty()- Specified by:
isEmpty
in interfaceCharSequence
- Specified by:
isEmpty
in interfaceIRichSequence<T extends IRichSequence<T>>
-
isBlank
public final boolean isBlank()- Specified by:
isBlank
in interfaceIRichSequence<T extends IRichSequence<T>>
-
isNotEmpty
public final boolean isNotEmpty()- Specified by:
isNotEmpty
in interfaceIRichSequence<T extends IRichSequence<T>>
-
isNotBlank
public final boolean isNotBlank()- Specified by:
isNotBlank
in interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWith
Description copied from interface:IRichSequence
test if this sequence ends with given characters- Specified by:
endsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- characters to test- Returns:
- true if ends with suffix
-
endsWith
Description copied from interface:IRichSequence
test if this sequence ends with given characters- Specified by:
endsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- characters to testignoreCase
- case ignored when true- Returns:
- true if ends with suffix
-
startsWith
Description copied from interface:IRichSequence
test if this sequence starts with given characters- Specified by:
startsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- characters to test- Returns:
- true if starts with prefix
-
startsWith
Description copied from interface:IRichSequence
test if this sequence starts with given characters- Specified by:
startsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- characters to testignoreCase
- case ignored when true- Returns:
- true if starts with prefix
-
endsWith
- Specified by:
endsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWith
- Specified by:
startsWith
in interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithEOL
public final boolean endsWithEOL()- Specified by:
endsWithEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithAnyEOL
public final boolean endsWithAnyEOL()- Specified by:
endsWithAnyEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithSpace
public final boolean endsWithSpace()- Specified by:
endsWithSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithSpaceTab
public final boolean endsWithSpaceTab()- Specified by:
endsWithSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithWhitespace
public final boolean endsWithWhitespace()- Specified by:
endsWithWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithEOL
public final boolean startsWithEOL()- Specified by:
startsWithEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithAnyEOL
public final boolean startsWithAnyEOL()- Specified by:
startsWithAnyEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithSpace
public final boolean startsWithSpace()- Specified by:
startsWithSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithSpaceTab
public final boolean startsWithSpaceTab()- Specified by:
startsWithSpaceTab
in interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithWhitespace
public final boolean startsWithWhitespace()- Specified by:
startsWithWhitespace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
removeSuffix
Description copied from interface:IRichSequence
Remove suffix if present- Specified by:
removeSuffix
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- characters to remove- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removePrefix
Description copied from interface:IRichSequence
Remove prefix if present- Specified by:
removePrefix
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- characters to remove- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
removeProperSuffix
Description copied from interface:IRichSequence
Remove suffix if present but only if this sequence is longer than the suffix- Specified by:
removeProperSuffix
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- characters to remove- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removeProperPrefix
Description copied from interface:IRichSequence
Remove prefix if present but only if this sequence is longer than the suffix- Specified by:
removeProperPrefix
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- characters to remove- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
endsWithIgnoreCase
Description copied from interface:IRichSequence
test if this sequence ends with given characters, ignoring case differences- Specified by:
endsWithIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- characters to test- Returns:
- true if ends with suffix
-
startsWithIgnoreCase
Description copied from interface:IRichSequence
test if this sequence starts with given characters, ignoring case differences- Specified by:
startsWithIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- characters to test- Returns:
- true if starts with prefix
-
removeSuffixIgnoreCase
Description copied from interface:IRichSequence
Remove suffix if present, ignoring case differences- Specified by:
removeSuffixIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- characters to remove- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removePrefixIgnoreCase
Description copied from interface:IRichSequence
Remove prefix if present, ignoring case differences- Specified by:
removePrefixIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- characters to remove- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
removeProperSuffixIgnoreCase
Description copied from interface:IRichSequence
Remove suffix if present but only if this sequence is longer than the suffix, ignoring case differences- Specified by:
removeProperSuffixIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- characters to remove- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removeProperPrefixIgnoreCase
Description copied from interface:IRichSequence
Remove prefix if present but only if this sequence is longer than the suffix, ignoring case differences- Specified by:
removeProperPrefixIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- characters to remove- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
removeSuffix
Description copied from interface:IRichSequence
Remove suffix if present- Specified by:
removeSuffix
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- characters to removeignoreCase
- case ignored when true- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removePrefix
Description copied from interface:IRichSequence
Remove prefix if present- Specified by:
removePrefix
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- characters to removeignoreCase
- case ignored when true- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
removeProperSuffix
@NotNull public final T removeProperSuffix(@NotNull @NotNull CharSequence suffix, boolean ignoreCase) Description copied from interface:IRichSequence
Remove suffix if present but only if this sequence is longer than the suffix- Specified by:
removeProperSuffix
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- characters to removeignoreCase
- case ignored when true- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removeProperPrefix
@NotNull public final T removeProperPrefix(@NotNull @NotNull CharSequence prefix, boolean ignoreCase) Description copied from interface:IRichSequence
Remove prefix if present but only if this sequence is longer than the suffix- Specified by:
removeProperPrefix
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- characters to removeignoreCase
- case ignored when true- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
insert
Description copied from interface:IRichSequence
Insert char sequence at given index- Specified by:
insert
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index of insertion. if >length of this sequence then same as length, if <0 then same as 0chars
- char sequence to insert- Returns:
- resulting sequence based sequence implementation may throw an IllegalArgumentException if inserting another based sequence out of order based on offsets
-
delete
Description copied from interface:IRichSequence
Delete range in sequence- Specified by:
delete
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startIndex
- start index of deletionendIndex
- end index, not inclusive, of insertion- Returns:
- resulting sequence
-
toLowerCase
Description copied from interface:IRichSequence
Map characters of this sequence to: Uppercase, Lowercase or use custom mapping- Specified by:
toLowerCase
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- lowercase version of sequence
-
toUpperCase
- Specified by:
toUpperCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
toNbSp
Description copied from interface:IRichSequence
Map spaces to non break spaces- Specified by:
toNbSp
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- mapped sequence with spc changed to NbSp
-
toSpc
Description copied from interface:IRichSequence
Map non break spaces to spaces- Specified by:
toSpc
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- mapped sequence with NbSp changed to spc
-
matches
- Specified by:
matches
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matches
Description copied from interface:IRichSequence
Test the sequence for a match to another CharSequence- Specified by:
matches
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
chars
- characters to match against- Returns:
- true if match
-
matchesIgnoreCase
- Specified by:
matchesIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchChars
public final boolean matchChars(@NotNull @NotNull CharSequence chars, int startIndex, boolean ignoreCase) Description copied from interface:IRichSequence
Test the sequence portion for a match to another CharSequence- Specified by:
matchChars
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
chars
- characters to match againststartIndex
- index from which to start the matchignoreCase
- if true match ignoring case differences- Returns:
- true if characters at the start index of this sequence match
-
matchChars
- Specified by:
matchChars
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchCharsIgnoreCase
- Specified by:
matchCharsIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchChars
- Specified by:
matchChars
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchChars
Description copied from interface:IRichSequence
Test the sequence portion for a match to another CharSequence- Specified by:
matchChars
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
chars
- characters to match against- Returns:
- true if characters at the start of this sequence match
-
matchCharsIgnoreCase
- Specified by:
matchCharsIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchCharsReversed
public final boolean matchCharsReversed(@NotNull @NotNull CharSequence chars, int endIndex, boolean ignoreCase) Description copied from interface:IRichSequence
Test the sequence portion for a match to another CharSequence, reverse order- Specified by:
matchCharsReversed
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
chars
- characters to match againstendIndex
- index from which to start the match and proceed to 0ignoreCase
- if true match ignoring case differences- Returns:
- true if characters at the start index of this sequence match
-
matchCharsReversed
- Specified by:
matchCharsReversed
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchCharsReversedIgnoreCase
public final boolean matchCharsReversedIgnoreCase(@NotNull @NotNull CharSequence chars, int endIndex) - Specified by:
matchCharsReversedIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
public final int matchedCharCount(@NotNull @NotNull CharSequence chars, int startIndex, int endIndex, boolean ignoreCase) - Specified by:
matchedCharCount
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
public final int matchedCharCount(@NotNull @NotNull CharSequence chars, int startIndex, boolean ignoreCase) - Specified by:
matchedCharCount
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
public final int matchedCharCount(@NotNull @NotNull CharSequence chars, int startIndex, int endIndex) - Specified by:
matchedCharCount
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
- Specified by:
matchedCharCount
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountIgnoreCase
- Specified by:
matchedCharCountIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountIgnoreCase
public final int matchedCharCountIgnoreCase(@NotNull @NotNull CharSequence chars, int startIndex, int endIndex) - Specified by:
matchedCharCountIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversedIgnoreCase
public final int matchedCharCountReversedIgnoreCase(@NotNull @NotNull CharSequence chars, int startIndex, int fromIndex) - Specified by:
matchedCharCountReversedIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversed
public final int matchedCharCountReversed(@NotNull @NotNull CharSequence chars, int startIndex, int fromIndex) - Specified by:
matchedCharCountReversed
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversed
public final int matchedCharCountReversed(@NotNull @NotNull CharSequence chars, int fromIndex, boolean ignoreCase) - Specified by:
matchedCharCountReversed
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversed
- Specified by:
matchedCharCountReversed
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversedIgnoreCase
public final int matchedCharCountReversedIgnoreCase(@NotNull @NotNull CharSequence chars, int fromIndex) - Specified by:
matchedCharCountReversedIgnoreCase
in interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
public final int matchedCharCount(@NotNull @NotNull CharSequence chars, int startIndex, int endIndex, boolean fullMatchOnly, boolean ignoreCase) Description copied from interface:IRichSequence
Test the sequence portion for a match to another CharSequence- Specified by:
matchedCharCount
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
chars
- characters to match againststartIndex
- index from which to start the matchendIndex
- index at which to end the matchingfullMatchOnly
- if true will do quick fail if length of chars is longer than characters after startIndex in this sequenceignoreCase
- if true match ignoring case differences- Returns:
- count of characters at the start index of this sequence matching corresponding characters in chars
-
matchedCharCountReversed
public final int matchedCharCountReversed(@NotNull @NotNull CharSequence chars, int startIndex, int fromIndex, boolean ignoreCase) Description copied from interface:IRichSequence
Test the sequence portion for a match to another CharSequence, equivalent to taking this.subSequence(startIndex, fromIndex) and then count matching chars going from end of both sequences- Specified by:
matchedCharCountReversed
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
chars
- characters to match againststartIndex
- index at which to stop the matchfromIndex
- index from which to start the match, not inclusive, matching starts at fromIndex-1 and proceeds towards 0ignoreCase
- if true match ignoring case differences- Returns:
- count of characters at the from index of this sequence matching corresponding characters in chars in reverse order
-
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
normalizeEOL
Description copied from interface:IRichSequence
replace any \r\n and \r by \n- Specified by:
normalizeEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- string with only \n for line separators
-
normalizeEndWithEOL
Description copied from interface:IRichSequence
replace any \r\n and \r by \n, append terminating EOL if one is not present- Specified by:
normalizeEndWithEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
- Returns:
- string with only \n for line separators and terminated by \n
-
toVisibleWhitespaceString
- Specified by:
toVisibleWhitespaceString
in interfaceIRichSequence<T extends IRichSequence<T>>
-
splitList
- Specified by:
splitList
in interfaceIRichSequence<T extends IRichSequence<T>>
-
splitList
@NotNull public final @NotNull List<T> splitList(@NotNull @NotNull CharSequence delimiter, int limit, boolean includeDelims, @Nullable @Nullable CharPredicate trimChars) Description copied from interface:IRichSequence
Split helpers based on delimiter character sets contained in CharPredicate- Specified by:
splitList
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
delimiter
- sequence of chars on which to split this sequencelimit
- max number of segments to splitincludeDelims
- if true include delimiters as part of split itemtrimChars
- set of characters that should be used for trimming individual split results- Returns:
- List of split results
-
splitList
@NotNull public final @NotNull List<T> splitList(@NotNull @NotNull CharSequence delimiter, int limit, int flags) - Specified by:
splitList
in interfaceIRichSequence<T extends IRichSequence<T>>
-
splitList
@NotNull public final @NotNull List<T> splitList(@NotNull @NotNull CharSequence delimiter, boolean includeDelims, @Nullable @Nullable CharPredicate trimChars) - Specified by:
splitList
in interfaceIRichSequence<T extends IRichSequence<T>>
-
splitListEOL
- Specified by:
splitListEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
splitListEOL
- Specified by:
splitListEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
splitListEOL
@NotNull public final @NotNull List<T> splitListEOL(boolean includeDelims, @Nullable @Nullable CharPredicate trimChars) - Specified by:
splitListEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
splitList
@NotNull public final @NotNull List<T> splitList(@NotNull @NotNull CharSequence delimiter, int limit, int flags, @Nullable @Nullable CharPredicate trimChars) Description copied from interface:IRichSequence
Split helpers based on delimiter character sets contained in CharSequence- Specified by:
splitList
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
delimiter
- delimiter char sequence to use for splittinglimit
- 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, if trimChars is not null or empty then this flag is turned on automatically 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 results- Returns:
- List of split results
-
splitEOL
- Specified by:
splitEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
splitEOL
- Specified by:
splitEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
split
@NotNull public final T[] split(@NotNull @NotNull CharSequence delimiter, boolean includeDelims, @Nullable @Nullable CharPredicate trimChars) - Specified by:
split
in interfaceIRichSequence<T extends IRichSequence<T>>
-
split
- Specified by:
split
in interfaceIRichSequence<T extends IRichSequence<T>>
-
split
@NotNull public final T[] split(@NotNull @NotNull CharSequence delimiter, int limit, boolean includeDelims, @Nullable @Nullable CharPredicate trimChars) - Specified by:
split
in interfaceIRichSequence<T extends IRichSequence<T>>
-
split
- Specified by:
split
in interfaceIRichSequence<T extends IRichSequence<T>>
-
split
@NotNull public final T[] split(@NotNull @NotNull CharSequence delimiter, int limit, int flags, @Nullable @Nullable CharPredicate trimChars) - Specified by:
split
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
@NotNull public final T appendTo(@NotNull @NotNull StringBuilder out, @Nullable @Nullable CharMapper charMapper) - Specified by:
appendTo
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
@NotNull public final T appendTo(@NotNull @NotNull StringBuilder out, @Nullable @Nullable CharMapper charMapper, int startIndex) - Specified by:
appendTo
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
- Specified by:
appendTo
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
- Specified by:
appendTo
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
- Specified by:
appendTo
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
@NotNull public final T appendTo(@NotNull @NotNull StringBuilder out, @Nullable @Nullable CharMapper charMapper, int startIndex, int endIndex) Description copied from interface:IRichSequence
Append helpers- Specified by:
appendTo
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
out
- string buildercharMapper
- mapping to use for output or null if nonestartIndex
- start indexendIndex
- end index- Returns:
- this
-
appendRangesTo
@NotNull public final T appendRangesTo(@NotNull @NotNull StringBuilder out, @Nullable @Nullable CharMapper charMapper, Range... ranges) Description copied from interface:IRichSequence
Append given ranges of this sequence to string builder- Specified by:
appendRangesTo
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
out
- string builder to append tocharMapper
- mapping to use for output or null if noneranges
- ranges to append, null range or one for which range.isNull() is true ranges are skipped- Returns:
- this
-
appendRangesTo
- Specified by:
appendRangesTo
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendRangesTo
@NotNull public final T appendRangesTo(@NotNull @NotNull StringBuilder out, Iterable<? extends Range> ranges) - Specified by:
appendRangesTo
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendRangesTo
@NotNull public final T appendRangesTo(@NotNull @NotNull StringBuilder out, @Nullable @Nullable CharMapper charMapper, Iterable<? extends Range> ranges) - Specified by:
appendRangesTo
in interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAll
@NotNull public final @org.jetbrains.annotations.NotNull int[] indexOfAll(@NotNull @NotNull CharSequence s) Description copied from interface:IRichSequence
Get indices of all occurrences of a sequence- Specified by:
indexOfAll
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
s
- sequence whose indices to find- Returns:
- array of indices
-
appendEOL
- Specified by:
appendEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixWithEOL
- Specified by:
suffixWithEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixWithEOL
- Specified by:
prefixWithEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixOnceWithEOL
- Specified by:
prefixOnceWithEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixOnceWithEOL
- Specified by:
suffixOnceWithEOL
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendSpace
- Specified by:
appendSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixWithSpace
- Specified by:
suffixWithSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixWithSpace
- Specified by:
prefixWithSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
appendSpaces
- Specified by:
appendSpaces
in interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixWithSpaces
- Specified by:
suffixWithSpaces
in interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixWithSpaces
- Specified by:
prefixWithSpaces
in interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixOnceWithSpace
- Specified by:
prefixOnceWithSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixOnceWithSpace
- Specified by:
suffixOnceWithSpace
in interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixWith
Description copied from interface:IRichSequence
Prefix this sequence with a char sequence- Specified by:
prefixWith
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- char sequence- Returns:
- resulting sequence
-
suffixWith
Description copied from interface:IRichSequence
Prefix this sequence with a char sequence- Specified by:
suffixWith
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- char sequence- Returns:
- resulting sequence
-
prefixOnceWith
Description copied from interface:IRichSequence
Prefix this sequence with a char sequence if not already starting with prefix- Specified by:
prefixOnceWith
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
prefix
- char sequence- Returns:
- resulting sequence
-
suffixOnceWith
Description copied from interface:IRichSequence
Suffix this sequence with a char sequence if not already ending with suffix- Specified by:
suffixOnceWith
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
suffix
- char sequence- Returns:
- resulting sequence
-
replace
@NotNull public final T replace(int startIndex, int endIndex, @NotNull @NotNull CharSequence replacement) Description copied from interface:IRichSequence
Replace part of the sequence with a char sequence- Specified by:
replace
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
startIndex
- start index of replaced partendIndex
- end index of replaced partreplacement
- char sequence- Returns:
- resulting sequence
-
replace
@NotNull public final T replace(@NotNull @NotNull CharSequence find, @NotNull @NotNull CharSequence replace) Description copied from interface:IRichSequence
Replace all occurrences of one sequence with another- Specified by:
replace
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
find
- sequence to findreplace
- replacement sequence- Returns:
- array of indices
-
append
Description copied from interface:IRichSequence
Concatenate this sequence and list of others, returning sequence of result- Specified by:
append
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
sequences
- list of char sequences to append to this sequence, null sequences are skipped- Returns:
- appended sequence
-
append
- Specified by:
append
in interfaceIRichSequence<T extends IRichSequence<T>>
-
extractRanges
Description copied from interface:IRichSequence
Build a sequence of ranges in this sequenceNOTE: BasedSequence ranges must be non-overlapping and ordered by startOffset or IllegalArgumentException will be thrown
- Specified by:
extractRanges
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
ranges
- ranges to extract- Returns:
- resulting sequence
-
extractRanges
- Specified by:
extractRanges
in interfaceIRichSequence<T extends IRichSequence<T>>
-
columnAtIndex
public final int columnAtIndex(int index) - Specified by:
columnAtIndex
in interfaceIRichSequence<T extends IRichSequence<T>>
-
lineColumnAtIndex
Description copied from interface:IRichSequence
Get the line and column information from index into sequence- Specified by:
lineColumnAtIndex
in interfaceIRichSequence<T extends IRichSequence<T>>
- Parameters:
index
- index for which to get line information- Returns:
- Pair(line, column) where line and column are 0 based, throws IllegalArgumentException if index < 0 or > length.
-
isIn
- Specified by:
isIn
in interfaceIRichSequence<T extends IRichSequence<T>>
-
isIn
- Specified by:
isIn
in interfaceIRichSequence<T extends IRichSequence<T>>
-