public interface AttributedCharacterIterator extends CharacterIterator
CharacterIterator
interface
in order to support iteration over character attributes as well as
over the characters themselves.
In addition to attributes of specific characters, this interface supports the concept of the "attribute run", which is an attribute that is defined for a particular value across an entire range of characters or which is undefined over a range of characters.
Modifier and Type | Interface and Description |
---|---|
static class |
AttributedCharacterIterator.Attribute
Defines attribute keys that are used as text attributes.
|
DONE
Modifier and Type | Method and Description |
---|---|
Set<AttributedCharacterIterator.Attribute> |
getAllAttributeKeys()
Returns a list of all keys that are defined for the
text range.
|
Object |
getAttribute(AttributedCharacterIterator.Attribute attrib)
Returns the value of the specified attribute for the
current character.
|
Map<AttributedCharacterIterator.Attribute,Object> |
getAttributes()
Returns a
Map of the attributes defined for the current
character. |
int |
getRunLimit()
Returns the index of the character after the end of the run
that contains all attributes defined for the current character.
|
int |
getRunLimit(AttributedCharacterIterator.Attribute attrib)
Returns the index of the character after the end of the run
that contains the specified attribute defined for the current character.
|
int |
getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> attribs)
Returns the index of the character after the end of the run
that contains all attributes in the specified
Set defined
for the current character. |
int |
getRunStart()
Returns the index of the first character in the run that
contains all attributes defined for the current character.
|
int |
getRunStart(AttributedCharacterIterator.Attribute attrib)
Returns the index of the first character in the run that
contains the specified attribute defined for the current character.
|
int |
getRunStart(Set<? extends AttributedCharacterIterator.Attribute> attribs)
Returns the index of the first character in the run that
contains all attributes in the specified
Set defined for
the current character. |
clone, current, first, getBeginIndex, getEndIndex, getIndex, last, next, previous, setIndex
Set<AttributedCharacterIterator.Attribute> getAllAttributeKeys()
Map<AttributedCharacterIterator.Attribute,Object> getAttributes()
Map
of the attributes defined for the current
character.Map
of the attributes for the current character.Object getAttribute(AttributedCharacterIterator.Attribute attrib)
null
is returned.attrib
- The attribute to retrieve the value of.int getRunStart()
int getRunStart(Set<? extends AttributedCharacterIterator.Attribute> attribs)
Set
defined for
the current character.attribs
- The Set
of attributes.int getRunStart(AttributedCharacterIterator.Attribute attrib)
attrib
- The attribute.int getRunLimit()
int getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> attribs)
Set
defined
for the current character.attribs
- The Set
of attributes.int getRunLimit(AttributedCharacterIterator.Attribute attrib)
attrib
- The attribute.