MCPcopy Index your code
hub / github.com/Aghajari/MathParser / addFunctions

Method addFunctions

MathParser/src/com/aghajari/math/Functions.java:71–87  ·  view source on GitHub ↗
(Collection<Method> methods, List<MathFunction> functions)

Source from the content-addressed store, hash-verified

69 }
70
71 static void addFunctions(Collection<Method> methods, List<MathFunction> functions) {
72 Math:
73 for (Method method : methods) {
74 if (method.getReturnType() == double.class) {
75 if (method.getParameterCount() != 1 ||
76 (method.getParameterTypes()[0] != Object[].class && method.getParameterTypes()[0] != Double[].class)) {
77 int index = 0;
78 for (Class<?> cls : method.getParameterTypes()) {
79 if (cls != double.class && cls != String.class && !(index == 0 && cls == MathParser.class))
80 continue Math;
81 index++;
82 }
83 }
84 functions.add(MathFunction.wrap(method));
85 }
86 }
87 }
88
89 static MathFunction getFunction(String src, int index, String name, int count, List<MathFunction> innerFunctions) throws MathFunctionInvalidArgumentsException {
90 MathFunction function = null;

Callers 2

addFunctionsMethod · 0.95
FunctionsClass · 0.95

Calls 2

wrapMethod · 0.95
getParameterCountMethod · 0.65

Tested by

no test coverage detected