@Test public void oneAndTwoArgFunctions() throws Exception { System.out.println(" alternate one or two arg functions"); String[] names = { "round", "log" }; List<String> oneArg = Arrays.asList("D"); List<String> twoArg = Arrays.asList("D", "D"); for (String name : names) { assertNotNull(FunctionLookup.getInfo(name, oneArg)); assertNotNull(FunctionLookup.getInfo(name, twoArg)); } }
public static FunctionInfo getInfo(String jiffleName, List<String> argTypes) throws UndefinedFunctionException { for (FunctionInfo info : lookup) { if (info.matches(jiffleName, argTypes)) { return info; } } throw new UndefinedFunctionException("Unrecognized function: " + jiffleName); }
FunctionLookup { public static FunctionInfo getInfo(String jiffleName, List<String> argTypes) throws UndefinedFunctionException { for (FunctionInfo info : lookup) { if (info.matches(jiffleName, argTypes)) { return info; } } throw new UndefinedFunctionException("Unrecognized function: " + jiffleName); } }
FunctionLookup { public static FunctionInfo getInfo(String jiffleName, List<String> argTypes) throws UndefinedFunctionException { for (FunctionInfo info : lookup) { if (info.matches(jiffleName, argTypes)) { return info; } } throw new UndefinedFunctionException("Unrecognized function: " + jiffleName); }  }
FunctionLookup { public static FunctionInfo getInfo(String jiffleName, List<String> argTypes) throws UndefinedFunctionException { for (FunctionInfo info : lookup) { if (info.matches(jiffleName, argTypes)) { return info; } } throw new UndefinedFunctionException("Unrecognized function: " + jiffleName); }  static boolean isDefined(String jiffleName, List<String> argTypes); static FunctionInfo getInfo(String jiffleName, List<String> argTypes); static String getRuntimeExpr(String jiffleName, List<String> argTypes); static String getReturnType(String jiffleName); }
FunctionLookup { public static FunctionInfo getInfo(String jiffleName, List<String> argTypes) throws UndefinedFunctionException { for (FunctionInfo info : lookup) { if (info.matches(jiffleName, argTypes)) { return info; } } throw new UndefinedFunctionException("Unrecognized function: " + jiffleName); }  static boolean isDefined(String jiffleName, List<String> argTypes); static FunctionInfo getInfo(String jiffleName, List<String> argTypes); static String getRuntimeExpr(String jiffleName, List<String> argTypes); static String getReturnType(String jiffleName);  }