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 Constructor Description BasedSequenceImpl(int hash)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSegments(@NotNull IBasedSegmentBuilder<?> builder)Add segments for this sequence, replacing out of base characters with stringsintbaseColumnAtEnd()intbaseColumnAtIndex(int index)intbaseColumnAtStart()intbaseEndOfLine()intbaseEndOfLine(int index)intbaseEndOfLineAnyEOL()intbaseEndOfLineAnyEOL(int index)@NotNull com.vladsch.flexmark.util.misc.Pair<Integer,Integer>baseLineColumnAtEnd()@NotNull com.vladsch.flexmark.util.misc.Pair<Integer,Integer>baseLineColumnAtIndex(int index)@NotNull com.vladsch.flexmark.util.misc.Pair<Integer,Integer>baseLineColumnAtStart()@NotNull RangebaseLineRangeAtEnd()@NotNull RangebaseLineRangeAtIndex(int index)@NotNull RangebaseLineRangeAtStart()intbaseStartOfLine()intbaseStartOfLine(int index)intbaseStartOfLineAnyEOL()intbaseStartOfLineAnyEOL(int index)@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 textualbooleancontainsSomeOf(@NotNull BasedSequence other)start/end offset based containment, not textual@NotNull BasedSequence[]emptyArray()@NotNull BasedSequenceextendByAny(@NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet)@NotNull BasedSequenceextendByAny(@NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet, int maxCount)Extend this based sequence to include characters from underlying based sequence@NotNull BasedSequenceextendByAnyNot(@NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet)@NotNull BasedSequenceextendByAnyNot(@NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet, int maxCount)Extend this based sequence to include characters from underlying based sequence not in character set@NotNull BasedSequenceextendByOneOfAny(@NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet)@NotNull BasedSequenceextendByOneOfAnyNot(@NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet)@NotNull BasedSequenceextendToEndOfLine()@NotNull BasedSequenceextendToEndOfLine(boolean includeEol)@NotNull BasedSequenceextendToEndOfLine(@NotNull com.vladsch.flexmark.util.misc.CharPredicate eolChars)@NotNull BasedSequenceextendToEndOfLine(@NotNull com.vladsch.flexmark.util.misc.CharPredicate eolChars, boolean includeEol)Extend in contained based sequence@NotNull BasedSequenceextendToStartOfLine()@NotNull BasedSequenceextendToStartOfLine(boolean includeEol)@NotNull BasedSequenceextendToStartOfLine(@NotNull com.vladsch.flexmark.util.misc.CharPredicate eolChars)@NotNull BasedSequenceextendToStartOfLine(@NotNull com.vladsch.flexmark.util.misc.CharPredicate eolChars, boolean includeEol)Extend in contained based sequencestatic BasedSequencefirstNonNull(BasedSequence... sequences)@NotNull SequenceBuildergetBuilder()Get a sequence builder for this sequence type@NotNull BasedSequencegetEmptyPrefix()Get empty prefix to this sequence@NotNull BasedSequencegetEmptySuffix()Get empty suffix to this sequence@NotNull SegmentTreegetSegmentTree()Get 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 com.vladsch.flexmark.util.misc.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 BasedSequencenullSequence()@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 sequence@NotNull BasedSequenceprefixWithIndent()@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 StringtoStringOrNull()Return 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 StringunescapeNoEntities()Get the unescaped string of this sequence content without unescaping entities-
Methods 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
-
-
-
-
Method Detail
-
firstNonNull
public static BasedSequence firstNonNull(BasedSequence... sequences)
-
emptyArray
@NotNull public @NotNull BasedSequence[] emptyArray()
- Specified by:
emptyArrayin interfaceIRichSequence<BasedSequence>
-
nullSequence
@NotNull public @NotNull 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
@NotNull public @NotNull SequenceBuilder 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
public void addSegments(@NotNull @NotNull IBasedSegmentBuilder<?> builder)Description copied from interface:BasedSequenceAdd segments for this sequence, replacing out of base characters with strings- Specified by:
addSegmentsin interfaceBasedSequence- Parameters:
builder- builder
-
getSegmentTree
@NotNull public @NotNull SegmentTree 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
@NotNull public @NotNull BasedSequence toMapped(CharMapper mapper)
- Specified by:
toMappedin interfaceIRichSequence<BasedSequence>
-
baseSubSequence
@NotNull public final @NotNull BasedSequence baseSubSequence(int startIndex)
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
@NotNull public @NotNull BasedSequence baseSubSequence(int startIndex, int endIndex)
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
public boolean isBaseCharAt(int index, @NotNull @NotNull com.vladsch.flexmark.util.misc.CharPredicate predicate)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
@NotNull public @NotNull BasedSequence getEmptyPrefix()
Description copied from interface:BasedSequenceGet empty prefix to this sequence- Specified by:
getEmptyPrefixin interfaceBasedSequence- Returns:
- same as subSequence(0,0)
-
getEmptySuffix
@NotNull public @NotNull BasedSequence getEmptySuffix()
Description copied from interface:BasedSequenceGet empty suffix to this sequence- Specified by:
getEmptySuffixin interfaceBasedSequence- Returns:
- same as subSequence(length())
-
toStringOrNull
@Nullable public @Nullable String 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
@NotNull public @NotNull String unescape()
Description copied from interface:BasedSequenceGet the unescaped string of this sequence content- Specified by:
unescapein interfaceBasedSequence- Returns:
- unescaped text
-
unescapeNoEntities
@NotNull public @NotNull String unescapeNoEntities()
Description copied from interface:BasedSequenceGet the unescaped string of this sequence content without unescaping entities- Specified by:
unescapeNoEntitiesin interfaceBasedSequence- Returns:
- unescaped text
-
unescape
@NotNull public @NotNull BasedSequence unescape(@NotNull @NotNull ReplacedTextMapper textMapper)
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
public boolean isContinuedBy(@NotNull @NotNull BasedSequence other)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
public boolean isContinuationOf(@NotNull @NotNull BasedSequence other)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
@NotNull public @NotNull BasedSequence spliceAtEnd(@NotNull @NotNull BasedSequence other)
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
public boolean containsAllOf(@NotNull @NotNull BasedSequence other)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
public boolean containsSomeOf(@NotNull @NotNull BasedSequence other)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
@NotNull public @NotNull BasedSequence intersect(@NotNull @NotNull BasedSequence other)
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
-
extendByAny
@NotNull public @NotNull BasedSequence extendByAny(@NotNull @NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet)
- Specified by:
extendByAnyin interfaceBasedSequence
-
extendByOneOfAny
@NotNull public @NotNull BasedSequence extendByOneOfAny(@NotNull @NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet)
- Specified by:
extendByOneOfAnyin interfaceBasedSequence
-
extendByAny
@NotNull public @NotNull BasedSequence extendByAny(@NotNull @NotNull com.vladsch.flexmark.util.misc.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
@NotNull public @NotNull BasedSequence extendByAnyNot(@NotNull @NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet)
- Specified by:
extendByAnyNotin interfaceBasedSequence
-
extendByOneOfAnyNot
@NotNull public @NotNull BasedSequence extendByOneOfAnyNot(@NotNull @NotNull com.vladsch.flexmark.util.misc.CharPredicate charSet)
- Specified by:
extendByOneOfAnyNotin interfaceBasedSequence
-
extendByAnyNot
@NotNull public @NotNull BasedSequence extendByAnyNot(@NotNull @NotNull com.vladsch.flexmark.util.misc.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 com.vladsch.flexmark.util.misc.CharPredicate eolChars)
- Specified by:
extendToEndOfLinein interfaceBasedSequence
-
extendToEndOfLine
@NotNull public final @NotNull BasedSequence extendToEndOfLine(boolean includeEol)
- Specified by:
extendToEndOfLinein interfaceBasedSequence
-
extendToEndOfLine
@NotNull public final @NotNull BasedSequence extendToEndOfLine()
- Specified by:
extendToEndOfLinein interfaceBasedSequence
-
extendToStartOfLine
@NotNull public final @NotNull BasedSequence extendToStartOfLine(@NotNull @NotNull com.vladsch.flexmark.util.misc.CharPredicate eolChars)
- Specified by:
extendToStartOfLinein interfaceBasedSequence
-
extendToStartOfLine
@NotNull public final @NotNull BasedSequence extendToStartOfLine(boolean includeEol)
- Specified by:
extendToStartOfLinein interfaceBasedSequence
-
extendToStartOfLine
@NotNull public final @NotNull BasedSequence extendToStartOfLine()
- Specified by:
extendToStartOfLinein interfaceBasedSequence
-
extendToEndOfLine
@NotNull public final @NotNull BasedSequence extendToEndOfLine(@NotNull @NotNull com.vladsch.flexmark.util.misc.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 com.vladsch.flexmark.util.misc.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
@NotNull public @NotNull BasedSequence prefixWith(@Nullable @Nullable CharSequence prefix)
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
@NotNull public final @NotNull BasedSequence prefixWithIndent()
- Specified by:
prefixWithIndentin interfaceBasedSequence
-
prefixWithIndent
@NotNull public @NotNull BasedSequence prefixWithIndent(int maxColumns)
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
@NotNull public @NotNull BasedSequence prefixOf(@NotNull @NotNull BasedSequence other)
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
@NotNull public @NotNull BasedSequence suffixOf(@NotNull @NotNull BasedSequence other)
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
@NotNull public @NotNull Range baseLineRangeAtIndex(int index)
- Specified by:
baseLineRangeAtIndexin interfaceBasedSequence
-
baseLineColumnAtIndex
@NotNull public @NotNull com.vladsch.flexmark.util.misc.Pair<Integer,Integer> baseLineColumnAtIndex(int index)
- 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
@NotNull public @NotNull Range baseLineRangeAtEnd()
- Specified by:
baseLineRangeAtEndin interfaceBasedSequence
-
baseLineColumnAtEnd
@NotNull public @NotNull com.vladsch.flexmark.util.misc.Pair<Integer,Integer> 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
@NotNull public @NotNull Range baseLineRangeAtStart()
- Specified by:
baseLineRangeAtStartin interfaceBasedSequence
-
baseLineColumnAtStart
@NotNull public @NotNull com.vladsch.flexmark.util.misc.Pair<Integer,Integer> baseLineColumnAtStart()
- Specified by:
baseLineColumnAtStartin interfaceBasedSequence
-
-