Class SegmentedSequenceFull

  • All Implemented Interfaces:
    BasedOptionsHolder, BasedSequence, IRichSequence<BasedSequence>, ReplacedBasedSequence, SequenceUtils, java.lang.CharSequence, java.lang.Comparable<java.lang.CharSequence>

    public final class SegmentedSequenceFull
    extends SegmentedSequence
    A BasedSequence which consists of segments of other BasedSequences NOTE: very efficient for random access but extremely wasteful with space by allocating 4 bytes per character in the sequence with corresponding construction penalty use SegmentedSequenceTree which is binary tree based segmented sequence with minimal overhead and optimized to give penalty free random access for most applications.
    • Method Detail

      • 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 BasedSequence 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.
      • create

        public static SegmentedSequenceFull create​(@NotNull
                                                   BasedSequence baseSequence,
                                                   ISegmentBuilder<?> builder)
        Base Constructor
        Parameters:
        baseSequence - base sequence for segmented sequence
        builder - builder for which to construct segmented sequence
        Returns:
        segmented sequence