public class UnicodeString extends java.lang.Object implements java.lang.Comparable<UnicodeString>, Duplicatable
This is often called a XLUnicodeRichExtendedString in MS documentation.
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(FormatRun r)
Adds a font run to the formatted string.
|
void |
clearFormatting() |
UnicodeString |
clone()
Deprecated.
|
int |
compareTo(UnicodeString str) |
UnicodeString |
copy() |
boolean |
equals(java.lang.Object o)
Our handling of equals is inconsistent with compareTo.
|
java.util.Iterator<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
|
ExtRst |
getExtendedRst() |
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(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 FormatRun getFormatRun(int index)
public void addFormatRun(FormatRun r)
public java.util.Iterator<FormatRun> formatIterator()
public void removeFormatRun(FormatRun r)
public void clearFormatting()
public 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>
@Deprecated @Removal(version="5.0.0") public UnicodeString clone()
clone
in class java.lang.Object
public UnicodeString copy()
copy
in interface Duplicatable
Copyright 2020 The Apache Software Foundation or its licensors, as applicable.