|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.lang.base.AbstractCharIterator
public abstract class AbstractCharIterator
This is an abstract base implementation of the CharIterator
interface. It allows to implement a lookahead CharIterator easier:
Simply extend this class and implement findNext(). From your
constructor or initializer call findFirst().
ATTENTION:
Do NOT forget to call findFirst() from your constructor or your
iterator will always be empty.
| Field Summary | |
|---|---|
private char |
next
The next char to iterate. |
| Fields inherited from interface net.sf.mmm.util.lang.api.CharIterator |
|---|
END_OF_ITERATOR |
| Constructor Summary | |
|---|---|
AbstractCharIterator()
The constructor. |
|
| Method Summary | |
|---|---|
protected void |
findFirst()
This method has to be called from the constructor of the implementing class. |
protected abstract char |
findNext()
This method tries to find the next element. |
boolean |
hasNext()
This method determines whether there is a next char
available or the end of this iterator has been reached. |
char |
next()
This method returns the next character to iterate or CharIterator.END_OF_ITERATOR if the end of this iterator has been reached. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private char next
| Constructor Detail |
|---|
public AbstractCharIterator()
| Method Detail |
|---|
protected final void findFirst()
protected abstract char findNext()
next element.
null if done.public boolean hasNext()
next char
available or the end of this iterator has been reached.
hasNext in interface CharIteratortrue if there is at least one next
char available, or false if the end of this iterator
has been reached and further calls of CharIterator.next() will return
CharIterator.END_OF_ITERATOR.CharIterator.next(),
Iterator.hasNext()public char next()
CharIterator.END_OF_ITERATOR if the end of this iterator has been reached. If
CharIterator.END_OF_ITERATOR is returned further calls will always return
CharIterator.END_OF_ITERATOR.
next in interface CharIteratorCharIterator.END_OF_ITERATOR if the end of this
iterator has been reached.Iterator.next()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||