Constructs an AttributedString instance with the subrange of
the given attributed text represented by
AttributedCharacterIterator. Only attributes that match the
given attributes will be incorporated into the instance. If the
given range produces an empty text, all attributes will be
discarded. Note that any attributes wrapped by an Annotation
object are discarded for a subrange of the original attribute
range.
Parameters:
-
text - The text for this attributed string.
-
beginIndex - Index of the first character of the range.
-
endIndex - Index of the character following the last character
of the range.
-
attributes - Specifies attributes to be extracted
from the text. If null is specified, all available attributes will
be used.
Throws:
-
NullPointerException - if
text
or
attributes
is null.
-
IllegalArgumentException - if the subrange given by
beginIndex and endIndex is out of the text range.
See Also:
Annotation
,