java.lang.Object
com.vladsch.flexmark.util.sequence.builder.Seg

public class Seg extends Object
Representation of a segment part in a segment list for a sequence it is a Range, either in the base sequence or in the out of base characters for the builder.

Out of base text offsets are limited to 1GB. Upper bit is used to store repeated and ascii only flags.

  • Field Details

    • NULL

      public static final Seg NULL
    • ANCHOR_0

      public static final Seg ANCHOR_0
    • MAX_TEXT_OFFSET

      public static final int MAX_TEXT_OFFSET
      See Also:
    • F_TEXT_OPTION

      public static final int F_TEXT_OPTION
      See Also:
    • start

      private final int start
    • end

      private final int end
  • Constructor Details

    • Seg

      private Seg(int start, int end)
  • Method Details

    • getStart

      public int getStart()
    • getEnd

      public int getEnd()
    • getSegStart

      public int getSegStart()
    • getSegEnd

      public int getSegEnd()
    • getTextStart

      public int getTextStart()
    • getTextOffset

      public static int getTextOffset(int startOffset)
    • getTextEnd

      public int getTextEnd()
    • isFirst256Start

      public boolean isFirst256Start()
    • isFirst256Start

      public static boolean isFirst256Start(int start)
    • isRepeatedTextEnd

      public boolean isRepeatedTextEnd()
    • isRepeatedTextEnd

      public static boolean isRepeatedTextEnd(int end)
    • isText

      public boolean isText()
    • isBase

      public boolean isBase()
      Test segment type being from original sequence
      Returns:
      true if it is
    • isAnchor

      public boolean isAnchor()
      Test segment type being from original sequence
      Returns:
      true if it is
    • isNull

      public boolean isNull()
    • getRange

      @NotNull public @NotNull Range getRange()
    • length

      public int length()
      Return length of text or if text is null span of range
      Returns:
      length of this part in the sequence
    • toString

      public String toString(@NotNull @NotNull CharSequence allText)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • segOf

      @NotNull public static @NotNull Seg segOf(int startOffset, int endOffset)
    • getTextStart

      public static int getTextStart(int startOffset, boolean isFirst256)
    • getTextEnd

      public static int getTextEnd(int startOffset, boolean isRepeatedText)
    • textOf

      @NotNull public static @NotNull Seg textOf(int startOffset, int endOffset, boolean isFirst256, boolean isRepeatedText)