Skip to content

Most visited

Recently visited

navigation
Added in API level 1

AttributedCharacterIterator

public interface AttributedCharacterIterator
implements CharacterIterator

java.text.AttributedCharacterIterator


Extends the CharacterIterator interface, adding support for iterating over attributes and not only characters. An AttributedCharacterIterator also allows the user to find runs and their limits. Runs are defined as ranges of characters that all have the same attributes with the same values.

Summary

Nested classes

class AttributedCharacterIterator.Attribute

Defines keys for text attributes. 

Inherited constants

From interface java.text.CharacterIterator

Public methods

abstract Set<AttributedCharacterIterator.Attribute> getAllAttributeKeys()

Returns a set of attributes present in the AttributedCharacterIterator.

abstract Object getAttribute(AttributedCharacterIterator.Attribute attribute)

Returns the value stored in the attribute for the current character.

abstract Map<AttributedCharacterIterator.AttributeObject> getAttributes()

Returns a map of all attributes of the current character.

abstract int getRunLimit(AttributedCharacterIterator.Attribute attribute)

Returns the index of the last character in the run that has the same attribute value for the given attribute as the current character.

abstract int getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> attributes)

Returns the index of the last character in the run that has the same attribute values for the attributes in the set as the current character.

abstract int getRunLimit()

Returns the index of the last character in the run having the same attributes as the current character.

abstract int getRunStart()

Returns the index of the first character in the run that has the same attributes as the current character.

abstract int getRunStart(AttributedCharacterIterator.Attribute attribute)

Returns the index of the first character in the run that has the same attribute value for the given attribute as the current character.

abstract int getRunStart(Set<? extends AttributedCharacterIterator.Attribute> attributes)

Returns the index of the first character in the run that has the same attribute values for the attributes in the set as the current character.

Inherited methods

From interface java.text.CharacterIterator

Public methods

getAllAttributeKeys

Added in API level 1
Set<AttributedCharacterIterator.Attribute> getAllAttributeKeys ()

Returns a set of attributes present in the AttributedCharacterIterator. An empty set is returned if no attributes were defined.

Returns
Set<AttributedCharacterIterator.Attribute> a set of attribute keys; may be empty.

getAttribute

Added in API level 1
Object getAttribute (AttributedCharacterIterator.Attribute attribute)

Returns the value stored in the attribute for the current character. If the attribute was not defined then null is returned.

Parameters
attribute AttributedCharacterIterator.Attribute: the attribute for which the value should be returned.
Returns
Object the value of the requested attribute for the current character or null if it was not defined.

getAttributes

Added in API level 1
Map<AttributedCharacterIterator.AttributeObject> getAttributes ()

Returns a map of all attributes of the current character. If no attributes were defined for the current character then an empty map is returned.

Returns
Map<AttributedCharacterIterator.AttributeObject> a map of all attributes for the current character or an empty map.

getRunLimit

Added in API level 1
int getRunLimit (AttributedCharacterIterator.Attribute attribute)

Returns the index of the last character in the run that has the same attribute value for the given attribute as the current character.

Parameters
attribute AttributedCharacterIterator.Attribute: the attribute which the run is based on.
Returns
int the index of the last character of the current run.

getRunLimit

Added in API level 1
int getRunLimit (Set<? extends AttributedCharacterIterator.Attribute> attributes)

Returns the index of the last character in the run that has the same attribute values for the attributes in the set as the current character.

Parameters
attributes Set: the set of attributes which the run is based on.
Returns
int the index of the last character of the current run.

getRunLimit

Added in API level 1
int getRunLimit ()

Returns the index of the last character in the run having the same attributes as the current character.

Returns
int the index of the last character of the current run.

getRunStart

Added in API level 1
int getRunStart ()

Returns the index of the first character in the run that has the same attributes as the current character.

Returns
int the index of the last character of the current run.

getRunStart

Added in API level 1
int getRunStart (AttributedCharacterIterator.Attribute attribute)

Returns the index of the first character in the run that has the same attribute value for the given attribute as the current character.

Parameters
attribute AttributedCharacterIterator.Attribute: the attribute which the run is based on.
Returns
int the index of the last character of the current run.

getRunStart

Added in API level 1
int getRunStart (Set<? extends AttributedCharacterIterator.Attribute> attributes)

Returns the index of the first character in the run that has the same attribute values for the attributes in the set as the current character.

Parameters
attributes Set: the set of attributes which the run is based on.
Returns
int the index of the last character of the current run.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.