Class Segment
- java.lang.Object
-
- com.vladsch.flexmark.util.sequence.builder.tree.Segment
-
public abstract class Segment extends java.lang.Object
SegmentedSequence Segment stored in byte[] in serialized format
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Segment.SegType
-
Field Summary
Fields Modifier and Type Field Description protected int
byteOffset
protected byte[]
bytes
protected int
pos
protected int
startIndex
-
Constructor Summary
Constructors Constructor Description Segment(int pos, byte[] bytes, int byteOffset, int startIndex)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static int
addChar(byte[] bytes, int offset, char c)
static int
addCharAscii(byte[] bytes, int offset, char c)
static int
addChars(byte[] bytes, int offset, java.lang.CharSequence chars, int start, int end)
static int
addCharsAscii(byte[] bytes, int offset, java.lang.CharSequence chars, int start, int end)
static int
addIntBytes(byte[] bytes, int offset, int value, int count)
static int
addSegBytes(byte[] bytes, int offset, Seg seg, java.lang.CharSequence textChars)
abstract char
charAt(int index)
get char at indexint
getByteLength()
int
getByteOffset()
byte[]
getBytes()
static char
getChar(byte[] bytes, int offset)
static char
getCharAscii(byte[] bytes, int offset)
abstract java.lang.CharSequence
getCharSequence()
int
getEndIndex()
abstract int
getEndOffset()
static int
getInt(byte[] bytes, int offset, int count)
static int
getIntBytes(int length)
static int
getLengthBytes(int length)
static int
getOffsetBytes(int offset)
int
getPos()
static int
getSegByteLength(Seg seg, java.lang.CharSequence textChars)
static int
getSegByteLength(Segment.SegType segType, int segStart, int segLength)
static Segment
getSegment(byte[] bytes, int byteOffset, int pos, int indexOffset, BasedSequence basedSequence)
static Segment.SegType
getSegType(Seg seg, java.lang.CharSequence textChars)
int
getStartIndex()
abstract int
getStartOffset()
Segment.SegType
getType()
boolean
hasAll(int flags, int mask)
abstract boolean
isAnchor()
abstract boolean
isBase()
abstract boolean
isFirst256Start()
abstract boolean
isRepeatedTextEnd()
abstract boolean
isText()
abstract int
length()
boolean
notInSegment(int index)
boolean
offsetNotInSegment(int offset)
java.lang.String
toString()
-
-
-
Method Detail
-
hasAll
public boolean hasAll(int flags, int mask)
-
getPos
public int getPos()
-
getBytes
public byte[] getBytes()
-
getByteOffset
public final int getByteOffset()
-
getStartIndex
public final int getStartIndex()
-
getEndIndex
public final int getEndIndex()
-
notInSegment
public boolean notInSegment(int index)
-
offsetNotInSegment
public boolean offsetNotInSegment(int offset)
-
getType
public final Segment.SegType getType()
-
getByteLength
public final int getByteLength()
-
length
public abstract int length()
-
isBase
public abstract boolean isBase()
-
isAnchor
public abstract boolean isAnchor()
-
isText
public abstract boolean isText()
-
isFirst256Start
public abstract boolean isFirst256Start()
-
isRepeatedTextEnd
public abstract boolean isRepeatedTextEnd()
-
getStartOffset
public abstract int getStartOffset()
-
getEndOffset
public abstract int getEndOffset()
-
getCharSequence
public abstract java.lang.CharSequence getCharSequence()
-
charAt
public abstract char charAt(int index)
get char at index- Parameters:
index
- index in segmented sequence coordinates. index offset must be subtracted to convert to segment coordinates- Returns:
- character at given index in segmented sequence
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSegment
public static Segment getSegment(byte[] bytes, int byteOffset, int pos, int indexOffset, @NotNull BasedSequence basedSequence)
-
getSegType
public static Segment.SegType getSegType(@NotNull Seg seg, @NotNull java.lang.CharSequence textChars)
-
getOffsetBytes
public static int getOffsetBytes(int offset)
-
getLengthBytes
public static int getLengthBytes(int length)
-
getIntBytes
public static int getIntBytes(int length)
-
getSegByteLength
public static int getSegByteLength(@NotNull Segment.SegType segType, int segStart, int segLength)
-
getSegByteLength
public static int getSegByteLength(@NotNull Seg seg, @NotNull java.lang.CharSequence textChars)
-
addIntBytes
public static int addIntBytes(byte[] bytes, int offset, int value, int count)
-
getInt
public static int getInt(byte[] bytes, int offset, int count)
-
addChar
public static int addChar(byte[] bytes, int offset, char c)
-
getChar
public static char getChar(byte[] bytes, int offset)
-
addChars
public static int addChars(byte[] bytes, int offset, @NotNull java.lang.CharSequence chars, int start, int end)
-
addCharAscii
public static int addCharAscii(byte[] bytes, int offset, char c)
-
addCharsAscii
public static int addCharsAscii(byte[] bytes, int offset, @NotNull java.lang.CharSequence chars, int start, int end)
-
getCharAscii
public static char getCharAscii(byte[] bytes, int offset)
-
addSegBytes
public static int addSegBytes(byte[] bytes, int offset, @NotNull Seg seg, @NotNull java.lang.CharSequence textChars)
-
-