Package org.moeaframework.util.tree
Class Call
java.lang.Object
org.moeaframework.util.tree.Node
org.moeaframework.util.tree.Call
- All Implemented Interfaces:
Serializable
The node for calling a named function.
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a new node for calling a function that takes no arguments.Constructs a new node for calling a function that takes a user-defined number of arguments.Constructs a new node for calling a function that takes one argument.Call
(String functionName, Class<?> returnType, String name1, Class<?> type1, String name2, Class<?> type2) Constructs a new node for calling a function that takes two arguments.Constructs a new node for calling the function as defined. -
Method Summary
Modifier and TypeMethodDescriptioncopyNode()
Returns a copy of this node, but without any children or parents assigned.evaluate
(Environment environment) Evaluates this node in the context of the specified environment.Returns the name of this function.String[]
Returns the names of the arguments to this function.Class<?>[]
Returns the types of the arguments to this function.toString()
Methods inherited from class org.moeaframework.util.tree.Node
copyTree, getArgument, getArgumentType, getDepth, getFunctionAt, getFunctionAt, getMaximumHeight, getMinimumHeight, getNodeAt, getNodeAt, getNodeAt, getNumberOfArguments, getNumberOfFunctions, getNumberOfFunctions, getNumberOfNodes, getNumberOfNodes, getNumberOfNodes, getNumberOfTerminals, getNumberOfTerminals, getParent, getReturnType, getTerminalAt, getTerminalAt, isFixed, isTerminal, isValid, setArgument, setFixed, setFixedTree, size
-
Constructor Details
-
Call
Constructs a new node for calling a function that takes no arguments.- Parameters:
functionName
- the name of the functionreturnType
- the return type of the function
-
Call
Constructs a new node for calling a function that takes one argument.- Parameters:
functionName
- the name of the functionreturnType
- the return type of the functionvariableName
- the name of the argumentvariableType
- the type of the argument
-
Call
public Call(String functionName, Class<?> returnType, String name1, Class<?> type1, String name2, Class<?> type2) Constructs a new node for calling a function that takes two arguments.- Parameters:
functionName
- the name of the functionreturnType
- the return type of the functionname1
- the name of the first argumenttype1
- the type of the first argumentname2
- the name of the second argumenttype2
- the type of the second argument
-
Call
Constructs a new node for calling the function as defined.- Parameters:
function
- the function
-
Call
public Call(String functionName, Class<?> returnType, String[] variableNames, Class<?>[] variableTypes) Constructs a new node for calling a function that takes a user-defined number of arguments.- Parameters:
functionName
- the name of the functionreturnType
- the return type of the functionvariableNames
- the names of the arguments to the functionvariableTypes
- the types of the arguments to the function
-
-
Method Details
-
getFunctionName
Returns the name of this function.- Returns:
- the name of this function
-
getVariableNames
Returns the names of the arguments to this function.- Returns:
- the names of the arguments to this function
-
getVariableTypes
Returns the types of the arguments to this function.- Returns:
- the types of the arguments to this function
-
copyNode
Description copied from class:Node
Returns a copy of this node, but without any children or parents assigned. -
evaluate
Description copied from class:Node
Evaluates this node in the context of the specified environment. -
toString
-