Interface InlineMatch
- All Known Implementing Classes:
InlineMatch.DataMatch
,InlineMatch.TextMatch
public interface InlineMatch
Represents some match from a matcher.
A match is attached to some input text by a matcher and is expected to provide styled characters to the CharacterVisitor in place of the text segment it's attached to.
InlineMatch.DataMatch
will work for most use cases.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
A match representing some data.static class
A match representing some text. -
Method Summary
Modifier and TypeMethodDescriptionint
accept
(net.minecraft.text.CharacterVisitor visitor, int index, net.minecraft.text.Style currentStyle) Supplies styled charactersint
Gets the length of this match
-
Method Details
-
accept
int accept(net.minecraft.text.CharacterVisitor visitor, int index, net.minecraft.text.Style currentStyle) Supplies styled characters- Parameters:
visitor
- accepts the styled charactersindex
- the number of characters given to this visitor so farcurrentStyle
- the style that this text would otherwise have.- Returns:
- the number of characters supplied to the visitor.
-
charLength
int charLength()Gets the length of this match- Returns:
- the number of characters we plan to give the visitor.
-