APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.icu.impl

public Class CharacterIteratorWrapper

extends UCharacterIterator
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
java.text.CharacterIterator, jdk.internal.icu.text.UCharacterIterator

This class is a wrapper around CharacterIterator and implements the UCharacterIterator protocol
Author
ram

Field Summary

Modifier and TypeField and Description
private CharacterIterator
Inherited from jdk.internal.icu.text.UCharacterIterator:
DONE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CharacterIteratorWrapper
clone()

Overrides jdk.internal.icu.text.UCharacterIterator.clone.

Creates a clone of this iterator.

public int
public int
getIndex()

Implements abstract jdk.internal.icu.text.UCharacterIterator.getIndex.

Gets the current index in text.

public int
getLength()

Implements abstract jdk.internal.icu.text.UCharacterIterator.getLength.

Returns the length of the text

public int
getText(char[] fillIn, int offset)

Implements abstract jdk.internal.icu.text.UCharacterIterator.getText.

Fills the buffer with the underlying text storage of the iterator If the buffer capacity is not enough a exception is thrown.

public int
next()

Implements abstract jdk.internal.icu.text.UCharacterIterator.next.

Returns the UTF16 code unit at index, and increments to the next code unit (post-increment semantics).

public int
previous()

Implements abstract jdk.internal.icu.text.UCharacterIterator.previous.

Decrement to the position of the previous code unit in the text, and return it (pre-decrement semantics).

public void
setIndex(int index)

Implements abstract jdk.internal.icu.text.UCharacterIterator.setIndex.

Sets the index to the specified index in the text.

Inherited from jdk.internal.icu.text.UCharacterIterator:
getInstancegetInstancegetInstancegetTextgetTextmoveCodePointIndexnextCodePointpreviousCodePointsetToStart

Field Detail

iteratorback to summary
private CharacterIterator iterator

Constructor Detail

CharacterIteratorWrapperback to summary
public CharacterIteratorWrapper(CharacterIterator iter)

Method Detail

cloneback to summary
public CharacterIteratorWrapper clone()

Overrides jdk.internal.icu.text.UCharacterIterator.clone.

Creates a clone of this iterator. Clones the underlying character iterator.

See Also
UCharacterIterator#clone()
currentback to summary
public int current()
See Also
UCharacterIterator#current()
getIndexback to summary
public int getIndex()

Implements abstract jdk.internal.icu.text.UCharacterIterator.getIndex.

Doc from jdk.internal.icu.text.UCharacterIterator.getIndex.

Gets the current index in text.

See Also
UCharacterIterator#getIndex()
getLengthback to summary
public int getLength()

Implements abstract jdk.internal.icu.text.UCharacterIterator.getLength.

Doc from jdk.internal.icu.text.UCharacterIterator.getLength.

Returns the length of the text

See Also
UCharacterIterator#getLength()
getTextback to summary
public int getText(char[] fillIn, int offset)

Implements abstract jdk.internal.icu.text.UCharacterIterator.getText.

Doc from jdk.internal.icu.text.UCharacterIterator.getText.

Fills the buffer with the underlying text storage of the iterator If the buffer capacity is not enough a exception is thrown. The capacity of the fill in buffer should at least be equal to length of text in the iterator obtained by calling getLength(). Usage:

UChacterIterator iter = new UCharacterIterator.getInstance(text);
        char[] buf = new char[iter.getLength()];
        iter.getText(buf);

        OR
        char[] buf= new char[1];
        int len = 0;
        for(;;){
            try{
                len = iter.getText(buf);
                break;
            }catch(IndexOutOfBoundsException e){
                buf = new char[iter.getLength()];
            }
        }
See Also
UCharacterIterator#getText(char[])
nextback to summary
public int next()

Implements abstract jdk.internal.icu.text.UCharacterIterator.next.

Doc from jdk.internal.icu.text.UCharacterIterator.next.

Returns the UTF16 code unit at index, and increments to the next code unit (post-increment semantics). If index is out of range, DONE is returned, and the iterator is reset to the limit of the text.

See Also
UCharacterIterator#next()
previousback to summary
public int previous()

Implements abstract jdk.internal.icu.text.UCharacterIterator.previous.

Doc from jdk.internal.icu.text.UCharacterIterator.previous.

Decrement to the position of the previous code unit in the text, and return it (pre-decrement semantics). If the resulting index is less than 0, the index is reset to 0 and DONE is returned.

See Also
UCharacterIterator#previous()
setIndexback to summary
public void setIndex(int index)

Implements abstract jdk.internal.icu.text.UCharacterIterator.setIndex.

Doc from jdk.internal.icu.text.UCharacterIterator.setIndex.

Sets the index to the specified index in the text.

See Also
UCharacterIterator#setIndex(int)