Package edu.uiuc.ncsa.qdl.functions
Class FunctionReferenceNode
- java.lang.Object
-
- edu.uiuc.ncsa.qdl.expressions.ExpressionImpl
-
- edu.uiuc.ncsa.qdl.functions.FunctionReferenceNode
-
- All Implemented Interfaces:
ExpressionNode
,FunctionReferenceNodeInterface
,ExpressionInterface
,HasResultInterface
,Statement
,Serializable
public class FunctionReferenceNode extends ExpressionImpl implements FunctionReferenceNodeInterface
Just a pointer to the collection of functions for a given name. Just has the name.Created by Jeff Gaynor
on 3/14/21 at 3:26 PM- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class edu.uiuc.ncsa.qdl.expressions.ExpressionImpl
arguments, result, valence
-
Fields inherited from interface edu.uiuc.ncsa.qdl.statements.ExpressionInterface
ALL_INDICES_NODE, ALT_IF_NODE, ASSIGNMENT_NODE, CLOSED_SLICE_NODE, COMPARISON_DYAD_NODE, CONSTANT_NODE, DYAD_NODE, DYADIC_FUNCTION_REFERENCE_NODE, EXPRESSION_STEM_NODE, EXPRESSION_STEM2_NODE, FUNCTION_REFERENCE_NODE, LAMBDA_DEFINITION_NODE, LIST_NODE, MODULE_NODE, MONAD_NODE, NILAD_NODE, OPEN_SLICE_NODE, PARENTHESIZED_NODE, PARSE_EXPRESSION_BLOCK_NODE, PARSE_STATEMENT_BLOCK_NODE, POLYAD_NODE, QDL_NULL_NODE, SELECT_NODE, SET_NODE, STEM_ENTRY_NODE, STEM_EXTRACTION_NODE, STEM_NODE, UNKNOWN_NODE, VARIABLE_NODE
-
-
Constructor Summary
Constructors Constructor Description FunctionReferenceNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
evaluate(State state)
FunctionRecordInterface
getByArgCount(int argCount)
String
getFunctionName()
FunctionRecordInterface
getFunctionRecord(int argCount)
List<FunctionRecordInterface>
getFunctionRecords()
State
getModuleState()
int
getNodeType()
QDL is not strongly typed but Java is, so each node type should have a unique integer and conditionals should use that, not the instanceof operator.boolean
hasFunctionRecord(int argCount)
boolean
hasModuleState()
boolean
isAnonymous()
ExpressionInterface
makeCopy()
void
setAnonymous(boolean anonymous)
void
setFunctionName(String functionName)
void
setFunctionRecords(List<FunctionRecordInterface> functionRecords)
void
setModuleState(State moduleState)
String
toString()
-
Methods inherited from class edu.uiuc.ncsa.qdl.expressions.ExpressionImpl
evalArg, evalLastArg, evaluatedArgs, getAlias, getArgAt, getArgCount, getArguments, getEvaluatedArgs, getLastArg, getOperatorType, getResult, getResultType, getSourceCode, getTokenPosition, hasAlias, hasEvaluatedArgs, hasTokenPosition, isEvaluated, isSizeQuery, setAlias, setArguments, setEvaluated, setEvaluatedArgs, setOperatorType, setResult, setResultType, setSizeQuery, setSourceCode, setTokenPosition
-
-
-
-
Method Detail
-
getFunctionName
public String getFunctionName()
- Specified by:
getFunctionName
in interfaceFunctionReferenceNodeInterface
-
setFunctionName
public void setFunctionName(String functionName)
- Specified by:
setFunctionName
in interfaceFunctionReferenceNodeInterface
-
isAnonymous
public boolean isAnonymous()
- Specified by:
isAnonymous
in interfaceFunctionReferenceNodeInterface
-
setAnonymous
public void setAnonymous(boolean anonymous)
- Specified by:
setAnonymous
in interfaceFunctionReferenceNodeInterface
-
getFunctionRecords
public List<FunctionRecordInterface> getFunctionRecords()
-
setFunctionRecords
public void setFunctionRecords(List<FunctionRecordInterface> functionRecords)
-
getFunctionRecord
public FunctionRecordInterface getFunctionRecord(int argCount)
- Specified by:
getFunctionRecord
in interfaceFunctionReferenceNodeInterface
-
hasFunctionRecord
public boolean hasFunctionRecord(int argCount)
- Specified by:
hasFunctionRecord
in interfaceFunctionReferenceNodeInterface
-
getModuleState
public State getModuleState()
- Specified by:
getModuleState
in interfaceFunctionReferenceNodeInterface
-
setModuleState
public void setModuleState(State moduleState)
- Specified by:
setModuleState
in interfaceFunctionReferenceNodeInterface
-
hasModuleState
public boolean hasModuleState()
- Specified by:
hasModuleState
in interfaceFunctionReferenceNodeInterface
-
getByArgCount
public FunctionRecordInterface getByArgCount(int argCount)
-
getNodeType
public int getNodeType()
Description copied from interface:ExpressionInterface
QDL is not strongly typed but Java is, so each node type should have a unique integer and conditionals should use that, not the instanceof operator. This allows for efficient programming with switch statements rather than a bevy of conditionals (potentially each of which gets done even if the correct case has been handled).- Specified by:
getNodeType
in interfaceExpressionInterface
- Returns:
-
makeCopy
public ExpressionInterface makeCopy()
- Specified by:
makeCopy
in interfaceExpressionInterface
-
toString
public String toString()
- Overrides:
toString
in classExpressionImpl
-
-