Methods Summary |
---|
public void | adjustForDelete(int start, int length)
|
public int | characterLength()
return (getEnd() - getStart()) / (_usesUnicode ? 2 : 1);
|
public boolean | equals(java.lang.Object o)
if (limitsAreEqual(o))
{
TextPiece tp = (TextPiece)o;
return getStringBuffer().toString().equals(tp.getStringBuffer().toString()) &&
tp._usesUnicode == _usesUnicode && _pd.equals(tp._pd);
}
return false;
|
public int | getCP()
return _cpStart;
|
public org.apache.poi.hwpf.model.PieceDescriptor | getPieceDescriptor()
return _pd;
|
public byte[] | getRawBytes()
try
{
return ((StringBuffer)_buf).toString().getBytes(_usesUnicode ?
"UTF-16LE" : "Cp1252");
}
catch (UnsupportedEncodingException ignore)
{
// shouldn't ever happen considering we wouldn't have been able to
// create the StringBuffer w/o getting this exception
return ((StringBuffer)_buf).toString().getBytes();
}
|
public java.lang.StringBuffer | getStringBuffer()
return (StringBuffer)_buf;
|
public java.lang.String | substring(int start, int end)
int denominator = _usesUnicode ? 2 : 1;
return ((StringBuffer)_buf).substring(start/denominator, end/denominator);
|
public boolean | usesUnicode()
return _usesUnicode;
|