Class TAttributedString

java.lang.Object
org.teavm.classlib.java.text.TAttributedString

public class TAttributedString extends Object
  • Constructor Details

  • Method Details

    • addAttribute

      public void addAttribute(TAttributedCharacterIterator.Attribute attribute, Object value)
      Applies a given attribute to this string.
      Parameters:
      attribute - the attribute that will be applied to this string.
      value - the value of the attribute that will be applied to this string.
      Throws:
      IllegalArgumentException - if the length of this attributed string is 0.
      NullPointerException - if attribute is null.
    • addAttribute

      public void addAttribute(TAttributedCharacterIterator.Attribute attribute, Object value, int start, int end)
      Applies a given attribute to the given range of this string.
      Parameters:
      attribute - the attribute that will be applied to this string.
      value - the value of the attribute that will be applied to this string.
      start - the start of the range where the attribute will be applied.
      end - the end of the range where the attribute will be applied.
      Throws:
      IllegalArgumentException - if start < 0, end is greater than the length of this string, or if start >= end.
      NullPointerException - if attribute is null.
    • addAttributes

      public void addAttributes(TMap<? extends TAttributedCharacterIterator.Attribute,?> attributes, int start, int end)
      Applies a given set of attributes to the given range of the string.
      Parameters:
      attributes - the set of attributes that will be applied to this string.
      start - the start of the range where the attribute will be applied.
      end - the end of the range where the attribute will be applied.
      Throws:
      IllegalArgumentException - if start < 0, end is greater than the length of this string, or if start >= end.
    • getIterator

      public TAttributedCharacterIterator getIterator()
      Returns an AttributedCharacterIterator that gives access to the complete content of this attributed string.
      Returns:
      the newly created AttributedCharacterIterator.
    • getIterator

      Returns an AttributedCharacterIterator that gives access to the complete content of this attributed string. Only attributes contained in attributes are available from this iterator if they are defined for this text.
      Parameters:
      attributes - the array containing attributes that will be in the new iterator if they are defined for this text.
      Returns:
      the newly created AttributedCharacterIterator.
    • getIterator

      public TAttributedCharacterIterator getIterator(TAttributedCharacterIterator.Attribute[] attributes, int start, int end)
      Returns an AttributedCharacterIterator that gives access to the contents of this attributed string starting at index start up to index end. Only attributes contained in attributes are available from this iterator if they are defined for this text.
      Parameters:
      attributes - the array containing attributes that will be in the new iterator if they are defined for this text.
      start - the start index of the iterator on the underlying text.
      end - the end index of the iterator on the underlying text.
      Returns:
      the newly created AttributedCharacterIterator.