Class BasedOptionsSequence
java.lang.Object
com.vladsch.flexmark.util.sequence.BasedOptionsSequence
- All Implemented Interfaces:
BasedOptionsHolder
,CharSequence
A BasedSequence with offset tracking that follows editing operations and subSequence() chopping as best as it can
a subSequence() returns a sub-sequence from the original base sequence with updated offset tracking
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vladsch.flexmark.util.sequence.BasedOptionsHolder
BasedOptionsHolder.Options
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NotNull CharSequence
private final int
private final @Nullable DataHolder
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
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
BasedOptionsSequence
(@NotNull CharSequence chars, int optionFlags, @Nullable DataHolder options) -
Method Summary
Modifier and TypeMethodDescriptionboolean
allOptions
(int options) Options test for options for this sequenceboolean
anyOptions
(int options) Options test for options for this sequencechar
charAt
(int index) chars()
boolean
<T> T
getOption
(DataKeyBase<T> dataKey) Options holder, default has none, only available on BasedSequenceWithOptionsint
Options test for options for this sequence@Nullable DataHolder
Options holder, default has none, only available on BasedSequenceWithOptionsint
hashCode()
int
length()
static BasedOptionsSequence
of
(@NotNull CharSequence chars, int optionFlags) static BasedOptionsSequence
of
(@NotNull CharSequence chars, int optionFlags, @Nullable DataHolder options) static BasedOptionsSequence
of
(@NotNull CharSequence chars, BitFieldSet<BasedOptionsHolder.Options> optionFlags) static BasedOptionsSequence
of
(@NotNull CharSequence chars, BitFieldSet<BasedOptionsHolder.Options> optionFlags, @Nullable DataHolder options) subSequence
(int start, int end) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
isEmpty
-
Field Details
-
chars
-
optionFlags
private final int optionFlags -
options
-
-
Constructor Details
-
BasedOptionsSequence
private BasedOptionsSequence(@NotNull @NotNull CharSequence chars, int optionFlags, @Nullable @Nullable DataHolder options)
-
-
Method Details
-
getOptionFlags
public int getOptionFlags()Description copied from interface:BasedOptionsHolder
Options test for options for this sequencedefault reports true for global default options (if any) , variation available on BasedSequenceWithOptions
- Specified by:
getOptionFlags
in interfaceBasedOptionsHolder
- Returns:
- option flags for this sequence
-
allOptions
public boolean allOptions(int options) Description copied from interface:BasedOptionsHolder
Options test for options for this sequencedefault reports true for global default options (if any) , variation available on BasedSequenceWithOptions
- Specified by:
allOptions
in interfaceBasedOptionsHolder
- Parameters:
options
- option flags- Returns:
- true if all option flags passed are set for this sequence
-
anyOptions
public boolean anyOptions(int options) Description copied from interface:BasedOptionsHolder
Options test for options for this sequencedefault reports true for global default options (if any) , variation available on BasedSequenceWithOptions
- Specified by:
anyOptions
in interfaceBasedOptionsHolder
- Parameters:
options
- option flags- Returns:
- true if any option flags passed are set for this sequence
-
getOption
Description copied from interface:BasedOptionsHolder
Options holder, default has none, only available on BasedSequenceWithOptions- Specified by:
getOption
in interfaceBasedOptionsHolder
- Type Parameters:
T
- type of value held by key- Parameters:
dataKey
- in options- Returns:
- true if data key is available
-
getOptions
Description copied from interface:BasedOptionsHolder
Options holder, default has none, only available on BasedSequenceWithOptions- Specified by:
getOptions
in interfaceBasedOptionsHolder
- Returns:
- data holder with options or null if none for this sequence
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
chars
- Specified by:
chars
in interfaceCharSequence
-
codePoints
- Specified by:
codePoints
in interfaceCharSequence
-
equals
-
hashCode
public int hashCode() -
of
public static BasedOptionsSequence of(@NotNull @NotNull CharSequence chars, BitFieldSet<BasedOptionsHolder.Options> optionFlags) -
of
-
of
public static BasedOptionsSequence of(@NotNull @NotNull CharSequence chars, BitFieldSet<BasedOptionsHolder.Options> optionFlags, @Nullable @Nullable DataHolder options) -
of
public static BasedOptionsSequence of(@NotNull @NotNull CharSequence chars, int optionFlags, @Nullable @Nullable DataHolder options)
-