public class UnicodeString extends java.lang.Object implements java.lang.Comparable<UnicodeString>
Description: Unicode String - just standard fields that are in several records. It is considered more desirable then repeating it in all of them.
This is often called a XLUnicodeRichExtendedString in MS documentation.
REFERENCE: PG 264 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
REFERENCE: PG 951 Excel Binary File Format (.xls) Structure Specification v20091214
Modifier and Type | Class and Description |
---|---|
static class |
UnicodeString.ExtRst |
static class |
UnicodeString.FormatRun |
static class |
UnicodeString.PhRun |
Constructor and Description |
---|
UnicodeString(RecordInputStream in)
construct a unicode string record and fill its fields, ID is ignored
|
UnicodeString(java.lang.String str) |
Modifier and Type | Method and Description |
---|---|
void |
addFormatRun(UnicodeString.FormatRun r)
Adds a font run to the formatted string.
|
void |
clearFormatting() |
java.lang.Object |
clone() |
int |
compareTo(UnicodeString str) |
boolean |
equals(java.lang.Object o)
Our handling of equals is inconsistent with compareTo.
|
java.util.Iterator<UnicodeString.FormatRun> |
formatIterator() |
int |
getCharCount()
get the number of characters in the string,
as an un-wrapped int
|
short |
getCharCountShort()
get the number of characters in the string,
wrapped as needed to fit within a short
|
java.lang.String |
getDebugInfo()
return a character representation of the fields of this record
|
UnicodeString.ExtRst |
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
|
java.lang.String |
getString() |
int |
hashCode() |
void |
removeFormatRun(UnicodeString.FormatRun r) |
void |
serialize(ContinuableRecordOutput out)
Serialises out the String.
|
void |
setCharCount(short cc)
set the number of characters in the string
|
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(java.lang.String string)
set the actual string this contains
|
void |
swapFontUse(short oldFontIndex,
short newFontIndex)
Swaps all use in the string of one font index
for use of a different font index.
|
java.lang.String |
toString()
unlike the real records we return the same as "getString()" rather than debug info
|
public UnicodeString(java.lang.String str)
public UnicodeString(RecordInputStream in)
in
- the RecordInputstream to read the record frompublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The object to compare.public int getCharCount()
public short getCharCountShort()
public void setCharCount(short cc)
cc
- - number of characterspublic byte getOptionFlags()
public void setOptionFlags(byte of)
of
- optionflags bitmaskpublic java.lang.String getString()
public void setString(java.lang.String string)
string
- the textpublic int getFormatRunCount()
public UnicodeString.FormatRun getFormatRun(int index)
public void addFormatRun(UnicodeString.FormatRun r)
public java.util.Iterator<UnicodeString.FormatRun> formatIterator()
public void removeFormatRun(UnicodeString.FormatRun r)
public void clearFormatting()
public UnicodeString.ExtRst getExtendedRst()
public void swapFontUse(short oldFontIndex, short newFontIndex)
public java.lang.String toString()
toString
in class java.lang.Object
getDebugInfo()
public java.lang.String getDebugInfo()
public void serialize(ContinuableRecordOutput out)
public int compareTo(UnicodeString str)
compareTo
in interface java.lang.Comparable<UnicodeString>
public java.lang.Object clone()
clone
in class java.lang.Object
Copyright 2018 The Apache Software Foundation or its licensors, as applicable.