Package chemaxon.jep

Interface CustomFunction


@PublicApi public interface CustomFunction
Base interface for custom Chemical Terms functions. To call a custom function, add it to the configuration XML passed to the constructors of Evaluator.
  • Field Details

    • TRUE

      static final Double TRUE
    • FALSE

      static final Double FALSE
    • NAN

      static final Double NAN
    • UNDECIDED

      static final Object UNDECIDED
    • VARARG

      static final int VARARG
      The multiplicity that marks a function vararg.
      See Also:
  • Method Details

    • minParameterCount

      int minParameterCount()
      Returns the minimum parameter count of this function. This method should always return the same value for instances of the same class.
    • maxParameterCount

      int maxParameterCount()
      Returns the maximum parameter count of this function, or VARARG if there is no maximum. This method should always return the same value for instances of the same class.
    • evaluate

      Object evaluate(Map<String,String> properties, List<Object> parameters, ChemContext context) throws JepException
      Evaluates this function.
      Parameters:
      properties - the properties defined in the configuration XML for this function, never null
      parameters - the actual parameters of this function
      context - The chemical context this function is evaluated in. If no context was given during, a dummy object is passed that does not declare any methods or variables, so this parameter is never null.
      Returns:
      the result of the function evaluation
      Throws:
      JepException - on error