public final class TextWithMnemonic
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
TextWithMnemonic |
append(java.lang.String textToAppend)
Appends given text to the current text.
|
TextWithMnemonic |
dropMnemonic()
Drops a mnemonic
|
boolean |
equals(java.lang.Object o) |
static TextWithMnemonic |
fromPlainText(java.lang.String text)
Creates a TextWithMnemonic object from a plain text without mnemonic.
|
int |
getMnemonic() |
int |
getMnemonicIndex() |
java.lang.String |
getText() |
int |
hashCode() |
boolean |
hasMnemonic() |
static TextWithMnemonic |
parse(java.lang.String text)
Parses a text in text-with-mnemonic format.
|
TextWithMnemonic |
replaceFirst(java.lang.String target,
java.lang.String replacement)
Replaces the first occurrence of given target text with the given replacement text.
|
TextWithMnemonic |
setMnemonicAt(int index)
Sets mnemonic at given index
|
java.lang.String |
toString() |
public java.lang.String getText()
public int getMnemonic()
public int getMnemonicIndex()
public boolean hasMnemonic()
public TextWithMnemonic dropMnemonic()
public TextWithMnemonic setMnemonicAt(int index)
index
- index, must be within the text
string.public TextWithMnemonic append(java.lang.String textToAppend)
textToAppend
- text to append. Appended text is treated as a plain text, without mnemonic, so mnemonic position is unchanged.public TextWithMnemonic replaceFirst(java.lang.String target, java.lang.String replacement)
target
- the target text to be replacedreplacement
- the replacement text which is treated as a plain text, without mnemonic.public static TextWithMnemonic fromPlainText(java.lang.String text)
text
- a plain text to create a TextWithMnemonic object frompublic static TextWithMnemonic parse(java.lang.String text)
text
- text to parsepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
parse(String)
method would create
a TextWithMnemonic object which is equal to this.