public class DeclareStatement extends AssignmentStatement
This class represents a statement used to declare variables in the storedprocedure language.
Statement.Labeled
LanguageObject.Util
TYPE_ASSIGNMENT, TYPE_BREAK, TYPE_COMMAND, TYPE_COMPOUND, TYPE_CONTINUE, TYPE_DECLARE, TYPE_ERROR, TYPE_IF, TYPE_LEAVE, TYPE_LOOP, TYPE_RETURN, TYPE_UNKNOWN, TYPE_UPDATE, TYPE_WHILE
Constructor and Description |
---|
DeclareStatement()
Constructor for DeclareStatement.
|
DeclareStatement(ElementSymbol variable,
String varType)
Constructor for DeclareStatement.
|
DeclareStatement(ElementSymbol variable,
String varType,
Command value)
Deprecated.
|
DeclareStatement(ElementSymbol variable,
String varType,
Expression value)
Constructor for DeclareStatement.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.
|
Object |
clone()
Deep clone statement to produce a new identical statement.
|
boolean |
equals(Object obj)
Compare two DeclareStatements for equality.
|
int |
getType()
Return the type for this statement, this is one of the types
defined on the statement object.
|
String |
getVariableType()
Get the type of this variable declared in this statement.
|
int |
hashCode()
Get hashcode for TableAssignmentStatement.
|
void |
setVariableType(String varType)
Set the type of this variable declared in this statement.
|
String |
toString()
Returns a string representation of an instance of this class.
|
getCommand, getExpectedType, getExpression, getVariable, setCommand, setExpression, setVariable
public DeclareStatement()
public DeclareStatement(ElementSymbol variable, String varType)
variable
- The ElementSymbol
object that is the variablevalueType
- The type of this variablepublic DeclareStatement(ElementSymbol variable, String varType, Expression value)
variable
- The ElementSymbol
object that is the variablevalueType
- The type of this variable@Deprecated public DeclareStatement(ElementSymbol variable, String varType, Command value)
public String getVariableType()
public void setVariableType(String varType)
varType
- A string giving the variable typepublic int getType()
getType
in class AssignmentStatement
public void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor
in interface LanguageObject
acceptVisitor
in class AssignmentStatement
visitor
- Visitor being usedpublic Object clone()
clone
in interface LanguageObject
clone
in class AssignmentStatement
public boolean equals(Object obj)
equals
in class AssignmentStatement
obj
- Other objectpublic int hashCode()
hashCode
in class AssignmentStatement
Copyright © 2019. All rights reserved.