Class AssignmentStatement

    • Method Detail

      • setCommand

        public void setCommand​(Command command)
      • getVariable

        public ElementSymbol getVariable()
        Get the expression giving the value that is assigned to the variable.
        Returns:
        An Expression with the value
      • setVariable

        public void setVariable​(ElementSymbol variable)
        Set the variable that is assigned to the value
        Parameters:
        variable - ElementSymbol that is being assigned
      • getType

        public int getType()
        Return the type for this statement, this is one of the types defined on the statement object.
        Specified by:
        getType in class Statement
        Returns:
        The type of this statement
      • acceptVisitor

        public void acceptVisitor​(LanguageVisitor visitor)
        Description copied from interface: LanguageObject
        Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.
        Specified by:
        acceptVisitor in interface LanguageObject
        Parameters:
        visitor - Visitor being used
      • clone

        public Object clone()
        Deep clone statement to produce a new identical statement.
        Specified by:
        clone in interface LanguageObject
        Specified by:
        clone in class Statement
        Returns:
        Deep clone
      • equals

        public boolean equals​(Object obj)
        Compare two AssignmentStatements for equality. They will only evaluate to equal if they are IDENTICAL: variable and its value which could be a command or an expression objects are equal.
        Overrides:
        equals in class Object
        Parameters:
        obj - Other object
        Returns:
        True if equal
      • hashCode

        public int hashCode()
        Get hashcode for AssignmentStatement. WARNING: This hash code relies on the hash codes of the variable and its value which could be a command or an expression.
        Overrides:
        hashCode in class Object
        Returns:
        Hash code