Class InlineMatch.DataMatch

java.lang.Object
com.samsthenerd.inline.api.matching.InlineMatch.DataMatch
All Implemented Interfaces:
InlineMatch
Enclosing interface:
InlineMatch

public static class InlineMatch.DataMatch extends Object implements InlineMatch
A match representing some data.
  • Field Details

    • data

      public final InlineData data
    • style

      public final net.minecraft.text.Style style
  • Constructor Details

    • DataMatch

      public DataMatch(InlineData data, net.minecraft.text.Style style)
      Makes a DataMatch with the given data and style
      Parameters:
      data -
      style -
    • DataMatch

      public DataMatch(InlineData data)
      Makes a DataMatch with the given data
      Parameters:
      data -
  • 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 interface InlineMatch
      Parameters:
      visitor - accepts the styled characters
      index - the number of characters given to this visitor so far
      currentStyle - 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 interface InlineMatch
      Returns:
      the number of characters we plan to give the visitor.