Class InlineMatch.TextMatch
java.lang.Object
com.samsthenerd.inline.api.matching.InlineMatch.TextMatch
- All Implemented Interfaces:
InlineMatch
- Enclosing interface:
- InlineMatch
A match representing some text.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.samsthenerd.inline.api.matching.InlineMatch
InlineMatch.DataMatch, InlineMatch.TextMatch
-
Constructor Summary
ConstructorsConstructorDescriptionTextMatch
(net.minecraft.text.Text text) Makes a TextMatch with the given 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
-
Constructor Details
-
TextMatch
public TextMatch(net.minecraft.text.Text text) Makes a TextMatch with the given text- Parameters:
text
-
-
-
Method Details
-
accept
public int accept(net.minecraft.text.CharacterVisitor visitor, int index, net.minecraft.text.Style currentStyle) Description copied from interface:InlineMatch
Supplies styled characters- Specified by:
accept
in interfaceInlineMatch
- 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
public int charLength()Description copied from interface:InlineMatch
Gets the length of this match- Specified by:
charLength
in interfaceInlineMatch
- Returns:
- the number of characters we plan to give the visitor.
-