com.ibm.icu.text

Class StringCharacterIterator

public final class StringCharacterIterator extends Object implements CharacterIterator

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

StringCharacterIterator implements the CharacterIterater protocol for a String. The StringCharacterIterator class iterates over the entire String.

See Also: CharacterIterator

Constructor Summary
StringCharacterIterator(String text)
Constructs an iterator with an initial index of 0.
StringCharacterIterator(String text, int pos)
Constructs an iterator with the specified initial index.
StringCharacterIterator(String text, int begin, int end, int pos)
Constructs an iterator over the given range of the given string, with the index set at the specified position.
Method Summary
Objectclone()
Creates a copy of this iterator.
charcurrent()
Implements CharacterIterator.current() for String.
booleanequals(Object obj)
Compares the equality of two StringCharacterIterator objects.
charfirst()
Implements CharacterIterator.first() for String.
intgetBeginIndex()
Implements CharacterIterator.getBeginIndex() for String.
intgetEndIndex()
Implements CharacterIterator.getEndIndex() for String.
intgetIndex()
Implements CharacterIterator.getIndex() for String.
inthashCode()
Computes a hashcode for this iterator.
charlast()
Implements CharacterIterator.last() for String.
charnext()
Implements CharacterIterator.next() for String.
charprevious()
Implements CharacterIterator.previous() for String.
charsetIndex(int p)
Implements CharacterIterator.setIndex() for String.
voidsetText(String text)
Reset this iterator to point to a new string.

Constructor Detail

StringCharacterIterator

public StringCharacterIterator(String text)

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Constructs an iterator with an initial index of 0.

StringCharacterIterator

public StringCharacterIterator(String text, int pos)

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Constructs an iterator with the specified initial index.

Parameters: text The String to be iterated over pos Initial iterator position

StringCharacterIterator

public StringCharacterIterator(String text, int begin, int end, int pos)

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Constructs an iterator over the given range of the given string, with the index set at the specified position.

Parameters: text The String to be iterated over begin Index of the first character end Index of the character following the last character pos Initial iterator position

Method Detail

clone

public Object clone()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Creates a copy of this iterator.

Returns: A copy of this

current

public char current()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.current() for String.

See Also: CharacterIterator#current

equals

public boolean equals(Object obj)

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Compares the equality of two StringCharacterIterator objects.

Parameters: obj the StringCharacterIterator object to be compared with.

Returns: true if the given obj is the same as this StringCharacterIterator object; false otherwise.

first

public char first()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.first() for String.

See Also: CharacterIterator#first

getBeginIndex

public int getBeginIndex()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.getBeginIndex() for String.

See Also: CharacterIterator#getBeginIndex

getEndIndex

public int getEndIndex()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.getEndIndex() for String.

See Also: CharacterIterator#getEndIndex

getIndex

public int getIndex()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.getIndex() for String.

See Also: CharacterIterator#getIndex

hashCode

public int hashCode()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Computes a hashcode for this iterator.

Returns: A hash code

last

public char last()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.last() for String.

See Also: CharacterIterator#last

next

public char next()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.next() for String.

See Also: CharacterIterator#next

previous

public char previous()

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.previous() for String.

See Also: CharacterIterator#previous

setIndex

public char setIndex(int p)

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.setIndex() for String.

See Also: CharacterIterator#setIndex

setText

public void setText(String text)

Deprecated: ICU 2.4. Use java.text.StringCharacterIterator instead.

Reset this iterator to point to a new string. This package-visible method is used by other java.text classes that want to avoid allocating new StringCharacterIterator objects every time their setText method is called.

Parameters: text The String to be iterated over

Copyright (c) 2007 IBM Corporation and others.