java.text
Interface AttributedCharacterIterator

All Superinterfaces:
CharacterIterator, Cloneable

public interface AttributedCharacterIterator
extends CharacterIterator

This interface extends the 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.

Since:
1.2, 1.2

Nested Class Summary
static class AttributedCharacterIterator.Attribute
          Defines attribute keys that are used as text attributes.
 
Field Summary
 
Fields inherited from interface java.text.CharacterIterator
DONE
 
Method Summary
 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.
 
Methods inherited from interface java.text.CharacterIterator
clone, current, first, getBeginIndex, getEndIndex, getIndex, last, next, previous, setIndex
 

Method Detail

getAllAttributeKeys

Set<AttributedCharacterIterator.Attribute> getAllAttributeKeys()
Returns a list of all keys that are defined for the text range. This can be an empty list if no attributes are defined.

Returns:
A list of keys

getAttributes

Map<AttributedCharacterIterator.Attribute,Object> getAttributes()
Returns a Map of the attributes defined for the current character.

Returns:
A Map of the attributes for the current character.

getAttribute

Object getAttribute(AttributedCharacterIterator.Attribute attrib)
Returns the value of the specified attribute for the current character. If the attribute is not defined for the current character, null is returned.

Parameters:
attrib - The attribute to retrieve the value of.
Returns:
The value of the specified attribute

getRunStart

int getRunStart()
Returns the index of the first character in the run that contains all attributes defined for the current character.

Returns:
The start index of the run

getRunStart

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.

Parameters:
attribs - The Set of attributes.
Returns:
The start index of the run.

getRunStart

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.

Parameters:
attrib - The attribute.
Returns:
The start index of the run.

getRunLimit

int getRunLimit()
Returns the index of the character after the end of the run that contains all attributes defined for the current character.

Returns:
The end index of the run.

getRunLimit

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.

Parameters:
attribs - The Set of attributes.
Returns:
The end index of the run.

getRunLimit

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.

Parameters:
attrib - The attribute.
Returns:
The end index of the run.