Package org.moeaframework.util.tree
Class Get
java.lang.Object
org.moeaframework.util.tree.Node
org.moeaframework.util.tree.Get
- All Implemented Interfaces:
Serializable
The node for reading the value stored in a named variable within the current scope. See
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 |
- See Also:
-
Constructor Summary
-
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 default value for the return type of this node.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
-
Get
Constructs a new node for reading the value stored in a named variable within the current scope.- Parameters:
type
- the type of the variablename
- the name of the variable
-
-
Method Details
-
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. -
getDefaultValue
Returns the default value for the return type of this node.- Returns:
- the default value for the return type of this node
-
toString
-