Package org.apache.poi.ss.usermodel
Interface RichTextString
-
- All Known Implementing Classes:
HSSFRichTextString
public interface RichTextStringRich text unicode string. These strings can have fonts applied to arbitary parts of the string.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyFont(int startIndex, int endIndex, short fontIndex)Applies a font to the specified characters of a string.voidapplyFont(int startIndex, int endIndex, Font font)Applies a font to the specified characters of a string.voidapplyFont(short fontIndex)Applies the specified font to the entire string.voidapplyFont(Font font)Sets the font of the entire string.voidclearFormatting()Removes any formatting that may have been applied to the string.intgetIndexOfFormattingRun(int index)The index within the string to which the specified formatting run applies.StringgetString()Returns the plain string representation.intlength()intnumFormattingRuns()
-
-
-
Method Detail
-
applyFont
void applyFont(int startIndex, int endIndex, short fontIndex)Applies a font to the specified characters of a string.- Parameters:
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.
-
applyFont
void applyFont(int startIndex, int endIndex, Font font)Applies a font to the specified characters of a string.- Parameters:
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.
-
applyFont
void applyFont(Font font)
Sets the font of the entire string.- Parameters:
font- The font to use.
-
clearFormatting
void clearFormatting()
Removes any formatting that may have been applied to the string.
-
getString
String getString()
Returns the plain string representation.
-
length
int length()
- Returns:
- the number of characters in the font.
-
numFormattingRuns
int numFormattingRuns()
- Returns:
- The number of formatting runs used.
-
getIndexOfFormattingRun
int getIndexOfFormattingRun(int index)
The index within the string to which the specified formatting run applies.- Parameters:
index- the index of the formatting run- Returns:
- the index within the string.
-
applyFont
void applyFont(short fontIndex)
Applies the specified font to the entire string.- Parameters:
fontIndex- the font to apply.
-
-