Top Description Fields Constructors Methods
com.vladsch.flexmark.util.sequence

public final Class MappedBasedSequence

extends BasedSequenceImpl
implements MappedSequence<BasedSequence>, ReplacedBasedSequence
Class Inheritance
All Implemented Interfaces
com.vladsch.flexmark.util.sequence.ReplacedBasedSequence, com.vladsch.flexmark.util.sequence.BasedSequence, com.vladsch.flexmark.util.sequence.BasedOptionsHolder, com.vladsch.flexmark.util.sequence.IRichSequence, com.vladsch.flexmark.util.sequence.SequenceUtils, java.lang.Comparable, java.lang.CharSequence, com.vladsch.flexmark.util.sequence.MappedSequence
Imports
com.vladsch.flexmark.util.data.DataHolder, .DataKeyBase, com.vladsch.flexmark.util.sequence.builder.IBasedSegmentBuilder, com.vladsch.flexmark.util.sequence.mappers.CharMapper, org.jetbrains.annotations.NotNull, .Nullable

A BasedSequence which maps characters according to CharMapper

Field Summary

Modifier and TypeField and Description
private final BasedSequence
private final CharMapper

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
allOptions(int
option flags
options
)

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.allOptions.

Options test for options for this sequence

default reports true for global default options (if any) , variation available on BasedSequenceWithOptions

public boolean
anyOptions(int
option flags
options
)

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.anyOptions.

Options test for options for this sequence

default reports true for global default options (if any) , variation available on BasedSequenceWithOptions

public char
charAt(int
the index of the char value to be returned
index
)

Implements java.lang.CharSequence.charAt.

Returns the char value at the specified index.

public @NotNull Object
getBase()

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getBase.

Get the underlying object on which this sequence contents are based

public @NotNull BasedSequence
public @NotNull CharMapper
public @NotNull BasedSequence
public int
getEndOffset()

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getEndOffset.

Get the end offset of this sequence into getBaseSequence() and getBase() original text source.

public int
getIndexOffset(int
index for which to get the offset in original source
index
)

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getIndexOffset.

Get the offset of index in this sequence mapped to offset into getBaseSequence() and getBase() original text source.

public <T> T
getOption(DataKeyBase<T>
in options
dataKey
)

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.getOption.

Options holder, default has none, only available on BasedSequenceWithOptions

public int
getOptionFlags()

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.getOptionFlags.

Options test for options for this sequence

default reports true for global default options (if any) , variation available on BasedSequenceWithOptions

public @Nullable DataHolder
getOptions()

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.getOptions.

Options holder, default has none, only available on BasedSequenceWithOptions

public @NotNull Range
getSourceRange()

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getSourceRange.

Get the range of this sequence in original getBaseSequence() and getBase() original text source.

public int
getStartOffset()

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getStartOffset.

Get the start offset of this sequence into getBaseSequence() and getBase() original text source.

public int
length()

Implements java.lang.CharSequence.length.

Returns the length of this character sequence.

public static @NotNull BasedSequence
public @NotNull BasedSequence
sequenceOf(@Nullable CharSequence baseSeq, int startIndex, int endIndex)

public @NotNull BasedSequence
subSequence(int
the start index, inclusive
startIndex
,
int
the end index, exclusive
endIndex
)

Implements java.lang.CharSequence.subSequence, com.vladsch.flexmark.util.sequence.BasedSequence.subSequence, com.vladsch.flexmark.util.sequence.IRichSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence.

