java.lang.Object | |
↳ | java.text.AttributedString |
Holds a string with attributes describing the characters of this string.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an
AttributedString from an AttributedCharacterIterator , which represents attributed text. | |||||||||||
Constructs an
AttributedString from a range of the text contained
in the specified AttributedCharacterIterator , starting at start and ending at end . | |||||||||||
Constructs an
AttributedString from a range of the text contained
in the specified AttributedCharacterIterator , starting at start , ending at end and it will copy the attributes defined in
the specified set. | |||||||||||
Creates an
AttributedString from the given text. | |||||||||||
Creates an
AttributedString from the given text and the
attributes. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Applies a given attribute to the given range of this string.
| |||||||||||
Applies a given attribute to this string.
| |||||||||||
Applies a given set of attributes to the given range of the string.
| |||||||||||
Returns an
AttributedCharacterIterator that gives access to the
contents of this attributed string starting at index start up to
index end . | |||||||||||
Returns an
AttributedCharacterIterator that gives access to the
complete content of this attributed string. | |||||||||||
Returns an
AttributedCharacterIterator that gives access to the
complete content of this attributed string. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Constructs an AttributedString
from an AttributedCharacterIterator
, which represents attributed text.
iterator | the AttributedCharacterIterator that contains the text
for this attributed string.
|
---|
Constructs an AttributedString
from a range of the text contained
in the specified AttributedCharacterIterator
, starting at start
and ending at end
. All attributes will be copied to this
attributed string.
iterator | the AttributedCharacterIterator that contains the text
for this attributed string. |
---|---|
start | the start index of the range of the copied text. |
end | the end index of the range of the copied text. |
IllegalArgumentException | if start is less than first index of
iterator , end is greater than the last
index + 1 in iterator or if start > end .
|
---|
Constructs an AttributedString
from a range of the text contained
in the specified AttributedCharacterIterator
, starting at start
, ending at end
and it will copy the attributes defined in
the specified set. If the set is null
then all attributes are
copied.
iterator | the AttributedCharacterIterator that contains the text
for this attributed string. |
---|---|
start | the start index of the range of the copied text. |
end | the end index of the range of the copied text. |
attributes | the set of attributes that will be copied, or all if it is
null . |
IllegalArgumentException | if start is less than first index of
iterator , end is greater than the last index +
1 in iterator or if start > end .
|
---|
Creates an AttributedString
from the given text.
value | the text to take as base for this attributed string. |
---|
Creates an AttributedString
from the given text and the
attributes. The whole text has the given attributes applied.
value | the text to take as base for this attributed string. |
---|---|
attributes | the attributes that the text is associated with. |
IllegalArgumentException | if the length of value is 0 but the size of attributes is greater than 0. |
---|---|
NullPointerException | if value is null .
|
Applies a given attribute to the given range of this string.
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. |
IllegalArgumentException | if start < 0 , end is greater than the length
of this string, or if start >= end . |
---|---|
NullPointerException | if attribute is null .
|
Applies a given attribute to this string.
attribute | the attribute that will be applied to this string. |
---|---|
value | the value of the attribute that will be applied to this string. |
IllegalArgumentException | if the length of this attributed string is 0. |
---|---|
NullPointerException | if attribute is null .
|
Applies a given set of attributes to the given range of the string.
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. |
IllegalArgumentException | if start < 0 , end is greater than the length
of this string, or if start >= 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.
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. |
AttributedCharacterIterator
.
Returns an AttributedCharacterIterator
that gives access to the
complete content of this attributed string.
AttributedCharacterIterator
.
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.
attributes | the array containing attributes that will be in the new iterator if they are defined for this text. |
---|
AttributedCharacterIterator
.