RichText

Inheritance: java.lang.Object, com.aspose.note.Node

All Implemented Interfaces: com.aspose.note.IOutlineElementChildNode, com.aspose.note.ITaggable, com.aspose.ms.System.Collections.Generic.IGenericEnumerable

public class RichText extends Node implements IOutlineElementChildNode, ITaggable, System.Collections.Generic.IGenericEnumerable<Character>

Represents a rich text.

Constructors

ConstructorDescription
RichText()Initializes a new instance of the RichText class.

Methods

MethodDescription
accept(DocumentVisitor visitor)Accepts the visitor of the node.
append(String value)Adds a string to the last text range.
append(String value, TextStyle style)Adds a string to the end.
appendFront(String value)Adds a string to the front of the first text range.
appendFront(String value, TextStyle style)Adds a string to the front.
clear()Clears content of this instance.
getAlignment()Gets the alignment.
getLastModifiedTime()Gets the last modified time.
getLength()
getLineSpacing()Gets the line spacing.
getParagraphStyle()Gets the paragraph style.
getSpaceAfter()Gets the minimum amount of space after.
getSpaceBefore()Gets the minimum amount of space before.
getStyles()Gets the styles.
getTags()Gets the list of all tags of a paragraph.
getText()Gets the text.
getTextRuns()
indexOf(char value)Returns the zero-based index of the first occurrence of the specified Unicode character in this string.
indexOf(char value, int startIndex)Returns the zero-based index of the first occurrence of the specified Unicode character in this string.
indexOf(char value, int startIndex, int count)Returns the zero-based index of the first occurrence of the specified character in this instance.
indexOf(String value)Returns the zero-based index of the first occurrence of the specified string in this instance.
indexOf(String value, int startIndex)Returns the zero-based index of the first occurrence of the specified string in this instance.
indexOf(String value, int startIndex, int count)Returns the zero-based index of the first occurrence of the specified string in this instance.
indexOf(String value, int startIndex, int count, short comparisonType)Returns the zero-based index of the first occurrence of the specified string in the current instance.
indexOf(String value, short comparisonType)Returns the zero-based index of the first occurrence of the specified string in the current instance.
indexOf_Rename_Namesake(String value, int startIndex, short comparisonType)Returns the zero-based index of the first occurrence of the specified string in the current instance.
insert(int startIndex, String value)Inserts a specified string at a specified index position in this instance.
insert(int startIndex, String value, TextStyle style)Inserts a specified string with specified style at a specified index position in this instance.
iterator()
remove(int startIndex)Removes all the characters in the current instance, beginning at a specified position and continuing through the last position.
remove(int startIndex, int count)Removes specified number of characters in the current instance beginning at a specified position.
replace(char oldChar, char newChar)Replaces all occurrences of a specified Unicode character in this instance with another specified Unicode character.
replace(String oldValue, String newValue)Replaces all occurrences of a specified string in the current instance with another specified string.
replace(String oldValue, String newValue, TextStyle style)Replaces all occurrences of a specified string in the current instance with another specified string in specified style.
setAlignment(int value)Sets the alignment.
setLastModifiedTime(Date value)Sets the last modified time.
setLineSpacing(float value)
setLineSpacing(Float value)Sets the line spacing.
setParagraphStyle(ParagraphStyle value)Sets the paragraph style.
setSpaceAfter(float value)
setSpaceAfter(Float value)Sets the minimum amount of space after.
setSpaceBefore(float value)
setSpaceBefore(Float value)Sets the minimum amount of space before.
setText(String value)Sets the text.
trim()Removes all leading and trailing white-space characters.
trim(char trimChar)Removes all leading and trailing instances of a character.
trim(char[] trimChars)Removes all leading and trailing occurrences of a set of characters specified in an array.
trimEnd()Removes all the trailing white-space characters.
trimEnd(char trimChar)Removes all the trailing occurrences of a character.
trimEnd(char[] trimChars)Removes all the trailing occurrences of a set of characters specified in an array.
trimStart()Removes all the leading white-space characters.
trimStart(char trimChar)Removes all the leading occurrences of a specified character.
trimStart(char[] trimChars)Removes all the leading occurrences of a set of characters specified in an array.

RichText()

public RichText()

Initializes a new instance of the RichText class.

accept(DocumentVisitor visitor)

public void accept(DocumentVisitor visitor)

Accepts the visitor of the node.

Parameters:

ParameterTypeDescription
visitorDocumentVisitorThe object of a class derived from the DocumentVisitor.

append(String value)

public RichText append(String value)

Adds a string to the last text range.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe added value.

Returns: RichText - The RichText.

append(String value, TextStyle style)

public final RichText append(String value, TextStyle style)

Adds a string to the end.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe added value.
styleTextStyleThe style of added string.

Returns: RichText - The RichText.

appendFront(String value)

public RichText appendFront(String value)

Adds a string to the front of the first text range.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe added value.

Returns: RichText - The RichText.

appendFront(String value, TextStyle style)

