pobs.parser
Class PLimit

java.lang.Object
  extended bypobs.PParser
      extended bypobs.parser.PLimit
All Implemented Interfaces:
PObject

public class PLimit
extends PParser

Semantic parser which verifies if a parsed numeric (double) value is within specified, inclusive boundaries.

Author:
Martijn W. van der Lee

Constructor Summary
PLimit(PObject parser, double min, double max)
          Sole constructor.
 
Method Summary
 PMatch parse(PScanner input, long begin, PContext context)
          Matches if the numerical (parsed as double) data parsed by the specified parser is within the specified minimal and maximum boundaries, inclusive.
 
Methods inherited from class pobs.PParser
addControl, getErrorInfo, process, setErrorInfo, setMatchAction, setMismatchAction
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PLimit

public PLimit(PObject parser,
              double min,
              double max)
Sole constructor. If the lower boundary is greater than the higher boundary, this parser will never match; boundaries are not interchangeable.

Parameters:
parser - the parser which will handle parsing the number
min - the lower boundary
max - the higher boundary
Method Detail

parse

public PMatch parse(PScanner input,
                    long begin,
                    PContext context)
Matches if the numerical (parsed as double) data parsed by the specified parser is within the specified minimal and maximum boundaries, inclusive.

Parameters:
input - Input to be parsed.
begin - Index of first character of input to be parsed.
context - Parsing context.
Returns:
Parsing result.