private class Expression.Tokenizer
extends java.lang.Object
implements java.util.Iterator<java.lang.String>
String
expression token by token. Blank characters will be skipped.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
input
The original input expression.
|
private int |
pos
Actual position in expression string.
|
private java.lang.String |
previousToken
The previous token or
null if none. |
Constructor and Description |
---|
Tokenizer(java.lang.String input)
Creates a new tokenizer for an expression.
|
Modifier and Type | Method and Description |
---|---|
int |
getPos()
Get the actual character position in the string.
|
boolean |
hasNext() |
java.lang.String |
next() |
private char |
peekNextChar()
Peek at the next character, without advancing the iterator.
|
void |
remove() |
private int pos
private java.lang.String input
private java.lang.String previousToken
null
if none.public Tokenizer(java.lang.String input)
input
- The expression string.public boolean hasNext()
hasNext
in interface java.util.Iterator<java.lang.String>
private char peekNextChar()
public java.lang.String next()
next
in interface java.util.Iterator<java.lang.String>
public void remove()
remove
in interface java.util.Iterator<java.lang.String>
public int getPos()