Class RegularBlockImpl

    • Field Detail

      • contents

        protected final java.util.List<Node> contents
        Internal representation of the contents.
    • Constructor Detail

      • RegularBlockImpl

        public RegularBlockImpl()
        Initialize an empty basic block to be filled with contents and linked to other basic blocks later.
    • Method Detail

      • addNode

        public void addNode​(Node t)
        Add a node to the contents of this basic block.
      • addNodes

        public void addNodes​(java.util.List<? extends Node> ts)
        Add multiple nodes to the contents of this basic block.
      • getNodes

        public java.util.List<Node> getNodes()
        Returns the nodes contained within this basic block. The list may be empty.

        The following invariant holds.

         forall n in getNodes() :: n.getBlock() == this
         

        This implementation returns an non-empty list.

        Specified by:
        getNodes in interface Block
        Returns:
        the nodes contained within this basic block
      • getLastNode

        public @Nullable Node getLastNode()
        Description copied from interface: Block
        Returns the last node of this block, or null if none.
        Specified by:
        getLastNode in interface Block
        Returns:
        the last node of this block or null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: RegularBlock
        Is this block empty (i.e., does it not contain any contents).
        Specified by:
        isEmpty in interface RegularBlock