Class BasedSequenceImpl
java.lang.Object
com.vladsch.flexmark.util.sequence.IRichSequenceBase<BasedSequence>
com.vladsch.flexmark.util.sequence.BasedSequenceImpl
- All Implemented Interfaces:
BasedOptionsHolder, BasedSequence, IRichSequence<BasedSequence>, SequenceUtils, CharSequence, Comparable<CharSequence>
- Direct Known Subclasses:
BasedSequence.EmptyBasedSequence, CharSubSequence, MappedBasedSequence, PrefixedSubSequence, SegmentedSequence, SubSequence
public abstract class BasedSequenceImpl
extends IRichSequenceBase<BasedSequence>
implements BasedSequence
Implementation of BaseSequence
-
Nested Class Summary
Nested classes/interfaces inherited from interface BasedOptionsHolder
BasedOptionsHolder.OptionsNested classes/interfaces inherited from interface BasedSequence
BasedSequence.EmptyBasedSequence -
Field Summary
Fields inherited from interface BasedOptionsHolder
F_APPLICATION_OPTIONS, F_COLLECT_FIRST256_STATS, F_COLLECT_SEGMENTED_STATS, F_FULL_SEGMENTED_SEQUENCES, F_LIBRARY_OPTIONS, F_NO_ANCHORS, F_TREE_SEGMENTED_SEQUENCES, O_COLLECT_FIRST256_STATS, O_COLLECT_SEGMENTED_STATS, O_FULL_SEGMENTED_SEQUENCES, O_NO_ANCHORS, O_TREE_SEGMENTED_SEQUENCES, SEGMENTED_STATSFields inherited from interface BasedSequence
EMPTY, EMPTY_ARRAY, EMPTY_LIST, EMPTY_SEGMENTS, EOL, LINE_SEP, NULL, SPACEFields inherited from interface 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSegments(@NotNull IBasedSegmentBuilder<?> builder) Add segments for this sequence, replacing out of base characters with stringsintintbaseColumnAtIndex(int index) intintintbaseEndOfLine(int index) intintbaseEndOfLineAnyEOL(int index) baseLineColumnAtIndex(int index) @NotNull Range@NotNull RangebaseLineRangeAtIndex(int index) @NotNull RangeintintbaseStartOfLine(int index) intintbaseStartOfLineAnyEOL(int index) final @NotNull BasedSequencebaseSubSequence(int startIndex) Get a portion of the original sequence that this sequence is based on@NotNull BasedSequencebaseSubSequence(int startIndex, int endIndex) Get a portion of this sequence's base sequencebooleancontainsAllOf(@NotNull BasedSequence other) start/end offset based containment, not textualbooleancontainsOnlyIn(@NotNull CharPredicate charSet) Test for line contains only characters from the setbooleancontainsOnlyNotIn(@NotNull CharPredicate charSet) Test for line containing only characters not in the setbooleancontainsSomeIn(@NotNull CharPredicate charSet) Test for line containing some of the characters in the setbooleancontainsSomeNotIn(@NotNull CharPredicate charSet) Test for line containing some characters not in the setbooleancontainsSomeOf(@NotNull BasedSequence other) start/end offset based containment, not textual(package private) static BasedSequencecreate(@Nullable CharSequence charSequence) @NotNull BasedSequence[]@NotNull BasedSequenceextendByAny(@NotNull CharPredicate charSet) @NotNull BasedSequenceextendByAny(@NotNull CharPredicate charSet, int maxCount) Extend this based sequence to include characters from underlying based sequence@NotNull BasedSequenceextendByAnyNot(@NotNull CharPredicate charSet) @NotNull BasedSequenceextendByAnyNot(@NotNull CharPredicate charSet, int maxCount) Extend this based sequence to include characters from underlying based sequence not in character set@NotNull BasedSequenceextendByOneOfAny(@NotNull CharPredicate charSet) @NotNull BasedSequenceextendByOneOfAnyNot(@NotNull CharPredicate charSet) final @NotNull BasedSequencefinal @NotNull BasedSequenceextendToEndOfLine(boolean includeEol) final @NotNull BasedSequenceextendToEndOfLine(@NotNull CharPredicate eolChars) final @NotNull BasedSequenceextendToEndOfLine(@NotNull CharPredicate eolChars, boolean includeEol) Extend in contained based sequencefinal @NotNull BasedSequencefinal @NotNull BasedSequenceextendToStartOfLine(boolean includeEol) final @NotNull BasedSequenceextendToStartOfLine(@NotNull CharPredicate eolChars) @NotNull BasedSequenceextendToStartOfLine(@NotNull CharPredicate eolChars, boolean includeEol) Extend in contained based sequencestatic BasedSequencefirstNonNull(BasedSequence... sequences) @NotNull SequenceBuilderGet a sequence builder for this sequence type@NotNull BasedSequenceGet empty prefix to this sequence@NotNull BasedSequenceGet empty suffix to this sequence@NotNull SegmentTreeGet the segment tree for this sequence or null if sequence is contiguous from startOffset to endOffset@NotNull BasedSequenceintersect(@NotNull BasedSequence other) start/end offset based intersection, not textualbooleanisBaseCharAt(int index, @NotNull CharPredicate predicate) Safe, if index out of range but based sequence has characters will return those, else returns '\0'booleanisContinuationOf(@NotNull BasedSequence other) Test if this sequence is a continuation of the given sequence in original source textbooleanisContinuedBy(@NotNull BasedSequence other) Test if the given sequence is a continuation of this sequence in original source text@NotNull BasedSequencenormalizeEndWithEOL(@NotNull ReplacedTextMapper textMapper) replace any \r\n and \r by \n, append terminating EOL if one is not present@NotNull BasedSequencenormalizeEOL(@NotNull ReplacedTextMapper textMapper) replace any \r\n and \r by \n@NotNull BasedSequence@NotNull BasedSequenceprefixOf(@NotNull BasedSequence other) Get the prefix part of this from other, start/end offset based containment, not textual@NotNull BasedSequenceprefixWith(@Nullable CharSequence prefix) Prefix this sequence with a char sequencefinal @NotNull BasedSequence@NotNull BasedSequenceprefixWithIndent(int maxColumns) Extend this based sequence to include characters from underlying based sequence taking tab expansion to 4th spaces into accountcharsafeBaseCharAt(int index) Safe, if index out of range but based sequence has characters will return those, else returns '\0'charsafeCharAt(int index) return char at index or '\0' if index <0 or >=length()@NotNull BasedSequencesequenceOf(@Nullable CharSequence charSequence, int startIndex, int endIndex) Factory function@NotNull BasedSequencespliceAtEnd(@NotNull BasedSequence other) Splice the given sequence to the end of this one and return a BasedSequence of the result.@NotNull BasedSequencesuffixOf(@NotNull BasedSequence other) Get the suffix part of this from other, start/end offset based containment, not textual@NotNull BasedSequencetoMapped(CharMapper mapper) @Nullable StringReturn string or null if BaseSequence.NULL@NotNull Stringunescape()Get the unescaped string of this sequence content@NotNull BasedSequenceunescape(@NotNull ReplacedTextMapper textMapper) Get the unescaped string of this sequence content@NotNull StringGet the unescaped string of this sequence content without unescaping entitiesMethods inherited from class IRichSequenceBase
append, append, appendEOL, appendRangesTo, appendRangesTo, appendRangesTo, appendRangesTo, appendSpace, appendSpaces, appendTo, appendTo, appendTo, appendTo, appendTo, appendTo, blankLinesRemovedRanges, blankLinesRemovedRanges, blankLinesRemovedRanges, blankLinesRemovedRanges, columnAtIndex, compareTo, countLeading, countLeading, countLeading, countLeadingColumns, countLeadingNot, countLeadingNot, countLeadingNot, countLeadingNotSpace, countLeadingNotSpace, countLeadingNotSpace, countLeadingNotSpaceTab, countLeadingNotSpaceTab, countLeadingNotSpaceTab, countLeadingNotWhitespace, countLeadingNotWhitespace, countLeadingNotWhitespace, countLeadingSpace, countLeadingSpace, countLeadingSpace, countLeadingSpaceTab, countLeadingSpaceTab, countLeadingSpaceTab, countLeadingWhitespace, countLeadingWhitespace, countLeadingWhitespace, countOfAny, countOfAny, countOfAny, countOfAnyNot, countOfAnyNot, countOfAnyNot, countOfNotSpaceTab, countOfNotWhitespace, countOfSpaceTab, countOfWhitespace, countTrailing, countTrailing, countTrailing, countTrailingNot, countTrailingNot, countTrailingNot, countTrailingNotSpace, countTrailingNotSpace, countTrailingNotSpace, countTrailingNotSpaceTab, countTrailingNotSpaceTab, countTrailingNotSpaceTab, countTrailingNotWhitespace, countTrailingNotWhitespace, countTrailingNotWhitespace, countTrailingSpace, countTrailingSpace, countTrailingSpace, countTrailingSpaceTab, countTrailingSpaceTab, countTrailingSpaceTab, countTrailingWhitespace, countTrailingWhitespace, countTrailingWhitespace, delete, endCharAt, endOfDelimitedBy, endOfDelimitedByAny, endOfDelimitedByAnyNot, endOfLine, endOfLineAnyEOL, endSequence, endSequence, endsWith, endsWith, endsWith, endsWithAnyEOL, endsWithEOL, endsWithIgnoreCase, endsWithSpace, endsWithSpaceTab, endsWithWhitespace, eolEndLength, eolEndLength, eolEndRange, eolStartLength, eolStartRange, equals, equals, equalsIgnoreCase, extractRanges, extractRanges, firstChar, hashCode, ifNull, ifNullEmptyAfter, ifNullEmptyBefore, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOfAll, indexOfAny, indexOfAny, indexOfAny, indexOfAnyNot, indexOfAnyNot, indexOfAnyNot, indexOfNot, indexOfNot, indexOfNot, insert, isBlank, isCharAt, isEmpty, isIn, isIn, isNotBlank, isNotEmpty, isNotNull, isNull, lastChar, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOfAny, lastIndexOfAny, lastIndexOfAny, lastIndexOfAnyNot, lastIndexOfAnyNot, lastIndexOfAnyNot, lastIndexOfNot, lastIndexOfNot, lastIndexOfNot, leadingBlankLinesRange, leadingBlankLinesRange, leadingBlankLinesRange, leadingBlankLinesRange, lineAt, lineAtAnyEOL, lineColumnAtIndex, lineRangeAt, lineRangeAtAnyEOL, matchChars, matchChars, matchChars, matchChars, matchCharsIgnoreCase, matchCharsIgnoreCase, matchCharsReversed, matchCharsReversed, matchCharsReversedIgnoreCase, matchedCharCount, matchedCharCount, matchedCharCount, matchedCharCount, matchedCharCount, matchedCharCountIgnoreCase, matchedCharCountIgnoreCase, matchedCharCountReversed, matchedCharCountReversed, matchedCharCountReversed, matchedCharCountReversed, matchedCharCountReversedIgnoreCase, matchedCharCountReversedIgnoreCase, matches, matches, matchesIgnoreCase, midCharAt, midSequence, midSequence, normalizeEndWithEOL, normalizeEOL, nullIf, nullIf, nullIf, nullIf, nullIfBlank, nullIfEmpty, nullIfEndsWith, nullIfEndsWith, nullIfEndsWithIgnoreCase, nullIfNot, nullIfNot, nullIfNot, nullIfNotEndsWith, nullIfNotEndsWith, nullIfNotEndsWithIgnoreCase, nullIfNotStartsWith, nullIfNotStartsWith, nullIfNotStartsWithIgnoreCase, nullIfStartsWith, nullIfStartsWith, nullIfStartsWithIgnoreCase, padding, padding, padEnd, padEnd, padStart, padStart, prefixOnceWith, prefixOnceWithEOL, prefixOnceWithSpace, prefixWithEOL, prefixWithSpace, prefixWithSpaces, removePrefix, removePrefix, removePrefixIgnoreCase, removeProperPrefix, removeProperPrefix, removeProperPrefixIgnoreCase, removeProperSuffix, removeProperSuffix, removeProperSuffixIgnoreCase, removeSuffix, removeSuffix, removeSuffixIgnoreCase, replace, replace, safeSubSequence, safeSubSequence, sequenceOf, sequenceOf, split, split, split, split, split, splitEOL, splitEOL, splitList, splitList, splitList, splitList, splitList, splitListEOL, splitListEOL, splitListEOL, startOfDelimitedBy, startOfDelimitedByAny, startOfDelimitedByAnyNot, startOfLine, startOfLineAnyEOL, startsWith, startsWith, startsWith, startsWithAnyEOL, startsWithEOL, startsWithIgnoreCase, startsWithSpace, startsWithSpaceTab, startsWithWhitespace, subSequence, subSequence, subSequenceAfter, subSequenceBefore, subSequenceBeforeAfter, suffixOnceWith, suffixOnceWithEOL, suffixOnceWithSpace, suffixWith, suffixWithEOL, suffixWithSpace, suffixWithSpaces, toLowerCase, toNbSp, toSpc, toString, toUpperCase, toVisibleWhitespaceString, trailingBlankLinesRange, trailingBlankLinesRange, trailingBlankLinesRange, trailingBlankLinesRange, trim, trim, trim, trim, trimEnd, trimEnd, trimEnd, trimEnd, trimEndRange, trimEndRange, trimEndRange, trimEndRange, trimEOL, trimLeadBlankLines, trimmed, trimmed, trimmed, trimmed, trimmedEnd, trimmedEnd, trimmedEnd, trimmedEnd, trimmedEOL, trimmedStart, trimmedStart, trimmedStart, trimmedStart, trimRange, trimRange, trimRange, trimRange, trimStart, trimStart, trimStart, trimStart, trimStartRange, trimStartRange, trimStartRange, trimStartRange, trimTailBlankLines, trimToEndOfLine, trimToEndOfLine, trimToEndOfLine, trimToEndOfLine, trimToEndOfLine, trimToStartOfLine, trimToStartOfLine, trimToStartOfLine, trimToStartOfLine, trimToStartOfLine, validateIndex, validateIndexInclusiveEnd, validateStartEndMethods inherited from interface BasedOptionsHolder
allOptions, anyOptions, getOption, getOptionFlags, getOptionsMethods inherited from interface BasedSequence
extendToAny, extendToAny, getBase, getBaseSequence, getEndOffset, getIndexOffset, getSourceRange, getStartOffset, subSequenceMethods inherited from interface CharSequence
charAt, chars, codePoints, getChars, length, toStringMethods inherited from interface Comparable
compareToMethods inherited from interface IRichSequence
append, append, appendEOL, appendRangesTo, appendRangesTo, appendRangesTo, appendRangesTo, appendSpace, appendSpaces, appendTo, appendTo, appendTo, appendTo, appendTo, appendTo, blankLinesRemovedRanges, blankLinesRemovedRanges, blankLinesRemovedRanges, blankLinesRemovedRanges, columnAtIndex, countLeading, countLeading, countLeading, countLeading, countLeading, countLeadingColumns, countLeadingNot, countLeadingNot, countLeadingNot, countLeadingNotSpace, countLeadingNotSpace, countLeadingNotSpace, countLeadingNotSpaceTab, countLeadingNotSpaceTab, countLeadingNotSpaceTab, countLeadingNotWhitespace, countLeadingNotWhitespace, countLeadingNotWhitespace, countLeadingSpace, countLeadingSpace, countLeadingSpace, countLeadingSpaceTab, countLeadingSpaceTab, countLeadingSpaceTab, countLeadingWhitespace, countLeadingWhitespace, countLeadingWhitespace, countOf, countOfAny, countOfAny, countOfAny, countOfAnyNot, countOfAnyNot, countOfAnyNot, countOfNotSpaceTab, countOfNotWhitespace, countOfSpaceTab, countOfWhitespace, countTrailing, countTrailing, countTrailing, countTrailing, countTrailingNot, countTrailingNot, countTrailingNot, countTrailingNotSpace, countTrailingNotSpace, countTrailingNotSpace, countTrailingNotSpaceTab, countTrailingNotSpaceTab, countTrailingNotSpaceTab, countTrailingNotWhitespace, countTrailingNotWhitespace, countTrailingNotWhitespace, countTrailingSpace, countTrailingSpace, countTrailingSpace, countTrailingSpaceTab, countTrailingSpaceTab, countTrailingSpaceTab, countTrailingWhitespace, countTrailingWhitespace, countTrailingWhitespace, delete, endCharAt, endOfDelimitedBy, endOfDelimitedByAny, endOfDelimitedByAnyNot, endOfLine, endOfLineAnyEOL, endSequence, endSequence, endsWith, endsWith, endsWith, endsWithAnyEOL, endsWithEOL, endsWithIgnoreCase, endsWithSpace, endsWithSpaceTab, endsWithWhitespace, eolEndLength, eolEndLength, eolEndRange, eolLength, eolStartLength, eolStartLength, eolStartRange, equals, equals, equalsIgnoreCase, extractRanges, extractRanges, firstChar, getColumnAtIndex, getLineColumnAtIndex, hashCode, ifNull, ifNullEmptyAfter, ifNullEmptyBefore, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOfAll, indexOfAny, indexOfAny, indexOfAny, indexOfAnyNot, indexOfAnyNot, indexOfAnyNot, indexOfNot, indexOfNot, indexOfNot, insert, insert, isBlank, isCharAt, isEmpty, isIn, isIn, isNotBlank, isNotEmpty, isNotNull, isNull, lastChar, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOfAny, lastIndexOfAny, lastIndexOfAny, lastIndexOfAnyNot, lastIndexOfAnyNot, lastIndexOfAnyNot, lastIndexOfNot, lastIndexOfNot, lastIndexOfNot, leadingBlankLinesRange, leadingBlankLinesRange, leadingBlankLinesRange, leadingBlankLinesRange, lineAt, lineAtAnyEOL, lineColumnAtIndex, lineRangeAt, lineRangeAtAnyEOL, matchChars, matchChars, matchChars, matchChars, matchCharsIgnoreCase, matchCharsIgnoreCase, matchCharsReversed, matchCharsReversed, matchCharsReversedIgnoreCase, matchedCharCount, matchedCharCount, matchedCharCount, matchedCharCount, matchedCharCount, matchedCharCountIgnoreCase, matchedCharCountIgnoreCase, matchedCharCountReversed, matchedCharCountReversed, matchedCharCountReversed, matchedCharCountReversed, matchedCharCountReversedIgnoreCase, matchedCharCountReversedIgnoreCase, matches, matches, matchesIgnoreCase, midCharAt, midSequence, midSequence, normalizeEndWithEOL, normalizeEOL, nullIf, nullIf, nullIf, nullIf, nullIfBlank, nullIfEmpty, nullIfEndsWith, nullIfEndsWith, nullIfEndsWithIgnoreCase, nullIfEndsWithNot, nullIfNot, nullIfNot, nullIfNot, nullIfNotEndsWith, nullIfNotEndsWith, nullIfNotEndsWithIgnoreCase, nullIfNotStartsWith, nullIfNotStartsWith, nullIfNotStartsWithIgnoreCase, nullIfStartsWith, nullIfStartsWith, nullIfStartsWithIgnoreCase, nullIfStartsWithNot, padding, padding, padEnd, padEnd, padStart, padStart, prefixOnceWith, prefixOnceWithEOL, prefixOnceWithSpace, prefixWithEOL, prefixWithSpace, prefixWithSpaces, removePrefix, removePrefix, removePrefixIgnoreCase, removeProperPrefix, removeProperPrefix, removeProperPrefixIgnoreCase, removeProperSuffix, removeProperSuffix, removeProperSuffixIgnoreCase, removeSuffix, removeSuffix, removeSuffixIgnoreCase, replace, replace, safeSubSequence, safeSubSequence, sequenceOf, sequenceOf, split, split, split, split, split, split, split, split, splitEOL, splitEOL, splitList, splitList, splitList, splitList, splitList, splitListEOL, splitListEOL, splitListEOL, startOfDelimitedBy, startOfDelimitedByAny, startOfDelimitedByAnyNot, startOfLine, startOfLineAnyEOL, startsWith, startsWith, startsWith, startsWithAnyEOL, startsWithEOL, startsWithIgnoreCase, startsWithSpace, startsWithSpaceTab, startsWithWhitespace, subSequence, subSequence, subSequenceAfter, subSequenceBefore, suffixOnceWith, suffixOnceWithEOL, suffixOnceWithSpace, suffixWith, suffixWithEOL, suffixWithSpace, suffixWithSpaces, toLowerCase, toNbSp, toSpc, toUpperCase, toVisibleWhitespaceString, trailingBlankLinesRange, trailingBlankLinesRange, trailingBlankLinesRange, trailingBlankLinesRange, trim, trim, trim, trim, trimEnd, trimEnd, trimEnd, trimEnd, trimEndRange, trimEndRange, trimEndRange, trimEndRange, trimEOL, trimLeadBlankLines, trimmed, trimmed, trimmed, trimmed, trimmedEnd, trimmedEnd, trimmedEnd, trimmedEnd, trimmedEOL, trimmedStart, trimmedStart, trimmedStart, trimmedStart, trimRange, trimRange, trimRange, trimRange, trimStart, trimStart, trimStart, trimStart, trimStartRange, trimStartRange, trimStartRange, trimStartRange, trimTailBlankLines, trimToEndOfLine, trimToEndOfLine, trimToEndOfLine, trimToEndOfLine, trimToEndOfLine, trimToStartOfLine, trimToStartOfLine, trimToStartOfLine, trimToStartOfLine, trimToStartOfLine
-
Constructor Details
-
BasedSequenceImpl
public BasedSequenceImpl(int hash)
-
-
Method Details
-
firstNonNull
-
emptyArray
- Specified by:
emptyArrayin interfaceIRichSequence<BasedSequence>
-
nullSequence
- Specified by:
nullSequencein interfaceIRichSequence<BasedSequence>
-
sequenceOf
@NotNull public @NotNull BasedSequence sequenceOf(@Nullable @Nullable CharSequence charSequence, int startIndex, int endIndex) Description copied from interface:IRichSequenceFactory function- Specified by:
sequenceOfin interfaceIRichSequence<BasedSequence>- Parameters:
charSequence- char sequence from which to construct a rich char sequencestartIndex- start index of the sequence to useendIndex- end index of the sequence to use- Returns:
- rich char sequence from given inputs
-
getBuilder
Description copied from interface:IRichSequenceGet a sequence builder for this sequence type- Specified by:
getBuilderin interfaceBasedSequence- Specified by:
getBuilderin interfaceIRichSequence<BasedSequence>- Returns:
- builder which can build this type of sequence
-
addSegments
Description copied from interface:BasedSequenceAdd segments for this sequence, replacing out of base characters with strings- Specified by:
addSegmentsin interfaceBasedSequence- Parameters:
builder- builder
-
getSegmentTree
Get the segment tree for this sequence or null if sequence is contiguous from startOffset to endOffset- Specified by:
getSegmentTreein interfaceBasedSequence- Returns:
- null for contiguous sequences, else segment tree for this sequence
-
toMapped
- Specified by:
toMappedin interfaceIRichSequence<BasedSequence>
-
baseSubSequence
Description copied from interface:BasedSequenceGet a portion of the original sequence that this sequence is based on- Specified by:
baseSubSequencein interfaceBasedSequence- Parameters:
startIndex- offset from 0 of original sequence- Returns:
- based sequence from startIndex to the endIndex
-
baseSubSequence
Description copied from interface:BasedSequenceGet a portion of this sequence's base sequenceNOTE: this means that if this sequence applies modifications to the original sequence then these modifications are NOT be applied to the returned sequence.
NOTE: It should only be implemented in classes which provide base sequences such as
CharSubSequenceandSubSequenceothers use inherited implementation ofBasedSequenceImpl- Specified by:
baseSubSequencein interfaceBasedSequence- Parameters:
startIndex- offset from 0 of original sequenceendIndex- offset from 0 of original sequence- Returns:
- based sequence whose contents reflect the selected portion
-
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<BasedSequence>- Overrides:
safeCharAtin classIRichSequenceBase<BasedSequence>- Parameters:
index- index- Returns:
- char or '\0'
-
safeBaseCharAt
public char safeBaseCharAt(int index) Description copied from interface:BasedSequenceSafe, if index out of range but based sequence has characters will return those, else returns '\0'Allows peeking into preceding/following characters to the ones contained in this sequence
- Specified by:
safeBaseCharAtin interfaceBasedSequence- Parameters:
index- index in string- Returns:
- character or '\0' if index out of base sequence
-
isBaseCharAt
Description copied from interface:BasedSequenceSafe, if index out of range but based sequence has characters will return those, else returns '\0'Allows peeking into preceding/following characters to the ones contained in this sequence
- Specified by:
isBaseCharAtin interfaceBasedSequence- Parameters:
index- index in stringpredicate- character set predicate- Returns:
- true if character at index tests true
-
getEmptyPrefix
Description copied from interface:BasedSequenceGet empty prefix to this sequence- Specified by:
getEmptyPrefixin interfaceBasedSequence- Returns:
- same as subSequence(0,0)
-
getEmptySuffix
Description copied from interface:BasedSequenceGet empty suffix to this sequence- Specified by:
getEmptySuffixin interfaceBasedSequence- Returns:
- same as subSequence(length())
-
toStringOrNull
Description copied from interface:IRichSequenceReturn string or null if BaseSequence.NULL- Specified by:
toStringOrNullin interfaceIRichSequence<BasedSequence>- Overrides:
toStringOrNullin classIRichSequenceBase<BasedSequence>- Returns:
- string or null if BaseSequence.NULL
-
unescape
Description copied from interface:BasedSequenceGet the unescaped string of this sequence content- Specified by:
unescapein interfaceBasedSequence- Returns:
- unescaped text
-
unescapeNoEntities
Description copied from interface:BasedSequenceGet the unescaped string of this sequence content without unescaping entities- Specified by:
unescapeNoEntitiesin interfaceBasedSequence- Returns:
- unescaped text
-
unescape
Description copied from interface:BasedSequenceGet the unescaped string of this sequence content- Specified by:
unescapein interfaceBasedSequence- Parameters:
textMapper- replaced text mapper which will be uses to map unescaped index to original source index- Returns:
- unescaped text in based sequence
-
normalizeEOL
@NotNull public @NotNull BasedSequence normalizeEOL(@NotNull @NotNull ReplacedTextMapper textMapper) Description copied from interface:BasedSequencereplace any \r\n and \r by \n- Specified by:
normalizeEOLin interfaceBasedSequence- Parameters:
textMapper- replaced text mapper which will be uses to map unescaped index to original source index- Returns:
- based sequence with only \n for line separators
-
normalizeEndWithEOL
@NotNull public @NotNull BasedSequence normalizeEndWithEOL(@NotNull @NotNull ReplacedTextMapper textMapper) Description copied from interface:BasedSequencereplace any \r\n and \r by \n, append terminating EOL if one is not present- Specified by:
normalizeEndWithEOLin interfaceBasedSequence- Parameters:
textMapper- replaced text mapper which will be uses to map unescaped index to original source index- Returns:
- based sequence with only \n for line separators and terminated by \n
-
isContinuedBy
Description copied from interface:BasedSequenceTest if the given sequence is a continuation of this sequence in original source text- Specified by:
isContinuedByin interfaceBasedSequence- Parameters:
other- sequence to test- Returns:
- true if the given sequence is a continuation of this one in the original text
-
isContinuationOf
Description copied from interface:BasedSequenceTest if this sequence is a continuation of the given sequence in original source text- Specified by:
isContinuationOfin interfaceBasedSequence- Parameters:
other- sequence to test- Returns:
- true if this sequence is a continuation of the given sequence in original source text
-
spliceAtEnd
Description copied from interface:BasedSequenceSplice the given sequence to the end of this one and return a BasedSequence of the result. Does not copy anything, creates a new based sequence of the original text but one that spans characters of this sequence and other- Specified by:
spliceAtEndin interfaceBasedSequence- Parameters:
other- sequence to append to end of this one- Returns:
- based sequence that contains the span from start of this sequence and end of other
assertion will fail if the other sequence is not a continuation of this one
-
containsAllOf
Description copied from interface:BasedSequencestart/end offset based containment, not textual- Specified by:
containsAllOfin interfaceBasedSequence- Parameters:
other- based sequence from the same base- Returns:
- true if other is contained in this
-
containsSomeOf
Description copied from interface:BasedSequencestart/end offset based containment, not textual- Specified by:
containsSomeOfin interfaceBasedSequence- Parameters:
other- based sequence from the same base- Returns:
- true if other is contained in this
-
intersect
Description copied from interface:BasedSequencestart/end offset based intersection, not textual- Specified by:
intersectin interfaceBasedSequence- Parameters:
other- based sequence from the same parent- Returns:
- sequence which is the intersection of the range of this and other
-
containsSomeIn
Description copied from interface:BasedSequenceTest for line containing some of the characters in the set- Specified by:
containsSomeInin interfaceBasedSequence- Parameters:
charSet- set of characters to be tested- Returns:
- true if line contains some characters in the set
-
containsSomeNotIn
Description copied from interface:BasedSequenceTest for line containing some characters not in the set- Specified by:
containsSomeNotInin interfaceBasedSequence- Parameters:
charSet- set of characters to be tested- Returns:
- true if line contains some characters not in the set
-
containsOnlyIn
Description copied from interface:BasedSequenceTest for line contains only characters from the set- Specified by:
containsOnlyInin interfaceBasedSequence- Parameters:
charSet- set of characters to be tested- Returns:
- true if line contains some characters from the set
-
containsOnlyNotIn
Description copied from interface:BasedSequenceTest for line containing only characters not in the set- Specified by:
containsOnlyNotInin interfaceBasedSequence- Parameters:
charSet- set of characters to be tested- Returns:
- true if line contains some characters from the set
-
extendByAny
- Specified by:
extendByAnyin interfaceBasedSequence
-
extendByOneOfAny
- Specified by:
extendByOneOfAnyin interfaceBasedSequence
-
extendByAny
@NotNull public @NotNull BasedSequence extendByAny(@NotNull @NotNull CharPredicate charSet, int maxCount) Description copied from interface:BasedSequenceExtend this based sequence to include characters from underlying based sequence- Specified by:
extendByAnyin interfaceBasedSequence- Parameters:
charSet- set of characters to includemaxCount- maximum extra characters to include- Returns:
- sequence which
-
extendByAnyNot
- Specified by:
extendByAnyNotin interfaceBasedSequence
-
extendByOneOfAnyNot
- Specified by:
extendByOneOfAnyNotin interfaceBasedSequence
-
extendByAnyNot
@NotNull public @NotNull BasedSequence extendByAnyNot(@NotNull @NotNull CharPredicate charSet, int maxCount) Description copied from interface:BasedSequenceExtend this based sequence to include characters from underlying based sequence not in character set- Specified by:
extendByAnyNotin interfaceBasedSequence- Parameters:
charSet- set of characters to includemaxCount- maximum extra characters to include- Returns:
- sequence which
-
extendToEndOfLine
@NotNull public final @NotNull BasedSequence extendToEndOfLine(@NotNull @NotNull CharPredicate eolChars) - Specified by:
extendToEndOfLinein interfaceBasedSequence
-
extendToEndOfLine
- Specified by:
extendToEndOfLinein interfaceBasedSequence
-
extendToEndOfLine
- Specified by:
extendToEndOfLinein interfaceBasedSequence
-
extendToStartOfLine
@NotNull public final @NotNull BasedSequence extendToStartOfLine(@NotNull @NotNull CharPredicate eolChars) - Specified by:
extendToStartOfLinein interfaceBasedSequence
-
extendToStartOfLine
- Specified by:
extendToStartOfLinein interfaceBasedSequence
-
extendToStartOfLine
- Specified by:
extendToStartOfLinein interfaceBasedSequence
-
extendToEndOfLine
@NotNull public final @NotNull BasedSequence extendToEndOfLine(@NotNull @NotNull CharPredicate eolChars, boolean includeEol) Description copied from interface:BasedSequenceExtend in contained based sequence- Specified by:
extendToEndOfLinein interfaceBasedSequence- Parameters:
eolChars- characters to consider as EOL, noteIRichSequence.eolStartLength(int)IRichSequence.eolEndLength(int)should report length of EOL found if length > 1includeEol- if to include the eol in the string- Returns:
- resulting sequence after extension. If already spanning the line then this sequence is returned. if the last character of this sequence are found in eolChars then no extension will be performed since it already includes the line end
-
extendToStartOfLine
@NotNull public @NotNull BasedSequence extendToStartOfLine(@NotNull @NotNull CharPredicate eolChars, boolean includeEol) Description copied from interface:BasedSequenceExtend in contained based sequence- Specified by:
extendToStartOfLinein interfaceBasedSequence- Parameters:
eolChars- characters to consider as EOL, noteIRichSequence.eolStartLength(int)IRichSequence.eolEndLength(int)should report length of EOL found if length > 1includeEol- if to include the eol in the string- Returns:
- resulting sequence after extension. If already spanning the line then this sequence is returned. if the first character of this sequence are found in eolChars then no extension will be performed since it already includes the line end
-
prefixWith
Description copied from interface:IRichSequencePrefix this sequence with a char sequence- Specified by:
prefixWithin interfaceIRichSequence<BasedSequence>- Overrides:
prefixWithin classIRichSequenceBase<BasedSequence>- Parameters:
prefix- char sequence- Returns:
- resulting sequence
-
prefixWithIndent
- Specified by:
prefixWithIndentin interfaceBasedSequence
-
prefixWithIndent
Description copied from interface:BasedSequenceExtend this based sequence to include characters from underlying based sequence taking tab expansion to 4th spaces into account- Specified by:
prefixWithIndentin interfaceBasedSequence- Parameters:
maxColumns- maximum columns to include, defaultInteger.MAX_VALUE- Returns:
- sequence which
-
prefixOf
Description copied from interface:BasedSequenceGet the prefix part of this from other, start/end offset based containment, not textual- Specified by:
prefixOfin interfaceBasedSequence- Parameters:
other- based sequence from the same base- Returns:
- prefix part of this as compared to other, start/end offset based, not content
-
suffixOf
Description copied from interface:BasedSequenceGet the suffix part of this from other, start/end offset based containment, not textual- Specified by:
suffixOfin interfaceBasedSequence- Parameters:
other- based sequence from the same base- Returns:
- suffix part of this as compared to other, start/end offset based, not content
-
baseLineRangeAtIndex
- Specified by:
baseLineRangeAtIndexin interfaceBasedSequence
-
baseLineColumnAtIndex
- Specified by:
baseLineColumnAtIndexin interfaceBasedSequence
-
baseEndOfLine
public int baseEndOfLine(int index) - Specified by:
baseEndOfLinein interfaceBasedSequence
-
baseEndOfLineAnyEOL
public int baseEndOfLineAnyEOL(int index) - Specified by:
baseEndOfLineAnyEOLin interfaceBasedSequence
-
baseStartOfLine
public int baseStartOfLine(int index) - Specified by:
baseStartOfLinein interfaceBasedSequence
-
baseStartOfLineAnyEOL
public int baseStartOfLineAnyEOL(int index) - Specified by:
baseStartOfLineAnyEOLin interfaceBasedSequence
-
baseColumnAtIndex
public int baseColumnAtIndex(int index) - Specified by:
baseColumnAtIndexin interfaceBasedSequence
-
baseEndOfLine
public int baseEndOfLine()- Specified by:
baseEndOfLinein interfaceBasedSequence
-
baseEndOfLineAnyEOL
public int baseEndOfLineAnyEOL()- Specified by:
baseEndOfLineAnyEOLin interfaceBasedSequence
-
baseColumnAtEnd
public int baseColumnAtEnd()- Specified by:
baseColumnAtEndin interfaceBasedSequence
-
baseLineRangeAtEnd
- Specified by:
baseLineRangeAtEndin interfaceBasedSequence
-
baseLineColumnAtEnd
- Specified by:
baseLineColumnAtEndin interfaceBasedSequence
-
baseStartOfLine
public int baseStartOfLine()- Specified by:
baseStartOfLinein interfaceBasedSequence
-
baseStartOfLineAnyEOL
public int baseStartOfLineAnyEOL()- Specified by:
baseStartOfLineAnyEOLin interfaceBasedSequence
-
baseColumnAtStart
public int baseColumnAtStart()- Specified by:
baseColumnAtStartin interfaceBasedSequence
-
baseLineRangeAtStart
- Specified by:
baseLineRangeAtStartin interfaceBasedSequence
-
baseLineColumnAtStart
- Specified by:
baseLineColumnAtStartin interfaceBasedSequence
-
create
-