public class BasedOffsetTracker extends Object
| Modifier and Type | Field and Description |
|---|---|
protected @NotNull SegmentOffsetTree |
segmentOffsetTree |
protected @NotNull BasedSequence |
sequence |
| Modifier | Constructor and Description |
|---|---|
protected |
BasedOffsetTracker(@NotNull BasedSequence sequence,
@NotNull SegmentOffsetTree segmentOffsetTree) |
protected |
BasedOffsetTracker(@NotNull BasedSequence sequence,
@NotNull SegmentTree segmentTree) |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull BasedOffsetTracker |
create(@NotNull BasedSequence sequence)
Create a based offset tracker for the given sequence
|
static @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 |
getSegmentOffsetTree() |
@NotNull BasedSequence |
getSequence() |
int |
size() |
String |
toString() |
@NotNull protected final @NotNull BasedSequence sequence
@NotNull protected final @NotNull SegmentOffsetTree segmentOffsetTree
protected BasedOffsetTracker(@NotNull
@NotNull BasedSequence sequence,
@NotNull
@NotNull SegmentTree segmentTree)
protected BasedOffsetTracker(@NotNull
@NotNull BasedSequence sequence,
@NotNull
@NotNull SegmentOffsetTree segmentOffsetTree)
public int size()
@NotNull public @NotNull OffsetInfo getOffsetInfo(int offset, boolean isEndOffset)
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.
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)@NotNull public @NotNull BasedSequence getSequence()
@NotNull public @NotNull SegmentOffsetTree getSegmentOffsetTree()
@NotNull public static @NotNull BasedOffsetTracker create(@NotNull @NotNull BasedSequence sequence)
sequence - sequence which to create offset tracker@NotNull public static @NotNull BasedOffsetTracker create(@NotNull @NotNull BasedSequence sequence, @NotNull @NotNull SegmentOffsetTree segmentOffsetTree)
sequence - sequence which to create offset trackersegmentOffsetTree - segment offset tree for the sequenceCopyright © 2020. All rights reserved.