public abstract class BaseText extends Object implements MutableText
Text.Serializer
StringVisitable.StyledVisitor<T>, StringVisitable.Visitor<T>
Modifier and Type | Field and Description |
---|---|
private OrderedText |
orderedText |
private Language |
previousLanguage |
protected List<Text> |
siblings |
private Style |
style |
EMPTY, TERMINATE_VISIT
Constructor and Description |
---|
BaseText() |
Modifier and Type | Method and Description |
---|---|
MutableText |
append(Text text)
Appends a text to this text's siblings.
|
OrderedText |
asOrderedText() |
String |
asString()
Returns the string representation of this text itself, excluding siblings.
|
abstract BaseText |
copy()
Copies the text itself, excluding the styles or siblings.
|
boolean |
equals(Object obj) |
List<Text> |
getSiblings()
Returns the siblings of this text.
|
Style |
getStyle()
Returns the style of this text.
|
int |
hashCode() |
MutableText |
setStyle(Style style)
Sets the style of this text.
|
MutableText |
shallowCopy()
Copies the text itself, the style, and the siblings.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
append, fillStyle, formatted, formatted, styled
asTruncatedString, getString, of, visit, visit, visitSelf, visitSelf
concat, concat, plain, styled
private OrderedText orderedText
private Style style
public MutableText append(Text text)
append
in interface MutableText
text
- the siblingpublic String asString()
public List<Text> getSiblings()
getSiblings
in interface Text
public MutableText setStyle(Style style)
setStyle
in interface MutableText
public Style getStyle()
public abstract BaseText copy()
Text
public final MutableText shallowCopy()
A shallow copy is made for the siblings.
shallowCopy
in interface Text
@Environment(value=CLIENT) public OrderedText asOrderedText()
asOrderedText
in interface Text