Interface ICConditionalStatement

All Superinterfaces:
ICCompound, ICElement, ICStatement
All Known Subinterfaces:
ICIfStm, ICSwitchStm

@Ser public interface ICConditionalStatement extends ICCompound
Base class for CAST conditional statements (if, switch).
  • Method Details

    • getDefaultBlock

      ICBlock getDefaultBlock()
      Return the default block, or null if no default block is defined
      Returns:
    • setDefaultBlock

      void setDefaultBlock(ICBlock b)
      Set the default block of code.
      Parameters:
      b - optional block, set to null to remove the default block
    • hasDefaultBlock

      boolean hasDefaultBlock()
      Determine whether the conditional statement has a default block.
      Returns:
      true if the conditional statement has an else block
    • getConditionalBlocks

      List<ICBlock> getConditionalBlocks()
      Return a copy of the CBlock conditional blocks. The default block is not included.
      Returns:
    • getBlocks

      List<ICBlock> getBlocks()
      Return a copy of the CBlock conditional blocks with default block (if it exists).
      Specified by:
      getBlocks in interface ICCompound
      Returns:
    • size

      int size()
      Return the number of blocks (including default block).
      Returns:
      the number of blocks
    • sizeWithoutDefault

      int sizeWithoutDefault()
      Return the number of blocks, NOT counting the default block if there is one.
      Returns:
    • duplicate

      Description copied from interface: ICElement
      Deep duplication of the element. Sub-elements are duplicated.

      Note: ICClass, ICMethod, ICField, ICIdentifier, ICConstant, ICType and ICLabel are not duplicated.

      Specified by:
      duplicate in interface ICCompound
      Specified by:
      duplicate in interface ICElement
      Specified by:
      duplicate in interface ICStatement