Class DeclareStatement

    • Constructor Detail

      • DeclareStatement

        public DeclareStatement()
        Constructor for DeclareStatement.
      • DeclareStatement

        public DeclareStatement​(ElementSymbol variable,
                                String varType)
        Constructor for DeclareStatement.
        Parameters:
        variable - The ElementSymbol object that is the variable
        varType - The type of this variable
      • DeclareStatement

        public DeclareStatement​(ElementSymbol variable,
                                String varType,
                                Expression value)
        Constructor for DeclareStatement.
        Parameters:
        variable - The ElementSymbol object that is the variable
        varType - The type of this variable
    • Method Detail

      • getVariableType

        public String getVariableType()
        Get the type of this variable declared in this statement.
        Returns:
        A string giving the variable type
      • setVariableType

        public void setVariableType​(String varType)
        Set the type of this variable declared in this statement.
        Parameters:
        varType - A string giving the variable type
      • getType

        public int getType()
        Return the type for this statement, this is one of the types defined on the statement object.
        Overrides:
        getType in class AssignmentStatement
        Returns:
        The type of this statement
      • equals

        public boolean equals​(Object obj)
        Compare two DeclareStatements for equality. They will only evaluate to equal if they are IDENTICAL: variable and the its type are equal.
        Overrides:
        equals in class AssignmentStatement
        Parameters:
        obj - Other object
        Returns:
        True if equal
      • hashCode

        public int hashCode()
        Get hashcode for TableAssignmentStatement. WARNING: This hash code relies on the hash codes of the statements present in the block. If statements are added to the block or if statements on the block change the hash code will change. Hash code is only valid after the block has been completely constructed.
        Overrides:
        hashCode in class AssignmentStatement
        Returns:
        Hash code
      • toString

        public String toString()
        Returns a string representation of an instance of this class.
        Overrides:
        toString in class Statement
        Returns:
        String representation of object