Top Description Fields Constructors Methods
com.ibm.icu.text

public final Class StringCharacterIterator

extends Object
implements CharacterIterator
Class Inheritance
All Implemented Interfaces
java.text.CharacterIterator, java.lang.Cloneable
Annotations
@Deprecated
Imports
java.text.CharacterIterator, com.ibm.icu.util.ICUCloneNotSupportedException

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

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private String

Constructor Summary

AccessConstructor and Description
public
StringCharacterIterator(String text)

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Constructs an iterator with an initial index of 0.
public
StringCharacterIterator(String
The String to be iterated over
text
,
int
Initial iterator position
pos
)

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Constructs an iterator with the specified initial index.
public
StringCharacterIterator(String
The String to be iterated over
text
,
int
Index of the first character
begin
,
int
Index of the character following the last character
end
,
int
Initial iterator position
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.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

A copy of this
clone
()

Overrides java.lang.Object.clone.

Implements java.text.CharacterIterator.clone.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Creates a copy of this iterator.
public char
current()

Implements java.text.CharacterIterator.current.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Implements CharacterIterator.current() for String.
public boolean

Returns:

true if the given obj is the same as this StringCharacterIterator object; false otherwise.
equals
(Object
the StringCharacterIterator object to be compared with.
obj
)

Overrides java.lang.Object.equals.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Compares the equality of two StringCharacterIterator objects.
public char
first()

Implements java.text.CharacterIterator.first.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Implements CharacterIterator.first() for String.
public int
getBeginIndex()

Implements java.text.CharacterIterator.getBeginIndex.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Implements CharacterIterator.getBeginIndex() for String.
public int
getEndIndex()

Implements java.text.CharacterIterator.getEndIndex.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Implements CharacterIterator.getEndIndex() for String.
public int
getIndex()

Implements java.text.CharacterIterator.getIndex.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Implements CharacterIterator.getIndex() for String.
public int

Returns:

A hash code
hashCode
()

Overrides java.lang.Object.hashCode.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Computes a hashcode for this iterator.
public char
last()

Implements java.text.CharacterIterator.last.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Implements CharacterIterator.last() for String.
public char
next()

Implements java.text.CharacterIterator.next.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Implements CharacterIterator.next() for String.
public char
previous()

Implements java.text.CharacterIterator.previous.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Implements CharacterIterator.previous() for String.
public char
setIndex(int
the position within the text. Valid values range from getBeginIndex() to getEndIndex(). An IllegalArgumentException is thrown if an invalid value is supplied.
p
)

Implements java.text.CharacterIterator.setIndex.

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Implements CharacterIterator.setIndex() for String.
public void
setText(String
The String to be iterated over
text
)

Deprecated ICU 2.4. Use java.text.StringCharacterIterator instead.
Reset this iterator to point to a new string.
Inherited from java.lang.Object:
finalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

beginback to summary
private int begin
endback to summary
private int end
posback to summary
private int pos
textback to summary
private String text

Constructor Detail

StringCharacterIteratorback to summary
public StringCharacterIterator(String text)

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Constructs an iterator with an initial index of 0.

Annotations
@Deprecated
StringCharacterIteratorback to summary
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:String

The String to be iterated over

pos:int

Initial iterator position

Annotations
@Deprecated
StringCharacterIteratorback to summary
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:String

The String to be iterated over

begin:int

Index of the first character

end:int

Index of the character following the last character

pos:int

Initial iterator position

Annotations
@Deprecated

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Implements java.text.CharacterIterator.clone.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Creates a copy of this iterator.

Returns:Object

A copy of this

Annotations
@Deprecated
currentback to summary
public char current()

Implements java.text.CharacterIterator.current.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.current() for String.

Returns:char

Doc from java.text.CharacterIterator.current.

the character at the current position or DONE if the current position is off the end of the text.

Annotations
@Deprecated
See Also
CharacterIterator#current
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Compares the equality of two StringCharacterIterator objects.

Parameters
obj:Object

the StringCharacterIterator object to be compared with.

Returns:boolean

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

Annotations
@Deprecated
firstback to summary
public char first()

Implements java.text.CharacterIterator.first.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.first() for String.

Returns:char

Doc from java.text.CharacterIterator.first.

the first character in the text, or DONE if the text is empty

Annotations
@Deprecated
See Also
CharacterIterator#first
getBeginIndexback to summary
public int getBeginIndex()

Implements java.text.CharacterIterator.getBeginIndex.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.getBeginIndex() for String.

Returns:int

Doc from java.text.CharacterIterator.getBeginIndex.

the index at which the text begins.

Annotations
@Deprecated
See Also
CharacterIterator#getBeginIndex
getEndIndexback to summary
public int getEndIndex()

Implements java.text.CharacterIterator.getEndIndex.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.getEndIndex() for String.

Returns:int

Doc from java.text.CharacterIterator.getEndIndex.

the index after the last character in the text

Annotations
@Deprecated
See Also
CharacterIterator#getEndIndex
getIndexback to summary
public int getIndex()

Implements java.text.CharacterIterator.getIndex.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.getIndex() for String.

Returns:int

Doc from java.text.CharacterIterator.getIndex.

the current index.

Annotations
@Deprecated
See Also
CharacterIterator#getIndex
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Computes a hashcode for this iterator.

Returns:int

A hash code

Annotations
@Deprecated
lastback to summary
public char last()

Implements java.text.CharacterIterator.last.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.last() for String.

Returns:char

Doc from java.text.CharacterIterator.last.

the last character in the text, or DONE if the text is empty

Annotations
@Deprecated
See Also
CharacterIterator#last
nextback to summary
public char next()

Implements java.text.CharacterIterator.next.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.next() for String.

Returns:char

Doc from java.text.CharacterIterator.next.

the character at the new position or DONE if the new position is off the end of the text range.

Annotations
@Deprecated
See Also
CharacterIterator#next
previousback to summary
public char previous()

Implements java.text.CharacterIterator.previous.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.previous() for String.

Returns:char

Doc from java.text.CharacterIterator.previous.

the character at the new position or DONE if the current position is equal to getBeginIndex().

Annotations
@Deprecated
See Also
CharacterIterator#previous
setIndexback to summary
public char setIndex(int p)

Implements java.text.CharacterIterator.setIndex.

Deprecated

ICU 2.4. Use java.text.StringCharacterIterator instead.

Implements CharacterIterator.setIndex() for String.

Parameters
p:int

Doc from java.text.CharacterIterator.setIndex.

the position within the text. Valid values range from getBeginIndex() to getEndIndex(). An IllegalArgumentException is thrown if an invalid value is supplied.

Returns:char

Doc from java.text.CharacterIterator.setIndex.

the character at the specified position or DONE if the specified position is equal to getEndIndex()

Annotations
@Deprecated
See Also
CharacterIterator#setIndex
setTextback to summary
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:String

The String to be iterated over

Annotations
@Deprecated