Unified Typesetting API M1-20040817

de.inghuimische.uta
Interface UtaCharacterIterator

All Known Implementing Classes:
SimpleCharIterator

public interface UtaCharacterIterator

Interface for iterating over an UtaAttributedString.

Java works with UTF-16 internally. The char data type is therefore only able to represent 216 different Unicode code points directly. Code points above U+FFFF must be represented by surrogate pairs. To be able to represent all code points directly CharacterIterator interface of the Java Foundation Classes would have to return an int value.

This interface is modeled after the ICU4J interface UForwardCharacterIterator and the AttributedCharacterIterator. Cause ICU classes regulary become part of the Java Foundation Classes this should be a quite future save solution. Java 1.5 provides a bit better support for surrogates in its String class.

Author:
Christian Ziesemer

Field Summary
static int DONE
           
 
Method Summary
 int currentCodePoint()
          Returns the current code point.
 Map getAttributes()
          Returns the attributes for the current code point.
 int getIndex()
          Returns the current index.
 int nextCodePoint()
          Returns the current code point and increments the pointer to the next code point.
 

Field Detail

DONE

public static final int DONE
See Also:
Constant Field Values
Method Detail

nextCodePoint

public int nextCodePoint()
Returns the current code point and increments the pointer to the next code point. DONE is returned if there are no further code points.

Returns:
The current code point or DONE if there are no further code points.

getIndex

public int getIndex()
Returns the current index.

Returns:
The current index.

currentCodePoint

public int currentCodePoint()
Returns the current code point.

Returns:
The current code point.

getAttributes

public Map getAttributes()
Returns the attributes for the current code point.

Returns:
The attributes for the current code point.

Unified Typesetting API M1-20040817


An inghuimische.de project.
Copyright (C) 2004 Christian Ziesemer; See the Mozilla Public License for more details.