Package org.apache.poi.hwpf.model
Class TextPiece
- All Implemented Interfaces:
Cloneable,Comparable<TextPiece>
- Direct Known Subclasses:
OldTextPiece,SinglentonTextPiece
Lightweight representation of a text piece.
Works in the character domain, not the byte domain, so you
need to have turned byte references into character
references before getting here.
- Author:
- Ryan Ackley
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.hwpf.model.PropertyNode
PropertyNode.EndComparator, PropertyNode.StartComparator -
Field Summary
Fields inherited from class org.apache.poi.hwpf.model.PropertyNode
_buf -
Constructor Summary
ConstructorsConstructorDescriptionTextPiece(int start, int end, byte[] text, PieceDescriptor pd) TextPiece(int start, int end, byte[] text, PieceDescriptor pd, int cpStart) -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustForDelete(int start, int length) Deprecated.intReturns the length, in bytesintDeprecated.booleanintgetCP()Returns the character position we start at.byte[]Deprecated.inthashCode()booleansubstring(int start, int end) Deprecated.toString()Methods inherited from class org.apache.poi.hwpf.model.PropertyNode
clone, compareTo, getEnd, getStart, limitsAreEqual, setEnd, setStart
-
Constructor Details
-
TextPiece
- Parameters:
start- Beginning offset in main document stream, in characters.end- Ending offset in main document stream, in characters.text- The raw bytes of our text instead
-
TextPiece
- Parameters:
start- Beginning offset in main document stream, in characters.end- Ending offset in main document stream, in characters.text- The raw bytes of our text
-
-
Method Details
-
isUnicode
public boolean isUnicode()- Returns:
- If this text piece is unicode
-
getPieceDescriptor
-
getStringBuffer
Deprecated. -
getStringBuilder
-
getRawBytes
public byte[] getRawBytes() -
substring
Deprecated.Returns part of the string. Works only in characters, not in bytes!- Parameters:
start- Local start position, in charactersend- Local end position, in characters
-
adjustForDelete
Deprecated.Adjusts the internal string for deletinging some characters within this.- Overrides:
adjustForDeletein classPropertyNode<TextPiece>- Parameters:
start- The start position for the delete, in characterslength- The number of characters to delete
-
characterLength
Deprecated.Returns the length, in characters -
bytesLength
public int bytesLength()Returns the length, in bytes -
equals
- Overrides:
equalsin classPropertyNode<TextPiece>
-
hashCode
public int hashCode()- Overrides:
hashCodein classPropertyNode<TextPiece>
-
getCP
public int getCP()Returns the character position we start at. -
toString
-