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 com.vladsch.flexmark.util.sequence.BasedOptionsHolder
BasedOptionsHolder.Options
Nested classes/interfaces inherited from interface com.vladsch.flexmark.util.sequence.BasedSequence
BasedSequence.EmptyBasedSequence
-
Field Summary
Fields inherited from interface com.vladsch.flexmark.util.sequence.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_STATS
Fields inherited from interface com.vladsch.flexmark.util.sequence.BasedSequence
EMPTY, EMPTY_ARRAY, EMPTY_LIST, EMPTY_SEGMENTS, EOL, LINE_SEP, NULL, SPACE
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSegments
(@NotNull IBasedSegmentBuilder<?> builder) Add segments for this sequence, replacing out of base characters with stringsint
int
baseColumnAtIndex
(int index) int
int
int
baseEndOfLine
(int index) int
int
baseEndOfLineAnyEOL
(int index) baseLineColumnAtIndex
(int index) @NotNull Range
@NotNull Range
baseLineRangeAtIndex
(int index) @NotNull Range
int
int
baseStartOfLine
(int index) int
int
baseStartOfLineAnyEOL
(int index) final @NotNull BasedSequence
baseSubSequence
(int startIndex) Get a portion of the original sequence that this sequence is based on@NotNull BasedSequence
baseSubSequence
(int startIndex, int endIndex) Get a portion of this sequence's base sequenceboolean
containsAllOf
(@NotNull BasedSequence other) start/end offset based containment, not textualboolean
containsOnlyIn
(@NotNull CharPredicate charSet) Test for line contains only characters from the setboolean
containsOnlyNotIn
(@NotNull CharPredicate charSet) Test for line containing only characters not in the setboolean
containsSomeIn
(@NotNull CharPredicate charSet) Test for line containing some of the characters in the setboolean
containsSomeNotIn
(@NotNull CharPredicate charSet) Test for line containing some characters not in the setboolean
containsSomeOf
(@NotNull BasedSequence other) start/end offset based containment, not textual(package private) static BasedSequence
create
(@Nullable CharSequence charSequence) @NotNull BasedSequence[]
@NotNull BasedSequence
extendByAny
(@NotNull CharPredicate charSet) @NotNull BasedSequence
extendByAny
(@NotNull CharPredicate charSet, int maxCount) Extend this based sequence to include characters from underlying based sequence@NotNull BasedSequence
extendByAnyNot
(@NotNull CharPredicate charSet) @NotNull BasedSequence
extendByAnyNot
(@NotNull CharPredicate charSet, int maxCount) Extend this based sequence to include characters from underlying based sequence not in character set@NotNull BasedSequence
extendByOneOfAny
(@NotNull CharPredicate charSet) @NotNull BasedSequence
extendByOneOfAnyNot
(@NotNull CharPredicate charSet) final @NotNull BasedSequence
final @NotNull BasedSequence
extendToEndOfLine
(boolean includeEol) final @NotNull BasedSequence
extendToEndOfLine
(@NotNull CharPredicate eolChars) final @NotNull BasedSequence
extendToEndOfLine
(@NotNull CharPredicate eolChars, boolean includeEol) Extend in contained based sequencefinal @NotNull BasedSequence
final @NotNull BasedSequence
extendToStartOfLine
(boolean includeEol) final @NotNull BasedSequence
extendToStartOfLine
(@NotNull CharPredicate eolChars) @NotNull BasedSequence
extendToStartOfLine
(@NotNull CharPredicate eolChars, boolean includeEol) Extend in contained based sequencestatic BasedSequence
firstNonNull
(BasedSequence... sequences) @NotNull SequenceBuilder
Get a sequence builder for this sequence type@NotNull BasedSequence
Get empty prefix to this sequence@NotNull BasedSequence
Get empty suffix to this sequence@NotNull SegmentTree
Get the segment tree for this sequence or null if sequence is contiguous from startOffset to endOffset@NotNull BasedSequence
intersect
(@NotNull BasedSequence other) start/end offset based intersection, not textualboolean
isBaseCharAt
(int index, @NotNull CharPredicate predicate) Safe, if index out of range but based sequence has characters will return those, else returns '\0'boolean
isContinuationOf
(@NotNull BasedSequence other) Test if this sequence is a continuation of the given sequence in original source textboolean
isContinuedBy
(@NotNull BasedSequence other) Test if the given sequence is a continuation of this sequence in original source text@NotNull BasedSequence
normalizeEndWithEOL
(@NotNull ReplacedTextMapper textMapper) replace any \r\n and \r by \n, append terminating EOL if one is not present@NotNull BasedSequence
normalizeEOL
(@NotNull ReplacedTextMapper textMapper) replace any \r\n and \r by \n@NotNull BasedSequence
@NotNull BasedSequence
prefixOf
(@NotNull BasedSequence other) Get the prefix part of this from other, start/end offset based containment, not textual@NotNull BasedSequence
prefixWith
(@Nullable CharSequence prefix) Prefix this sequence with a char sequencefinal @NotNull BasedSequence
@NotNull BasedSequence
prefixWithIndent
(int maxColumns) Extend this based sequence to include characters from underlying based sequence taking tab expansion to 4th spaces into accountchar
safeBaseCharAt
(int index) Safe, if index out of range but based sequence has characters will return those, else returns '\0'char
safeCharAt
(int index) return char at index or '\0' if index <0 or >=length()@NotNull BasedSequence
sequenceOf
(@Nullable CharSequence charSequence, int startIndex, int endIndex) Factory function@NotNull BasedSequence
spliceAtEnd
(@NotNull BasedSequence other) Splice the given sequence to the end of this one and return a BasedSequence of the result.@NotNull BasedSequence
suffixOf
(@NotNull BasedSequence other) Get the suffix part of this from other, start/end offset based containment, not textual@NotNull BasedSequence
toMapped
(CharMapper mapper) @Nullable String
Return string or null if BaseSequence.NULL@NotNull String
unescape()
Get the unescaped string of this sequence content@NotNull BasedSequence
unescape
(@NotNull ReplacedTextMapper textMapper) Get the unescaped string of this sequence content@NotNull String
Get the unescaped string of this sequence content without unescaping entitiesMethods inherited from class com.vladsch.flexmark.util.sequence.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, validateStartEnd
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.vladsch.flexmark.util.sequence.BasedOptionsHolder
allOptions, anyOptions, getOption, getOptionFlags, getOptions
Methods inherited from interface com.vladsch.flexmark.util.sequence.BasedSequence
extendToAny, extendToAny, getBase, getBaseSequence, getEndOffset, getIndexOffset, getSourceRange, getStartOffset, subSequence
Methods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, length, toString
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.vladsch.flexmark.util.sequence.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:
emptyArray
in interfaceIRichSequence<BasedSequence>
-
nullSequence
- Specified by:
nullSequence
in interfaceIRichSequence<BasedSequence>
-
sequenceOf
@NotNull public @NotNull BasedSequence sequenceOf(@Nullable @Nullable CharSequence charSequence, int startIndex, int endIndex) Description copied from interface:IRichSequence
Factory function- Specified by:
sequenceOf
in 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:IRichSequence
Get a sequence builder for this sequence type- Specified by:
getBuilder
in interfaceBasedSequence
- Specified by:
getBuilder
in interfaceIRichSequence<BasedSequence>
- Returns:
- builder which can build this type of sequence
-
addSegments
Description copied from interface:BasedSequence
Add segments for this sequence, replacing out of base characters with strings- Specified by:
addSegments
in interfaceBasedSequence
- Parameters:
builder
- builder
-
getSegmentTree
Get the segment tree for this sequence or null if sequence is contiguous from startOffset to endOffset- Specified by:
getSegmentTree
in interfaceBasedSequence
- Returns:
- null for contiguous sequences, else segment tree for this sequence
-
toMapped
- Specified by:
toMapped
in interfaceIRichSequence<BasedSequence>
-
baseSubSequence
Description copied from interface:BasedSequence
Get a portion of the original sequence that this sequence is based on- Specified by:
baseSubSequence
in interfaceBasedSequence
- Parameters:
startIndex
- offset from 0 of original sequence- Returns:
- based sequence from startIndex to the endIndex
-
baseSubSequence
Description copied from interface:BasedSequence
Get 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
CharSubSequence
andSubSequence
others use inherited implementation ofBasedSequenceImpl
- Specified by:
baseSubSequence
in 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:IRichSequence
return char at index or '\0' if index <0 or >=length()- Specified by:
safeCharAt
in interfaceIRichSequence<BasedSequence>
- Overrides:
safeCharAt
in classIRichSequenceBase<BasedSequence>
- Parameters:
index
- index- Returns:
- char or '\0'
-
safeBaseCharAt
public char safeBaseCharAt(int index) Description copied from interface:BasedSequence
Safe, 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:
safeBaseCharAt
in interfaceBasedSequence
- Parameters:
index
- index in string- Returns:
- character or '\0' if index out of base sequence
-
isBaseCharAt
Description copied from interface:BasedSequence
Safe, 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:
isBaseCharAt
in interfaceBasedSequence
- Parameters:
index
- index in stringpredicate
- character set predicate- Returns:
- true if character at index tests true
-
getEmptyPrefix
Description copied from interface:BasedSequence
Get empty prefix to this sequence- Specified by:
getEmptyPrefix
in interfaceBasedSequence
- Returns:
- same as subSequence(0,0)
-
getEmptySuffix
Description copied from interface:BasedSequence
Get empty suffix to this sequence- Specified by:
getEmptySuffix
in interfaceBasedSequence
- Returns:
- same as subSequence(length())
-
toStringOrNull
Description copied from interface:IRichSequence
Return string or null if BaseSequence.NULL- Specified by:
toStringOrNull
in interfaceIRichSequence<BasedSequence>
- Overrides:
toStringOrNull
in classIRichSequenceBase<BasedSequence>
- Returns:
- string or null if BaseSequence.NULL
-
unescape
Description copied from interface:BasedSequence
Get the unescaped string of this sequence content- Specified by:
unescape
in interfaceBasedSequence
- Returns:
- unescaped text
-
unescapeNoEntities
Description copied from interface:BasedSequence
Get the unescaped string of this sequence content without unescaping entities- Specified by:
unescapeNoEntities
in interfaceBasedSequence
- Returns:
- unescaped text
-
unescape
Description copied from interface:BasedSequence
Get the unescaped string of this sequence content- Specified by:
unescape
in 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:BasedSequence
replace any \r\n and \r by \n- Specified by:
normalizeEOL
in 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:BasedSequence
replace any \r\n and \r by \n, append terminating EOL if one is not present- Specified by:
normalizeEndWithEOL
in 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:BasedSequence
Test if the given sequence is a continuation of this sequence in original source text- Specified by:
isContinuedBy
in 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:BasedSequence
Test if this sequence is a continuation of the given sequence in original source text- Specified by:
isContinuationOf
in 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:BasedSequence
Splice 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:
spliceAtEnd
in 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:BasedSequence
start/end offset based containment, not textual- Specified by:
containsAllOf
in interfaceBasedSequence
- Parameters:
other
- based sequence from the same base- Returns:
- true if other is contained in this
-
containsSomeOf
Description copied from interface:BasedSequence
start/end offset based containment, not textual- Specified by:
containsSomeOf
in interfaceBasedSequence
- Parameters:
other
- based sequence from the same base- Returns:
- true if other is contained in this
-
intersect
Description copied from interface:BasedSequence
start/end offset based intersection, not textual- Specified by:
intersect
in 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:BasedSequence
Test for line containing some of the characters in the set- Specified by:
containsSomeIn
in interfaceBasedSequence
- Parameters:
charSet
- set of characters to be tested- Returns:
- true if line contains some characters in the set
-
containsSomeNotIn
Description copied from interface:BasedSequence
Test for line containing some characters not in the set- Specified by:
containsSomeNotIn
in 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:BasedSequence
Test for line contains only characters from the set- Specified by:
containsOnlyIn
in interfaceBasedSequence
- Parameters:
charSet
- set of characters to be tested- Returns:
- true if line contains some characters from the set
-
containsOnlyNotIn
Description copied from interface:BasedSequence
Test for line containing only characters not in the set- Specified by:
containsOnlyNotIn
in interfaceBasedSequence
- Parameters:
charSet
- set of characters to be tested- Returns:
- true if line contains some characters from the set
-
extendByAny
- Specified by:
extendByAny
in interfaceBasedSequence
-
extendByOneOfAny
- Specified by:
extendByOneOfAny
in interfaceBasedSequence
-
extendByAny
@NotNull public @NotNull BasedSequence extendByAny(@NotNull @NotNull CharPredicate charSet, int maxCount) Description copied from interface:BasedSequence
Extend this based sequence to include characters from underlying based sequence- Specified by:
extendByAny
in interfaceBasedSequence
- Parameters:
charSet
- set of characters to includemaxCount
- maximum extra characters to include- Returns:
- sequence which
-
extendByAnyNot
- Specified by:
extendByAnyNot
in interfaceBasedSequence
-
extendByOneOfAnyNot
- Specified by:
extendByOneOfAnyNot
in interfaceBasedSequence
-
extendByAnyNot
@NotNull public @NotNull BasedSequence extendByAnyNot(@NotNull @NotNull CharPredicate charSet, int maxCount) Description copied from interface:BasedSequence
Extend this based sequence to include characters from underlying based sequence not in character set- Specified by:
extendByAnyNot
in 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:
extendToEndOfLine
in interfaceBasedSequence
-
extendToEndOfLine
- Specified by:
extendToEndOfLine
in interfaceBasedSequence
-
extendToEndOfLine
- Specified by:
extendToEndOfLine
in interfaceBasedSequence
-
extendToStartOfLine
@NotNull public final @NotNull BasedSequence extendToStartOfLine(@NotNull @NotNull CharPredicate eolChars) - Specified by:
extendToStartOfLine
in interfaceBasedSequence
-
extendToStartOfLine
- Specified by:
extendToStartOfLine
in interfaceBasedSequence
-
extendToStartOfLine
- Specified by:
extendToStartOfLine
in interfaceBasedSequence
-
extendToEndOfLine
@NotNull public final @NotNull BasedSequence extendToEndOfLine(@NotNull @NotNull CharPredicate eolChars, boolean includeEol) Description copied from interface:BasedSequence
Extend in contained based sequence- Specified by:
extendToEndOfLine
in 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:BasedSequence
Extend in contained based sequence- Specified by:
extendToStartOfLine
in 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:IRichSequence
Prefix this sequence with a char sequence- Specified by:
prefixWith
in interfaceIRichSequence<BasedSequence>
- Overrides:
prefixWith
in classIRichSequenceBase<BasedSequence>
- Parameters:
prefix
- char sequence- Returns:
- resulting sequence
-
prefixWithIndent
- Specified by:
prefixWithIndent
in interfaceBasedSequence
-
prefixWithIndent
Description copied from interface:BasedSequence
Extend this based sequence to include characters from underlying based sequence taking tab expansion to 4th spaces into account- Specified by:
prefixWithIndent
in interfaceBasedSequence
- Parameters:
maxColumns
- maximum columns to include, defaultInteger.MAX_VALUE
- Returns:
- sequence which
-
prefixOf
Description copied from interface:BasedSequence
Get the prefix part of this from other, start/end offset based containment, not textual- Specified by:
prefixOf
in 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:BasedSequence
Get the suffix part of this from other, start/end offset based containment, not textual- Specified by:
suffixOf
in 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:
baseLineRangeAtIndex
in interfaceBasedSequence
-
baseLineColumnAtIndex
- Specified by:
baseLineColumnAtIndex
in interfaceBasedSequence
-
baseEndOfLine
public int baseEndOfLine(int index) - Specified by:
baseEndOfLine
in interfaceBasedSequence
-
baseEndOfLineAnyEOL
public int baseEndOfLineAnyEOL(int index) - Specified by:
baseEndOfLineAnyEOL
in interfaceBasedSequence
-
baseStartOfLine
public int baseStartOfLine(int index) - Specified by:
baseStartOfLine
in interfaceBasedSequence
-
baseStartOfLineAnyEOL
public int baseStartOfLineAnyEOL(int index) - Specified by:
baseStartOfLineAnyEOL
in interfaceBasedSequence
-
baseColumnAtIndex
public int baseColumnAtIndex(int index) - Specified by:
baseColumnAtIndex
in interfaceBasedSequence
-
baseEndOfLine
public int baseEndOfLine()- Specified by:
baseEndOfLine
in interfaceBasedSequence
-
baseEndOfLineAnyEOL
public int baseEndOfLineAnyEOL()- Specified by:
baseEndOfLineAnyEOL
in interfaceBasedSequence
-
baseColumnAtEnd
public int baseColumnAtEnd()- Specified by:
baseColumnAtEnd
in interfaceBasedSequence
-
baseLineRangeAtEnd
- Specified by:
baseLineRangeAtEnd
in interfaceBasedSequence
-
baseLineColumnAtEnd
- Specified by:
baseLineColumnAtEnd
in interfaceBasedSequence
-
baseStartOfLine
public int baseStartOfLine()- Specified by:
baseStartOfLine
in interfaceBasedSequence
-
baseStartOfLineAnyEOL
public int baseStartOfLineAnyEOL()- Specified by:
baseStartOfLineAnyEOL
in interfaceBasedSequence
-
baseColumnAtStart
public int baseColumnAtStart()- Specified by:
baseColumnAtStart
in interfaceBasedSequence
-
baseLineRangeAtStart
- Specified by:
baseLineRangeAtStart
in interfaceBasedSequence
-
baseLineColumnAtStart
- Specified by:
baseLineColumnAtStart
in interfaceBasedSequence
-
create
-