Interface ParseImp

All Known Implementing Classes:
ParseHelper

public interface ParseImp
The ParseImp class defines an interface for all classes that help parse mathematical expressions by setting up a correspondence between variable names and their type and index value. The variable's index value will be used in the subsequent evaluation operation to retrieve the variable value. The variable's type is used in expression parsing to determine type conversions and the expression output type.
Since:
3.4.0
Author:
Peter Hollemans
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the index of the specified variable.
    Gets the type of a variable as a primitive wrapper class name.
  • Method Details

    • indexOfVariable

      int indexOfVariable(String varName)
      Gets the index of the specified variable. The index is used to recall the variable value from an EvaluateImp instance.
      Parameters:
      varName - the variable name.
      Returns:
      the variable index, or -1 if not available.
    • typeOfVariable

      String typeOfVariable(String varName)
      Gets the type of a variable as a primitive wrapper class name.
      Parameters:
      varName - the variable name.
      Returns:
      the variable class name: Byte, Short, Integer, Long, Float, or Double. The returned value is null if the variable type is unknown.