Class SubSequence

    • Method Detail

      • getBaseSequence

        @NotNull
        public SubSequence getBaseSequence()
        Description copied from interface: BasedSequence
        Get the base sequence for the text
        Returns:
        base sequence
      • 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

        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

        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

        Parameters:
        options - option flags
        Returns:
        true if any option flags passed are set for this sequence
      • getOption

        public <T> T getOption​(@NotNull
                               DataKeyBase<T> dataKey)
        Description copied from interface: BasedOptionsHolder
        Options holder, default has none, only available on BasedSequenceWithOptions
        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
        Returns:
        data holder with options or null if none for this sequence
      • getBase

        @NotNull
        public java.lang.CharSequence getBase()
        Description copied from interface: BasedSequence
        Get the underlying object on which this sequence contents are based
        Returns:
        underlying object containing original text
      • length

        public int length()
      • getIndexOffset

        public int getIndexOffset​(int index)
        Description copied from interface: BasedSequence
        Get the offset of index in this sequence mapped to offset into BasedSequence.getBaseSequence() and BasedSequence.getBase() original text source. NOTE: if the character at given index does not equal the corresponding character in the base sequence then this method should return -1 otherwise segmented based sequence will be created for original base character
        Parameters:
        index - index for which to get the offset in original source
        Returns:
        offset of index of this sequence in original text
      • charAt

        public char charAt​(int index)
      • subSequence

        @NotNull
        public SubSequence subSequence​(int startIndex,
                                       int endIndex)
        Description copied from interface: BasedSequence
        Get a portion of this sequence
        Parameters:
        startIndex - offset from startIndex of this sequence
        endIndex - offset from startIndex of this sequence
        Returns:
        based sequence which represents the requested range of this sequence.
      • baseSubSequence

        @NotNull
        public SubSequence baseSubSequence​(int startIndex,
                                           int endIndex)
        Description copied from interface: BasedSequence
        Get a portion of this sequence's base sequence

        NOTE: this means that if this sequence applies modifications to the original sequence then these modifications are NOT be applied to the returned sequence.

        NOTE: It should only be implemented in classes which provide base sequences such as CharSubSequence and SubSequence others use inherited implementation of BasedSequenceImpl

        Specified by:
        baseSubSequence in interface BasedSequence
        Overrides:
        baseSubSequence in class BasedSequenceImpl
        Parameters:
        startIndex - offset from 0 of original sequence
        endIndex - offset from 0 of original sequence
        Returns:
        based sequence whose contents reflect the selected portion
      • of

        @Deprecated
        public static BasedSequence of​(@Nullable
                                       java.lang.CharSequence charSequence)
        Deprecated.
      • of

        @Deprecated
        public static BasedSequence of​(@Nullable
                                       java.lang.CharSequence charSequence,
                                       int startIndex)
        Deprecated.
      • of

        @Deprecated
        public static BasedSequence of​(@Nullable
                                       java.lang.CharSequence charSequence,
                                       int startIndex,
                                       int endIndex)
        Deprecated.