public class HSSFRichTextString extends Object implements Comparable
Modifier and Type | Field and Description |
---|---|
private Workbook |
book |
static short |
NO_FONT
Place holder for indicating that NO_FONT has been applied here
|
private LabelSSTRecord |
record |
private UnicodeString |
string |
Constructor and Description |
---|
HSSFRichTextString() |
HSSFRichTextString(String string) |
HSSFRichTextString(Workbook book,
LabelSSTRecord record) |
Modifier and Type | Method and Description |
---|---|
private void |
addToSSTIfRequired() |
void |
applyFont(HSSFFont font)
Sets the font of the entire string.
|
void |
applyFont(int startIndex,
int endIndex,
HSSFFont font)
Applies a font to the specified characters of a string.
|
void |
applyFont(int startIndex,
int endIndex,
short fontIndex)
Applies a font to the specified characters of a string.
|
void |
applyFont(short fontIndex)
Applies the specified font to the entire string.
|
void |
clearFormatting()
Removes any formatting that may have been applied to the string.
|
private UnicodeString |
cloneStringIfRequired()
Called whenever the unicode string is modified.
|
int |
compareTo(Object o)
Compares one rich text string to another.
|
boolean |
equals(Object o) |
short |
getFontAtIndex(int index)
Returns the font in use at a particular index.
|
short |
getFontOfFormattingRun(int index)
Gets the font used in a particular formatting run.
|
int |
getIndexOfFormattingRun(int index)
The index within the string to which the specified formatting run applies.
|
String |
getString()
Returns the plain string representation.
|
(package private) UnicodeString |
getUnicodeString()
Used internally by the HSSFCell to get the internal string value
|
int |
length() |
int |
numFormattingRuns() |
(package private) void |
setUnicodeString(UnicodeString str)
Used internally by the HSSFCell to set the internal string value
|
(package private) void |
setWorkbookReferences(Workbook book,
LabelSSTRecord record)
This must be called to setup the internal work book references whenever
a RichTextString is added to a cell
|
String |
toString() |
public static final short NO_FONT
private UnicodeString string
private Workbook book
private LabelSSTRecord record
public HSSFRichTextString()
public HSSFRichTextString(String string)
HSSFRichTextString(Workbook book, LabelSSTRecord record)
void setWorkbookReferences(Workbook book, LabelSSTRecord record)
private UnicodeString cloneStringIfRequired()
private void addToSSTIfRequired()
public void applyFont(int startIndex, int endIndex, short fontIndex)
startIndex
- The start index to apply the font to (inclusive)endIndex
- The end index to apply the font to (exclusive)fontIndex
- The font to use.public void applyFont(int startIndex, int endIndex, HSSFFont font)
startIndex
- The start index to apply the font to (inclusive)endIndex
- The end index to apply to font to (exclusive)font
- The index of the font to use.public void applyFont(HSSFFont font)
font
- The font to use.public void clearFormatting()
public String getString()
UnicodeString getUnicodeString()
void setUnicodeString(UnicodeString str)
public int length()
public short getFontAtIndex(int index)
index
- The index.public int numFormattingRuns()
NO_FONT
public int getIndexOfFormattingRun(int index)
index
- the index of the formatting runpublic short getFontOfFormattingRun(int index)
index
- the index of the formatting runpublic int compareTo(Object o)
compareTo
in interface Comparable
public String toString()
public void applyFont(short fontIndex)
fontIndex
- the font to apply.Copyright © 2016 Open Microscopy Environment