Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Header Files   Compound Members   File Members  

UCharCharacterIterator Class Reference

A concrete subclass of CharacterIterator that iterates over the characters in a UnicodeString. More...

#include <uchriter.h>

Class diagram for UCharCharacterIterator:

CharacterIterator

List of all members.


Public Members

 UCharCharacterIterator (const UChar* text, int32_t len)
Create an iterator over the UnicodeString referred to by "text". More...

 UCharCharacterIterator (const UCharCharacterIterator& that)
Copy constructor. More...

 ~UCharCharacterIterator ()
Destructor. More...

UCharCharacterIterator& operator= (const UCharCharacterIterator& that)
Assignment operator. More...

virtual bool_t operator== (const CharacterIterator& that) const
Returns true if the iterators iterate over the same range of the same string and are pointing at the same character. More...

virtual int32_t hashCode (void) const
Generates a hash code for this iterator. More...

virtual CharacterIteratorclone (void) const
Returns a new StringCharacterIterator referring to the same character in the same range of the same string as this one. More...

virtual UChar first (void)
Sets the iterator to refer to the first character in its iteration range, and returns that character,. More...

virtual UChar last (void)
Sets the iterator to refer to the last character in its iteration range, and returns that character. More...

virtual UChar setIndex (UTextOffset pos)
Sets the iterator to refer to the "position"-th character in the UnicodeString the iterator refers to, and returns that character. More...

virtual UChar current (void) const
Returns the character the iterator currently refers to. More...

virtual UChar next (void)
Advances to the next character in the iteration range (toward last()), and returns that character. More...

virtual UChar previous (void)
Advances to the previous character in the iteration rance (toward first()), and returns that character. More...

virtual UTextOffset startIndex (void) const
Returns the numeric index of the first character in this iterator's iteration range. More...

virtual UTextOffset endIndex (void) const
Returns the numeric index of the character immediately BEYOND the last character in this iterator's iteration range. More...

virtual UTextOffset getIndex (void) const
Returns the numeric index in the underlying UnicodeString of the character the iterator currently refers to (i.e., the character returned by current()). More...

virtual void setText (const UChar* newText, int32_t newTextLength)
Sets the iterator to iterate over a new range of text. More...

virtual void getText (UnicodeString& result)
Copies the UnicodeString under iteration into the UnicodeString referred to by "result". More...

virtual UClassID getDynamicClassID (void) const
Return a class ID for this object (not really public). More...


Static Public Members

UClassID getStaticClassID (void)
Return a class ID for this class (not really public). More...


Detailed Description

A concrete subclass of CharacterIterator that iterates over the characters in a UnicodeString.

It's possible not only to create an iterator that iterates over an entire UnicodeString, but also to create only that iterates over only a subrange of a UnicodeString (iterators over different subranges of the same UnicodeString don't compare equal).


Member Function Documentation

UCharCharacterIterator::UCharCharacterIterator (const UChar * text, int32_t len)

Create an iterator over the UnicodeString referred to by "text".

The iteration range is the whole string, and the starting position is 0.

Stable:

UCharCharacterIterator::UCharCharacterIterator (const UCharCharacterIterator & that)

Copy constructor.

The new iterator iterates over the same range of the same string as "that", and its initial position is the same as "that"'s current position.

Stable:

UCharCharacterIterator::~UCharCharacterIterator ()

Destructor.

Stable:

UCharCharacterIterator & UCharCharacterIterator::operator= (const UCharCharacterIterator & that)

Assignment operator.

*this is altered to iterate over the sane range of the same string as "that", and refers to the same character within that string as "that" does.

Stable:

virtual bool_t UCharCharacterIterator::operator== (const CharacterIterator & that) const [virtual]

Returns true if the iterators iterate over the same range of the same string and are pointing at the same character.

Stable:

Reimplemented from CharacterIterator.

virtual int32_t UCharCharacterIterator::hashCode (void) const [virtual]

Generates a hash code for this iterator.

Stable:

Reimplemented from CharacterIterator.

virtual CharacterIterator * UCharCharacterIterator::clone (void) const [virtual]

Returns a new StringCharacterIterator referring to the same character in the same range of the same string as this one.

The caller must delete the new iterator.

Stable:

Reimplemented from CharacterIterator.

virtual UChar UCharCharacterIterator::first (void) [virtual]

Sets the iterator to refer to the first character in its iteration range, and returns that character,.

Draft:

Reimplemented from CharacterIterator.

virtual UChar UCharCharacterIterator::last (void) [virtual]

Sets the iterator to refer to the last character in its iteration range, and returns that character.

Draft:

Reimplemented from CharacterIterator.

virtual UChar UCharCharacterIterator::setIndex (UTextOffset pos) [virtual]

Sets the iterator to refer to the "position"-th character in the UnicodeString the iterator refers to, and returns that character.

If the index is outside the iterator's iteration range, the behavior of the iterator is undefined.

Draft:

Reimplemented from CharacterIterator.

virtual UChar UCharCharacterIterator::current (void) const [virtual]

Returns the character the iterator currently refers to.

Draft:

Reimplemented from CharacterIterator.

virtual UChar UCharCharacterIterator::next (void) [virtual]

Advances to the next character in the iteration range (toward last()), and returns that character.

If there are no more characters to return, returns DONE.

Draft:

Reimplemented from CharacterIterator.

virtual UChar UCharCharacterIterator::previous (void) [virtual]

Advances to the previous character in the iteration rance (toward first()), and returns that character.

If there are no more characters to return, returns DONE.

Draft:

Reimplemented from CharacterIterator.

virtual UTextOffset UCharCharacterIterator::startIndex (void) const [virtual]

Returns the numeric index of the first character in this iterator's iteration range.

Stable:

Reimplemented from CharacterIterator.

virtual UTextOffset UCharCharacterIterator::endIndex (void) const [virtual]

Returns the numeric index of the character immediately BEYOND the last character in this iterator's iteration range.

Stable:

Reimplemented from CharacterIterator.

virtual UTextOffset UCharCharacterIterator::getIndex (void) const [virtual]

Returns the numeric index in the underlying UnicodeString of the character the iterator currently refers to (i.e., the character returned by current()).

Stable:

Reimplemented from CharacterIterator.

virtual void UCharCharacterIterator::setText (const UChar * newText, int32_t newTextLength) [virtual]

Sets the iterator to iterate over a new range of text.

Draft:

virtual void UCharCharacterIterator::getText (UnicodeString & result) [virtual]

Copies the UnicodeString under iteration into the UnicodeString referred to by "result".

Even if this iterator iterates across only a part of this string, the whole string is copied.

Parameters:
result   Receives a copy of the text under iteration.
Stable:

Reimplemented from CharacterIterator.

virtual UClassID UCharCharacterIterator::getDynamicClassID (void) const [inline, virtual]

Return a class ID for this object (not really public).

Stable:

Reimplemented from CharacterIterator.

UClassID UCharCharacterIterator::getStaticClassID (void) [inline, static]

Return a class ID for this class (not really public).

Stable:

The documentation for this class was generated from the following file:
Generated at Thu Feb 10 15:31:06 2000 for icu by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999