|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.hwpf.model.TextPieceTable
public class TextPieceTable
The piece table for matching up character positions to bits of text. This mostly works in bytes, but the TextPieces themselves work in characters. This does the icky convertion.
Field Summary | |
---|---|
protected java.util.ArrayList<TextPiece> |
_textPieces
|
protected java.util.ArrayList<TextPiece> |
_textPiecesFCOrder
|
Constructor Summary | |
---|---|
TextPieceTable()
|
|
TextPieceTable(byte[] documentStream,
byte[] tableStream,
int offset,
int size,
int fcMin)
|
Method Summary | |
---|---|
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(java.lang.Object o)
|
int |
getCharIndex(int bytePos)
Calculates the char index of the given byte index. |
int |
getCharIndex(int bytePos,
int startCP)
Calculates the char index of the given byte index. |
int |
getCpMin()
|
java.util.List<TextPiece> |
getTextPieces()
|
boolean |
isIndexInTable(int bytePos)
Check if index is in table |
int |
lookIndexBackward(int bytePos)
Return last index <= bytePos that is in table |
int |
lookIndexForward(int bytePos)
Return first index >= bytePos that is in table |
byte[] |
writeTo(HWPFOutputStream docStream)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<TextPiece> _textPieces
protected java.util.ArrayList<TextPiece> _textPiecesFCOrder
Constructor Detail |
---|
public TextPieceTable()
public TextPieceTable(byte[] documentStream, byte[] tableStream, int offset, int size, int fcMin)
Method Detail |
---|
public int getCpMin()
public java.util.List<TextPiece> getTextPieces()
public void add(TextPiece piece)
public byte[] writeTo(HWPFOutputStream docStream) throws java.io.IOException
java.io.IOException
public int adjustForInsert(int listIndex, int length)
listIndex
- The TextPiece that had characters inserted intolength
- The number of characters insertedpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int getCharIndex(int bytePos)
CharIndexTranslator
getCharIndex
in interface CharIndexTranslator
bytePos
- The character offset to check
public int getCharIndex(int bytePos, int startCP)
CharIndexTranslator
getCharIndex
in interface CharIndexTranslator
bytePos
- The character offset to checkstartCP
- look from this characted position
public int lookIndexForward(int bytePos)
CharIndexTranslator
lookIndexForward
in interface CharIndexTranslator
public int lookIndexBackward(int bytePos)
CharIndexTranslator
lookIndexBackward
in interface CharIndexTranslator
public boolean isIndexInTable(int bytePos)
CharIndexTranslator
isIndexInTable
in interface CharIndexTranslator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |