Package org.qdl_lang.evaluate
Class FunctionEvaluator
- java.lang.Object
- 
- org.qdl_lang.evaluate.AbstractEvaluator
- 
- org.qdl_lang.evaluate.FunctionEvaluator
 
 
- 
- All Implemented Interfaces:
- Serializable,- EvaluatorInterface
 
 public class FunctionEvaluator extends AbstractEvaluator Created by Jeff Gaynor 
 on 1/22/20 at 10:53 AM- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.qdl_lang.evaluate.AbstractEvaluatorAbstractEvaluator.CommonKeyIterator, AbstractEvaluator.fPointer, AbstractEvaluator.fpResult
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static StringAPPLYstatic intAPPLY_TYPEstatic StringARG_COUNTstatic intARG_COUNT_TYPEstatic intBASE_FUNCTION_VALUEstatic StringDUMMY_BUILT_IN_FUNCTION_NAME_CAPUTstatic StringFUNCTION_NAMESPACEstatic StringIS_FUNCTIONstatic intIS_FUNCTION_TYPEstatic StringNAMESstatic intNAMES_TYPEstatic longserialVersionUID- 
Fields inherited from class org.qdl_lang.evaluate.AbstractEvaluatorbigArgList, bigArgList0, FILE_OP_AUTO, FILE_OP_BINARY, FILE_OP_INPUT_STREAM, FILE_OP_TEXT_INI, FILE_OP_TEXT_STEM, FILE_OP_TEXT_STRING, FILE_OP_TEXT_WITHOUT_LIST_INI, fNames, MAX_ARG_COUNT
 - 
Fields inherited from interface org.qdl_lang.evaluate.EvaluatorInterfaceUNKNOWN_VALUE
 
- 
 - 
Constructor SummaryConstructors Constructor Description FunctionEvaluator()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BooleancheckIsFunction(String fName, int argCount, State state)protected String[]dereferenceFunctionName(String name)booleandispatch(Polyad polyad, State state)Does the actual evaluation of thePolyad.protected voiddoFunctionEvaluation(Polyad polyad, State state, FR_WithState frs)Executes a user-defined function, defined in QDL., E.g.protected voiddoIsFunction(Polyad polyad, State state)protected voiddoJavaFunction(Polyad polyad, State state, FR_WithState frs)Executes a user-defined function, defined in Java as an implementation ofQDLFunction.booleanevaluate(String alias, Polyad polyad, State state)booleanevaluate(Polyad polyad, State state)Decides if aPolyadis evaluated by this evaluator and if not, returns false, if so, it evaluates it and returns true.protected voidfigureOutEvaluation(Polyad polyad, State state, boolean checkForDuplicates)String[]getFunctionNames()StringgetNamespace()intgetType(String name)protected booleanisFDef(Statement statement)protected booleanisFunctionReference(String name)protected ArrayList<XThing>resolveArguments(FunctionRecordInterface functionRecord, Polyad polyad, State state, State localState)This will take the function record and polyad and find the arguments that are requested in the function record vs.protected booleantryScript(Polyad polyad, State state)- 
Methods inherited from class org.qdl_lang.evaluate.AbstractEvaluatorareAllBigDecimals, areAllBoolean, areAllLongs, areAllNumbers, areAllSets, areAllStems, areAllStrings, areAnyBigDecimals, areNoneStems, bdEquals, checkNull, checkNull, convertArgsToStem, finishExpr, getBigArgList, getBigArgList0, getCommonKeys, getFQFunctionNames, getFunctionReferenceNode, getFunctionReferenceNode, getOperator, getOrCreateStem, isBigDecimal, isBoolean, isBuiltInFunction, isFunctionRef, isLong, isNumber, isScalar, isSet, isStem, isStemList, isString, listFunctions, NEWgetOperator, OLDgetOperator, process1, process2, process2, process3, processSet1, processSet2, processSet2, processStem1, processStem2, processStem3, resolveResourceToFile, tempFname, toBD, toConstants, toStem
 