public @NotNull BasedSequence
Inherited from com.vladsch.flexmark.util.sequence.BasedSequenceImpl:
addSegmentsbaseColumnAtEndbaseColumnAtIndexbaseColumnAtStartbaseEndOfLinebaseEndOfLinebaseEndOfLineAnyEOLbaseEndOfLineAnyEOLbaseLineColumnAtEndbaseLineColumnAtIndexbaseLineColumnAtStartbaseLineRangeAtEndbaseLineRangeAtIndexbaseLineRangeAtStartbaseStartOfLinebaseStartOfLinebaseStartOfLineAnyEOLbaseStartOfLineAnyEOLbaseSubSequencebaseSubSequencecontainsAllOfcontainsOnlyIncontainsOnlyNotIncontainsSomeIncontainsSomeNotIncontainsSomeOfcreateemptyArrayextendByAnyextendByAnyextendByAnyNotextendByAnyNotextendByOneOfAnyextendByOneOfAnyNotextendToEndOfLineextendToEndOfLineextendToEndOfLineextendToEndOfLineextendToStartOfLineextendToStartOfLineextendToStartOfLineextendToStartOfLinefirstNonNullgetBuildergetEmptyPrefixgetEmptySuffixgetSegmentTreeintersectisBaseCharAtisContinuationOfisContinuedBynormalizeEndWithEOLnormalizeEOLnullSequenceprefixOfprefixWithprefixWithIndentprefixWithIndentsafeBaseCharAtsafeCharAtsequenceOfspliceAtEndsuffixOftoStringOrNullunescapeunescapeunescapeNoEntities

Field Detail

baseSeqback to summary
private final BasedSequence baseSeq
mapperback to summary
private final CharMapper mapper

Constructor Detail

MappedBasedSequenceback to summary
private MappedBasedSequence(BasedSequence baseSeq, CharMapper mapper)

Method Detail

addSegmentsback to summary
public void addSegments(@NotNull IBasedSegmentBuilder<?> builder)
Annotations
@Override
allOptionsback to summary
public boolean allOptions(int options)

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.allOptions.

Doc from com.vladsch.flexmark.util.sequence.BasedOptionsHolder.allOptions.

Options test for options for this sequence

default reports true for global default options (if any) , variation available on BasedSequenceWithOptions

Parameters
options:int

option flags

Returns:boolean

true if all option flags passed are set for this sequence

Annotations
@Override
anyOptionsback to summary
public boolean anyOptions(int options)

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.anyOptions.

Doc from com.vladsch.flexmark.util.sequence.BasedOptionsHolder.anyOptions.

Options test for options for this sequence

default reports true for global default options (if any) , variation available on BasedSequenceWithOptions

Parameters
options:int

option flags

Returns:boolean

true if any option flags passed are set for this sequence

Annotations
@Override
charAtback to summary
public char charAt(int index)

Implements java.lang.CharSequence.charAt.

Doc from java.lang.CharSequence.charAt.

Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.

If the char value specified by the index is a surrogate, the surrogate value is returned.

Parameters
index:int

the index of the char value to be returned

Returns:char

the specified char value

Annotations
@Override
getBaseback to summary
public @NotNull Object getBase()

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getBase.

Doc from com.vladsch.flexmark.util.sequence.BasedSequence.getBase.

Get the underlying object on which this sequence contents are based

Returns:@NotNull Object

underlying object containing original text

Annotations
@NotNull
@Override
getBaseSequenceback to summary
public @NotNull BasedSequence getBaseSequence()

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getBaseSequence.

Doc from com.vladsch.flexmark.util.sequence.BasedSequence.getBaseSequence.

Get the base sequence for the text

Returns:@NotNull BasedSequence

base sequence

Annotations
@NotNull
@Override
getCharMapperback to summary
public @NotNull CharMapper getCharMapper()

Implements com.vladsch.flexmark.util.sequence.MappedSequence.getCharMapper.

Annotations
@NotNull
@Override
getCharSequenceback to summary
public @NotNull BasedSequence getCharSequence()

Implements com.vladsch.flexmark.util.sequence.MappedSequence.getCharSequence.

Annotations
@NotNull
@Override
getEndOffsetback to summary
public int getEndOffset()

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getEndOffset.

Doc from com.vladsch.flexmark.util.sequence.BasedSequence.getEndOffset.

