Class SequenceBuilder

    • Constructor Detail

      • SequenceBuilder

        private SequenceBuilder​(@NotNull
                                @NotNull BasedSequence base,
                                @Nullable
                                @Nullable SegmentOptimizer optimizer)
        Construct a base sequence builder for given base sequence with default options.

        NOTE: the builder is always constructed for the base sequence of the base. ie. for the based sequence returned by BasedSequence.getBaseSequence(), so any subsequence from a base can be used as argument for the constructor

        Parameters:
        base - base sequence for which to create a builder
        optimizer - optimizer for based segment builder, or default CharRecoveryOptimizer
      • SequenceBuilder

        private SequenceBuilder​(@NotNull
                                @NotNull BasedSequence base,
                                @Nullable
                                @Nullable SegmentOptimizer optimizer,
                                @NotNull
                                @NotNull java.util.HashMap<BasedSequence,​java.lang.Boolean> equivalentBases)
      • SequenceBuilder

        private SequenceBuilder​(@NotNull
                                @NotNull BasedSequence base,
                                int options,
                                @Nullable
                                @Nullable SegmentOptimizer optimizer,
                                @NotNull
                                @NotNull java.util.HashMap<BasedSequence,​java.lang.Boolean> equivalentBases)
        Construct a base sequence builder for given base sequence with specific options.

        NOTE: the builder is always constructed for the base sequence of the base. ie. for the based sequence returned by BasedSequence.getBaseSequence(), so any subsequence from a base can be used as argument for the constructor

        Parameters:
        base - base sequence for which to create a builder
        options - builder options
        optimizer - optimizer for based segment builder, or default CharRecoveryOptimizer
    • Method Detail

      • getBaseSequence

        @NotNull
        public @NotNull BasedSequence getBaseSequence()
      • getLastRangeOrNull

        @Nullable
        public @Nullable Range getLastRangeOrNull()
      • isCommonBaseSequence

        boolean isCommonBaseSequence​(@NotNull
                                     @NotNull BasedSequence chars)
      • append

        @NotNull
        public @NotNull SequenceBuilder append​(int startOffset,
                                               int endOffset)
      • addByOffsets

        @NotNull
        public @NotNull SequenceBuilder addByOffsets​(int startOffset,
                                                     int endOffset)
      • addByLength

        @NotNull
        public @NotNull SequenceBuilder addByLength​(int startOffset,
                                                    int textLength)
      • toSequence

        @NotNull
        public @NotNull BasedSequence toSequence​(@NotNull
                                                 @NotNull BasedSequence altSequence)
        Construct sequence from this builder using another based sequence which is character identical to this builder's baseSeq
        Parameters:
        altSequence - based sequence which is character identical to this builder's baseSeq
        Returns:
        builder with offsets mapped to altSequence
      • toSequence

        @NotNull
        public @NotNull BasedSequence toSequence​(@NotNull
                                                 @NotNull BasedSequence altSequence,
                                                 @Nullable
                                                 @Nullable CharPredicate trimStart,
                                                 @Nullable
                                                 @Nullable CharPredicate ignoreCharDiff)
        Construct sequence from this builder using another based sequence which is character identical to this builder's baseSeq
        Parameters:
        altSequence - based sequence which is character identical to this builder's baseSeq
        trimStart - character set of characters to trim
        ignoreCharDiff - chars which should be treated as equivalent for verification purposes (Space, Tab, EOL, usually)
        Returns:
        builder with offsets mapped to altSequence
      • toSequenceByIndex

        @NotNull
        public @NotNull BasedSequence toSequenceByIndex​(@NotNull
                                                        @NotNull BasedSequence altSequence,
                                                        @Nullable
                                                        @Nullable CharPredicate trimStart,
                                                        @Nullable
                                                        @Nullable CharPredicate ignoreCharDiff)
        Construct sequence from this builder using another based sequence which is character identical to this builder's baseSeq by length
        Parameters:
        altSequence - based sequence which is character identical to this builder's baseSeq
        trimStart - character set of characters to trim
        ignoreCharDiff - chars which should be treated as equivalent for verification purposes (Space, Tab, EOL, usually)
        Returns:
        builder with offsets mapped to altSequence
      • toStringWithRanges

        @NotNull
        public @NotNull java.lang.String toStringWithRanges()
      • toStringWithRanges

        @NotNull
        public @NotNull java.lang.String toStringWithRanges​(boolean toVisibleWhiteSpace)
      • toString

        @NotNull
        public @NotNull java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringNoAddedSpaces

        @NotNull
        public @NotNull java.lang.String toStringNoAddedSpaces()