Class AttributedStringBuilder

java.lang.Object
games.stendhal.client.gui.textformat.AttributedStringBuilder
All Implemented Interfaces:
AttributedTextSink<TextAttributeSet>

public class AttributedStringBuilder extends Object implements AttributedTextSink<TextAttributeSet>
A builder for AtttributedStrings, that works quite similarly to StringBuilder.
  • Constructor Details

    • AttributedStringBuilder

      public AttributedStringBuilder()
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • append

      public void append(String s, TextAttributeSet attrs)
      Append a string with attributes.
      Specified by:
      append in interface AttributedTextSink<TextAttributeSet>
      Parameters:
      s - string
      attrs - attributes to be used for the appended part
    • toAttributedString

      public AttributedString toAttributedString()
      Get the built AttributedString.
      Returns:
      AttributedString with the appended parts and attributes that have been defined for those at the time of appending