Class BasedOptionsSequence

  • All Implemented Interfaces:
    BasedOptionsHolder, CharSequence

    public final class BasedOptionsSequence
    extends Object
    implements CharSequence, BasedOptionsHolder
    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

    • Method Detail

      • getOptionFlags

        public int getOptionFlags()
        Description copied from interface: BasedOptionsHolder
        Options test for options for this sequence

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

        Specified by:
        getOptionFlags in interface BasedOptionsHolder
        Returns:
        option flags for this sequence
      • allOptions

        public boolean allOptions​(int options)
        Description copied from interface: BasedOptionsHolder
        Options test for options for this sequence

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

        Specified by:
        allOptions in interface BasedOptionsHolder
        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 sequence

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

        Specified by:
        anyOptions in interface BasedOptionsHolder
        Parameters:
        options - option flags
        Returns:
        true if any option flags passed are set for this sequence
      • getOption

        public <T> T getOption​(com.vladsch.flexmark.util.data.DataKeyBase<T> dataKey)
        Description copied from interface: BasedOptionsHolder
        Options holder, default has none, only available on BasedSequenceWithOptions
        Specified by:
        getOption in interface BasedOptionsHolder
        Type Parameters:
        T - type of value held by key
        Parameters:
        dataKey - in options
        Returns:
        true if data key is available
      • getOptions

        @Nullable
        public @Nullable com.vladsch.flexmark.util.data.DataHolder getOptions()
        Description copied from interface: BasedOptionsHolder
        Options holder, default has none, only available on BasedSequenceWithOptions
        Specified by:
        getOptions in interface BasedOptionsHolder
        Returns:
        data holder with options or null if none for this sequence
      • charAt

        public char charAt​(int index)
        Specified by:
        charAt in interface CharSequence
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • of

        public static BasedOptionsSequence of​(@NotNull
                                              @NotNull CharSequence chars,
                                              int optionFlags,
                                              @Nullable
                                              @Nullable com.vladsch.flexmark.util.data.DataHolder options)