Class Seg
- java.lang.Object
-
- com.vladsch.flexmark.util.sequence.builder.Seg
-
public class Seg extends java.lang.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 Summary
Fields Modifier and Type Field Description static Seg
ANCHOR_0
static int
F_TEXT_OPTION
static int
MAX_TEXT_OFFSET
static Seg
NULL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getEnd()
Range
getRange()
int
getSegEnd()
int
getSegStart()
int
getStart()
int
getTextEnd()
static int
getTextEnd(int startOffset, boolean isRepeatedText)
static int
getTextOffset(int startOffset)
int
getTextStart()
static int
getTextStart(int startOffset, boolean isFirst256)
boolean
isAnchor()
Test segment type being from original sequenceboolean
isBase()
Test segment type being from original sequenceboolean
isFirst256Start()
static boolean
isFirst256Start(int start)
boolean
isNull()
boolean
isRepeatedTextEnd()
static boolean
isRepeatedTextEnd(int end)
boolean
isText()
int
length()
Return length of text or if text is null span of rangestatic Seg
segOf(int startOffset, int endOffset)
static Seg
textOf(int startOffset, int endOffset, boolean isFirst256, boolean isRepeatedText)
java.lang.String
toString()
java.lang.String
toString(java.lang.CharSequence allText)
-
-
-
Field Detail
-
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:
- Constant Field Values
-
F_TEXT_OPTION
public static final int F_TEXT_OPTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 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 java.lang.String toString(@NotNull java.lang.CharSequence allText)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
segOf
@NotNull public static 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 Seg textOf(int startOffset, int endOffset, boolean isFirst256, boolean isRepeatedText)
-
-