net.sf.sfac.string
Interface CharIterator
- All Known Implementing Classes:
- AbstractCharIterator, ReaderCharIterator, StringCharIterator
public interface CharIterator
Char iterator: Iterate on the characted of any kind of character source.
The iterator can normalize the returned characters. The method returning normalized and non-normalized chars can be mixed in a
iteration.
- Author:
- Olivier Berlanger
|
Method Summary |
String |
getNormalizedString()
Get the content of this char iterator as a normalized string. |
char |
nextChar()
Get the next char of this iterator. |
char |
nextNormalizedChar()
Get the next char of this iterator. |
void |
reset()
Reset the internal pointer of this iterator to the first char. |
reset
void reset()
- Reset the internal pointer of this iterator to the first char.
nextChar
char nextChar()
- Get the next char of this iterator.
The returned char are not normalized. When no more characters are available, an zero char ('\0') is returned.
- Returns:
- the next char of this iterator or '\0' if no more characters are availbale.
nextNormalizedChar
char nextNormalizedChar()
- Get the next char of this iterator.
The chars returned by this method are normalized as following:
- Accentued chars replaced by the corresponding non-accentued char.
- All lowercase.
- Leading white space(s) removed.
- All non-letter or digit chars replaced by space.
- Any suite of white chars replaced by a single space.
When no more characters are available, an zero char ('\0') is returned.
- Returns:
- the next char of this iterator or '\0' if no more characters are availbale.
getNormalizedString
String getNormalizedString()
- Get the content of this char iterator as a normalized string.
The result will be:
- All lowercase.
- Trimmed.
- All non-letter or non-digit chars replaced by space.
- Any suite of white chars replaced by a single space.
- Returns:
- The content of this char iterator as a normalized string.
Copyright © 2012. All Rights Reserved.