Class Expression.Tokenizer

java.lang.Object
org.apache.felix.gogo.runtime.Expression.Tokenizer
All Implemented Interfaces:
Iterator<String>
Enclosing class:
Expression

private class Expression.Tokenizer extends Object implements Iterator<String>
Expression tokenizer that allows to iterate over a String expression token by token. Blank characters will be skipped.
  • Field Details

    • pos

      private int pos
      Actual position in expression string.
    • input

      private String input
      The original input expression.
    • previousToken

      private String previousToken
      The previous token or null if none.
  • Constructor Details

    • Tokenizer

      public Tokenizer(String input)
      Creates a new tokenizer for an expression.
      Parameters:
      input - The expression string.
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<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 String next()
      Specified by:
      next in interface Iterator<String>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<String>
    • getPos

      public int getPos()
      Get the actual character position in the string.
      Returns:
      The actual character position.