Class IRichSequenceBase<T extends IRichSequence<T>>
- java.lang.Object
-
- com.vladsch.flexmark.util.sequence.IRichSequenceBase<T>
-
- All Implemented Interfaces:
IRichSequence<T>,SequenceUtils,java.lang.CharSequence,java.lang.Comparable<java.lang.CharSequence>
- Direct Known Subclasses:
BasedSequenceImpl,MappedRichSequence,RichSequenceImpl
public abstract class IRichSequenceBase<T extends IRichSequence<T>> extends java.lang.Object implements IRichSequence<T>
An abstract base for RichSequence which implements most of the methods allowing subclasses to implement RichSequence with minimal support methods
-
-
Field Summary
Fields Modifier and Type Field Description private inthash-
Fields 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
Constructors Constructor Description IRichSequenceBase(int hash)Constructor with pre-computed hash if available, 0 for lazy computation if length() not 0
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tappend(java.lang.CharSequence... sequences)Concatenate this sequence and list of others, returning sequence of resultTappend(java.lang.Iterable<? extends java.lang.CharSequence> sequences)TappendEOL()TappendRangesTo(@NotNull java.lang.StringBuilder out, @Nullable CharMapper charMapper, Range... ranges)Append given ranges of this sequence to string builderTappendRangesTo(@NotNull java.lang.StringBuilder out, @Nullable CharMapper charMapper, java.lang.Iterable<? extends Range> ranges)TappendRangesTo(@NotNull java.lang.StringBuilder out, Range... ranges)TappendRangesTo(@NotNull java.lang.StringBuilder out, java.lang.Iterable<? extends Range> ranges)TappendSpace()TappendSpaces(int count)TappendTo(@NotNull java.lang.StringBuilder out)TappendTo(@NotNull java.lang.StringBuilder out, int startIndex)TappendTo(@NotNull java.lang.StringBuilder out, int startIndex, int endIndex)TappendTo(@NotNull java.lang.StringBuilder out, @Nullable CharMapper charMapper)TappendTo(@NotNull java.lang.StringBuilder out, @Nullable CharMapper charMapper, int startIndex)TappendTo(@NotNull java.lang.StringBuilder out, @Nullable CharMapper charMapper, int startIndex, int endIndex)Append helpers@NotNull java.util.List<Range>blankLinesRemovedRanges()@NotNull java.util.List<Range>blankLinesRemovedRanges(int fromIndex)@NotNull java.util.List<Range>blankLinesRemovedRanges(int fromIndex, int endIndex)@NotNull java.util.List<Range>blankLinesRemovedRanges(@NotNull CharPredicate eolChars, int fromIndex, int endIndex)intcolumnAtIndex(int index)intcompareTo(@NotNull java.lang.CharSequence o)intcountLeading(@NotNull CharPredicate chars)Count leading/trailing characters of this sequenceintcountLeading(@NotNull CharPredicate chars, int fromIndex)intcountLeading(@NotNull CharPredicate chars, int fromIndex, int endIndex)intcountLeadingColumns(int startColumn, @NotNull CharPredicate chars)Count column of indent given by chars in the set in this sequence, expanding tabs to 4th columnintcountLeadingNot(@NotNull CharPredicate chars)intcountLeadingNot(@NotNull CharPredicate chars, int fromIndex)intcountLeadingNot(@NotNull CharPredicate chars, int startIndex, int endIndex)intcountLeadingNotSpace()intcountLeadingNotSpace(int startIndex)intcountLeadingNotSpace(int startIndex, int endIndex)intcountLeadingNotSpaceTab()intcountLeadingNotSpaceTab(int startIndex)intcountLeadingNotSpaceTab(int startIndex, int endIndex)intcountLeadingNotWhitespace()intcountLeadingNotWhitespace(int startIndex)intcountLeadingNotWhitespace(int startIndex, int endIndex)intcountLeadingSpace()intcountLeadingSpace(int startIndex)intcountLeadingSpace(int startIndex, int endIndex)intcountLeadingSpaceTab()intcountLeadingSpaceTab(int startIndex)intcountLeadingSpaceTab(int startIndex, int endIndex)intcountLeadingWhitespace()intcountLeadingWhitespace(int startIndex)intcountLeadingWhitespace(int startIndex, int endIndex)intcountOfAny(@NotNull CharPredicate chars)intcountOfAny(@NotNull CharPredicate chars, int fromIndex)intcountOfAny(@NotNull CharPredicate s, int fromIndex, int endIndex)intcountOfAnyNot(@NotNull CharPredicate chars)intcountOfAnyNot(@NotNull CharPredicate chars, int fromIndex)intcountOfAnyNot(@NotNull CharPredicate chars, int startIndex, int endIndex)intcountOfNotSpaceTab()intcountOfNotWhitespace()intcountOfSpaceTab()intcountOfWhitespace()intcountTrailing(@NotNull CharPredicate chars)intcountTrailing(@NotNull CharPredicate chars, int fromIndex)intcountTrailing(@NotNull CharPredicate chars, int startIndex, int fromIndex)intcountTrailingNot(@NotNull CharPredicate chars)intcountTrailingNot(@NotNull CharPredicate chars, int fromIndex)intcountTrailingNot(@NotNull CharPredicate chars, int startIndex, int endIndex)intcountTrailingNotSpace()intcountTrailingNotSpace(int fromIndex)intcountTrailingNotSpace(int startIndex, int fromIndex)intcountTrailingNotSpaceTab()intcountTrailingNotSpaceTab(int fromIndex)intcountTrailingNotSpaceTab(int startIndex, int fromIndex)intcountTrailingNotWhitespace()intcountTrailingNotWhitespace(int fromIndex)intcountTrailingNotWhitespace(int startIndex, int fromIndex)intcountTrailingSpace()intcountTrailingSpace(int fromIndex)intcountTrailingSpace(int startIndex, int fromIndex)intcountTrailingSpaceTab()intcountTrailingSpaceTab(int fromIndex)intcountTrailingSpaceTab(int startIndex, int fromIndex)intcountTrailingWhitespace()intcountTrailingWhitespace(int fromIndex)intcountTrailingWhitespace(int startIndex, int fromIndex)Tdelete(int startIndex, int endIndex)Delete range in sequencecharendCharAt(int index)Convenience method to get characters offset from end of sequence.intendOfDelimitedBy(@NotNull java.lang.CharSequence s, int index)Find start/end region in this sequence delimited by any characters in argument or the CharSequenceintendOfDelimitedByAny(@NotNull CharPredicate s, int index)intendOfDelimitedByAnyNot(@NotNull CharPredicate s, int index)intendOfLine(int index)Get the offset of the end of line at given index, end of line delimited by \nintendOfLineAnyEOL(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.TendSequence(int startIndex)Convenience method to get characters offset from endIndex of sequence.TendSequence(int startIndex, int endIndex)Convenience method to get characters offset from endIndex of sequence.booleanendsWith(@NotNull CharPredicate chars)booleanendsWith(@NotNull java.lang.CharSequence suffix)test if this sequence ends with given charactersbooleanendsWith(@NotNull java.lang.CharSequence suffix, boolean ignoreCase)test if this sequence ends with given charactersbooleanendsWithAnyEOL()booleanendsWithEOL()booleanendsWithIgnoreCase(@NotNull java.lang.CharSequence suffix)test if this sequence ends with given characters, ignoring case differencesbooleanendsWithSpace()booleanendsWithSpaceTab()booleanendsWithWhitespace()inteolEndLength()Get the length of EOL character at the end of this sequence, if present.inteolEndLength(int eolEnd)Get the length of EOL character at the given index of this sequence, if present.@NotNull RangeeolEndRange(int eolEnd)Return Range of eol at given indexinteolStartLength(int eolStart)Get the length of EOL character at the given index of this sequence, if present.@NotNull RangeeolStartRange(int eolStart)Return Range of eol at given indexbooleanequals(@Nullable java.lang.Object other, boolean ignoreCase)Test the sequence for a match to another CharSequencebooleanequals(java.lang.Object o)Equality comparison based on character content of this sequence, with quick fail resorting to content comparison only if length and hashCodes are equalbooleanequalsIgnoreCase(@Nullable java.lang.Object other)Test the sequence for a match to another CharSequence, ignoring case differencesTextractRanges(Range... ranges)Build a sequence of ranges in this sequenceTextractRanges(java.lang.Iterable<Range> ranges)charfirstChar()inthashCode()String hash code computationTifNull(T other)If this sequence is the nullSequence() instance then returns other, otherwise returns this sequence.TifNullEmptyAfter(T other)If this sequence is the nullSequence() instance then returns an empty subSequence from the end of other, otherwise returns this sequence.TifNullEmptyBefore(T other)If this sequence is the nullSequence() instance then returns an empty subSequence from the start of other, otherwise returns this sequence.intindexOf(char c)intindexOf(char c, int fromIndex)intindexOf(char c, int fromIndex, int endIndex)intindexOf(@NotNull java.lang.CharSequence s)All index methods return the position or -1 if not found of the given character, characters or string.intindexOf(@NotNull java.lang.CharSequence s, int fromIndex)intindexOf(@NotNull java.lang.CharSequence s, int fromIndex, int endIndex)@org.jetbrains.annotations.NotNull int[]indexOfAll(@NotNull java.lang.CharSequence s)Get indices of all occurrences of a sequenceintindexOfAny(@NotNull CharPredicate s)intindexOfAny(@NotNull CharPredicate s, int index)intindexOfAny(@NotNull CharPredicate s, int fromIndex, int endIndex)intindexOfAnyNot(@NotNull CharPredicate s)intindexOfAnyNot(@NotNull CharPredicate s, int fromIndex)intindexOfAnyNot(@NotNull CharPredicate s, int fromIndex, int endIndex)intindexOfNot(char c)intindexOfNot(char c, int fromIndex)intindexOfNot(char c, int fromIndex, int endIndex)Tinsert(int index, @NotNull java.lang.CharSequence chars)Insert char sequence at given indexbooleanisBlank()booleanisCharAt(int index, @NotNull CharPredicate predicate)Safe, if index out of range returns '\0'booleanisEmpty()booleanisIn(@NotNull java.lang.String[] texts)booleanisIn(@NotNull java.util.Collection<? extends java.lang.CharSequence> texts)booleanisNotBlank()booleanisNotEmpty()booleanisNotNull()booleanisNull()charlastChar()intlastIndexOf(char c)intlastIndexOf(char c, int fromIndex)intlastIndexOf(char c, int startIndex, int fromIndex)intlastIndexOf(@NotNull java.lang.CharSequence s)intlastIndexOf(@NotNull java.lang.CharSequence s, int fromIndex)intlastIndexOf(@NotNull java.lang.CharSequence s, int startIndex, int fromIndex)intlastIndexOfAny(@NotNull CharPredicate s)intlastIndexOfAny(@NotNull CharPredicate s, int fromIndex)intlastIndexOfAny(@NotNull CharPredicate s, int startIndex, int fromIndex)intlastIndexOfAnyNot(@NotNull CharPredicate s)intlastIndexOfAnyNot(@NotNull CharPredicate s, int fromIndex)intlastIndexOfAnyNot(@NotNull CharPredicate s, int startIndex, int fromIndex)intlastIndexOfNot(char c)intlastIndexOfNot(char c, int fromIndex)intlastIndexOfNot(char c, int startIndex, int fromIndex)@NotNull RangeleadingBlankLinesRange()@NotNull RangeleadingBlankLinesRange(int startIndex)@NotNull RangeleadingBlankLinesRange(int fromIndex, int endIndex)@NotNull RangeleadingBlankLinesRange(@NotNull CharPredicate eolChars, int fromIndex, int endIndex)Get Range of leading blank lines at given index offsets in sequenceTlineAt(int index)Get the line characters at given index, line delimited by \nTlineAtAnyEOL(int index)Get the line characters at given index, line delimited by \n, \r or \r\n@NotNull Pair<java.lang.Integer,java.lang.Integer>lineColumnAtIndex(int index)Get the line and column information from index into sequence@NotNull RangelineRangeAt(int index)Get the line characters at given index, line delimited by \n@NotNull RangelineRangeAtAnyEOL(int index)Get the line characters at given index, line delimited by \n, \r or \r\nbooleanmatchChars(@NotNull java.lang.CharSequence chars)Test the sequence portion for a match to another CharSequencebooleanmatchChars(@NotNull java.lang.CharSequence chars, boolean ignoreCase)booleanmatchChars(@NotNull java.lang.CharSequence chars, int startIndex)booleanmatchChars(@NotNull java.lang.CharSequence chars, int startIndex, boolean ignoreCase)Test the sequence portion for a match to another CharSequencebooleanmatchCharsIgnoreCase(@NotNull java.lang.CharSequence chars)booleanmatchCharsIgnoreCase(@NotNull java.lang.CharSequence chars, int startIndex)booleanmatchCharsReversed(@NotNull java.lang.CharSequence chars, int endIndex)booleanmatchCharsReversed(@NotNull java.lang.CharSequence chars, int endIndex, boolean ignoreCase)Test the sequence portion for a match to another CharSequence, reverse orderbooleanmatchCharsReversedIgnoreCase(@NotNull java.lang.CharSequence chars, int endIndex)intmatchedCharCount(@NotNull java.lang.CharSequence chars, int startIndex)intmatchedCharCount(@NotNull java.lang.CharSequence chars, int startIndex, boolean ignoreCase)intmatchedCharCount(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex)intmatchedCharCount(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex, boolean ignoreCase)intmatchedCharCount(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex, boolean fullMatchOnly, boolean ignoreCase)Test the sequence portion for a match to another CharSequenceintmatchedCharCountIgnoreCase(@NotNull java.lang.CharSequence chars, int startIndex)intmatchedCharCountIgnoreCase(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex)intmatchedCharCountReversed(@NotNull java.lang.CharSequence chars, int fromIndex)intmatchedCharCountReversed(@NotNull java.lang.CharSequence chars, int fromIndex, boolean ignoreCase)intmatchedCharCountReversed(@NotNull java.lang.CharSequence chars, int startIndex, int fromIndex)intmatchedCharCountReversed(@NotNull java.lang.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 sequencesintmatchedCharCountReversedIgnoreCase(@NotNull java.lang.CharSequence chars, int fromIndex)intmatchedCharCountReversedIgnoreCase(@NotNull java.lang.CharSequence chars, int startIndex, int fromIndex)booleanmatches(@NotNull java.lang.CharSequence chars)Test the sequence for a match to another CharSequencebooleanmatches(@NotNull java.lang.CharSequence chars, boolean ignoreCase)booleanmatchesIgnoreCase(@NotNull java.lang.CharSequence chars)charmidCharAt(int index)Convenience method to get characters offset from start or end of sequence.TmidSequence(int startIndex)Convenience method to get characters offset from start or end of sequence.TmidSequence(int startIndex, int endIndex)Convenience method to get characters offset from start or end of sequence.@NotNull java.lang.StringnormalizeEndWithEOL()replace any \r\n and \r by \n, append terminating EOL if one is not present@NotNull java.lang.StringnormalizeEOL()replace any \r\n and \r by \nTnullIf(boolean condition)If condition is true return nullSequence() otherwise returns this sequence.TnullIf(@NotNull java.util.function.BiPredicate<? super T,? super java.lang.CharSequence> predicate, java.lang.CharSequence... matches)If predicate returns true for this sequence and one of given sequences return nullSequence() otherwise returns this sequence.TnullIf(@NotNull java.util.function.Predicate<? super java.lang.CharSequence> predicate, java.lang.CharSequence... matches)If predicate returns true for one of given sequences return nullSequence() otherwise returns this sequence.TnullIf(java.lang.CharSequence... matches)If this sequence matches one of given sequences return nullSequence() otherwise returns this sequence.TnullIfBlank()If this sequence is blank return nullSequence() otherwise returns this sequence.TnullIfEmpty()If this sequence is empty return nullSequence() otherwise returns this sequence.TnullIfEndsWith(boolean ignoreCase, java.lang.CharSequence... matches)TnullIfEndsWith(java.lang.CharSequence... matches)TnullIfEndsWithIgnoreCase(java.lang.CharSequence... matches)TnullIfNot(@NotNull java.util.function.BiPredicate<? super T,? super java.lang.CharSequence> predicate, java.lang.CharSequence... matches)TnullIfNot(@NotNull java.util.function.Predicate<? super java.lang.CharSequence> predicate, java.lang.CharSequence... matches)TnullIfNot(java.lang.CharSequence... matches)TnullIfNotEndsWith(boolean ignoreCase, java.lang.CharSequence... matches)TnullIfNotEndsWith(java.lang.CharSequence... matches)TnullIfNotEndsWithIgnoreCase(java.lang.CharSequence... matches)TnullIfNotStartsWith(boolean ignoreCase, java.lang.CharSequence... matches)TnullIfNotStartsWith(java.lang.CharSequence... matches)TnullIfNotStartsWithIgnoreCase(java.lang.CharSequence... matches)TnullIfStartsWith(boolean ignoreCase, java.lang.CharSequence... matches)TnullIfStartsWith(java.lang.CharSequence... matches)TnullIfStartsWithIgnoreCase(java.lang.CharSequence... matches)Tpadding(int length)Tpadding(int length, char pad)Get the chars needed for padding to lengthTpadEnd(int length)TpadEnd(int length, char pad)TpadStart(int length)TpadStart(int length, char pad)Pad this sequence to given lengthTprefixOnceWith(@Nullable java.lang.CharSequence prefix)Prefix this sequence with a char sequence if not already starting with prefixTprefixOnceWithEOL()TprefixOnceWithSpace()TprefixWith(@Nullable java.lang.CharSequence prefix)Prefix this sequence with a char sequenceTprefixWithEOL()TprefixWithSpace()TprefixWithSpaces(int count)TremovePrefix(@NotNull java.lang.CharSequence prefix)Remove prefix if presentTremovePrefix(@NotNull java.lang.CharSequence prefix, boolean ignoreCase)Remove prefix if presentTremovePrefixIgnoreCase(@NotNull java.lang.CharSequence prefix)Remove prefix if present, ignoring case differencesTremoveProperPrefix(@NotNull java.lang.CharSequence prefix)Remove prefix if present but only if this sequence is longer than the suffixTremoveProperPrefix(@NotNull java.lang.CharSequence prefix, boolean ignoreCase)Remove prefix if present but only if this sequence is longer than the suffixTremoveProperPrefixIgnoreCase(@NotNull java.lang.CharSequence prefix)Remove prefix if present but only if this sequence is longer than the suffix, ignoring case differencesTremoveProperSuffix(@NotNull java.lang.CharSequence suffix)Remove suffix if present but only if this sequence is longer than the suffixTremoveProperSuffix(@NotNull java.lang.CharSequence suffix, boolean ignoreCase)Remove suffix if present but only if this sequence is longer than the suffixTremoveProperSuffixIgnoreCase(@NotNull java.lang.CharSequence suffix)Remove suffix if present but only if this sequence is longer than the suffix, ignoring case differencesTremoveSuffix(@NotNull java.lang.CharSequence suffix)Remove suffix if presentTremoveSuffix(@NotNull java.lang.CharSequence suffix, boolean ignoreCase)Remove suffix if presentTremoveSuffixIgnoreCase(@NotNull java.lang.CharSequence suffix)Remove suffix if present, ignoring case differencesTreplace(int startIndex, int endIndex, @NotNull java.lang.CharSequence replacement)Replace part of the sequence with a char sequenceTreplace(@NotNull java.lang.CharSequence find, @NotNull java.lang.CharSequence replace)Replace all occurrences of one sequence with anothercharsafeCharAt(int index)return char at index or '\0' if index <0 or >=length()TsafeSubSequence(int startIndex)Get a portion of this sequence, if index < 0 use 0, if > length() use lengthTsafeSubSequence(int startIndex, int endIndex)Get a portion of this sequence, if index < 0 use 0, if > length() use lengthTsequenceOf(@Nullable java.lang.CharSequence charSequence)Factory functionTsequenceOf(@Nullable java.lang.CharSequence charSequence, int startIndex)Factory function@NotNull T[]split(@NotNull java.lang.CharSequence delimiter)@NotNull T[]split(@NotNull java.lang.CharSequence delimiter, boolean includeDelims, @Nullable CharPredicate trimChars)@NotNull T[]split(@NotNull java.lang.CharSequence delimiter, int limit, boolean includeDelims, @Nullable CharPredicate trimChars)@NotNull T[]split(@NotNull java.lang.CharSequence delimiter, int limit, int flags)@NotNull T[]split(@NotNull java.lang.CharSequence delimiter, int limit, int flags, @Nullable CharPredicate trimChars)@NotNull T[]splitEOL()@NotNull T[]splitEOL(boolean includeDelims)@NotNull java.util.List<T>splitList(@NotNull java.lang.CharSequence delimiter)@NotNull java.util.List<T>splitList(@NotNull java.lang.CharSequence delimiter, boolean includeDelims, @Nullable CharPredicate trimChars)@NotNull java.util.List<T>splitList(@NotNull java.lang.CharSequence delimiter, int limit, boolean includeDelims, @Nullable CharPredicate trimChars)Split helpers based on delimiter character sets contained in CharPredicate@NotNull java.util.List<T>splitList(@NotNull java.lang.CharSequence delimiter, int limit, int flags)@NotNull java.util.List<T>splitList(@NotNull java.lang.CharSequence delimiter, int limit, int flags, @Nullable CharPredicate trimChars)Split helpers based on delimiter character sets contained in CharSequence@NotNull java.util.List<T>splitListEOL()@NotNull java.util.List<T>splitListEOL(boolean includeDelims)@NotNull java.util.List<T>splitListEOL(boolean includeDelims, @Nullable CharPredicate trimChars)intstartOfDelimitedBy(@NotNull java.lang.CharSequence s, int index)intstartOfDelimitedByAny(@NotNull CharPredicate s, int index)intstartOfDelimitedByAnyNot(@NotNull CharPredicate s, int index)intstartOfLine(int index)Get the offset of the start of line at given index, start of line delimited by \nintstartOfLineAnyEOL(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.booleanstartsWith(@NotNull CharPredicate chars)booleanstartsWith(@NotNull java.lang.CharSequence prefix)test if this sequence starts with given charactersbooleanstartsWith(@NotNull java.lang.CharSequence prefix, boolean ignoreCase)test if this sequence starts with given charactersbooleanstartsWithAnyEOL()booleanstartsWithEOL()booleanstartsWithIgnoreCase(@NotNull java.lang.CharSequence prefix)test if this sequence starts with given characters, ignoring case differencesbooleanstartsWithSpace()booleanstartsWithSpaceTab()booleanstartsWithWhitespace()TsubSequence(int startIndex)Get a portion of this sequence starting from a given offset to endIndex of the sequenceTsubSequence(@NotNull Range range)Get a portion of this sequence selected by rangeTsubSequenceAfter(@NotNull Range range)Get a portion of this sequence after one selected by rangeTsubSequenceBefore(@NotNull Range range)Get a portion of this sequence before one selected by rangePair<T,T>subSequenceBeforeAfter(Range range)Get a portions of this sequence before and after one selected by rangeTsuffixOnceWith(@Nullable java.lang.CharSequence suffix)Suffix this sequence with a char sequence if not already ending with suffixTsuffixOnceWithEOL()TsuffixOnceWithSpace()TsuffixWith(@Nullable java.lang.CharSequence suffix)Prefix this sequence with a char sequenceTsuffixWithEOL()TsuffixWithSpace()TsuffixWithSpaces(int count)TtoLowerCase()Map characters of this sequence to: Uppercase, Lowercase or use custom mappingTtoNbSp()Map spaces to non break spacesTtoSpc()Map non break spaces to spaces@NotNull java.lang.StringtoString()@Nullable java.lang.StringtoStringOrNull()Return string or null if BaseSequence.NULLTtoUpperCase()@NotNull java.lang.StringtoVisibleWhitespaceString()@NotNull RangetrailingBlankLinesRange()@NotNull RangetrailingBlankLinesRange(int fromIndex)@NotNull RangetrailingBlankLinesRange(int startIndex, int fromIndex)@NotNull RangetrailingBlankLinesRange(CharPredicate eolChars, int startIndex, int fromIndex)Get Range of trailing blank lines at given index offsets in sequenceTtrim()Ttrim(int keep)Ttrim(int keep, @NotNull CharPredicate chars)Ttrim(@NotNull CharPredicate chars)TtrimEnd()TtrimEnd(int keep)TtrimEnd(int keep, @NotNull CharPredicate chars)TtrimEnd(@NotNull CharPredicate chars)@NotNull RangetrimEndRange()@NotNull RangetrimEndRange(int keep)@NotNull RangetrimEndRange(int keep, @NotNull CharPredicate chars)@NotNull RangetrimEndRange(@NotNull CharPredicate chars)TtrimEOL()Trim last eol at the end of this sequence,TtrimLeadBlankLines()@NotNull Pair<T,T>trimmed()@NotNull Pair<T,T>trimmed(int keep)@NotNull Pair<T,T>trimmed(int keep, @NotNull CharPredicate chars)@NotNull Pair<T,T>trimmed(@NotNull CharPredicate chars)TtrimmedEnd()TtrimmedEnd(int keep)TtrimmedEnd(int keep, @NotNull CharPredicate chars)TtrimmedEnd(@NotNull CharPredicate chars)TtrimmedEOL()Get Trimmed part byIRichSequence.trimEOL()TtrimmedStart()TtrimmedStart(int keep)TtrimmedStart(int keep, @NotNull CharPredicate chars)Get the characters Trimmed, Trimmed from start/end of this sequence, characters to trim are passed in the sequence argumentTtrimmedStart(@NotNull CharPredicate chars)@NotNull RangetrimRange()@NotNull RangetrimRange(int keep)@NotNull RangetrimRange(int keep, @NotNull CharPredicate chars)@NotNull RangetrimRange(@NotNull CharPredicate chars)TtrimStart()TtrimStart(int keep)TtrimStart(int keep, @NotNull CharPredicate chars)Trim, Trim start/end of this sequence, characters to trim are passed in the sequence argumentTtrimStart(@NotNull CharPredicate chars)@NotNull RangetrimStartRange()@NotNull RangetrimStartRange(int keep)@NotNull RangetrimStartRange(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 argument@NotNull RangetrimStartRange(@NotNull CharPredicate chars)TtrimTailBlankLines()Trim leading trailing blank lines in this sequenceTtrimToEndOfLine()TtrimToEndOfLine(boolean includeEol)TtrimToEndOfLine(boolean includeEol, int index)TtrimToEndOfLine(int index)TtrimToEndOfLine(@NotNull CharPredicate eolChars, boolean includeEol, int index)Trim end to end of line containing indexTtrimToStartOfLine()TtrimToStartOfLine(boolean includeEol)TtrimToStartOfLine(boolean includeEol, int index)TtrimToStartOfLine(int index)TtrimToStartOfLine(@NotNull CharPredicate eolChars, boolean includeEol, int index)Trim start to start of line containing indexvoidvalidateIndex(int index)voidvalidateIndexInclusiveEnd(int index)voidvalidateStartEnd(int startIndex, int endIndex)-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
Constructor Detail
-
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 Detail
-
equals
@Contract(pure=true, value="null -> false") public final boolean equals(java.lang.Object o)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:
equalsin interfaceIRichSequence<T extends IRichSequence<T>>- Overrides:
equalsin classjava.lang.Object- 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:
hashCodein interfaceIRichSequence<T extends IRichSequence<T>>- Overrides:
hashCodein classjava.lang.Object- Returns:
- hash code of equivalent string
-
equalsIgnoreCase
@Contract(pure=true, value="null -> false") public final boolean equalsIgnoreCase(@Nullable @Nullable java.lang.Object other)Description copied from interface:IRichSequenceTest the sequence for a match to another CharSequence, ignoring case differences- Specified by:
equalsIgnoreCasein 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 java.lang.Object other, boolean ignoreCase)Description copied from interface:IRichSequenceTest the sequence for a match to another CharSequence- Specified by:
equalsin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
other- characters to match againstignoreCase- case ignored when true- Returns:
- true if match
-
compareTo
public int compareTo(@NotNull @NotNull java.lang.CharSequence o)- Specified by:
compareToin interfacejava.lang.Comparable<T extends IRichSequence<T>>
-
sequenceOf
@NotNull public final T sequenceOf(@Nullable @Nullable java.lang.CharSequence charSequence)
Description copied from interface:IRichSequenceFactory function- Specified by:
sequenceOfin 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
@NotNull public final T sequenceOf(@Nullable @Nullable java.lang.CharSequence charSequence, int startIndex)
Description copied from interface:IRichSequenceFactory function- Specified by:
sequenceOfin 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
@NotNull public final T subSequence(int startIndex)
Description copied from interface:IRichSequenceGet a portion of this sequence starting from a given offset to endIndex of the sequence- Specified by:
subSequencein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
startIndex- offset from startIndex of this sequence- Returns:
- based sequence whose contents reflect the selected portion
-
subSequence
@NotNull public final T subSequence(@NotNull @NotNull Range range)
Get a portion of this sequence selected by range- Specified by:
subSequencein 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
@NotNull public final T subSequenceBefore(@NotNull @NotNull Range range)
Get a portion of this sequence before one selected by range- Specified by:
subSequenceBeforein 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
@NotNull public final T subSequenceAfter(@NotNull @NotNull Range range)
Get a portion of this sequence after one selected by range- Specified by:
subSequenceAfterin 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
public final Pair<T,T> subSequenceBeforeAfter(Range range)
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
@NotNull public final T endSequence(int startIndex, int endIndex)
Description copied from interface:IRichSequenceConvenience 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:
endSequencein 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
@NotNull public final T endSequence(int startIndex)
Description copied from interface:IRichSequenceConvenience 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:
endSequencein 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:IRichSequenceConvenience 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:
endCharAtin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
index- offset from end of sequence- Returns:
- character located at length() - index in this sequence
-
midSequence
@NotNull public final T midSequence(int startIndex, int endIndex)
Description copied from interface:IRichSequenceConvenience 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:
midSequencein 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
@NotNull public final T midSequence(int startIndex)
Description copied from interface:IRichSequenceConvenience 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:
midSequencein 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:IRichSequenceConvenience 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:
midCharAtin 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:
lastCharin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- the last character of the sequence or '\0' if empty
-
firstChar
public final char firstChar()
- Specified by:
firstCharin 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:IRichSequencereturn char at index or '\0' if index <0 or >=length()- Specified by:
safeCharAtin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
index- index- Returns:
- char or '\0'
-
safeSubSequence
@NotNull public T safeSubSequence(int startIndex, int endIndex)
Description copied from interface:IRichSequenceGet 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:
safeSubSequencein 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
@NotNull public T safeSubSequence(int startIndex)
Description copied from interface:IRichSequenceGet 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:
safeSubSequencein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
startIndex- offset from startIndex of this sequence- Returns:
- based sequence whose contents reflect the selected portion
-
isCharAt
public boolean isCharAt(int index, @NotNull @NotNull CharPredicate predicate)Description copied from interface:IRichSequenceSafe, if index out of range returns '\0'- Specified by:
isCharAtin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
index- index in stringpredicate- character set predicate- Returns:
- true if character at index tests true
-
toStringOrNull
@Nullable public @Nullable java.lang.String toStringOrNull()
Description copied from interface:IRichSequenceReturn string or null if BaseSequence.NULL- Specified by:
toStringOrNullin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- string or null if BaseSequence.NULL
-
indexOf
public final int indexOf(@NotNull @NotNull java.lang.CharSequence s)Description copied from interface:IRichSequenceAll 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:
indexOfin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
s- character pre whose occurrence to find- Returns:
- index where found or -1
-
indexOf
public final int indexOf(@NotNull @NotNull java.lang.CharSequence s, int fromIndex)- Specified by:
indexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOf
public final int indexOf(@NotNull @NotNull java.lang.CharSequence s, int fromIndex, int endIndex)- Specified by:
indexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOf
public final int indexOf(char c)
- Specified by:
indexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOf
public final int indexOf(char c, int fromIndex)- Specified by:
indexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAny
public final int indexOfAny(@NotNull @NotNull CharPredicate s)- Specified by:
indexOfAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAny
public final int indexOfAny(@NotNull @NotNull CharPredicate s, int index)- Specified by:
indexOfAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAnyNot
public final int indexOfAnyNot(@NotNull @NotNull CharPredicate s)- Specified by:
indexOfAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAnyNot
public final int indexOfAnyNot(@NotNull @NotNull CharPredicate s, int fromIndex)- Specified by:
indexOfAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAnyNot
public final int indexOfAnyNot(@NotNull @NotNull CharPredicate s, int fromIndex, int endIndex)- Specified by:
indexOfAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfNot
public final int indexOfNot(char c)
- Specified by:
indexOfNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfNot
public final int indexOfNot(char c, int fromIndex)- Specified by:
indexOfNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
public final int lastIndexOf(char c)
- Specified by:
lastIndexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
public final int lastIndexOf(char c, int fromIndex)- Specified by:
lastIndexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfNot
public final int lastIndexOfNot(char c)
- Specified by:
lastIndexOfNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfNot
public final int lastIndexOfNot(char c, int fromIndex)- Specified by:
lastIndexOfNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
public final int lastIndexOf(@NotNull @NotNull java.lang.CharSequence s)- Specified by:
lastIndexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
public final int lastIndexOf(@NotNull @NotNull java.lang.CharSequence s, int fromIndex)- Specified by:
lastIndexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAny
public final int lastIndexOfAny(@NotNull @NotNull CharPredicate s, int fromIndex)- Specified by:
lastIndexOfAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAny
public final int lastIndexOfAny(@NotNull @NotNull CharPredicate s)- Specified by:
lastIndexOfAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAnyNot
public final int lastIndexOfAnyNot(@NotNull @NotNull CharPredicate s)- Specified by:
lastIndexOfAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAnyNot
public final int lastIndexOfAnyNot(@NotNull @NotNull CharPredicate s, int fromIndex)- Specified by:
lastIndexOfAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAnyNot
public final int lastIndexOfAnyNot(@NotNull @NotNull CharPredicate s, int startIndex, int fromIndex)- Specified by:
lastIndexOfAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOf
public final int indexOf(char c, int fromIndex, int endIndex)- Specified by:
indexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfNot
public final int indexOfNot(char c, int fromIndex, int endIndex)- Specified by:
indexOfNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAny
public final int indexOfAny(@NotNull @NotNull CharPredicate s, int fromIndex, int endIndex)- Specified by:
indexOfAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
public final int lastIndexOf(@NotNull @NotNull java.lang.CharSequence s, int startIndex, int fromIndex)- Specified by:
lastIndexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOf
public final int lastIndexOf(char c, int startIndex, int fromIndex)- Specified by:
lastIndexOfin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfNot
public final int lastIndexOfNot(char c, int startIndex, int fromIndex)- Specified by:
lastIndexOfNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
lastIndexOfAny
public final int lastIndexOfAny(@NotNull @NotNull CharPredicate s, int startIndex, int fromIndex)- Specified by:
lastIndexOfAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfSpaceTab
public final int countOfSpaceTab()
- Specified by:
countOfSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfNotSpaceTab
public final int countOfNotSpaceTab()
- Specified by:
countOfNotSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfWhitespace
public final int countOfWhitespace()
- Specified by:
countOfWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfNotWhitespace
public final int countOfNotWhitespace()
- Specified by:
countOfNotWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAny
public final int countOfAny(@NotNull @NotNull CharPredicate chars, int fromIndex)- Specified by:
countOfAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAny
public final int countOfAny(@NotNull @NotNull CharPredicate chars)- Specified by:
countOfAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAnyNot
public final int countOfAnyNot(@NotNull @NotNull CharPredicate chars, int fromIndex)- Specified by:
countOfAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAnyNot
public final int countOfAnyNot(@NotNull @NotNull CharPredicate chars)- Specified by:
countOfAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAny
public final int countOfAny(@NotNull @NotNull CharPredicate s, int fromIndex, int endIndex)- Specified by:
countOfAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
countOfAnyNot
public final int countOfAnyNot(@NotNull @NotNull CharPredicate chars, int startIndex, int endIndex)- Specified by:
countOfAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeading
public final int countLeading(@NotNull @NotNull CharPredicate chars)Description copied from interface:IRichSequenceCount 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:
countLeadingin 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
public final int countLeading(@NotNull @NotNull CharPredicate chars, int fromIndex)- Specified by:
countLeadingin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNot
public final int countLeadingNot(@NotNull @NotNull CharPredicate chars)- Specified by:
countLeadingNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNot
public final int countLeadingNot(@NotNull @NotNull CharPredicate chars, int fromIndex)- Specified by:
countLeadingNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailing
public final int countTrailing(@NotNull @NotNull CharPredicate chars)- Specified by:
countTrailingin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailing
public final int countTrailing(@NotNull @NotNull CharPredicate chars, int fromIndex)- Specified by:
countTrailingin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNot
public final int countTrailingNot(@NotNull @NotNull CharPredicate chars)- Specified by:
countTrailingNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNot
public final int countTrailingNot(@NotNull @NotNull CharPredicate chars, int fromIndex)- Specified by:
countTrailingNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNot
public final int countLeadingNot(@NotNull @NotNull CharPredicate chars, int startIndex, int endIndex)- Specified by:
countLeadingNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNot
public final int countTrailingNot(@NotNull @NotNull CharPredicate chars, int startIndex, int endIndex)- Specified by:
countTrailingNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeading
public final int countLeading(@NotNull @NotNull CharPredicate chars, int fromIndex, int endIndex)- Specified by:
countLeadingin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingColumns
public final int countLeadingColumns(int startColumn, @NotNull @NotNull CharPredicate chars)Description copied from interface:IRichSequenceCount column of indent given by chars in the set in this sequence, expanding tabs to 4th column- Specified by:
countLeadingColumnsin 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:
countTrailingin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpace
public final int countLeadingSpace()
- Specified by:
countLeadingSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpace
public final int countLeadingNotSpace()
- Specified by:
countLeadingNotSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpace
public final int countLeadingSpace(int startIndex)
- Specified by:
countLeadingSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpace
public final int countLeadingNotSpace(int startIndex)
- Specified by:
countLeadingNotSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpace
public final int countLeadingSpace(int startIndex, int endIndex)- Specified by:
countLeadingSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpace
public final int countLeadingNotSpace(int startIndex, int endIndex)- Specified by:
countLeadingNotSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpace
public final int countTrailingSpace()
- Specified by:
countTrailingSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpace
public final int countTrailingNotSpace()
- Specified by:
countTrailingNotSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpace
public final int countTrailingSpace(int fromIndex)
- Specified by:
countTrailingSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpace
public final int countTrailingNotSpace(int fromIndex)
- Specified by:
countTrailingNotSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpace
public final int countTrailingSpace(int startIndex, int fromIndex)- Specified by:
countTrailingSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpace
public final int countTrailingNotSpace(int startIndex, int fromIndex)- Specified by:
countTrailingNotSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpaceTab
public final int countLeadingSpaceTab()
- Specified by:
countLeadingSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpaceTab
public final int countLeadingNotSpaceTab()
- Specified by:
countLeadingNotSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpaceTab
public final int countLeadingSpaceTab(int startIndex)
- Specified by:
countLeadingSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpaceTab
public final int countLeadingNotSpaceTab(int startIndex)
- Specified by:
countLeadingNotSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingSpaceTab
public final int countLeadingSpaceTab(int startIndex, int endIndex)- Specified by:
countLeadingSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotSpaceTab
public final int countLeadingNotSpaceTab(int startIndex, int endIndex)- Specified by:
countLeadingNotSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpaceTab
public final int countTrailingSpaceTab()
- Specified by:
countTrailingSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpaceTab
public final int countTrailingNotSpaceTab()
- Specified by:
countTrailingNotSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpaceTab
public final int countTrailingSpaceTab(int fromIndex)
- Specified by:
countTrailingSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpaceTab
public final int countTrailingNotSpaceTab(int fromIndex)
- Specified by:
countTrailingNotSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingSpaceTab
public final int countTrailingSpaceTab(int startIndex, int fromIndex)- Specified by:
countTrailingSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotSpaceTab
public final int countTrailingNotSpaceTab(int startIndex, int fromIndex)- Specified by:
countTrailingNotSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingWhitespace
public final int countLeadingWhitespace()
- Specified by:
countLeadingWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotWhitespace
public final int countLeadingNotWhitespace()
- Specified by:
countLeadingNotWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingWhitespace
public final int countLeadingWhitespace(int startIndex)
- Specified by:
countLeadingWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotWhitespace
public final int countLeadingNotWhitespace(int startIndex)
- Specified by:
countLeadingNotWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingWhitespace
public final int countLeadingWhitespace(int startIndex, int endIndex)- Specified by:
countLeadingWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countLeadingNotWhitespace
public final int countLeadingNotWhitespace(int startIndex, int endIndex)- Specified by:
countLeadingNotWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingWhitespace
public final int countTrailingWhitespace()
- Specified by:
countTrailingWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotWhitespace
public final int countTrailingNotWhitespace()
- Specified by:
countTrailingNotWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingWhitespace
public final int countTrailingWhitespace(int fromIndex)
- Specified by:
countTrailingWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotWhitespace
public final int countTrailingNotWhitespace(int fromIndex)
- Specified by:
countTrailingNotWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingWhitespace
public final int countTrailingWhitespace(int startIndex, int fromIndex)- Specified by:
countTrailingWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
countTrailingNotWhitespace
public final int countTrailingNotWhitespace(int startIndex, int fromIndex)- Specified by:
countTrailingNotWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStart
@NotNull public final T trimStart(@NotNull @NotNull CharPredicate chars)
- Specified by:
trimStartin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedStart
@NotNull public final T trimmedStart(@NotNull @NotNull CharPredicate chars)
- Specified by:
trimmedStartin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEnd
@NotNull public final T trimEnd(@NotNull @NotNull CharPredicate chars)
- Specified by:
trimEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedEnd
@NotNull public final T trimmedEnd(@NotNull @NotNull CharPredicate chars)
- Specified by:
trimmedEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
trim
@NotNull public final T trim(@NotNull @NotNull CharPredicate chars)
- Specified by:
trimin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmed
@NotNull public final @NotNull Pair<T,T> trimmed(@NotNull @NotNull CharPredicate chars)
- Specified by:
trimmedin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStart
@NotNull public final T trimStart(int keep)
- Specified by:
trimStartin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedStart
@NotNull public final T trimmedStart(int keep)
- Specified by:
trimmedStartin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEnd
@NotNull public final T trimEnd(int keep)
- Specified by:
trimEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedEnd
@NotNull public final T trimmedEnd(int keep)
- Specified by:
trimmedEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
trim
@NotNull public final T trim(int keep)
- Specified by:
trimin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmed
@NotNull public final @NotNull Pair<T,T> trimmed(int keep)
- Specified by:
trimmedin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStart
@NotNull public final T trimStart()
- Specified by:
trimStartin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedStart
@NotNull public final T trimmedStart()
- Specified by:
trimmedStartin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEnd
@NotNull public final T trimEnd()
- Specified by:
trimEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedEnd
@NotNull public final T trimmedEnd()
- Specified by:
trimmedEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
trim
@NotNull public final T trim()
- Specified by:
trimin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmed
@NotNull public final @NotNull Pair<T,T> trimmed()
- Specified by:
trimmedin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStart
@NotNull public final T trimStart(int keep, @NotNull @NotNull CharPredicate chars)
Description copied from interface:IRichSequenceTrim, 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.WHITESPACEare assumed.- Specified by:
trimStartin 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
@NotNull public final T trimmedStart(int keep, @NotNull @NotNull CharPredicate chars)
Description copied from interface:IRichSequenceGet 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:
trimmedStartin 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
@NotNull public final T trimEnd(int keep, @NotNull @NotNull CharPredicate chars)
- Specified by:
trimEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmedEnd
@NotNull public final T trimmedEnd(int keep, @NotNull @NotNull CharPredicate chars)
- Specified by:
trimmedEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
trim
@NotNull public final T trim(int keep, @NotNull @NotNull CharPredicate chars)
- Specified by:
trimin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimmed
@NotNull public final @NotNull Pair<T,T> trimmed(int keep, @NotNull @NotNull CharPredicate chars)
- Specified by:
trimmedin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStartRange
@NotNull public final @NotNull Range trimStartRange(int keep, @NotNull @NotNull CharPredicate chars)
Description copied from interface:IRichSequenceRange 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.WHITESPACEare assumed.- Specified by:
trimStartRangein 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
@NotNull public final @NotNull Range trimEndRange(int keep, @NotNull @NotNull CharPredicate chars)
- Specified by:
trimEndRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimRange
@NotNull public final @NotNull Range trimRange(int keep, @NotNull @NotNull CharPredicate chars)
- Specified by:
trimRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStartRange
@NotNull public final @NotNull Range trimStartRange(@NotNull @NotNull CharPredicate chars)
- Specified by:
trimStartRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEndRange
@NotNull public final @NotNull Range trimEndRange(@NotNull @NotNull CharPredicate chars)
- Specified by:
trimEndRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimRange
@NotNull public final @NotNull Range trimRange(@NotNull @NotNull CharPredicate chars)
- Specified by:
trimRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStartRange
@NotNull public final @NotNull Range trimStartRange(int keep)
- Specified by:
trimStartRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEndRange
@NotNull public final @NotNull Range trimEndRange(int keep)
- Specified by:
trimEndRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimRange
@NotNull public final @NotNull Range trimRange(int keep)
- Specified by:
trimRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimStartRange
@NotNull public final @NotNull Range trimStartRange()
- Specified by:
trimStartRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimEndRange
@NotNull public final @NotNull Range trimEndRange()
- Specified by:
trimEndRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimRange
@NotNull public final @NotNull Range trimRange()
- Specified by:
trimRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
padding
@NotNull public final T padding(int length, char pad)
Description copied from interface:IRichSequenceGet the chars needed for padding to length- Specified by:
paddingin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
length- lengthpad- char to use for padding- Returns:
- padding chars
-
padding
@NotNull public final T padding(int length)
- Specified by:
paddingin interfaceIRichSequence<T extends IRichSequence<T>>
-
padStart
@NotNull public T padStart(int length, char pad)
Description copied from interface:IRichSequencePad this sequence to given length- Specified by:
padStartin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
length- length to padpad- char to use for padding- Returns:
- sequence padded
-
padEnd
@NotNull public T padEnd(int length, char pad)
- Specified by:
padEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
padStart
@NotNull public T padStart(int length)
- Specified by:
padStartin interfaceIRichSequence<T extends IRichSequence<T>>
-
padEnd
@NotNull public T padEnd(int length)
- Specified by:
padEndin interfaceIRichSequence<T extends IRichSequence<T>>
-
eolEndLength
public final int eolEndLength()
Description copied from interface:IRichSequenceGet the length of EOL character at the end of this sequence, if present.\n - 1 \r - 1 \r\n - 2
- Specified by:
eolEndLengthin 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:IRichSequenceGet the length of EOL character at the given index of this sequence, if present.\n - 1 \r - 1 \r\n - 2
- Specified by:
eolEndLengthin 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:IRichSequenceGet the length of EOL character at the given index of this sequence, if present.\n - 1 \r - 1 \r\n - 2
- Specified by:
eolStartLengthin 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:IRichSequenceGet the offset of the end of line at given index, end of line delimited by \n- Specified by:
endOfLinein 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:IRichSequenceGet 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:
endOfLineAnyEOLin 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:IRichSequenceGet the offset of the start of line at given index, start of line delimited by \n- Specified by:
startOfLinein 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:IRichSequenceGet 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:
startOfLineAnyEOLin 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
public final int startOfDelimitedByAnyNot(@NotNull @NotNull CharPredicate s, int index)- Specified by:
startOfDelimitedByAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
endOfDelimitedByAnyNot
public final int endOfDelimitedByAnyNot(@NotNull @NotNull CharPredicate s, int index)- Specified by:
endOfDelimitedByAnyNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
startOfDelimitedBy
public final int startOfDelimitedBy(@NotNull @NotNull java.lang.CharSequence s, int index)- Specified by:
startOfDelimitedByin interfaceIRichSequence<T extends IRichSequence<T>>
-
startOfDelimitedByAny
public final int startOfDelimitedByAny(@NotNull @NotNull CharPredicate s, int index)- Specified by:
startOfDelimitedByAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
endOfDelimitedBy
public final int endOfDelimitedBy(@NotNull @NotNull java.lang.CharSequence s, int index)Description copied from interface:IRichSequenceFind 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:
endOfDelimitedByin 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
public final int endOfDelimitedByAny(@NotNull @NotNull CharPredicate s, int index)- Specified by:
endOfDelimitedByAnyin interfaceIRichSequence<T extends IRichSequence<T>>
-
lineRangeAt
@NotNull public final @NotNull Range lineRangeAt(int index)
Description copied from interface:IRichSequenceGet the line characters at given index, line delimited by \n- Specified by:
lineRangeAtin 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
@NotNull public final @NotNull Range lineRangeAtAnyEOL(int index)
Description copied from interface:IRichSequenceGet the line characters at given index, line delimited by \n, \r or \r\n- Specified by:
lineRangeAtAnyEOLin 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
@NotNull public final T lineAt(int index)
Description copied from interface:IRichSequenceGet the line characters at given index, line delimited by \n- Specified by:
lineAtin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
index- index at which to get the line- Returns:
- sub-sequence for the line containing index
-
lineAtAnyEOL
@NotNull public final T lineAtAnyEOL(int index)
Description copied from interface:IRichSequenceGet the line characters at given index, line delimited by \n, \r or \r\n- Specified by:
lineAtAnyEOLin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
index- index at which to get the line- Returns:
- sub-sequence for the line containing index
-
eolEndRange
@NotNull public final @NotNull Range eolEndRange(int eolEnd)
Description copied from interface:IRichSequenceReturn Range of eol at given index- Specified by:
eolEndRangein 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
@NotNull public @NotNull Range eolStartRange(int eolStart)
Description copied from interface:IRichSequenceReturn Range of eol at given index- Specified by:
eolStartRangein 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
@NotNull public final T trimEOL()
Description copied from interface:IRichSequenceTrim last eol at the end of this sequence,- Specified by:
trimEOLin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- sequence with one EOL trimmed off if it had one
-
trimmedEOL
@NotNull public final T trimmedEOL()
Description copied from interface:IRichSequenceGet Trimmed part byIRichSequence.trimEOL()- Specified by:
trimmedEOLin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- trimmed off EOL if sequence had one or
IRichSequence.nullSequence()
-
trimTailBlankLines
@NotNull public final T trimTailBlankLines()
Description copied from interface:IRichSequenceTrim leading trailing blank lines in this sequence- Specified by:
trimTailBlankLinesin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- return sequence with trailing blank lines trimmed off
-
trimLeadBlankLines
@NotNull public final T trimLeadBlankLines()
- Specified by:
trimLeadBlankLinesin interfaceIRichSequence<T extends IRichSequence<T>>
-
leadingBlankLinesRange
@NotNull public final @NotNull Range leadingBlankLinesRange()
- Specified by:
leadingBlankLinesRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
leadingBlankLinesRange
@NotNull public final @NotNull Range leadingBlankLinesRange(int startIndex)
- Specified by:
leadingBlankLinesRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
leadingBlankLinesRange
@NotNull public final @NotNull Range leadingBlankLinesRange(int fromIndex, int endIndex)
- Specified by:
leadingBlankLinesRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trailingBlankLinesRange
@NotNull public final @NotNull Range trailingBlankLinesRange()
- Specified by:
trailingBlankLinesRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trailingBlankLinesRange
@NotNull public final @NotNull Range trailingBlankLinesRange(int fromIndex)
- Specified by:
trailingBlankLinesRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trailingBlankLinesRange
@NotNull public final @NotNull Range trailingBlankLinesRange(int startIndex, int fromIndex)
- Specified by:
trailingBlankLinesRangein interfaceIRichSequence<T extends IRichSequence<T>>
-
trailingBlankLinesRange
@NotNull public final @NotNull Range trailingBlankLinesRange(CharPredicate eolChars, int startIndex, int fromIndex)
Description copied from interface:IRichSequenceGet Range of trailing blank lines at given index offsets in sequence- Specified by:
trailingBlankLinesRangein 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:IRichSequenceGet Range of leading blank lines at given index offsets in sequence- Specified by:
leadingBlankLinesRangein 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
@NotNull public final @NotNull java.util.List<Range> blankLinesRemovedRanges()
- Specified by:
blankLinesRemovedRangesin interfaceIRichSequence<T extends IRichSequence<T>>
-
blankLinesRemovedRanges
@NotNull public final @NotNull java.util.List<Range> blankLinesRemovedRanges(int fromIndex)
- Specified by:
blankLinesRemovedRangesin interfaceIRichSequence<T extends IRichSequence<T>>
-
blankLinesRemovedRanges
@NotNull public final @NotNull java.util.List<Range> blankLinesRemovedRanges(int fromIndex, int endIndex)
- Specified by:
blankLinesRemovedRangesin interfaceIRichSequence<T extends IRichSequence<T>>
-
blankLinesRemovedRanges
@NotNull public final @NotNull java.util.List<Range> blankLinesRemovedRanges(@NotNull @NotNull CharPredicate eolChars, int fromIndex, int endIndex)
- Specified by:
blankLinesRemovedRangesin interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
@NotNull public T trimToEndOfLine(boolean includeEol)
- Specified by:
trimToEndOfLinein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
@NotNull public T trimToEndOfLine(int index)
- Specified by:
trimToEndOfLinein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
@NotNull public T trimToEndOfLine()
- Specified by:
trimToEndOfLinein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
@NotNull public T trimToEndOfLine(boolean includeEol, int index)
- Specified by:
trimToEndOfLinein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToStartOfLine
@NotNull public T trimToStartOfLine(boolean includeEol)
- Specified by:
trimToStartOfLinein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToStartOfLine
@NotNull public T trimToStartOfLine(int index)
- Specified by:
trimToStartOfLinein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToStartOfLine
@NotNull public T trimToStartOfLine()
- Specified by:
trimToStartOfLinein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToStartOfLine
@NotNull public T trimToStartOfLine(boolean includeEol, int index)
- Specified by:
trimToStartOfLinein interfaceIRichSequence<T extends IRichSequence<T>>
-
trimToEndOfLine
@NotNull public T trimToEndOfLine(@NotNull @NotNull CharPredicate eolChars, boolean includeEol, int index)
Description copied from interface:IRichSequenceTrim end to end of line containing index- Specified by:
trimToEndOfLinein 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:IRichSequenceTrim start to start of line containing index- Specified by:
trimToStartOfLinein 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
@NotNull public final T ifNull(@NotNull T other)
Description copied from interface:IRichSequenceIf this sequence is the nullSequence() instance then returns other, otherwise returns this sequence.- Specified by:
ifNullin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
other- based sequence to return if this is nullSequence()- Returns:
- this or other
-
ifNullEmptyAfter
@NotNull public final T ifNullEmptyAfter(@NotNull T other)
Description copied from interface:IRichSequenceIf this sequence is the nullSequence() instance then returns an empty subSequence from the end of other, otherwise returns this sequence.- Specified by:
ifNullEmptyAfterin 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
@NotNull public final T ifNullEmptyBefore(@NotNull T other)
Description copied from interface:IRichSequenceIf this sequence is the nullSequence() instance then returns an empty subSequence from the start of other, otherwise returns this sequence.- Specified by:
ifNullEmptyBeforein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
other- based sequence from which to take the empty sequence- Returns:
- this or other.subSequence(0, 0)
-
nullIfEmpty
@NotNull public final T nullIfEmpty()
Description copied from interface:IRichSequenceIf this sequence is empty return nullSequence() otherwise returns this sequence.- Specified by:
nullIfEmptyin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- this or nullSequence()
-
nullIfBlank
@NotNull public final T nullIfBlank()
Description copied from interface:IRichSequenceIf this sequence is blank return nullSequence() otherwise returns this sequence.- Specified by:
nullIfBlankin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- this or nullSequence()
-
nullIf
@NotNull public final T nullIf(boolean condition)
Description copied from interface:IRichSequenceIf condition is true return nullSequence() otherwise returns this sequence.- Specified by:
nullIfin 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 java.util.function.BiPredicate<? super T,? super java.lang.CharSequence> predicate, java.lang.CharSequence... matches)
- Specified by:
nullIfNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIf
@NotNull public final T nullIf(@NotNull @NotNull java.util.function.Predicate<? super java.lang.CharSequence> predicate, java.lang.CharSequence... matches)
Description copied from interface:IRichSequenceIf predicate returns true for one of given sequences return nullSequence() otherwise returns this sequence.- Specified by:
nullIfin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
predicate- sequence predicatematches- match sequence list- Returns:
- this or nullSequence()
-
nullIfNot
@NotNull public final T nullIfNot(@NotNull @NotNull java.util.function.Predicate<? super java.lang.CharSequence> predicate, java.lang.CharSequence... matches)
- Specified by:
nullIfNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIf
@NotNull public final T nullIf(java.lang.CharSequence... matches)
Description copied from interface:IRichSequenceIf this sequence matches one of given sequences return nullSequence() otherwise returns this sequence.- Specified by:
nullIfin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
matches- match sequence list- Returns:
- this or nullSequence()
-
nullIfNot
@NotNull public final T nullIfNot(java.lang.CharSequence... matches)
- Specified by:
nullIfNotin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfStartsWith
@NotNull public final T nullIfStartsWith(java.lang.CharSequence... matches)
- Specified by:
nullIfStartsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotStartsWith
@NotNull public final T nullIfNotStartsWith(java.lang.CharSequence... matches)
- Specified by:
nullIfNotStartsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfEndsWith
@NotNull public final T nullIfEndsWith(java.lang.CharSequence... matches)
- Specified by:
nullIfEndsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotEndsWith
@NotNull public final T nullIfNotEndsWith(java.lang.CharSequence... matches)
- Specified by:
nullIfNotEndsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfStartsWithIgnoreCase
@NotNull public final T nullIfStartsWithIgnoreCase(java.lang.CharSequence... matches)
- Specified by:
nullIfStartsWithIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotStartsWithIgnoreCase
@NotNull public final T nullIfNotStartsWithIgnoreCase(java.lang.CharSequence... matches)
- Specified by:
nullIfNotStartsWithIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfEndsWithIgnoreCase
@NotNull public final T nullIfEndsWithIgnoreCase(java.lang.CharSequence... matches)
- Specified by:
nullIfEndsWithIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotEndsWithIgnoreCase
@NotNull public final T nullIfNotEndsWithIgnoreCase(java.lang.CharSequence... matches)
- Specified by:
nullIfNotEndsWithIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfStartsWith
@NotNull public final T nullIfStartsWith(boolean ignoreCase, java.lang.CharSequence... matches)
- Specified by:
nullIfStartsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotStartsWith
@NotNull public final T nullIfNotStartsWith(boolean ignoreCase, java.lang.CharSequence... matches)
- Specified by:
nullIfNotStartsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfEndsWith
@NotNull public final T nullIfEndsWith(boolean ignoreCase, java.lang.CharSequence... matches)
- Specified by:
nullIfEndsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIfNotEndsWith
@NotNull public final T nullIfNotEndsWith(boolean ignoreCase, java.lang.CharSequence... matches)
- Specified by:
nullIfNotEndsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
nullIf
@NotNull public final T nullIf(@NotNull @NotNull java.util.function.BiPredicate<? super T,? super java.lang.CharSequence> predicate, java.lang.CharSequence... matches)
Description copied from interface:IRichSequenceIf predicate returns true for this sequence and one of given sequences return nullSequence() otherwise returns this sequence.- Specified by:
nullIfin 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:
isNullin interfaceIRichSequence<T extends IRichSequence<T>>
-
isNotNull
public final boolean isNotNull()
- Specified by:
isNotNullin interfaceIRichSequence<T extends IRichSequence<T>>
-
isEmpty
public final boolean isEmpty()
- Specified by:
isEmptyin interfaceIRichSequence<T extends IRichSequence<T>>
-
isBlank
public final boolean isBlank()
- Specified by:
isBlankin interfaceIRichSequence<T extends IRichSequence<T>>
-
isNotEmpty
public final boolean isNotEmpty()
- Specified by:
isNotEmptyin interfaceIRichSequence<T extends IRichSequence<T>>
-
isNotBlank
public final boolean isNotBlank()
- Specified by:
isNotBlankin interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWith
public final boolean endsWith(@NotNull @NotNull java.lang.CharSequence suffix)Description copied from interface:IRichSequencetest if this sequence ends with given characters- Specified by:
endsWithin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
suffix- characters to test- Returns:
- true if ends with suffix
-
endsWith
public final boolean endsWith(@NotNull @NotNull java.lang.CharSequence suffix, boolean ignoreCase)Description copied from interface:IRichSequencetest if this sequence ends with given characters- Specified by:
endsWithin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
suffix- characters to testignoreCase- case ignored when true- Returns:
- true if ends with suffix
-
startsWith
public final boolean startsWith(@NotNull @NotNull java.lang.CharSequence prefix)Description copied from interface:IRichSequencetest if this sequence starts with given characters- Specified by:
startsWithin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
prefix- characters to test- Returns:
- true if starts with prefix
-
startsWith
public final boolean startsWith(@NotNull @NotNull java.lang.CharSequence prefix, boolean ignoreCase)Description copied from interface:IRichSequencetest if this sequence starts with given characters- Specified by:
startsWithin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
prefix- characters to testignoreCase- case ignored when true- Returns:
- true if starts with prefix
-
endsWith
public final boolean endsWith(@NotNull @NotNull CharPredicate chars)- Specified by:
endsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWith
public final boolean startsWith(@NotNull @NotNull CharPredicate chars)- Specified by:
startsWithin interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithEOL
public final boolean endsWithEOL()
- Specified by:
endsWithEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithAnyEOL
public final boolean endsWithAnyEOL()
- Specified by:
endsWithAnyEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithSpace
public final boolean endsWithSpace()
- Specified by:
endsWithSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithSpaceTab
public final boolean endsWithSpaceTab()
- Specified by:
endsWithSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
endsWithWhitespace
public final boolean endsWithWhitespace()
- Specified by:
endsWithWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithEOL
public final boolean startsWithEOL()
- Specified by:
startsWithEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithAnyEOL
public final boolean startsWithAnyEOL()
- Specified by:
startsWithAnyEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithSpace
public final boolean startsWithSpace()
- Specified by:
startsWithSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithSpaceTab
public final boolean startsWithSpaceTab()
- Specified by:
startsWithSpaceTabin interfaceIRichSequence<T extends IRichSequence<T>>
-
startsWithWhitespace
public final boolean startsWithWhitespace()
- Specified by:
startsWithWhitespacein interfaceIRichSequence<T extends IRichSequence<T>>
-
removeSuffix
@NotNull public final T removeSuffix(@NotNull @NotNull java.lang.CharSequence suffix)
Description copied from interface:IRichSequenceRemove suffix if present- Specified by:
removeSuffixin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
suffix- characters to remove- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removePrefix
@NotNull public final T removePrefix(@NotNull @NotNull java.lang.CharSequence prefix)
Description copied from interface:IRichSequenceRemove prefix if present- Specified by:
removePrefixin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
prefix- characters to remove- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
removeProperSuffix
@NotNull public final T removeProperSuffix(@NotNull @NotNull java.lang.CharSequence suffix)
Description copied from interface:IRichSequenceRemove suffix if present but only if this sequence is longer than the suffix- Specified by:
removeProperSuffixin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
suffix- characters to remove- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removeProperPrefix
@NotNull public final T removeProperPrefix(@NotNull @NotNull java.lang.CharSequence prefix)
Description copied from interface:IRichSequenceRemove prefix if present but only if this sequence is longer than the suffix- Specified by:
removeProperPrefixin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
prefix- characters to remove- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
endsWithIgnoreCase
public final boolean endsWithIgnoreCase(@NotNull @NotNull java.lang.CharSequence suffix)Description copied from interface:IRichSequencetest if this sequence ends with given characters, ignoring case differences- Specified by:
endsWithIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
suffix- characters to test- Returns:
- true if ends with suffix
-
startsWithIgnoreCase
public final boolean startsWithIgnoreCase(@NotNull @NotNull java.lang.CharSequence prefix)Description copied from interface:IRichSequencetest if this sequence starts with given characters, ignoring case differences- Specified by:
startsWithIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
prefix- characters to test- Returns:
- true if starts with prefix
-
removeSuffixIgnoreCase
@NotNull public final T removeSuffixIgnoreCase(@NotNull @NotNull java.lang.CharSequence suffix)
Description copied from interface:IRichSequenceRemove suffix if present, ignoring case differences- Specified by:
removeSuffixIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
suffix- characters to remove- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removePrefixIgnoreCase
@NotNull public final T removePrefixIgnoreCase(@NotNull @NotNull java.lang.CharSequence prefix)
Description copied from interface:IRichSequenceRemove prefix if present, ignoring case differences- Specified by:
removePrefixIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
prefix- characters to remove- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
removeProperSuffixIgnoreCase
@NotNull public final T removeProperSuffixIgnoreCase(@NotNull @NotNull java.lang.CharSequence suffix)
Description copied from interface:IRichSequenceRemove suffix if present but only if this sequence is longer than the suffix, ignoring case differences- Specified by:
removeProperSuffixIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
suffix- characters to remove- Returns:
- sequence with suffix removed, or same sequence if no suffix was present
-
removeProperPrefixIgnoreCase
@NotNull public final T removeProperPrefixIgnoreCase(@NotNull @NotNull java.lang.CharSequence prefix)
Description copied from interface:IRichSequenceRemove prefix if present but only if this sequence is longer than the suffix, ignoring case differences- Specified by:
removeProperPrefixIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
prefix- characters to remove- Returns:
- sequence with prefix removed, or same sequence if no prefix was present
-
removeSuffix
@NotNull public final T removeSuffix(@NotNull @NotNull java.lang.CharSequence suffix, boolean ignoreCase)
Description copied from interface:IRichSequenceRemove suffix if present- Specified by:
removeSuffixin 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
@NotNull public final T removePrefix(@NotNull @NotNull java.lang.CharSequence prefix, boolean ignoreCase)
Description copied from interface:IRichSequenceRemove prefix if present- Specified by:
removePrefixin 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 java.lang.CharSequence suffix, boolean ignoreCase)
Description copied from interface:IRichSequenceRemove suffix if present but only if this sequence is longer than the suffix- Specified by:
removeProperSuffixin 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 java.lang.CharSequence prefix, boolean ignoreCase)
Description copied from interface:IRichSequenceRemove prefix if present but only if this sequence is longer than the suffix- Specified by:
removeProperPrefixin 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
@NotNull public T insert(int index, @NotNull @NotNull java.lang.CharSequence chars)
Description copied from interface:IRichSequenceInsert char sequence at given index- Specified by:
insertin 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
@NotNull public T delete(int startIndex, int endIndex)
Description copied from interface:IRichSequenceDelete range in sequence- Specified by:
deletein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
startIndex- start index of deletionendIndex- end index, not inclusive, of insertion- Returns:
- resulting sequence
-
toLowerCase
@NotNull public final T toLowerCase()
Description copied from interface:IRichSequenceMap characters of this sequence to: Uppercase, Lowercase or use custom mapping- Specified by:
toLowerCasein interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- lowercase version of sequence
-
toUpperCase
@NotNull public final T toUpperCase()
- Specified by:
toUpperCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
toNbSp
@NotNull public final T toNbSp()
Description copied from interface:IRichSequenceMap spaces to non break spaces- Specified by:
toNbSpin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- mapped sequence with spc changed to NbSp
-
toSpc
@NotNull public final T toSpc()
Description copied from interface:IRichSequenceMap non break spaces to spaces- Specified by:
toSpcin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- mapped sequence with NbSp changed to spc
-
matches
public final boolean matches(@NotNull @NotNull java.lang.CharSequence chars, boolean ignoreCase)- Specified by:
matchesin interfaceIRichSequence<T extends IRichSequence<T>>
-
matches
public final boolean matches(@NotNull @NotNull java.lang.CharSequence chars)Description copied from interface:IRichSequenceTest the sequence for a match to another CharSequence- Specified by:
matchesin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
chars- characters to match against- Returns:
- true if match
-
matchesIgnoreCase
public final boolean matchesIgnoreCase(@NotNull @NotNull java.lang.CharSequence chars)- Specified by:
matchesIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
matchChars
public final boolean matchChars(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, boolean ignoreCase)Description copied from interface:IRichSequenceTest the sequence portion for a match to another CharSequence- Specified by:
matchCharsin 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
public final boolean matchChars(@NotNull @NotNull java.lang.CharSequence chars, int startIndex)- Specified by:
matchCharsin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchCharsIgnoreCase
public final boolean matchCharsIgnoreCase(@NotNull @NotNull java.lang.CharSequence chars, int startIndex)- Specified by:
matchCharsIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
matchChars
public final boolean matchChars(@NotNull @NotNull java.lang.CharSequence chars, boolean ignoreCase)- Specified by:
matchCharsin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchChars
public final boolean matchChars(@NotNull @NotNull java.lang.CharSequence chars)Description copied from interface:IRichSequenceTest the sequence portion for a match to another CharSequence- Specified by:
matchCharsin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
chars- characters to match against- Returns:
- true if characters at the start of this sequence match
-
matchCharsIgnoreCase
public final boolean matchCharsIgnoreCase(@NotNull @NotNull java.lang.CharSequence chars)- Specified by:
matchCharsIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
matchCharsReversed
public final boolean matchCharsReversed(@NotNull @NotNull java.lang.CharSequence chars, int endIndex, boolean ignoreCase)Description copied from interface:IRichSequenceTest the sequence portion for a match to another CharSequence, reverse order- Specified by:
matchCharsReversedin 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
public final boolean matchCharsReversed(@NotNull @NotNull java.lang.CharSequence chars, int endIndex)- Specified by:
matchCharsReversedin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchCharsReversedIgnoreCase
public final boolean matchCharsReversedIgnoreCase(@NotNull @NotNull java.lang.CharSequence chars, int endIndex)- Specified by:
matchCharsReversedIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
public final int matchedCharCount(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, int endIndex, boolean ignoreCase)- Specified by:
matchedCharCountin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
public final int matchedCharCount(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, boolean ignoreCase)- Specified by:
matchedCharCountin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
public final int matchedCharCount(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, int endIndex)- Specified by:
matchedCharCountin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
public final int matchedCharCount(@NotNull @NotNull java.lang.CharSequence chars, int startIndex)- Specified by:
matchedCharCountin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountIgnoreCase
public final int matchedCharCountIgnoreCase(@NotNull @NotNull java.lang.CharSequence chars, int startIndex)- Specified by:
matchedCharCountIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountIgnoreCase
public final int matchedCharCountIgnoreCase(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, int endIndex)- Specified by:
matchedCharCountIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversedIgnoreCase
public final int matchedCharCountReversedIgnoreCase(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, int fromIndex)- Specified by:
matchedCharCountReversedIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversed
public final int matchedCharCountReversed(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, int fromIndex)- Specified by:
matchedCharCountReversedin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversed
public final int matchedCharCountReversed(@NotNull @NotNull java.lang.CharSequence chars, int fromIndex, boolean ignoreCase)- Specified by:
matchedCharCountReversedin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversed
public final int matchedCharCountReversed(@NotNull @NotNull java.lang.CharSequence chars, int fromIndex)- Specified by:
matchedCharCountReversedin interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCountReversedIgnoreCase
public final int matchedCharCountReversedIgnoreCase(@NotNull @NotNull java.lang.CharSequence chars, int fromIndex)- Specified by:
matchedCharCountReversedIgnoreCasein interfaceIRichSequence<T extends IRichSequence<T>>
-
matchedCharCount
public final int matchedCharCount(@NotNull @NotNull java.lang.CharSequence chars, int startIndex, int endIndex, boolean fullMatchOnly, boolean ignoreCase)Description copied from interface:IRichSequenceTest the sequence portion for a match to another CharSequence- Specified by:
matchedCharCountin 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 java.lang.CharSequence chars, int startIndex, int fromIndex, boolean ignoreCase)Description copied from interface:IRichSequenceTest 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:
matchedCharCountReversedin 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
@NotNull public @NotNull java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classjava.lang.Object
-
normalizeEOL
@NotNull public final @NotNull java.lang.String normalizeEOL()
Description copied from interface:IRichSequencereplace any \r\n and \r by \n- Specified by:
normalizeEOLin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- string with only \n for line separators
-
normalizeEndWithEOL
@NotNull public final @NotNull java.lang.String normalizeEndWithEOL()
Description copied from interface:IRichSequencereplace any \r\n and \r by \n, append terminating EOL if one is not present- Specified by:
normalizeEndWithEOLin interfaceIRichSequence<T extends IRichSequence<T>>- Returns:
- string with only \n for line separators and terminated by \n
-
toVisibleWhitespaceString
@NotNull public final @NotNull java.lang.String toVisibleWhitespaceString()
- Specified by:
toVisibleWhitespaceStringin interfaceIRichSequence<T extends IRichSequence<T>>
-
splitList
@NotNull public final @NotNull java.util.List<T> splitList(@NotNull @NotNull java.lang.CharSequence delimiter)
- Specified by:
splitListin interfaceIRichSequence<T extends IRichSequence<T>>
-
splitList
@NotNull public final @NotNull java.util.List<T> splitList(@NotNull @NotNull java.lang.CharSequence delimiter, int limit, boolean includeDelims, @Nullable @Nullable CharPredicate trimChars)
Description copied from interface:IRichSequenceSplit helpers based on delimiter character sets contained in CharPredicate- Specified by:
splitListin 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 java.util.List<T> splitList(@NotNull @NotNull java.lang.CharSequence delimiter, int limit, int flags)
- Specified by:
splitListin interfaceIRichSequence<T extends IRichSequence<T>>
-
splitList
@NotNull public final @NotNull java.util.List<T> splitList(@NotNull @NotNull java.lang.CharSequence delimiter, boolean includeDelims, @Nullable @Nullable CharPredicate trimChars)
- Specified by:
splitListin interfaceIRichSequence<T extends IRichSequence<T>>
-
splitListEOL
@NotNull public final @NotNull java.util.List<T> splitListEOL()
- Specified by:
splitListEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
splitListEOL
@NotNull public final @NotNull java.util.List<T> splitListEOL(boolean includeDelims)
- Specified by:
splitListEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
splitListEOL
@NotNull public final @NotNull java.util.List<T> splitListEOL(boolean includeDelims, @Nullable @Nullable CharPredicate trimChars)
- Specified by:
splitListEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
splitList
@NotNull public final @NotNull java.util.List<T> splitList(@NotNull @NotNull java.lang.CharSequence delimiter, int limit, int flags, @Nullable @Nullable CharPredicate trimChars)
Description copied from interface:IRichSequenceSplit helpers based on delimiter character sets contained in CharSequence- Specified by:
splitListin 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
@NotNull public final @NotNull T[] splitEOL()
- Specified by:
splitEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
splitEOL
@NotNull public final @NotNull T[] splitEOL(boolean includeDelims)
- Specified by:
splitEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
split
@NotNull public final @NotNull T[] split(@NotNull @NotNull java.lang.CharSequence delimiter, boolean includeDelims, @Nullable @Nullable CharPredicate trimChars)
- Specified by:
splitin interfaceIRichSequence<T extends IRichSequence<T>>
-
split
@NotNull public final @NotNull T[] split(@NotNull @NotNull java.lang.CharSequence delimiter)
- Specified by:
splitin interfaceIRichSequence<T extends IRichSequence<T>>
-
split
@NotNull public final @NotNull T[] split(@NotNull @NotNull java.lang.CharSequence delimiter, int limit, boolean includeDelims, @Nullable @Nullable CharPredicate trimChars)
- Specified by:
splitin interfaceIRichSequence<T extends IRichSequence<T>>
-
split
@NotNull public final @NotNull T[] split(@NotNull @NotNull java.lang.CharSequence delimiter, int limit, int flags)
- Specified by:
splitin interfaceIRichSequence<T extends IRichSequence<T>>
-
split
@NotNull public final @NotNull T[] split(@NotNull @NotNull java.lang.CharSequence delimiter, int limit, int flags, @Nullable @Nullable CharPredicate trimChars)
- Specified by:
splitin interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
@NotNull public final T appendTo(@NotNull @NotNull java.lang.StringBuilder out, @Nullable @Nullable CharMapper charMapper)
- Specified by:
appendToin interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
@NotNull public final T appendTo(@NotNull @NotNull java.lang.StringBuilder out, @Nullable @Nullable CharMapper charMapper, int startIndex)
- Specified by:
appendToin interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
@NotNull public final T appendTo(@NotNull @NotNull java.lang.StringBuilder out)
- Specified by:
appendToin interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
@NotNull public final T appendTo(@NotNull @NotNull java.lang.StringBuilder out, int startIndex)
- Specified by:
appendToin interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
@NotNull public final T appendTo(@NotNull @NotNull java.lang.StringBuilder out, int startIndex, int endIndex)
- Specified by:
appendToin interfaceIRichSequence<T extends IRichSequence<T>>
-
appendTo
@NotNull public final T appendTo(@NotNull @NotNull java.lang.StringBuilder out, @Nullable @Nullable CharMapper charMapper, int startIndex, int endIndex)
Description copied from interface:IRichSequenceAppend helpers- Specified by:
appendToin 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 java.lang.StringBuilder out, @Nullable @Nullable CharMapper charMapper, Range... ranges)
Description copied from interface:IRichSequenceAppend given ranges of this sequence to string builder- Specified by:
appendRangesToin 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
@NotNull public final T appendRangesTo(@NotNull @NotNull java.lang.StringBuilder out, Range... ranges)
- Specified by:
appendRangesToin interfaceIRichSequence<T extends IRichSequence<T>>
-
appendRangesTo
@NotNull public final T appendRangesTo(@NotNull @NotNull java.lang.StringBuilder out, java.lang.Iterable<? extends Range> ranges)
- Specified by:
appendRangesToin interfaceIRichSequence<T extends IRichSequence<T>>
-
appendRangesTo
@NotNull public final T appendRangesTo(@NotNull @NotNull java.lang.StringBuilder out, @Nullable @Nullable CharMapper charMapper, java.lang.Iterable<? extends Range> ranges)
- Specified by:
appendRangesToin interfaceIRichSequence<T extends IRichSequence<T>>
-
indexOfAll
@NotNull public final @org.jetbrains.annotations.NotNull int[] indexOfAll(@NotNull @NotNull java.lang.CharSequence s)Description copied from interface:IRichSequenceGet indices of all occurrences of a sequence- Specified by:
indexOfAllin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
s- sequence whose indices to find- Returns:
- array of indices
-
appendEOL
@NotNull public final T appendEOL()
- Specified by:
appendEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixWithEOL
@NotNull public final T suffixWithEOL()
- Specified by:
suffixWithEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixWithEOL
@NotNull public final T prefixWithEOL()
- Specified by:
prefixWithEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixOnceWithEOL
@NotNull public final T prefixOnceWithEOL()
- Specified by:
prefixOnceWithEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixOnceWithEOL
@NotNull public final T suffixOnceWithEOL()
- Specified by:
suffixOnceWithEOLin interfaceIRichSequence<T extends IRichSequence<T>>
-
appendSpace
@NotNull public final T appendSpace()
- Specified by:
appendSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixWithSpace
@NotNull public final T suffixWithSpace()
- Specified by:
suffixWithSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixWithSpace
@NotNull public final T prefixWithSpace()
- Specified by:
prefixWithSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
appendSpaces
@NotNull public final T appendSpaces(int count)
- Specified by:
appendSpacesin interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixWithSpaces
@NotNull public final T suffixWithSpaces(int count)
- Specified by:
suffixWithSpacesin interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixWithSpaces
@NotNull public final T prefixWithSpaces(int count)
- Specified by:
prefixWithSpacesin interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixOnceWithSpace
@NotNull public final T prefixOnceWithSpace()
- Specified by:
prefixOnceWithSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
suffixOnceWithSpace
@NotNull public final T suffixOnceWithSpace()
- Specified by:
suffixOnceWithSpacein interfaceIRichSequence<T extends IRichSequence<T>>
-
prefixWith
@NotNull public T prefixWith(@Nullable @Nullable java.lang.CharSequence prefix)
Description copied from interface:IRichSequencePrefix this sequence with a char sequence- Specified by:
prefixWithin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
prefix- char sequence- Returns:
- resulting sequence
-
suffixWith
@NotNull public T suffixWith(@Nullable @Nullable java.lang.CharSequence suffix)
Description copied from interface:IRichSequencePrefix this sequence with a char sequence- Specified by:
suffixWithin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
suffix- char sequence- Returns:
- resulting sequence
-
prefixOnceWith
@NotNull public final T prefixOnceWith(@Nullable @Nullable java.lang.CharSequence prefix)
Description copied from interface:IRichSequencePrefix this sequence with a char sequence if not already starting with prefix- Specified by:
prefixOnceWithin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
prefix- char sequence- Returns:
- resulting sequence
-
suffixOnceWith
@NotNull public final T suffixOnceWith(@Nullable @Nullable java.lang.CharSequence suffix)
Description copied from interface:IRichSequenceSuffix this sequence with a char sequence if not already ending with suffix- Specified by:
suffixOnceWithin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
suffix- char sequence- Returns:
- resulting sequence
-
replace
@NotNull public final T replace(int startIndex, int endIndex, @NotNull @NotNull java.lang.CharSequence replacement)
Description copied from interface:IRichSequenceReplace part of the sequence with a char sequence- Specified by:
replacein 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 java.lang.CharSequence find, @NotNull @NotNull java.lang.CharSequence replace)
Description copied from interface:IRichSequenceReplace all occurrences of one sequence with another- Specified by:
replacein interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
find- sequence to findreplace- replacement sequence- Returns:
- array of indices
-
append
@NotNull public final T append(java.lang.CharSequence... sequences)
Description copied from interface:IRichSequenceConcatenate this sequence and list of others, returning sequence of result- Specified by:
appendin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
sequences- list of char sequences to append to this sequence, null sequences are skipped- Returns:
- appended sequence
-
append
@NotNull public final T append(java.lang.Iterable<? extends java.lang.CharSequence> sequences)
- Specified by:
appendin interfaceIRichSequence<T extends IRichSequence<T>>
-
extractRanges
@NotNull public final T extractRanges(Range... ranges)
Description copied from interface:IRichSequenceBuild a sequence of ranges in this sequenceNOTE: BasedSequence ranges must be non-overlapping and ordered by startOffset or IllegalArgumentException will be thrown
- Specified by:
extractRangesin interfaceIRichSequence<T extends IRichSequence<T>>- Parameters:
ranges- ranges to extract- Returns:
- resulting sequence
-
extractRanges
@NotNull public final T extractRanges(java.lang.Iterable<Range> ranges)
- Specified by:
extractRangesin interfaceIRichSequence<T extends IRichSequence<T>>
-
columnAtIndex
public final int columnAtIndex(int index)
- Specified by:
columnAtIndexin interfaceIRichSequence<T extends IRichSequence<T>>
-
lineColumnAtIndex
@NotNull public final @NotNull Pair<java.lang.Integer,java.lang.Integer> lineColumnAtIndex(int index)
Description copied from interface:IRichSequenceGet the line and column information from index into sequence- Specified by:
lineColumnAtIndexin 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
public boolean isIn(@NotNull @NotNull java.lang.String[] texts)- Specified by:
isInin interfaceIRichSequence<T extends IRichSequence<T>>
-
isIn
public boolean isIn(@NotNull @NotNull java.util.Collection<? extends java.lang.CharSequence> texts)- Specified by:
isInin interfaceIRichSequence<T extends IRichSequence<T>>
-
-