public class FormulaFunctions extends Object
Constructor and Description |
---|
FormulaFunctions() |
Modifier and Type | Method and Description |
---|---|
static Collection<FormulaFunction> |
findArgTypeMatch(List<Class<?>> argTypes,
Collection<FormulaFunction> formulaFunctions)
Finds the functions that match the given types as arguments.
|
static FormulaFunction |
findFirstMatch(List<Object> arguments,
Collection<FormulaFunction> formulaFunctions)
Finds the first function that can accept the given values as arguments.
|
static String |
format(String function,
List<String> args)
Given the function name and a string representation of the arguments,
returns the properly formatted string representation of the whole
expression.
|
static String |
formatSignature(FormulaFunction function)
Returns a string representation of the function that will include
the function name, argument types, argument names and the result
type.
|
static boolean |
matchArgumentCount(int nArguments,
FormulaFunction function)
Check whether the function will accept the given number of arguments.
|
static boolean |
matchArgumentTypes(List<Object> arguments,
FormulaFunction function)
Check whether the function will accept the given list of values as arguments.
|
static boolean |
matchArgumentTypes(List<Object> arguments,
FormulaFunction function,
boolean allowNull)
Checks whether the function will accept the given arguments.
|
public static boolean matchArgumentTypes(List<Object> arguments, FormulaFunction function)
arguments
- the possible valuesfunction
- a functionpublic static boolean matchArgumentTypes(List<Object> arguments, FormulaFunction function, boolean allowNull)
arguments
- the argumentsfunction
- a functionallowNull
- whether the function should allow null argumentspublic static boolean matchArgumentCount(int nArguments, FormulaFunction function)
nArguments
- the number of argumentsfunction
- a functionpublic static FormulaFunction findFirstMatch(List<Object> arguments, Collection<FormulaFunction> formulaFunctions)
arguments
- the possible valuesformulaFunctions
- a collection of functionspublic static Collection<FormulaFunction> findArgTypeMatch(List<Class<?>> argTypes, Collection<FormulaFunction> formulaFunctions)
argTypes
- the possible typesformulaFunctions
- a collection of functionspublic static String formatSignature(FormulaFunction function)
function
- a functionpublic static String format(String function, List<String> args)
function
- the function nameargs
- the argumentsCopyright © 2010–2015. All rights reserved.