org.apache.poi.hwpf.model
Class TextPiece

java.lang.Object
  extended by org.apache.poi.hwpf.model.PropertyNode
      extended by org.apache.poi.hwpf.model.TextPiece
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class TextPiece
extends PropertyNode
implements java.lang.Comparable

Lightweight representation of a text piece.

Author:
Ryan Ackley

Field Summary
 
Fields inherited from class org.apache.poi.hwpf.model.PropertyNode
_buf
 
Constructor Summary
TextPiece(int start, int end, byte[] text, PieceDescriptor pd, int cpStart)
           
 
Method Summary
 void adjustForDelete(int start, int length)
          Adjust for a deletion that can span multiple PropertyNodes.
 int characterLength()
           
 boolean equals(java.lang.Object o)
           
 int getCP()
           
 PieceDescriptor getPieceDescriptor()
           
 byte[] getRawBytes()
           
 java.lang.StringBuffer getStringBuffer()
           
 java.lang.String substring(int start, int end)
           
 boolean usesUnicode()
           
 
Methods inherited from class org.apache.poi.hwpf.model.PropertyNode
clone, compareTo, getEnd, getStart, limitsAreEqual, setEnd, setStart
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

TextPiece

public TextPiece(int start,
                 int end,
                 byte[] text,
                 PieceDescriptor pd,
                 int cpStart)
          throws java.io.UnsupportedEncodingException
Parameters:
start - Offset in main document stream.
Throws:
java.io.UnsupportedEncodingException
Method Detail

usesUnicode

public boolean usesUnicode()
Returns:
If this text piece uses unicode

getPieceDescriptor

public PieceDescriptor getPieceDescriptor()

getStringBuffer

public java.lang.StringBuffer getStringBuffer()

getRawBytes

public byte[] getRawBytes()

substring

public java.lang.String substring(int start,
                                  int end)

adjustForDelete

public void adjustForDelete(int start,
                            int length)
Description copied from class: PropertyNode
Adjust for a deletion that can span multiple PropertyNodes.

Overrides:
adjustForDelete in class PropertyNode

characterLength

public int characterLength()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class PropertyNode

getCP

public int getCP()


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.