Class BasedOffsetTracker
java.lang.Object
com.vladsch.flexmark.util.sequence.builder.tree.BasedOffsetTracker
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable Segment
protected final @NotNull SegmentOffsetTree
protected final @NotNull BasedSequence
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BasedOffsetTracker
(@NotNull BasedSequence sequence, @NotNull SegmentOffsetTree segmentOffsetTree) protected
BasedOffsetTracker
(@NotNull BasedSequence sequence, @NotNull SegmentTree segmentTree) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull BasedOffsetTracker
create
(@NotNull BasedSequence sequence) Create a based offset tracker for the given sequencestatic @NotNull BasedOffsetTracker
create
(@NotNull BasedSequence sequence, @NotNull SegmentOffsetTree segmentOffsetTree) Create a based offset tracker for the given sequence@NotNull OffsetInfo
getOffsetInfo
(int offset, boolean isEndOffset) Return the range of indices in the sequence of this based offset tracker that correspond to the given offset in the base sequence from which this sequence was derived.@NotNull SegmentOffsetTree
@NotNull BasedSequence
int
size()
toString()
-
Field Details
-
sequence
-
segmentOffsetTree
-
lastSegment
-
-
Constructor Details
-
BasedOffsetTracker
protected BasedOffsetTracker(@NotNull @NotNull BasedSequence sequence, @NotNull @NotNull SegmentTree segmentTree) -
BasedOffsetTracker
protected BasedOffsetTracker(@NotNull @NotNull BasedSequence sequence, @NotNull @NotNull SegmentOffsetTree segmentOffsetTree)
-
-
Method Details
-
size
public int size() -
getOffsetInfo
Return the range of indices in the sequence of this based offset tracker that correspond to the given offset in the base sequence from which this sequence was derived.NOTE: indented use is the recover the editing caret position from original text after some text transformation such as formatting, rendering HTML or paragraph wrapping.
- Parameters:
offset
- offset in base sequenceisEndOffset
- if true then offset represents the range [offset, offset) so it is located between character at offset-1 and character at offset if false then offset represents the character at offset and the range [offset, offset+1)- Returns:
- information about the offset in this sequence
-
getSequence
-
getSegmentOffsetTree
-
toString
-
create
Create a based offset tracker for the given sequence- Parameters:
sequence
- sequence which to create offset tracker- Returns:
- based offset tracker
-
create
@NotNull public static @NotNull BasedOffsetTracker create(@NotNull @NotNull BasedSequence sequence, @NotNull @NotNull SegmentOffsetTree segmentOffsetTree) Create a based offset tracker for the given sequence- Parameters:
sequence
- sequence which to create offset trackersegmentOffsetTree
- segment offset tree for the sequence- Returns:
- based offset tracker
-