Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
pr_methods:calculate [2023/04/04 07:17] – removed - external edit (Unknown date) 127.0.0.1pr_methods:calculate [2023/05/08 06:47] (current) sean
Line 1: Line 1:
 +{{tag>Index Programmers_Reference Methods IFunctionLibrary_Interface Calculate}}
 +
 +====calculate (String, Object [], INodeHelper)====
 +<code java>public Object calculate (String functionName, Object [] parameters, INodeHelper helper)</code>
 +
 +This method is what the function is all about – it performs the required calculation and returns the result.
 +
 +===Parameters===
 +|''functionName''|the name of the function in the library that needs to be calculated|
 +|''parameters''|the values of function parameters as specified in a rule where the function is used. The given array contains Java objects corresponding to different attribute types (''String'', ''Integer'', ''DateHolder'' etc – see a complete list in the [[docs:3500:appendix_a|Appendix A]])|
 +|''helper''|a call-back interface. Should not be used by custom function libraries.|
 +
 +===Returns===
 +The result of the calculation as a Java object of the type corresponding to the attribute types – see [[docs:3500:appendix_a|Appendix A]]. If the function value cannot be calculated for whatever reason (for example, the number of parameters or their types are wrong), ''null'' should be returned.