|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.databene.commons.StringCharacterIterator
public class StringCharacterIterator
Supports iterating the characters of a String.
This is especially useful for writing parsers that iterate over Strings,
since it encapsules the cursor index.
Created: 18.08.2006 19:21:45
| Constructor Summary | |
|---|---|
StringCharacterIterator(java.lang.String source)
Creates an iterator that starts at the String's beginning |
|
StringCharacterIterator(java.lang.String source,
int index)
Creates an iterator that starts at a specified position |
|
| Method Summary | |
|---|---|
void |
assertNext(char c)
|
int |
column()
|
boolean |
hasNext()
Tells if the iterator has not reached the String's end. |
int |
index()
|
int |
line()
|
char |
next()
|
java.lang.String |
parsedSubstring(int from)
|
java.lang.String |
parseLetters()
|
char |
peekNext()
|
void |
pushBack()
Pushes back the cursor by one character. |
java.lang.String |
remainingText()
|
void |
remove()
Implements the remove() operation of the Iterator interface, raising an UnsupportedOperationException. |
void |
skipWhitespace()
|
java.lang.String |
substring(int from,
int to)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StringCharacterIterator(java.lang.String source)
public StringCharacterIterator(java.lang.String source,
int index)
| Method Detail |
|---|
public boolean hasNext()
hasNext in interface CharacterIteratorpublic char next()
next in interface CharacterIteratorIterator.next()public void remove()
Iterator.remove()public char peekNext()
public void pushBack()
public int index()
public void skipWhitespace()
public java.lang.String parseLetters()
public java.lang.String remainingText()
public java.lang.String substring(int from,
int to)
public java.lang.String parsedSubstring(int from)
public void assertNext(char c)
public int line()
public int column()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||