Class VariableDeclarationStatement
java.lang.Object
io.github.jspinak.brobot.runner.dsl.statements.Statement
io.github.jspinak.brobot.runner.dsl.statements.VariableDeclarationStatement
Represents a variable declaration statement in the Brobot DSL.
This statement declares a new variable in the current scope, optionally initializing it with a value. The variable can then be referenced in subsequent statements and expressions within its scope.
Variables must be declared before use and cannot be redeclared within the same scope. The type information helps with validation and type checking.
Example in JSON:
{ "statementType": "variableDeclaration", "name": "count", "type": "integer", "value": {"expressionType": "literal", "valueType": "integer", "value": 0} }
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
getName()
The name of the variable being declared.getType()
The data type of the variable.getValue()
Optional initial value expression for the variable.int
hashCode()
void
The name of the variable being declared.void
The data type of the variable.void
setValue
(Expression value) Optional initial value expression for the variable.toString()
Methods inherited from class io.github.jspinak.brobot.runner.dsl.statements.Statement
getStatementType, setStatementType
-
Constructor Details
-
VariableDeclarationStatement
public VariableDeclarationStatement()
-
-
Method Details
-
getName
The name of the variable being declared. This name must be unique within the current scope and will be used to reference the variable in subsequent statements. -
getType
The data type of the variable. Common types include: "string", "integer", "double", "boolean", "object" This helps with type checking and validation during DSL execution. -
getValue
Optional initial value expression for the variable. If provided, the expression is evaluated and its result is assigned to the variable. If null, the variable is initialized with a default value based on its type. -
setName
The name of the variable being declared. This name must be unique within the current scope and will be used to reference the variable in subsequent statements. -
setType
The data type of the variable. Common types include: "string", "integer", "double", "boolean", "object" This helps with type checking and validation during DSL execution. -
setValue
Optional initial value expression for the variable. If provided, the expression is evaluated and its result is assigned to the variable. If null, the variable is initialized with a default value based on its type. -
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-