Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Interface java.text.AttributedCharacterIterator

Implementing Classes:
StyledStringIterator

public interface AttributedCharacterIterator
extends CharacterIterator
An AttributedCharacterIterator allows iteration through both text and related attribute information.

An attribute is a name/value pair, identified by name. No two attributes on a given character can have the same name.

The values for an attribute are immutable, or must not be mutated by clients or storage. They are always passed by reference, and not cloned.

A run with respect to an attribute is a maximum text range for which:

A run with respect to a set of attributes is a maximum text range for which this condition is met for each member attribute.

The returned indexes are limited to the range of the iterator.

The returned attribute information is limited to runs that contain the current character.

Attribute names are strings that are often predefined by Java libraries. Names for some basic text attributes are defined in AttributedCharacterIterator. ISVs may define attribute names such as "com.isv.isvPackage.isvAttribute".

See Also:
AttributeSet, AttributedString, Annotation

Field Summary
static String  INPUT_METHOD_SEGMENT
Constant for the attribute "input method segment".
static String  LANGUAGE
Constant for the attribute "language".
static String  READING
Constant for the attribute "reading".
 

Method Summary
Enumeration  getAllAttributeNames()
Returns the names of all attributes defined on the iterator's text range.
Object  getAttribute(String attributeName)
Returns the value of the named attribute for the current character.
AttributeSet  getAttributes()
Returns an attribute set with the attributes defined on the current character.
int  getRunLimit()
Returns the index of the first character following the run with respect to all attributes containing the current character.
int  getRunLimit(String attributeName)
Returns the index of the first character following the run with respect to the named attribute containing the current character.
int  getRunLimit(Enumeration attributeNames)
Returns the index of the first character following the run with respect to the named attributes containing the current character.
int  getRunStart()
Returns the index of the first character of the run with respect to all attributes containing the current character.
int  getRunStart(String attributeName)
Returns the index of the first character of the run with respect to the named attribute containing the current character.
int  getRunStart(Enumeration attributeNames)
Returns the index of the first character of the run with respect to the named attributes containing the current character.
 

Field Detail

LANGUAGE

public static final String LANGUAGE
Constant for the attribute "language". The value of this attribute should be an instance of Locale.
See Also:
Locale

READING

public static final String READING
Constant for the attribute "reading". In languages where the written form and the pronunciation of a word are only loosely related (such as Japanese), it is often necessary to store the reading (pronunciation) along with the written form. This is an annotation attribute. The value should be an instance of Annotation holding an instance of String.
See Also:
Annotation, String

INPUT_METHOD_SEGMENT

public static final String INPUT_METHOD_SEGMENT
Constant for the attribute "input method segment". Input methods often break up text into segments, which usually correspond to words. This is an annotation attribute. The value should be an instance of Annotation holding a value of null.
See Also:
String
Method Detail

getRunStart

public int getRunStart()
Returns the index of the first character of the run with respect to all attributes containing the current character.

getRunStart

public int getRunStart(String attributeName)
Returns the index of the first character of the run with respect to the named attribute containing the current character.

getRunStart

public int getRunStart(Enumeration attributeNames)
Returns the index of the first character of the run with respect to the named attributes containing the current character.

getRunLimit

public int getRunLimit()
Returns the index of the first character following the run with respect to all attributes containing the current character.

getRunLimit

public int getRunLimit(String attributeName)
Returns the index of the first character following the run with respect to the named attribute containing the current character.

getRunLimit

public int getRunLimit(Enumeration attributeNames)
Returns the index of the first character following the run with respect to the named attributes containing the current character.

getAttributes

public AttributeSet getAttributes()
Returns an attribute set with the attributes defined on the current character.

getAttribute

public Object getAttribute(String attributeName)
Returns the value of the named attribute for the current character. Returns null if the attribute is not defined.
Parameters:
attributeName - the name of the attribute whose value is requested.

getAllAttributeNames

public Enumeration getAllAttributeNames()
Returns the names of all attributes defined on the iterator's text range. The enumeration is empty if no attributes are defined.

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.