|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.moeaframework.util.tree.Node
org.moeaframework.util.tree.Lambda
public class Lambda
The node for defining an immutable, anonymous function. Unlike
Define, the behavior (body) of a Lambda can not be modified.
Therefore, Lambdas are useful for providing pre-defined functions
built using existing Nodes.
Define| Constructor Summary | |
|---|---|
Lambda(Node node)
Constructs a new node for defining an immutable, anonymous function with no arguments. |
|
Lambda(Node node,
String[] variableNames,
Class<?>[] variableTypes)
Constructs a new node for defining an immutable, anonymous function with a user-defined number of arguments. |
|
Lambda(Node node,
String variableName,
Class<?> variableType)
Constructs a new node for defining an immutable, anonymous function with one argument. |
|
Lambda(Node node,
String name1,
Class<?> type1,
String name2,
Class<?> type2)
Constructs a new node for defining an immutable, anonymous function with two arguments. |
|
| Method Summary | |
|---|---|
Node |
copyNode()
Returns a copy of this node, but without any children or parents assigned. |
Object |
evaluate(Environment environment)
Evaluates this node in the context of the specified environment. |
| 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, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Lambda(Node node)
node - the body of this function
IllegalArgumentException - if node is incomplete or not
strongly typed (i.e., node.isValid() returns
false)
public Lambda(Node node,
String variableName,
Class<?> variableType)
node - the body of this functionvariableName - the name of the argumentvariableType - the type of the argument
IllegalArgumentException - if node is incomplete or not
strongly typed (i.e., node.isValid() returns
false)
public Lambda(Node node,
String name1,
Class<?> type1,
String name2,
Class<?> type2)
node - the body of this 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
IllegalArgumentException - if node is incomplete or not
strongly typed (i.e., node.isValid() returns
false)
public Lambda(Node node,
String[] variableNames,
Class<?>[] variableTypes)
node - the body of this functionvariableNames - the names of the arguments to this functionvariableTypes - the types of the arguments to this function
IllegalArgumentException - if node is incomplete or not
strongly typed (i.e., node.isValid() returns
false)| Method Detail |
|---|
public Node copyNode()
Node
copyNode in class Nodepublic Object evaluate(Environment environment)
Node
evaluate in class Nodeenvironment - the execution environment
|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||