public abstract class Segment extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Segment.SegType |
| Modifier and Type | Field and Description |
|---|---|
protected int |
byteOffset |
protected byte[] |
bytes |
protected int |
pos |
protected int |
startIndex |
| Constructor and Description |
|---|
Segment(int pos,
byte[] bytes,
int byteOffset,
int startIndex) |
| Modifier and Type | Method and 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,
@NotNull CharSequence chars,
int start,
int end) |
static int |
addCharsAscii(byte[] bytes,
int offset,
@NotNull CharSequence chars,
int start,
int end) |
static int |
addIntBytes(byte[] bytes,
int offset,
int value,
int count) |
static int |
addSegBytes(byte[] bytes,
int offset,
@NotNull Seg seg,
@NotNull CharSequence textChars) |
abstract char |
charAt(int index)
get char at index
|
int |
getByteLength() |
int |
getByteOffset() |
byte[] |
getBytes() |
static char |
getChar(byte[] bytes,
int offset) |
static char |
getCharAscii(byte[] bytes,
int offset) |
abstract 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(@NotNull Seg seg,
@NotNull CharSequence textChars) |
static int |
getSegByteLength(Segment.SegType segType,
int segStart,
int segLength) |
static Segment |
getSegment(byte[] bytes,
int byteOffset,
int pos,
int indexOffset,
@NotNull BasedSequence basedSequence) |
static Segment.SegType |
getSegType(@NotNull Seg seg,
@NotNull 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) |
String |
toString() |
protected final int pos
protected final byte[] bytes
protected final int byteOffset
protected final int startIndex
public boolean hasAll(int flags,
int mask)
public int getPos()
public byte[] getBytes()
public final int getByteOffset()
public final int getStartIndex()
public final int getEndIndex()
public boolean notInSegment(int index)
public boolean offsetNotInSegment(int offset)
public final Segment.SegType getType()
public final int getByteLength()
public abstract int length()
public abstract boolean isBase()
public abstract boolean isAnchor()
public abstract boolean isText()
public abstract boolean isFirst256Start()
public abstract boolean isRepeatedTextEnd()
public abstract int getStartOffset()
public abstract int getEndOffset()
public abstract CharSequence getCharSequence()
public abstract char charAt(int index)
index - index in segmented sequence coordinates. index offset must be subtracted to convert to segment coordinatespublic static Segment getSegment(byte[] bytes, int byteOffset, int pos, int indexOffset, @NotNull @NotNull BasedSequence basedSequence)
public static Segment.SegType getSegType(@NotNull @NotNull Seg seg, @NotNull @NotNull CharSequence textChars)
public static int getOffsetBytes(int offset)
public static int getLengthBytes(int length)
public static int getIntBytes(int length)
public static int getSegByteLength(@NotNull
Segment.SegType segType,
int segStart,
int segLength)
public static int getSegByteLength(@NotNull
@NotNull Seg seg,
@NotNull
@NotNull CharSequence textChars)
public static int addIntBytes(byte[] bytes,
int offset,
int value,
int count)
public static int getInt(byte[] bytes,
int offset,
int count)
public static int addChar(byte[] bytes,
int offset,
char c)
public static char getChar(byte[] bytes,
int offset)
public static int addChars(byte[] bytes,
int offset,
@NotNull
@NotNull CharSequence chars,
int start,
int end)
public static int addCharAscii(byte[] bytes,
int offset,
char c)
public static int addCharsAscii(byte[] bytes,
int offset,
@NotNull
@NotNull CharSequence chars,
int start,
int end)
public static char getCharAscii(byte[] bytes,
int offset)
public static int addSegBytes(byte[] bytes,
int offset,
@NotNull
@NotNull Seg seg,
@NotNull
@NotNull CharSequence textChars)
Copyright © 2020. All rights reserved.