public RichText appendFront(String value, TextStyle style)

Adds a string to the front.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe added value.
styleTextStyleThe style of added string.

Returns: RichText - The RichText.

clear()

public final RichText clear()

Clears content of this instance.

Returns: RichText - The RichText.

getAlignment()

public int getAlignment()

Gets the alignment.

Returns: int

getLastModifiedTime()

public Date getLastModifiedTime()

Gets the last modified time.

Returns: java.util.Date

getLength()

public final int getLength()

Returns: int

getLineSpacing()

public Float getLineSpacing()

Gets the line spacing.

Returns: java.lang.Float

getParagraphStyle()

public final ParagraphStyle getParagraphStyle()

Gets the paragraph style. These settings are used if there is no matching TextStyle object in getStyles collection either this object doesn’t specify a needed setting.

Returns: ParagraphStyle

getSpaceAfter()

public Float getSpaceAfter()

Gets the minimum amount of space after.

Returns: java.lang.Float

getSpaceBefore()

public Float getSpaceBefore()

Gets the minimum amount of space before.

Returns: java.lang.Float

getStyles()

public System.Collections.Generic.IGenericEnumerable<TextStyle> getStyles()

Gets the styles.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.note.TextStyle>

getTags()

public final System.Collections.Generic.List<ITag> getTags()

Gets the list of all tags of a paragraph.

Returns: com.aspose.ms.System.Collections.Generic.List<com.aspose.note.ITag>

getText()

public final String getText()

Gets the text. The string MUST NOT contain any characters of the value 10 (line feed).

Returns: java.lang.String

getTextRuns()

public final System.Collections.Generic.IGenericEnumerable<TextRun> getTextRuns()

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.note.TextRun>

indexOf(char value)

public final int indexOf(char value)

Returns the zero-based index of the first occurrence of the specified Unicode character in this string.

Parameters:

ParameterTypeDescription
valuecharThe value.

Returns: int - The int.

indexOf(char value, int startIndex)

public final int indexOf(char value, int startIndex)

Returns the zero-based index of the first occurrence of the specified Unicode character in this string. The search starts at a specified character position.

Parameters:

ParameterTypeDescription
valuecharThe value.
startIndexintThe starting search position

Returns: int - The int.

indexOf(char value, int startIndex, int count)

public final int indexOf(char value, int startIndex, int count)

Returns the zero-based index of the first occurrence of the specified character in this instance. The search starts at a specified character position and examines a specified number of character positions.

Parameters:

ParameterTypeDescription
valuecharThe value.
startIndexintThe starting search position
countintThe count.

Returns: int - The int.

indexOf(String value)

public final int indexOf(String value)

Returns the zero-based index of the first occurrence of the specified string in this instance.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe value.

Returns: int - The int.

indexOf(String value, int startIndex)

public final int indexOf(String value, int startIndex)

Returns the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe value.
startIndexintThe starting search position

Returns: int - The int.

indexOf(String value, int startIndex, int count)

public final int indexOf(String value, int startIndex, int count)

Returns the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position and examines a specified number of character positions.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe value.
startIndexintThe starting search position
countintThe count.

Returns: int - The int.

indexOf(String value, int startIndex, int count, short comparisonType)

public final int indexOf(String value, int startIndex, int count, short comparisonType)

Returns the zero-based index of the first occurrence of the specified string in the current instance.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe value.
startIndexintThe starting search position
countintThe count.
comparisonTypeshortThe type of search to use for the specified string

Returns: int - The int.

indexOf(String value, short comparisonType)

public final int indexOf(String value, short comparisonType)

Returns the zero-based index of the first occurrence of the specified string in the current instance. A parameter specifies the type of search to use for the specified string.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe value.
comparisonTypeshortThe type of search to use for the specified string

Returns: int - The int.

indexOf_Rename_Namesake(String value, int startIndex, short comparisonType)

public final int indexOf_Rename_Namesake(String value, int startIndex, short comparisonType)

Returns the zero-based index of the first occurrence of the specified string in the current instance. Parameters specify the starting search position in the current string and the type of search to use for the specified string.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe value.
startIndexintThe starting search position
comparisonTypeshortThe type of search to use for the specified string

Returns: int - The int.

insert(int startIndex, String value)

public final RichText insert(int startIndex, String value)

Inserts a specified string at a specified index position in this instance.

Parameters:

ParameterTypeDescription
startIndexintThe start index.
valuejava.lang.StringThe value.

Returns: RichText - The RichText.

insert(int startIndex, String value, TextStyle style)

public final RichText insert(int startIndex, String value, TextStyle style)

Inserts a specified string with specified style at a specified index position in this instance.

Parameters:

ParameterTypeDescription
startIndexintThe start index.
valuejava.lang.StringThe value.
styleTextStyleThe style.

Returns: RichText - The RichText.

iterator()

public System.Collections.Generic.IGenericEnumerator<Character> iterator()

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<java.lang.Character>

remove(int startIndex)

public final RichText remove(int startIndex)