- 
 
- 
- 
- 
Field Detail- 
serialVersionUIDpublic static long serialVersionUID 
 - 
FUNCTION_NAMESPACEpublic static final String FUNCTION_NAMESPACE - See Also:
- Constant Field Values
 
 - 
BASE_FUNCTION_VALUEpublic static final int BASE_FUNCTION_VALUE - See Also:
- Constant Field Values
 
 - 
IS_FUNCTIONpublic static final String IS_FUNCTION - See Also:
- Constant Field Values
 
 - 
IS_FUNCTION_TYPEpublic static final int IS_FUNCTION_TYPE - See Also:
- Constant Field Values
 
 - 
APPLYpublic static final String APPLY - See Also:
- Constant Field Values
 
 - 
APPLY_TYPEpublic static final int APPLY_TYPE - See Also:
- Constant Field Values
 
 - 
NAMESpublic static final String NAMES - See Also:
- Constant Field Values
 
 - 
NAMES_TYPEpublic static final int NAMES_TYPE - See Also:
- Constant Field Values
 
 - 
ARG_COUNTpublic static final String ARG_COUNT - See Also:
- Constant Field Values
 
 - 
ARG_COUNT_TYPEpublic static final int ARG_COUNT_TYPE - See Also:
- Constant Field Values
 
 - 
DUMMY_BUILT_IN_FUNCTION_NAME_CAPUTpublic static final String DUMMY_BUILT_IN_FUNCTION_NAME_CAPUT - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getNamespacepublic String getNamespace() 
 - 
getTypepublic int getType(String name) 
 - 
getFunctionNamespublic String[] getFunctionNames() - Specified by:
- getFunctionNamesin class- AbstractEvaluator
 
 - 
evaluatepublic boolean evaluate(String alias, Polyad polyad, State state) - Overrides:
- evaluatein class- AbstractEvaluator
 
 - 
evaluatepublic boolean evaluate(Polyad polyad, State state) Description copied from class:AbstractEvaluatorDecides if aPolyadis evaluated by this evaluator and if not, returns false, if so, it evaluates it and returns true. This function actually just dispatches it toAbstractEvaluator.dispatch(Polyad, State)where the work is done and manages putting better trace information in if there is a failure.- Overrides:
- evaluatein class- AbstractEvaluator
- Returns:
 
 - 
dispatchpublic boolean dispatch(Polyad polyad, State state) Description copied from class:AbstractEvaluatorDoes the actual evaluation of thePolyad.- Specified by:
- dispatchin class- AbstractEvaluator
- Returns:
 
 - 
isFDefprotected boolean isFDef(Statement statement) 
 - 
doJavaFunctionprotected void doJavaFunction(Polyad polyad, State state, FR_WithState frs) throws Throwable Executes a user-defined function, defined in Java as an implementation ofQDLFunction.- Parameters:
- polyad-
- state-
- frs-
- Throws:
- Throwable
 
 - 
figureOutEvaluationprotected void figureOutEvaluation(Polyad polyad, State state, boolean checkForDuplicates) throws Throwable - Throws:
- Throwable
 
 - 
doFunctionEvaluationprotected void doFunctionEvaluation(Polyad polyad, State state, FR_WithState frs) throws Throwable Executes a user-defined function, defined in QDL., E.g.f(x) → x;- Parameters:
- polyad-
- state-
- frs-
- Throws:
- Throwable
 
 - 
resolveArgumentsprotected ArrayList<XThing> resolveArguments(FunctionRecordInterface functionRecord, Polyad polyad, State state, State localState) This will take the function record and polyad and find the arguments that are requested in the function record vs. what's in the polyad and stash them in the correct state objects.- Parameters:
- functionRecord-
- polyad-
- state-
- localState-
 
 - 
isFunctionReferenceprotected boolean isFunctionReference(String name) 
 
- 
 
-