Class PrefixedSubSequence

    • Method Detail

      • getBase

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

        @NotNull
        public BasedSequence 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
      • 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
      • 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
        Specified by:
        getIndexOffset in interface BasedSequence
        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)
        Specified by:
        charAt in interface java.lang.CharSequence
      • subSequence

        @NotNull
        public BasedSequence subSequence​(int startIndex,
                                         int endIndex)
        Description copied from interface: BasedSequence
        Get a portion of this sequence
        Specified by:
        subSequence in interface BasedSequence
        Specified by:
        subSequence in interface java.lang.CharSequence
        Specified by:
        subSequence in interface IRichSequence<BasedSequence>
        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.