Get the end offset of this sequence into getBaseSequence() and getBase() original text source.

Returns:int

end offset in original text

Annotations
@Override
getIndexOffsetback to summary
public int getIndexOffset(int index)

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getIndexOffset.

Doc from com.vladsch.flexmark.util.sequence.BasedSequence.getIndexOffset.

Get the offset of index in this sequence mapped to offset into getBaseSequence() and getBase() 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:int

index for which to get the offset in original source

Returns:int

offset of index of this sequence in original text

Annotations
@Override
getOptionback to summary
public <T> T getOption(DataKeyBase<T> dataKey)

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.getOption.

Doc from com.vladsch.flexmark.util.sequence.BasedOptionsHolder.getOption.

Options holder, default has none, only available on BasedSequenceWithOptions

Parameters
<T>
type of value held by key
dataKey:DataKeyBase<T>

in options

Returns:T

true if data key is available

Annotations
@Override
getOptionFlagsback to summary
public int getOptionFlags()

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.getOptionFlags.

Doc from com.vladsch.flexmark.util.sequence.BasedOptionsHolder.getOptionFlags.

Options test for options for this sequence

default reports true for global default options (if any) , variation available on BasedSequenceWithOptions

Returns:int

option flags for this sequence

Annotations
@Override
getOptionsback to summary
public @Nullable DataHolder getOptions()

Implements com.vladsch.flexmark.util.sequence.BasedOptionsHolder.getOptions.

Doc from com.vladsch.flexmark.util.sequence.BasedOptionsHolder.getOptions.

Options holder, default has none, only available on BasedSequenceWithOptions

Returns:@Nullable DataHolder

data holder with options or null if none for this sequence

Annotations
@Override
@Nullable
getSourceRangeback to summary
public @NotNull Range getSourceRange()

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getSourceRange.

Doc from com.vladsch.flexmark.util.sequence.BasedSequence.getSourceRange.

Get the range of this sequence in original getBaseSequence() and getBase() original text source.

Returns:@NotNull Range

Range of start offset and end offset

Annotations
@NotNull
@Override
getStartOffsetback to summary
public int getStartOffset()

Implements com.vladsch.flexmark.util.sequence.BasedSequence.getStartOffset.

Doc from com.vladsch.flexmark.util.sequence.BasedSequence.getStartOffset.

Get the start offset of this sequence into getBaseSequence() and getBase() original text source.

Returns:int

start offset in original text

Annotations
@Override
lengthback to summary
public int length()

Implements java.lang.CharSequence.length.

Doc from java.lang.CharSequence.length.

Returns the length of this character sequence. The length is the number of 16-bit chars in the sequence.

Returns:int

the number of chars in this sequence

Annotations
@Override
mappedOfback to summary
public static @NotNull BasedSequence mappedOf(@NotNull BasedSequence baseSeq, @NotNull CharMapper mapper)
Annotations
@NotNull
sequenceOfback to summary
public @NotNull BasedSequence sequenceOf(@Nullable CharSequence baseSeq, int startIndex, int endIndex)
Annotations
@NotNull
@Override
subSequenceback to summary
public @NotNull BasedSequence subSequence(int startIndex, int endIndex)

Implements java.lang.CharSequence.subSequence, com.vladsch.flexmark.util.sequence.BasedSequence.subSequence, com.vladsch.flexmark.util.sequence.IRichSequence.subSequence.

Doc from java.lang.CharSequence.subSequence.

Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters
startIndex:int

the start index, inclusive

endIndex:int

the end index, exclusive

Returns:@NotNull BasedSequence

the specified subsequence

Annotations
@NotNull
@Override
toMappedback to summary
public @NotNull BasedSequence toMapped(CharMapper mapper)

Overrides com.vladsch.flexmark.util.sequence.BasedSequenceImpl.toMapped.

Implements com.vladsch.flexmark.util.sequence.IRichSequence.toMapped.

Annotations
@Override
@NotNull