Class BasedOptionsSequence
- java.lang.Object
-
- com.vladsch.flexmark.util.sequence.BasedOptionsSequence
-
- All Implemented Interfaces:
BasedOptionsHolder,java.lang.CharSequence
public final class BasedOptionsSequence extends java.lang.Object implements java.lang.CharSequence, BasedOptionsHolder
A BasedSequence with offset tracking that follows editing operations and subSequence() chopping as best as it cana 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
Fields Modifier and Type Field Description private @NotNull java.lang.CharSequencecharsprivate intoptionFlagsprivate @Nullable DataHolderoptions-
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
Constructors Modifier Constructor Description privateBasedOptionsSequence(@NotNull java.lang.CharSequence chars, int optionFlags, @Nullable DataHolder options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallOptions(int options)Options test for options for this sequencebooleananyOptions(int options)Options test for options for this sequencecharcharAt(int index)java.util.stream.IntStreamchars()java.util.stream.IntStreamcodePoints()booleanequals(java.lang.Object o)<T> TgetOption(DataKeyBase<T> dataKey)Options holder, default has none, only available on BasedSequenceWithOptionsintgetOptionFlags()Options test for options for this sequence@Nullable DataHoldergetOptions()Options holder, default has none, only available on BasedSequenceWithOptionsinthashCode()intlength()static BasedOptionsSequenceof(@NotNull java.lang.CharSequence chars, int optionFlags)static BasedOptionsSequenceof(@NotNull java.lang.CharSequence chars, int optionFlags, @Nullable DataHolder options)static BasedOptionsSequenceof(@NotNull java.lang.CharSequence chars, BitFieldSet<BasedOptionsHolder.Options> optionFlags)static BasedOptionsSequenceof(@NotNull java.lang.CharSequence chars, BitFieldSet<BasedOptionsHolder.Options> optionFlags, @Nullable DataHolder options)java.lang.CharSequencesubSequence(int start, int end)java.lang.StringtoString()
-
-
-
Field Detail
-
chars
@NotNull private final @NotNull java.lang.CharSequence chars
-
optionFlags
private final int optionFlags
-
options
@Nullable private final @Nullable DataHolder options
-
-
Constructor Detail
-
BasedOptionsSequence
private BasedOptionsSequence(@NotNull @NotNull java.lang.CharSequence chars, int optionFlags, @Nullable @Nullable DataHolder options)
-
-
Method Detail
-
getOptionFlags
public int getOptionFlags()
Description copied from interface:BasedOptionsHolderOptions test for options for this sequencedefault reports true for global default options (if any) , variation available on BasedSequenceWithOptions
- Specified by:
getOptionFlagsin interfaceBasedOptionsHolder- Returns:
- option flags for this sequence
-
allOptions
public boolean allOptions(int options)
Description copied from interface:BasedOptionsHolderOptions test for options for this sequencedefault reports true for global default options (if any) , variation available on BasedSequenceWithOptions
- Specified by:
allOptionsin 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:BasedOptionsHolderOptions test for options for this sequencedefault reports true for global default options (if any) , variation available on BasedSequenceWithOptions
- Specified by:
anyOptionsin interfaceBasedOptionsHolder- Parameters:
options- option flags- Returns:
- true if any option flags passed are set for this sequence
-
getOption
public <T> T getOption(DataKeyBase<T> dataKey)
Description copied from interface:BasedOptionsHolderOptions holder, default has none, only available on BasedSequenceWithOptions- Specified by:
getOptionin interfaceBasedOptionsHolder- Type Parameters:
T- type of value held by key- Parameters:
dataKey- in options- Returns:
- true if data key is available
-
getOptions
@Nullable public @Nullable DataHolder getOptions()
Description copied from interface:BasedOptionsHolderOptions holder, default has none, only available on BasedSequenceWithOptions- Specified by:
getOptionsin interfaceBasedOptionsHolder- Returns:
- data holder with options or null if none for this sequence
-
length
public int length()
- Specified by:
lengthin interfacejava.lang.CharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAtin interfacejava.lang.CharSequence
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)- Specified by:
subSequencein interfacejava.lang.CharSequence
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classjava.lang.Object
-
chars
public java.util.stream.IntStream chars()
- Specified by:
charsin interfacejava.lang.CharSequence
-
codePoints
public java.util.stream.IntStream codePoints()
- Specified by:
codePointsin interfacejava.lang.CharSequence
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
of
public static BasedOptionsSequence of(@NotNull @NotNull java.lang.CharSequence chars, BitFieldSet<BasedOptionsHolder.Options> optionFlags)
-
of
public static BasedOptionsSequence of(@NotNull @NotNull java.lang.CharSequence chars, int optionFlags)
-
of
public static BasedOptionsSequence of(@NotNull @NotNull java.lang.CharSequence chars, BitFieldSet<BasedOptionsHolder.Options> optionFlags, @Nullable @Nullable DataHolder options)
-
of
public static BasedOptionsSequence of(@NotNull @NotNull java.lang.CharSequence chars, int optionFlags, @Nullable @Nullable DataHolder options)
-
-