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 aString
expression token by token. Blank characters will be skipped.
-
-
Field Summary
Fields Modifier and Type Field 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 ornull
if 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 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()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in 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:
next
in interfacejava.util.Iterator<java.lang.String>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<java.lang.String>
-
getPos
public int getPos()
Get the actual character position in the string.- Returns:
- The actual character position.
-
-