Class 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 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​(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 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
      • length

        public int length()
        Specified by:
        length in interface java.lang.CharSequence
      • charAt

        public char charAt​(int index)
        Specified by:
        charAt in interface java.lang.CharSequence
      • subSequence

        public java.lang.CharSequence subSequence​(int start,
                                                  int end)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class java.lang.Object
      • chars

        public java.util.stream.IntStream chars()
        Specified by:
        chars in interface java.lang.CharSequence
      • codePoints

        public java.util.stream.IntStream codePoints()
        Specified by:
        codePoints in interface java.lang.CharSequence
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public static BasedOptionsSequence of​(@NotNull
                                              java.lang.CharSequence chars,
                                              int optionFlags)