Top Description Methods
org.apache.poi.ss.usermodel

public Interface RichTextString

Known Direct Implementers
org.apache.poi.hssf.usermodel.HSSFRichTextString

Rich text unicode string. These strings can have fonts applied to arbitary parts of the string.

Method Summary

Modifier and TypeMethod and Description
public void
applyFont(int
The start index to apply the font to (inclusive)
startIndex
,
int
The end index to apply the font to (exclusive)
endIndex
,
short
The font to use.
fontIndex
)

Applies a font to the specified characters of a string.

public void
applyFont(int
The start index to apply the font to (inclusive)
startIndex
,
int
The end index to apply to font to (exclusive)
endIndex
,
Font
The index of the font to use.
font
)

Applies a font to the specified characters of a string.

public void
applyFont(Font
The font to use.
font
)

Sets the font of the entire string.

public void
applyFont(short
the font to apply.
fontIndex
)

Applies the specified font to the entire string.

public void
clearFormatting()

Removes any formatting that may have been applied to the string.

public int

Returns:

the index within the string.
getIndexOfFormattingRun
(int
the index of the formatting run
index
)

The index within the string to which the specified formatting run applies.

public String
getString()

Returns the plain string representation.

public int

Returns:

the number of characters in the font.
length
()

public int

Returns:

The number of formatting runs used.
numFormattingRuns
()

Method Detail

applyFontback to summary
public void applyFont(int startIndex, int endIndex, short fontIndex)

Applies a font to the specified characters of a string.

Parameters
startIndex:int

The start index to apply the font to (inclusive)

endIndex:int

The end index to apply the font to (exclusive)

fontIndex:short

The font to use.

applyFontback to summary
public void applyFont(int startIndex, int endIndex, Font font)

Applies a font to the specified characters of a string.

Parameters
startIndex:int

The start index to apply the font to (inclusive)

endIndex:int

The end index to apply to font to (exclusive)

font:Font

The index of the font to use.

applyFontback to summary
public void applyFont(Font font)

Sets the font of the entire string.

Parameters
font:Font

The font to use.

applyFontback to summary
public void applyFont(short fontIndex)

Applies the specified font to the entire string.

Parameters
fontIndex:short

the font to apply.

clearFormattingback to summary
public void clearFormatting()

Removes any formatting that may have been applied to the string.

getIndexOfFormattingRunback to summary
public int getIndexOfFormattingRun(int index)

The index within the string to which the specified formatting run applies.

Parameters
index:int

the index of the formatting run

Returns:int

the index within the string.

getStringback to summary
public String getString()

Returns the plain string representation.

lengthback to summary
public int length()
Returns:int

the number of characters in the font.

numFormattingRunsback to summary
public int numFormattingRuns()
Returns:int

The number of formatting runs used.