public class Get extends Node
Set
for details on scoping.
If the named variable has not yet been set, a default value is returned
depending on the return type. For numeric values, the default is
0
. For boolean values, the default is false
. For objects,
the default is null
.
Name | Type | Description |
---|---|---|
Return Value | User-Defined | The valued stored in the named variable |
Set
Constructor and Description |
---|
Get(java.lang.Class<?> type,
java.lang.String name)
Constructs a new node for reading the value stored in a named variable
within the current scope.
|
Modifier and Type | Method and Description |
---|---|
Get |
copyNode()
Returns a copy of this node, but without any children or parents
assigned.
|
java.lang.Object |
evaluate(Environment environment)
Evaluates this node in the context of the specified environment.
|
java.lang.Object |
getDefaultValue()
Returns the default value for the return type of this node.
|
java.lang.String |
toString() |
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
public Get(java.lang.Class<?> type, java.lang.String name)
type
- the type of the variablename
- the name of the variablepublic Get copyNode()
Node
public java.lang.Object evaluate(Environment environment)
Node
public java.lang.Object getDefaultValue()
Copyright 2009-2024 David Hadka and other contributors. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage.