Package org.moeaframework.util.tree
Class Constant
java.lang.Object
org.moeaframework.util.tree.Node
org.moeaframework.util.tree.Constant
- All Implemented Interfaces:
Serializable
The node for defining a constant value.
Name | Type | Description |
---|---|---|
Return Value | Number | The constant value |
- See Also:
-
Constructor Summary
ConstructorDescriptionConstant
(boolean value) Constructs a new node for defining a constant boolean value.Constant
(double value) Constructs a new node for defining a constant floating-point number.Constant
(long value) Constructs a new node for defining a constant integer value.Constructs a new node for defining a constantObject
. -
Method Summary
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
-
Constant
public Constant(double value) Constructs a new node for defining a constant floating-point number.- Parameters:
value
- the floating-point number
-
Constant
public Constant(long value) Constructs a new node for defining a constant integer value.- Parameters:
value
- the integer value
-
Constant
public Constant(boolean value) Constructs a new node for defining a constant boolean value.- Parameters:
value
- the boolean value
-
Constant
Constructs a new node for defining a constantObject
. It is necessary to pass the type explicitly to ensure values such asnull
are handled correctly.- Parameters:
type
- the type of the objectvalue
- the object
-
-
Method Details