Package org.apache.felix.gogo.runtime
Class Expression.Tokenizer
- java.lang.Object
-
- org.apache.felix.gogo.runtime.Expression.Tokenizer
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.String>
- Enclosing class:
- Expression
private class Expression.Tokenizer extends java.lang.Object implements java.util.Iterator<java.lang.String>Expression tokenizer that allows to iterate over aStringexpression token by token. Blank characters will be skipped.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringinputThe original input expression.private intposActual position in expression string.private java.lang.StringpreviousTokenThe previous token ornullif none.
-
Constructor Summary
Constructors Constructor Description Tokenizer(java.lang.String input)Creates a new tokenizer for an expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPos()Get the actual character position in the string.booleanhasNext()java.lang.Stringnext()private charpeekNextChar()Peek at the next character, without advancing the iterator.voidremove()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<java.lang.String>
-
peekNextChar
private char peekNextChar()
Peek at the next character, without advancing the iterator.- Returns:
- The next character or character 0, if at end of string.
-
next
public java.lang.String next()
- Specified by:
nextin interfacejava.util.Iterator<java.lang.String>
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<java.lang.String>
-
getPos
public int getPos()
Get the actual character position in the string.- Returns:
- The actual character position.
-
-