public class UnicodeString extends Object implements Comparable
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)
Modifier and Type | Class and Description |
---|---|
static class |
UnicodeString.FormatRun |
static class |
UnicodeString.UnicodeRecordStats
Returns the size of this record, given the ammount of record space
remaining, it will also include the size of writing a continue record.
|
Modifier and Type | Field and Description |
---|---|
private static BitField |
extBit |
private short |
field_1_charCount |
private byte |
field_2_optionflags |
private String |
field_3_string |
private List |
field_4_format_runs |
private byte[] |
field_5_ext_rst |
private static BitField |
highByte |
private static BitField |
richText |
static short |
sid |
Modifier | Constructor and Description |
---|---|
private |
UnicodeString() |
|
UnicodeString(RecordInputStream in)
construct a unicode string record and fill its fields, ID is ignored
|
|
UnicodeString(String str) |
Modifier and Type | Method and Description |
---|---|
void |
addFormatRun(UnicodeString.FormatRun r)
Adds a font run to the formatted string.
|
void |
clearFormatting() |
Object |
clone() |
int |
compareTo(Object obj) |
boolean |
equals(Object o)
Our handling of equals is inconsistent with compareTo.
|
protected void |
fillFields(RecordInputStream in) |
private int |
findFormatRunAt(int characterPos) |
Iterator |
formatIterator() |
short |
getCharCount()
get the number of characters in the string
|
String |
getDebugInfo()
return a character representation of the fields of this record
|
byte[] |
getExtendedRst() |
UnicodeString.FormatRun |
getFormatRun(int index) |
int |
getFormatRunCount() |
byte |
getOptionFlags()
get the option flags which among other things return if this is a 16-bit or
8 bit string
|
void |
getRecordSize(UnicodeString.UnicodeRecordStats stats) |
short |
getSid() |
String |
getString()
get the actual string this contains as a java String object
|
int |
hashCode() |
boolean |
isExtendedText() |
boolean |
isRichText() |
private boolean |
isUncompressedUnicode() |
void |
removeFormatRun(UnicodeString.FormatRun r) |
int |
serialize(UnicodeString.UnicodeRecordStats stats,
int offset,
byte[] data) |
void |
setCharCount(short cc)
set the number of characters in the string
|
void |
setCompressedUnicode() |
void |
setExtendedRst(byte[] ext_rst) |
void |
setOptionFlags(byte of)
set the option flags which among other things return if this is a 16-bit or
8 bit string
|
void |
setString(String string)
set the actual string this contains
|
void |
setUncompressedUnicode() |
String |
toString()
unlike the real records we return the same as "getString()" rather than debug info
|
protected void |
validateSid(short id)
NO OP
|
private int |
writeContinueIfRequired(UnicodeString.UnicodeRecordStats stats,
int requiredSize,
int offset,
byte[] data) |
public static final short sid
private short field_1_charCount
private byte field_2_optionflags
private String field_3_string
private List field_4_format_runs
private byte[] field_5_ext_rst
private static final BitField highByte
private static final BitField extBit
private static final BitField richText
private UnicodeString()
public UnicodeString(String str)
public UnicodeString(RecordInputStream in)
in
- the RecordInputstream to read the record frompublic boolean equals(Object o)
protected void validateSid(short id)
protected void fillFields(RecordInputStream in)
in
- the RecordInputstream to read the record frompublic short getCharCount()
public void setCharCount(short cc)
cc
- - number of characterspublic byte getOptionFlags()
public void setOptionFlags(byte of)
of
- optionflags bitmaskpublic String getString()
public void setString(String string)
string
- the textpublic int getFormatRunCount()
public UnicodeString.FormatRun getFormatRun(int index)
private int findFormatRunAt(int characterPos)
public void addFormatRun(UnicodeString.FormatRun r)
public Iterator formatIterator()
public void removeFormatRun(UnicodeString.FormatRun r)
public void clearFormatting()
public byte[] getExtendedRst()
public void setExtendedRst(byte[] ext_rst)
public String toString()
toString
in class Object
getDebugInfo()
public String getDebugInfo()
private int writeContinueIfRequired(UnicodeString.UnicodeRecordStats stats, int requiredSize, int offset, byte[] data)
public int serialize(UnicodeString.UnicodeRecordStats stats, int offset, byte[] data)
public void setCompressedUnicode()
public void setUncompressedUnicode()
private boolean isUncompressedUnicode()
public void getRecordSize(UnicodeString.UnicodeRecordStats stats)
public short getSid()
public int compareTo(Object obj)
compareTo
in interface Comparable
public boolean isRichText()
public boolean isExtendedText()
Copyright © 2016 Open Microscopy Environment