Package com.singularsys.jep.configurableparser.matchers

# Class NumberTokenMatcher

java.lang.Object
com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher
com.singularsys.jep.configurableparser.matchers.NumberTokenMatcher

All Implemented Interfaces:
  `TokenBuilder`, `TokenMatcher`, `Serializable`

Direct Known Subclasses:
  `BugsTest.CommaNumberTokenMatcher`, `HexNumberTokenMatcher`

public class NumberTokenMatcher extends RegExpTokenMatcher
Matches numbers. The jep NumberFactory is used to create the number.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NumberTokenMatcher(String regex)`
  `NumberTokenMatcher(Pattern pattern)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Token`
  `buildToken(String s)`
  Builds a token following a successful match.
  `static NumberTokenMatcher`
  `defaultNumberTokenMatcher()`
  Factory to create a matcher for decimal number without exponents
  `static NumberTokenMatcher`
  `exponentNumberTokenMatcher()`
  Factory to create a matcher for decimal number with or without exponents
  `void`
  `init(Jep jep)`
  Initialize the matcher when the Jep instance is known.

  ### Methods inherited from class com.singularsys.jep.configurableparser.matchers.RegExpTokenMatcher

  `match, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### NumberTokenMatcher

    public NumberTokenMatcher(Pattern pattern)

  - ### NumberTokenMatcher

    public NumberTokenMatcher(String regex)

- ## Method Details

  - ### buildToken

    public Token buildToken(String s) throws ParseException
    Description copied from class: `RegExpTokenMatcher`
    Builds a token following a successful match. Note new objects should be created each time as error reporting information is later attached to tokens.
    Specified by:
      `buildToken` in interface `TokenBuilder`
    Specified by:
      `buildToken` in class `RegExpTokenMatcher`
    Parameters:
      `s` - String representing the completed matched token
    Returns:
      the appropriate type of token.
    Throws:
      `ParseException`

  - ### defaultNumberTokenMatcher

    public static NumberTokenMatcher defaultNumberTokenMatcher()
    Factory to create a matcher for decimal number without exponents
    Returns:
      the matcher

  - ### exponentNumberTokenMatcher

    public static NumberTokenMatcher exponentNumberTokenMatcher()
    Factory to create a matcher for decimal number with or without exponents
    Returns:
      the matcher

  - ### init

    public void init(Jep jep)
    Description copied from interface: `TokenMatcher`
    Initialize the matcher when the Jep instance is known.
    Parameters:
      `jep` - Jep instance