net.sf.parcinj
Class OneOrMore<P extends Processor>

java.lang.Object
  extended by net.sf.parcinj.AbstractSymbol<P>
      extended by net.sf.parcinj.OneOrMore<P>
All Implemented Interfaces:
Symbol<P>

public class OneOrMore<P extends Processor>
extends AbstractSymbol<P>

Wraps a symbol which will be executed one or more times.


Constructor Summary
OneOrMore(Symbol<P> symbol)
          Creates an instance for the specified symbol.
 
Method Summary
 void doProcess(TokenIterator iterator, P processor)
          Processes the current symbol of the specified iterator by the wrapped symbol and repeats this as long as the symbol still matches.
 MatchingResult matches(Token token)
          Returns MatchingResult.OK if the wrapped symbol matches.
 
Methods inherited from class net.sf.parcinj.AbstractSymbol
followedBy, oneOrMoreTimes, optional, or, process, zeroOrMoreTimes, zeroOrMoreTimesSeparatedBy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneOrMore

public OneOrMore(Symbol<P> symbol)
Creates an instance for the specified symbol.

Method Detail

matches

public MatchingResult matches(Token token)
Returns MatchingResult.OK if the wrapped symbol matches.

Parameters:
token - Token to be checked. Will be null if beyond last token.

doProcess

public void doProcess(TokenIterator iterator,
                      P processor)
Processes the current symbol of the specified iterator by the wrapped symbol and repeats this as long as the symbol still matches.

Specified by:
doProcess in class AbstractSymbol<P extends Processor>
processor - Processor who does the actual processing.