Package loci.poi.hssf.record
Class UnicodeString
java.lang.Object
loci.poi.hssf.record.UnicodeString
- All Implemented Interfaces:
Comparable
Title: Unicode String
Description: Unicode String record. We implement these as a record, although they are really just standard fields that are in several records. It is considered more desirable then repeating it in all of them.
REFERENCE: PG 264 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
- Version:
- 2.0-pre
- Author:
- Andrew C. Oliver, Marc Johnson (mjohnson at apache dot org), Glen Stampoultzis (glens at apache.org)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classReturns the size of this record, given the ammount of record space remaining, it will also include the size of writing a continue record. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUnicodeString(String str) construct a unicode string record and fill its fields, ID is ignored -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a font run to the formatted string.voidclone()intbooleanOur handling of equals is inconsistent with compareTo.protected voidshortget the number of characters in the stringreturn a character representation of the fields of this recordbyte[]getFormatRun(int index) intbyteget the option flags which among other things return if this is a 16-bit or 8 bit stringvoidshortgetSid()get the actual string this contains as a java String objectinthashCode()booleanbooleanvoidintserialize(UnicodeString.UnicodeRecordStats stats, int offset, byte[] data) voidsetCharCount(short cc) set the number of characters in the stringvoidvoidsetExtendedRst(byte[] ext_rst) voidsetOptionFlags(byte of) set the option flags which among other things return if this is a 16-bit or 8 bit stringvoidset the actual string this containsvoidtoString()unlike the real records we return the same as "getString()" rather than debug infoprotected voidvalidateSid(short id) NO OP
-
Field Details
-
sid
public static final short sid- See Also:
-
-
Constructor Details
-
UnicodeString
-
UnicodeString
construct a unicode string record and fill its fields, ID is ignored- Parameters:
in- the RecordInputstream to read the record from
-
-
Method Details
-
hashCode
public int hashCode() -
equals
Our handling of equals is inconsistent with compareTo. The trouble is because we don't truely understand rich text fields yet it's difficult to make a sound comparison. -
validateSid
protected void validateSid(short id) NO OP -
fillFields
- Parameters:
in- the RecordInputstream to read the record from
-
getCharCount
public short getCharCount()get the number of characters in the string- Returns:
- number of characters
-
setCharCount
public void setCharCount(short cc) set the number of characters in the string- Parameters:
cc- - number of characters
-
getOptionFlags
public byte getOptionFlags()get the option flags which among other things return if this is a 16-bit or 8 bit string- Returns:
- optionflags bitmask
-
setOptionFlags
public void setOptionFlags(byte of) set the option flags which among other things return if this is a 16-bit or 8 bit string- Parameters:
of- optionflags bitmask
-
getString
get the actual string this contains as a java String object- Returns:
- String
-
setString
set the actual string this contains- Parameters:
string- the text
-
getFormatRunCount
public int getFormatRunCount() -
getFormatRun
-
addFormatRun
Adds a font run to the formatted string. If a font run exists at the current charcter location, then it is replaced with the font run to be added. -
formatIterator
-
removeFormatRun
-
clearFormatting
public void clearFormatting() -
getExtendedRst
public byte[] getExtendedRst() -
setExtendedRst
public void setExtendedRst(byte[] ext_rst) -
toString
unlike the real records we return the same as "getString()" rather than debug info -
getDebugInfo
return a character representation of the fields of this record- Returns:
- String of output for biffviewer etc.
-
serialize
-
setCompressedUnicode
public void setCompressedUnicode() -
setUncompressedUnicode
public void setUncompressedUnicode() -
getRecordSize
-
getSid
public short getSid() -
compareTo
- Specified by:
compareToin interfaceComparable
-
isRichText
public boolean isRichText() -
isExtendedText
public boolean isExtendedText() -
clone
-