TextReplacement

Inheritance: java.lang.Object

public class TextReplacement

Represents a textual replacement information.


Learn more

Constructors

Constructor Description
TextReplacement(int index, String original, String replacement) Initializes a new instance of TextReplacement class.

Methods

Method Description
getIndex() Gets an index of the matched text within source string.
getOriginalText() Gets the original matched string.
getReplacement() Gets the string, replacing OriginalText.
toString() Provides text replacement description and its position.

TextReplacement(int index, String original, String replacement)

public TextReplacement(int index, String original, String replacement)

Initializes a new instance of TextReplacement class.

Parameters:

Parameter Type Description
index int Index of a matched text within source string
original java.lang.String Original matched string
replacement java.lang.String String, replacing OriginalText in source string

getIndex()

public final int getIndex()

Gets an index of the matched text within source string.

Returns: int - An index of the matched text within source string.

getOriginalText()

public final String getOriginalText()

Gets the original matched string.

Returns: java.lang.String - The original matched string.

getReplacement()

public final String getReplacement()

Gets the string, replacing OriginalText.

Returns: java.lang.String - The string, replacing OriginalText.

toString()

public String toString()

Provides text replacement description and its position.

Returns: java.lang.String - Replacement description