Class BasedSequence.EmptyBasedSequence

    • Constructor Detail

      • EmptyBasedSequence

        public EmptyBasedSequence()
    • 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

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

        public int length()
      • charAt

        public char charAt​(int index)
      • 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
      • subSequence

        @NotNull
        public BasedSequence subSequence​(int i,
                                         int i1)
        Description copied from interface: BasedSequence
        Get a portion of this sequence
        Parameters:
        i - offset from startIndex of this sequence
        i1 - offset from startIndex of this sequence
        Returns:
        based sequence which represents the requested range of this sequence.
      • 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
      • getBaseSequence

        @NotNull
        public BasedSequence getBaseSequence()
        Description copied from interface: BasedSequence
        Get the base sequence for the text
        Returns:
        base sequence
      • getBase

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