com.ibm.icu.text

Class StringCharacterIterator

Implemented Interfaces:
CharacterIterator

public final class StringCharacterIterator
extends Object
implements CharacterIterator

StringCharacterIterator implements the CharacterIterater protocol for a String. The StringCharacterIterator class iterates over the entire String.
See Also:
CharacterIterator

Constructor Summary

StringCharacterIterator(String text)
Deprecated. ICU 2.4.
StringCharacterIterator(String text, int pos)
Deprecated. ICU 2.4.
StringCharacterIterator(String text, int begin, int end, int pos)
Deprecated. ICU 2.4.

Method Summary

Object
clone()
Deprecated. ICU 2.4.
char
current()
Deprecated. ICU 2.4.
boolean
equals(Object obj)
Deprecated. ICU 2.4.
char
first()
Deprecated. ICU 2.4.
int
getBeginIndex()
Deprecated. ICU 2.4.
int
getEndIndex()
Deprecated. ICU 2.4.
int
getIndex()
Deprecated. ICU 2.4.
int
hashCode()
Deprecated. ICU 2.4.
char
last()
Deprecated. ICU 2.4.
char
next()
Deprecated. ICU 2.4.
char
previous()
Deprecated. ICU 2.4.
char
setIndex(int p)
Deprecated. ICU 2.4.
void
setText(String text)
Deprecated. ICU 2.4.

Constructor Details

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 Details

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) 2006 IBM Corporation and others.