MCPcopy Create free account
hub / github.com/Aghajari/MathParser / getFunction

Method getFunction

MathParser/src/com/aghajari/math/Functions.java:89–109  ·  view source on GitHub ↗
(String src, int index, String name, int count, List<MathFunction> innerFunctions)

Source from the content-addressed store, hash-verified

87 }
88
89 static MathFunction getFunction(String src, int index, String name, int count, List<MathFunction> innerFunctions) throws MathFunctionInvalidArgumentsException {
90 MathFunction function = null;
91 if (innerFunctions != null)
92 for (MathFunction func : innerFunctions)
93 if (func.compareNames(name)) {
94 function = func;
95 if (func.getParameterCount() == count || func.getParameterCount() == -1)
96 return func;
97 }
98
99 for (MathFunction func : functions)
100 if (func.compareNames(name)) {
101 function = func;
102 if (func.getParameterCount() == count || func.getParameterCount() == -1)
103 return func;
104 }
105
106 if (function != null)
107 throw new MathFunctionInvalidArgumentsException(src, index, function, count);
108 return null;
109 }
110
111 /* Built-in functions */
112

Callers 1

calculateMethod · 0.95

Calls 2

compareNamesMethod · 0.65
getParameterCountMethod · 0.65

Tested by

no test coverage detected