Class Block

    • Constructor Detail

      • Block

        public Block()
        Constructor for Block.
      • Block

        public Block​(Statement statement)
        Constructor for Block with a single Statement.
        statement - The Statement to be added to the block
    • Method Detail

      • getStatements

        public List<Statement> getStatements()
        Get all the statements contained on this block.
        A list of Statements contained in this block
      • setStatements

        public void setStatements​(List<Statement> statements)
        Set the statements contained on this block.
        statements - A list of Statements contained in this block
      • addStatement

        public void addStatement​(Statement statement)
        Add a Statement to this block.
        statement - The Statement to be added to the block
      • addStatement

        public void addStatement​(Statement statement,
                                 boolean exception)
      • 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
        visitor - Visitor being used
      • clone

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

        public boolean equals​(Object obj)
        Compare two queries for equality. Blocks will only evaluate to equal if they are IDENTICAL: statements in the block are equal and are in the same order.
        equals in class Object
        obj - Other object
        True if equal
      • hashCode

        public int hashCode()
        Get hashcode for block. 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.
        hashCode in class Object
        Hash code
      • toString

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

        public boolean isAtomic()
      • setAtomic

        public void setAtomic​(boolean atomic)
      • getType

        public int getType()
        Description copied from class: Statement
        Return type of statement to make it easier to build switch statements by statement type.
        Specified by:
        getType in class Statement
        Type from TYPE constants
      • getExceptionGroup

        public String getExceptionGroup()
      • setExceptionGroup

        public void setExceptionGroup​(String exceptionGroup)
      • getExceptionStatements

        public List<Statement> getExceptionStatements()
      • setExceptionStatements

        public void setExceptionStatements​(List<Statement> exceptionStatements)