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

RichText()

public RichText()

Initializes a new instance of the RichText class.

getLastModifiedTime()

public Date getLastModifiedTime()

Gets the last modified time.

Returns: java.util.Date

setLastModifiedTime(Date value)

public void setLastModifiedTime(Date value)

Sets the last modified time.

Parameters:

ParameterTypeDescription
valuejava.util.Date

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

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

getLength()

public final int getLength()

Returns: int

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

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

getAlignment()

public int getAlignment()

Gets the alignment.

Returns: int

setAlignment(int value)

public void setAlignment(int value)

Sets the alignment.

Parameters:

ParameterTypeDescription
valueint

getSpaceBefore()

public Float getSpaceBefore()

Gets the minimum amount of space before.

Returns: java.lang.Float

setSpaceBefore(Float value)

public void setSpaceBefore(Float value)

Sets the minimum amount of space before.

Parameters:

ParameterTypeDescription
valuejava.lang.Float

setSpaceBefore(float value)

public void setSpaceBefore(float value)

Parameters:

ParameterTypeDescription
valuefloat

getSpaceAfter()

public Float getSpaceAfter()

Gets the minimum amount of space after.

Returns: java.lang.Float

setSpaceAfter(Float value)

public void setSpaceAfter(Float value)

Sets the minimum amount of space after.

Parameters:

ParameterTypeDescription
valuejava.lang.Float

setSpaceAfter(float value)

public void setSpaceAfter(float value)

Parameters:

ParameterTypeDescription
valuefloat

getLineSpacing()

public Float getLineSpacing()

Gets the line spacing.

Returns: java.lang.Float

setLineSpacing(Float value)

public void setLineSpacing(Float value)

Sets the line spacing.

Parameters:

ParameterTypeDescription
valuejava.lang.Float

setLineSpacing(float value)

public void setLineSpacing(float value)

Parameters:

ParameterTypeDescription
valuefloat

getStyles()

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

Gets the styles.

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

getTextRuns()

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

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

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>

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.

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.

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.

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.

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.

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.

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.

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.

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.

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()

public final RichText trim()

Removes all leading and trailing white-space characters.

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.

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()

public final RichText trimStart()

Removes all the leading white-space characters.

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.

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()

public final RichText trimEnd()

Removes all the trailing white-space characters.

Returns: RichText - The RichText.

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_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 .

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, 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(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(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(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(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(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 .

clear()

public final RichText clear()

Clears content of this instance.

Returns: RichText - The RichText.

iterator()

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

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