Removes all the characters in the current instance, beginning at a specified position and continuing through the last position.

Parameters:

ParameterTypeDescription
startIndexintThe start index.

Returns: RichText - The RichText.

remove(int startIndex, int count)

public final RichText remove(int startIndex, int count)

Removes specified number of characters in the current instance beginning at a specified position.

Parameters:

ParameterTypeDescription
startIndexintThe start index.
countintThe count.

Returns: RichText - The RichText.

replace(char oldChar, char newChar)

public final RichText replace(char oldChar, char newChar)

Replaces all occurrences of a specified Unicode character in this instance with another specified Unicode character.

Parameters:

ParameterTypeDescription
oldCharcharThe old char.
newCharcharThe new char.

Returns: RichText - The RichText.

replace(String oldValue, String newValue)

public final RichText replace(String oldValue, String newValue)

Replaces all occurrences of a specified string in the current instance with another specified string.

Parameters:

ParameterTypeDescription
oldValuejava.lang.StringThe old value.
newValuejava.lang.StringThe new value.

Returns: RichText - The RichText.

replace(String oldValue, String newValue, TextStyle style)

public final RichText replace(String oldValue, String newValue, TextStyle style)

Replaces all occurrences of a specified string in the current instance with another specified string in specified style.

Parameters:

ParameterTypeDescription
oldValuejava.lang.StringThe old value.
newValuejava.lang.StringThe new value.
styleTextStyleThe style of the new value.

Returns: RichText - The RichText.

setAlignment(int value)

public void setAlignment(int value)

Sets the alignment.

Parameters:

ParameterTypeDescription
valueint

setLastModifiedTime(Date value)

public void setLastModifiedTime(Date value)

Sets the last modified time.

Parameters:

ParameterTypeDescription
valuejava.util.Date

setLineSpacing(float value)

public void setLineSpacing(float value)

Parameters:

ParameterTypeDescription
valuefloat

setLineSpacing(Float value)

public void setLineSpacing(Float value)

Sets the line spacing.

Parameters:

ParameterTypeDescription
valuejava.lang.Float

setParagraphStyle(ParagraphStyle value)

public final void setParagraphStyle(ParagraphStyle value)

Sets the paragraph style. These settings are used if there is no matching TextStyle object in getStyles collection either this object doesn’t specify a needed setting.

Parameters:

ParameterTypeDescription
valueParagraphStyle

setSpaceAfter(float value)

public void setSpaceAfter(float value)

Parameters:

ParameterTypeDescription
valuefloat

setSpaceAfter(Float value)

public void setSpaceAfter(Float value)

Sets the minimum amount of space after.

Parameters:

ParameterTypeDescription
valuejava.lang.Float

setSpaceBefore(float value)

public void setSpaceBefore(float value)

Parameters:

ParameterTypeDescription
valuefloat

setSpaceBefore(Float value)

public void setSpaceBefore(Float value)

Sets the minimum amount of space before.

Parameters:

ParameterTypeDescription
valuejava.lang.Float

setText(String value)

public final void setText(String value)

Sets the text. The string MUST NOT contain any characters of the value 10 (line feed).

Parameters:

ParameterTypeDescription
valuejava.lang.String

trim()

public final RichText trim()

Removes all leading and trailing white-space characters.

Returns: RichText - The RichText.

trim(char trimChar)

public final RichText trim(char trimChar)

Removes all leading and trailing instances of a character.

Parameters:

ParameterTypeDescription
trimCharcharThe trim char.

Returns: RichText - The RichText.

trim(char[] trimChars)

public final RichText trim(char[] trimChars)

Removes all leading and trailing occurrences of a set of characters specified in an array.

Parameters:

ParameterTypeDescription
trimCharschar[]The trim chars.

Returns: RichText - The RichText.

trimEnd()

public final RichText trimEnd()

Removes all the trailing white-space characters.

Returns: RichText - The RichText.

trimEnd(char trimChar)

public final RichText trimEnd(char trimChar)

Removes all the trailing occurrences of a character.

Parameters:

ParameterTypeDescription
trimCharcharThe trim char.

Returns: RichText - The RichText.

trimEnd(char[] trimChars)

public final RichText trimEnd(char[] trimChars)

Removes all the trailing occurrences of a set of characters specified in an array.

Parameters:

ParameterTypeDescription
trimCharschar[]The trim chars.

Returns: RichText - The RichText.

trimStart()

public final RichText trimStart()

Removes all the leading white-space characters.

Returns: RichText - The RichText.

trimStart(char trimChar)

public final RichText trimStart(char trimChar)

Removes all the leading occurrences of a specified character.

Parameters:

ParameterTypeDescription
trimCharcharThe trim char.

Returns: RichText - The RichText.

trimStart(char[] trimChars)

public final RichText trimStart(char[] trimChars)

Removes all the leading occurrences of a set of characters specified in an array.

Parameters:

ParameterTypeDescription
trimCharschar[]The trim chars.

Returns: RichText - The RichText.