Interface BasedSequence
-
- All Superinterfaces:
BasedOptionsHolder
,java.lang.CharSequence
,java.lang.Comparable<java.lang.CharSequence>
,IRichSequence<BasedSequence>
,SequenceUtils
- All Known Subinterfaces:
ReplacedBasedSequence
- All Known Implementing Classes:
BasedSequence.EmptyBasedSequence
,BasedSequenceImpl
,CharSubSequence
,MappedBasedSequence
,PrefixedSubSequence
,SegmentedSequence
,SegmentedSequenceFull
,SegmentedSequenceTree
,SubSequence
public interface BasedSequence extends IRichSequence<BasedSequence>, BasedOptionsHolder
A CharSequence that references original char sequence with offsets into original preserved.NOTE: '\0' changed to '�' use
NullEncoder.decodeNull
mapper to get original null chars.Since equals is used for comparison of sequences and strings by base sequence manager, a base sequence with NUL may not compare equal to an equivalent unwrapped sequence because NUL chars are not converted. For Strings this is handled by using String.equals() for comparison. For other CharacterSequence types the match will fail if original has NUL in it.
a subSequence() returns a sub-sequence from the original base sequence with corresponding offsets
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
BasedSequence.EmptyBasedSequence
-
Nested classes/interfaces inherited from interface com.vladsch.flexmark.util.sequence.BasedOptionsHolder
BasedOptionsHolder.Options
-
-
Field Summary
Fields Modifier and Type Field Description static BasedSequence
EMPTY
static BasedSequence[]
EMPTY_ARRAY
static java.util.List<BasedSequence>
EMPTY_LIST
static BasedSequence[]
EMPTY_SEGMENTS
static BasedSequence
EOL
static BasedSequence
LINE_SEP
static BasedSequence
NULL
static BasedSequence
SPACE
-
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.SequenceUtils
ANY_EOL, ANY_EOL_SET, BACKSLASH_SET, DECIMAL_DIGITS, EMPTY_INDICES, ENC_NUL, EOL_CHAR, EOL_CHAR1, EOL_CHAR2, EOL_CHARS, EOL_SET, HASH_SET, HEXADECIMAL_DIGITS, LS, LSEP, NBSP, NBSP_CHARS, NUL, OCTAL_DIGITS, 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
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addSegments(IBasedSegmentBuilder<?> builder)
Add segments for this sequence, replacing out of base characters with stringsint
baseColumnAtEnd()
int
baseColumnAtIndex(int index)
int
baseColumnAtStart()
int
baseEndOfLine()
int
baseEndOfLine(int index)
int
baseEndOfLineAnyEOL()
int
baseEndOfLineAnyEOL(int index)
Pair<java.lang.Integer,java.lang.Integer>
baseLineColumnAtEnd()
Pair<java.lang.Integer,java.lang.Integer>
baseLineColumnAtIndex(int index)
Pair<java.lang.Integer,java.lang.Integer>
baseLineColumnAtStart()
Range
baseLineRangeAtEnd()
Range
baseLineRangeAtIndex(int index)
Range
baseLineRangeAtStart()
int
baseStartOfLine()
int
baseStartOfLine(int index)
int
baseStartOfLineAnyEOL()
int
baseStartOfLineAnyEOL(int index)
BasedSequence
baseSubSequence(int startIndex)
Get a portion of the original sequence that this sequence is based onBasedSequence
baseSubSequence(int startIndex, int endIndex)
Get a portion of this sequence's base sequenceboolean
containsAllOf(BasedSequence other)
start/end offset based containment, not textualboolean
containsOnlyIn(CharPredicate charSet)
Test for line contains only characters from the setboolean
containsOnlyNotIn(CharPredicate charSet)
Test for line containing only characters not in the setboolean
containsSomeIn(CharPredicate charSet)
Test for line containing some of the characters in the setboolean
containsSomeNotIn(CharPredicate charSet)
Test for line containing some characters not in the setboolean
containsSomeOf(BasedSequence other)
start/end offset based containment, not textualBasedSequence
extendByAny(CharPredicate charSet)
BasedSequence
extendByAny(CharPredicate charSet, int maxCount)
Extend this based sequence to include characters from underlying based sequenceBasedSequence
extendByAnyNot(CharPredicate charSet)
BasedSequence
extendByAnyNot(CharPredicate charSet, int maxCount)
Extend this based sequence to include characters from underlying based sequence not in character setBasedSequence
extendByOneOfAny(CharPredicate charSet)
BasedSequence
extendByOneOfAnyNot(CharPredicate charSet)
default BasedSequence
extendToAny(CharPredicate charSet)
Deprecated.default BasedSequence
extendToAny(CharPredicate charSet, int maxCount)
Deprecated.BasedSequence
extendToEndOfLine()
BasedSequence
extendToEndOfLine(boolean includeEol)
BasedSequence
extendToEndOfLine(CharPredicate eolChars)
BasedSequence
extendToEndOfLine(CharPredicate eolChars, boolean includeEol)
Extend in contained based sequenceBasedSequence
extendToStartOfLine()
BasedSequence
extendToStartOfLine(boolean includeEol)
BasedSequence
extendToStartOfLine(CharPredicate eolChars)
BasedSequence
extendToStartOfLine(CharPredicate eolChars, boolean includeEol)
Extend in contained based sequencejava.lang.Object
getBase()
Get the underlying object on which this sequence contents are basedBasedSequence
getBaseSequence()
Get the base sequence for the textSequenceBuilder
getBuilder()
Get a sequence builder for this sequence typeBasedSequence
getEmptyPrefix()
Get empty prefix to this sequenceBasedSequence
getEmptySuffix()
Get empty suffix to this sequenceint
getEndOffset()
Get the end offset of this sequence intogetBaseSequence()
andgetBase()
original text source.int
getIndexOffset(int index)
Get the offset of index in this sequence mapped to offset intogetBaseSequence()
andgetBase()
original text source.SegmentTree
getSegmentTree()
Get the segment tree for this sequenceRange
getSourceRange()
Get the range of this sequence in originalgetBaseSequence()
andgetBase()
original text source.int
getStartOffset()
Get the start offset of this sequence intogetBaseSequence()
andgetBase()
original text source.BasedSequence
intersect(BasedSequence other)
start/end offset based intersection, not textualboolean
isBaseCharAt(int index, CharPredicate predicate)
Safe, if index out of range but based sequence has characters will return those, else returns '\0'boolean
isContinuationOf(BasedSequence other)
Test if this sequence is a continuation of the given sequence in original source textboolean
isContinuedBy(BasedSequence other)
Test if the given sequence is a continuation of this sequence in original source textBasedSequence
normalizeEndWithEOL(ReplacedTextMapper textMapper)
replace any \r\n and \r by \n, append terminating EOL if one is not presentBasedSequence
normalizeEOL(ReplacedTextMapper textMapper)
replace any \r\n and \r by \nstatic BasedSequence
of(java.lang.CharSequence charSequence)
static BasedSequence
ofSpaces(int count)
BasedSequence
prefixOf(BasedSequence other)
Get the prefix part of this from other, start/end offset based containment, not textualBasedSequence
prefixWithIndent()
BasedSequence
prefixWithIndent(int maxColumns)
Extend this based sequence to include characters from underlying based sequence taking tab expansion to 4th spaces into accountstatic BasedSequence
repeatOf(char c, int count)
static BasedSequence
repeatOf(java.lang.CharSequence chars, int count)
static BasedSequence
repeatOf(java.lang.CharSequence chars, int startIndex, int endIndex)
char
safeBaseCharAt(int index)
Safe, if index out of range but based sequence has characters will return those, else returns '\0'BasedSequence
spliceAtEnd(BasedSequence other)
Splice the given sequence to the end of this one and return a BasedSequence of the result.BasedSequence
subSequence(int startIndex, int endIndex)
Get a portion of this sequenceBasedSequence
suffixOf(BasedSequence other)
Get the suffix part of this from other, start/end offset based containment, not textualjava.lang.String
unescape()
Get the unescaped string of this sequence contentBasedSequence
unescape(ReplacedTextMapper textMapper)
Get the unescaped string of this sequence contentjava.lang.String
unescapeNoEntities()
Get the unescaped string of this sequence content without unescaping entities-
Methods inherited from interface com.vladsch.flexmark.util.sequence.BasedOptionsHolder
allOptions, anyOptions, getOption, getOptionFlags, getOptions
-
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, emptyArray, 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, nullSequence, padding, padding, padEnd, padEnd, padStart, padStart, prefixOnceWith, prefixOnceWithEOL, prefixOnceWithSpace, prefixWith, prefixWithEOL, prefixWithSpace, prefixWithSpaces, removePrefix, removePrefix, removePrefixIgnoreCase, removeProperPrefix, removeProperPrefix, removeProperPrefixIgnoreCase, removeProperSuffix, removeProperSuffix, removeProperSuffixIgnoreCase, removeSuffix, removeSuffix, removeSuffixIgnoreCase, replace, replace, safeCharAt, safeSubSequence, safeSubSequence, sequenceOf, 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, toMapped, toNbSp, toSpc, toStringOrNull, 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
-
-
-
-
Field Detail
-
NULL
static final BasedSequence NULL
-
EMPTY
static final BasedSequence EMPTY
-
EOL
static final BasedSequence EOL
-
SPACE
static final BasedSequence SPACE
-
EMPTY_LIST
static final java.util.List<BasedSequence> EMPTY_LIST
-
EMPTY_ARRAY
static final BasedSequence[] EMPTY_ARRAY
-
EMPTY_SEGMENTS
static final BasedSequence[] EMPTY_SEGMENTS
-
LINE_SEP
static final BasedSequence LINE_SEP
-
-
Method Detail
-
of
@NotNull static BasedSequence of(@Nullable java.lang.CharSequence charSequence)
-
ofSpaces
@NotNull static BasedSequence ofSpaces(int count)
-
repeatOf
@NotNull static BasedSequence repeatOf(char c, int count)
-
repeatOf
@NotNull static BasedSequence repeatOf(@NotNull java.lang.CharSequence chars, int count)
-
repeatOf
@NotNull static BasedSequence repeatOf(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex)
-
getBuilder
@NotNull SequenceBuilder getBuilder()
Description copied from interface:IRichSequence
Get a sequence builder for this sequence type- Specified by:
getBuilder
in interfaceIRichSequence<BasedSequence>
- Returns:
- builder which can build this type of sequence
-
getBase
@NotNull java.lang.Object getBase()
Get the underlying object on which this sequence contents are based- Returns:
- underlying object containing original text
-
getBaseSequence
@NotNull BasedSequence getBaseSequence()
Get the base sequence for the text- Returns:
- base sequence
-
getStartOffset
int getStartOffset()
Get the start offset of this sequence intogetBaseSequence()
andgetBase()
original text source.- Returns:
- start offset in original text
-
getEndOffset
int getEndOffset()
Get the end offset of this sequence intogetBaseSequence()
andgetBase()
original text source.- Returns:
- end offset in original text
-
getIndexOffset
int getIndexOffset(int index)
Get the offset of index in this sequence mapped to offset intogetBaseSequence()
andgetBase()
original text source. NOTE: if the character at given index does not equal the corresponding character in the base sequence then this method should return -1 otherwise segmented based sequence will be created for original base character- Parameters:
index
- index for which to get the offset in original source- Returns:
- offset of index of this sequence in original text
-
addSegments
void addSegments(@NotNull IBasedSegmentBuilder<?> builder)
Add segments for this sequence, replacing out of base characters with strings- Parameters:
builder
- builder
-
getSegmentTree
@NotNull SegmentTree getSegmentTree()
Get the segment tree for this sequence- Returns:
- segment tree
-
getSourceRange
@NotNull Range getSourceRange()
Get the range of this sequence in originalgetBaseSequence()
andgetBase()
original text source.- Returns:
- Range of start offset and end offset
-
subSequence
@NotNull BasedSequence subSequence(int startIndex, int endIndex)
Get a portion of this sequence- Specified by:
subSequence
in interfacejava.lang.CharSequence
- Specified by:
subSequence
in interfaceIRichSequence<BasedSequence>
- Parameters:
startIndex
- offset from startIndex of this sequenceendIndex
- offset from startIndex of this sequence- Returns:
- based sequence which represents the requested range of this sequence.
-
baseSubSequence
@NotNull BasedSequence baseSubSequence(int startIndex, int endIndex)
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
- Parameters:
startIndex
- offset from 0 of original sequenceendIndex
- offset from 0 of original sequence- Returns:
- based sequence whose contents reflect the selected portion
-
baseSubSequence
@NotNull BasedSequence baseSubSequence(int startIndex)
Get a portion of the original sequence that this sequence is based on- Parameters:
startIndex
- offset from 0 of original sequence- Returns:
- based sequence from startIndex to the endIndex
-
safeBaseCharAt
char safeBaseCharAt(int index)
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
- Parameters:
index
- index in string- Returns:
- character or '\0' if index out of base sequence
-
isBaseCharAt
boolean isBaseCharAt(int index, @NotNull CharPredicate predicate)
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
- Parameters:
index
- index in stringpredicate
- character set predicate- Returns:
- true if character at index tests true
-
getEmptyPrefix
@NotNull BasedSequence getEmptyPrefix()
Get empty prefix to this sequence- Returns:
- same as subSequence(0,0)
-
getEmptySuffix
@NotNull BasedSequence getEmptySuffix()
Get empty suffix to this sequence- Returns:
- same as subSequence(length())
-
unescape
@NotNull java.lang.String unescape()
Get the unescaped string of this sequence content- Returns:
- unescaped text
-
unescapeNoEntities
@NotNull java.lang.String unescapeNoEntities()
Get the unescaped string of this sequence content without unescaping entities- Returns:
- unescaped text
-
unescape
@NotNull BasedSequence unescape(@NotNull ReplacedTextMapper textMapper)
Get the unescaped string of this sequence content- 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 BasedSequence normalizeEOL(@NotNull ReplacedTextMapper textMapper)
replace any \r\n and \r by \n- 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 BasedSequence normalizeEndWithEOL(@NotNull ReplacedTextMapper textMapper)
replace any \r\n and \r by \n, append terminating EOL if one is not present- 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
boolean isContinuedBy(@NotNull BasedSequence other)
Test if the given sequence is a continuation of this sequence in original source text- Parameters:
other
- sequence to test- Returns:
- true if the given sequence is a continuation of this one in the original text
-
isContinuationOf
boolean isContinuationOf(@NotNull BasedSequence other)
Test if this sequence is a continuation of the given sequence in original source text- Parameters:
other
- sequence to test- Returns:
- true if this sequence is a continuation of the given sequence in original source text
-
spliceAtEnd
@NotNull BasedSequence spliceAtEnd(@NotNull BasedSequence other)
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- 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
boolean containsAllOf(@NotNull BasedSequence other)
start/end offset based containment, not textual- Parameters:
other
- based sequence from the same base- Returns:
- true if other is contained in this
-
containsSomeOf
boolean containsSomeOf(@NotNull BasedSequence other)
start/end offset based containment, not textual- Parameters:
other
- based sequence from the same base- Returns:
- true if other is contained in this
-
prefixOf
@NotNull BasedSequence prefixOf(@NotNull BasedSequence other)
Get the prefix part of this from other, start/end offset based containment, not textual- 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 BasedSequence suffixOf(@NotNull BasedSequence other)
Get the suffix part of this from other, start/end offset based containment, not textual- Parameters:
other
- based sequence from the same base- Returns:
- suffix part of this as compared to other, start/end offset based, not content
-
intersect
@NotNull BasedSequence intersect(@NotNull BasedSequence other)
start/end offset based intersection, not textual- Parameters:
other
- based sequence from the same parent- Returns:
- sequence which is the intersection of the range of this and other
-
extendByAny
@NotNull BasedSequence extendByAny(@NotNull CharPredicate charSet, int maxCount)
Extend this based sequence to include characters from underlying based sequence- Parameters:
charSet
- set of characters to includemaxCount
- maximum extra characters to include- Returns:
- sequence which
-
extendByAny
@NotNull BasedSequence extendByAny(@NotNull CharPredicate charSet)
-
extendByOneOfAny
@NotNull BasedSequence extendByOneOfAny(@NotNull CharPredicate charSet)
-
containsSomeIn
boolean containsSomeIn(@NotNull CharPredicate charSet)
Test for line containing some of the characters in the set- Parameters:
charSet
- set of characters to be tested- Returns:
- true if line contains some characters in the set
-
containsSomeNotIn
boolean containsSomeNotIn(@NotNull CharPredicate charSet)
Test for line containing some characters not in the set- Parameters:
charSet
- set of characters to be tested- Returns:
- true if line contains some characters not in the set
-
containsOnlyIn
boolean containsOnlyIn(@NotNull CharPredicate charSet)
Test for line contains only characters from the set- Parameters:
charSet
- set of characters to be tested- Returns:
- true if line contains some characters from the set
-
containsOnlyNotIn
boolean containsOnlyNotIn(@NotNull CharPredicate charSet)
Test for line containing only characters not in the set- Parameters:
charSet
- set of characters to be tested- Returns:
- true if line contains some characters from the set
-
extendByAnyNot
@NotNull BasedSequence extendByAnyNot(@NotNull CharPredicate charSet, int maxCount)
Extend this based sequence to include characters from underlying based sequence not in character set- Parameters:
charSet
- set of characters to includemaxCount
- maximum extra characters to include- Returns:
- sequence which
-
extendByAnyNot
@NotNull BasedSequence extendByAnyNot(@NotNull CharPredicate charSet)
-
extendByOneOfAnyNot
@NotNull BasedSequence extendByOneOfAnyNot(@NotNull CharPredicate charSet)
-
extendToAny
@NotNull @Deprecated default BasedSequence extendToAny(@NotNull CharPredicate charSet, int maxCount)
Deprecated.
-
extendToAny
@NotNull @Deprecated default BasedSequence extendToAny(@NotNull CharPredicate charSet)
Deprecated.
-
extendToEndOfLine
@NotNull BasedSequence extendToEndOfLine(@NotNull CharPredicate eolChars, boolean includeEol)
Extend in contained based sequence- 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
-
extendToEndOfLine
@NotNull BasedSequence extendToEndOfLine(@NotNull CharPredicate eolChars)
-
extendToEndOfLine
@NotNull BasedSequence extendToEndOfLine(boolean includeEol)
-
extendToEndOfLine
@NotNull BasedSequence extendToEndOfLine()
-
extendToStartOfLine
@NotNull BasedSequence extendToStartOfLine(@NotNull CharPredicate eolChars, boolean includeEol)
Extend in contained based sequence- 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
-
extendToStartOfLine
@NotNull BasedSequence extendToStartOfLine(@NotNull CharPredicate eolChars)
-
extendToStartOfLine
@NotNull BasedSequence extendToStartOfLine(boolean includeEol)
-
extendToStartOfLine
@NotNull BasedSequence extendToStartOfLine()
-
prefixWithIndent
@NotNull BasedSequence prefixWithIndent(int maxColumns)
Extend this based sequence to include characters from underlying based sequence taking tab expansion to 4th spaces into account- Parameters:
maxColumns
- maximum columns to include, defaultInteger.MAX_VALUE
- Returns:
- sequence which
-
prefixWithIndent
@NotNull BasedSequence prefixWithIndent()
-
baseLineColumnAtIndex
@NotNull Pair<java.lang.Integer,java.lang.Integer> baseLineColumnAtIndex(int index)
-
baseLineRangeAtIndex
@NotNull Range baseLineRangeAtIndex(int index)
-
baseEndOfLine
int baseEndOfLine(int index)
-
baseEndOfLineAnyEOL
int baseEndOfLineAnyEOL(int index)
-
baseStartOfLine
int baseStartOfLine(int index)
-
baseStartOfLineAnyEOL
int baseStartOfLineAnyEOL(int index)
-
baseColumnAtIndex
int baseColumnAtIndex(int index)
-
baseLineColumnAtStart
@NotNull Pair<java.lang.Integer,java.lang.Integer> baseLineColumnAtStart()
-
baseLineColumnAtEnd
@NotNull Pair<java.lang.Integer,java.lang.Integer> baseLineColumnAtEnd()
-
baseEndOfLine
int baseEndOfLine()
-
baseEndOfLineAnyEOL
int baseEndOfLineAnyEOL()
-
baseStartOfLine
int baseStartOfLine()
-
baseStartOfLineAnyEOL
int baseStartOfLineAnyEOL()
-
baseLineRangeAtStart
@NotNull Range baseLineRangeAtStart()
-
baseLineRangeAtEnd
@NotNull Range baseLineRangeAtEnd()
-
baseColumnAtEnd
int baseColumnAtEnd()
-
baseColumnAtStart
int baseColumnAtStart()
-
-