AttributedString

public class AttributedString extends Object

An AttributedString holds text and related attribute information. It may be used as the actual data storage in some cases where a text reader wants to access attributed text through the AttributedCharacterIterator interface.

An attribute is a key/value pair, identified by the key. No two attributes on a given character can have the same key.

The values for an attribute are immutable, or must not be mutated by clients or storage. They are always passed by reference, and not cloned.

Public Constructor Summary

AttributedString(String text)
Constructs an AttributedString instance with the given text.
AttributedString(String text, Map<? extends AttributedCharacterIterator.Attribute, ?> attributes)
Constructs an AttributedString instance with the given text and attributes.
AttributedString(AttributedCharacterIterator text)
Constructs an AttributedString instance with the given attributed text represented by AttributedCharacterIterator.
AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex)
Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator.
AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex, Attribute[] attributes)
Constructs an AttributedString instance with the subrange of the given attributed text represented by AttributedCharacterIterator.

Public Method Summary

void
addAttribute(AttributedCharacterIterator.Attribute attribute, Object value)
Adds an attribute to the entire string.
void