@Internal public class TextPieceTable extends Object implements CharIndexTranslator
| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<TextPiece> |
_textPieces |
protected ArrayList<TextPiece> |
_textPiecesFCOrder |
| Constructor and Description |
|---|
TextPieceTable() |
TextPieceTable(byte[] documentStream,
byte[] tableStream,
int offset,
int size,
int fcMin) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(TextPiece piece) |
int |
adjustForInsert(int listIndex,
int length)
Adjust all the text piece after inserting some text into one of them
|
boolean |
equals(Object o) |
int |
getByteIndex(int charPos)
Calculates the byte index of the given char index.
|
int |
getCharIndex(int bytePos)
Deprecated.
|
int |
getCharIndex(int startBytePos,
int startCP)
Deprecated.
|
int[][] |
getCharIndexRanges(int startBytePosInclusive,
int endBytePosExclusive)
Finds character ranges that includes specified byte range.
|
int |
getCpMin() |
StringBuilder |
getText() |
List<TextPiece> |
getTextPieces() |
int |
hashCode() |
boolean |
isIndexInTable(int bytePos)
Check if index is in table
|
int |
lookIndexBackward(int startBytePos)
Return last index <= bytePos that is in table
|
int |
lookIndexForward(int startBytePos)
Return first index >= bytePos that is in table
|
byte[] |
writeTo(HWPFOutputStream docStream) |
public TextPieceTable()
public TextPieceTable(byte[] documentStream,
byte[] tableStream,
int offset,
int size,
int fcMin)
public void add(TextPiece piece)
public int adjustForInsert(int listIndex,
int length)
listIndex - The TextPiece that had characters inserted intolength - The number of characters insertedpublic int getByteIndex(int charPos)
CharIndexTranslatorgetByteIndex in interface CharIndexTranslatorcharPos - The char position@Deprecated public int getCharIndex(int bytePos)
CharIndexTranslatorgetCharIndex in interface CharIndexTranslatorbytePos - The character offset to check@Deprecated public int getCharIndex(int startBytePos, int startCP)
CharIndexTranslatorgetCharIndex in interface CharIndexTranslatorstartBytePos - The character offset to checkstartCP - look from this characted positionpublic int[][] getCharIndexRanges(int startBytePosInclusive,
int endBytePosExclusive)
CharIndexTranslatorgetCharIndexRanges in interface CharIndexTranslatorstartBytePosInclusive - start byte rangeendBytePosExclusive - end byte rangepublic int getCpMin()
public StringBuilder getText()
public boolean isIndexInTable(int bytePos)
CharIndexTranslatorisIndexInTable in interface CharIndexTranslatorpublic int lookIndexBackward(int startBytePos)
CharIndexTranslatorlookIndexBackward in interface CharIndexTranslatorpublic int lookIndexForward(int startBytePos)
CharIndexTranslatorlookIndexForward in interface CharIndexTranslatorpublic byte[] writeTo(HWPFOutputStream docStream) throws IOException
IOExceptionCopyright © 2020. All rights reserved.