Package relaxngcc.codedom

## Class CDBlock

- java.lang.Object
- - relaxngcc.codedom.CDBlock

- All Implemented Interfaces:
    `CDStatement`

      public class CDBlock
      extends java.lang.Object
      implements CDStatement

  Author:
    Daisuke OKAJIMA simple collection of CDStatement objects

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CDBlock()` |
    `CDBlock​(CDStatement s)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CDIfStatement` | `_if​(CDExpression exp)` |
    `void` | `_return​(CDExpression val)` | Adds a new return statement.
    `void` | `add​(CDBlock sv)` |
    `void` | `add​(CDStatement s)` |
    `CDAssignStatement` | `assign​(CDExpression lhs, CDExpression rhs)` | Adds a new assignment.
    `CDVariable` | `decl​(CDType type, java.lang.String name)` | Adds a new variable declaration.
    `CDVariable` | `decl​(CDType type, java.lang.String name, CDExpression init)` |
    `CDVariable` | `insertDecl​(CDType type, java.lang.String name)` | Declares a new variable at the beginning of the block.
    `CDMethodInvokeExpression` | `invoke​(java.lang.String method)` |
    `CDMethodInvokeExpression` | `invoke​(CDExpression obj, java.lang.String method)` | Adds a new method invocation.
    `int` | `size()` |
    `void` | `state​(CDFormatter f)` | Prints itself as a statement.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CDBlock

          public CDBlock()

    - #### CDBlock

          public CDBlock​(CDStatement s)

  - ### Method Detail

    - #### add

          public void add​(CDStatement s)

    - #### add

          public void add​(CDBlock sv)

    - #### _if

          public CDIfStatement _if​(CDExpression exp)

    - #### invoke

          public CDMethodInvokeExpression invoke​(CDExpression obj,
                                                 java.lang.String method)

      Adds a new method invocation.

    - #### invoke

          public CDMethodInvokeExpression invoke​(java.lang.String method)

    - #### decl

          public CDVariable decl​(CDType type,
                                 java.lang.String name)

      Adds a new variable declaration.

    - #### decl

          public CDVariable decl​(CDType type,
                                 java.lang.String name,
                                 CDExpression init)

    - #### insertDecl

          public CDVariable insertDecl​(CDType type,
                                       java.lang.String name)

      Declares a new variable at the beginning of the block.

    - #### assign

          public CDAssignStatement assign​(CDExpression lhs,
                                          CDExpression rhs)

      Adds a new assignment.

    - #### _return

          public void _return​(CDExpression val)

      Adds a new return statement.

    - #### size

          public int size()

    - #### state

          public void state​(CDFormatter f)
                     throws java.io.IOException

      Description copied from interface: `CDStatement`
      Prints itself as a statement.
      Specified by:
        `state` in interface `CDStatement`
      Throws:
        `java.io.IOException`