Name
AttributedString
Synopsis
This class represents text
and associated attributes. An AttributedString can
be defined in terms of an underlying
AttributedCharacterIterator or an underlying
String. Additional attributes can be specified
with the addAttribute( ) and
addAttributes( ) methods. getIterator(
) returns an AttributedCharacterIterator
over the AttributedString or over a specified
portion of the string. Note that two of the getIterator(
) methods take an array of Attribute
keys as an argument. These methods return an
AttributedCharacterIterator that ignores all
attributes that are not in the specified array. If the array argument
is null, however, the returned iterator contains
all attributes.
public class AttributedString { // Public Constructors public AttributedString(String text); public AttributedString(AttributedCharacterIterator text); public AttributedString(String text, java.util.Map<? extends AttributedCharacterIterator.Attribute,?> attributes); public AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex); public AttributedString(AttributedCharacterIterator text, int beginIndex, int endIndex, AttributedCharacterIterator.Attribute[ ] attributes); // Public Instance Methods public void addAttribute(AttributedCharacterIterator.Attribute attribute, Object value); public void addAttribute(AttributedCharacterIterator.Attribute attribute, Object value, int beginIndex, int endIndex); public void addAttributes(java.util.Map<? extends AttributedCharacterIterator.Attribute,?> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access