Class ForJBlock

All Implemented Interfaces:
BlockContent, JBlock, JCommentable, JFor, JStatement, Writable

class ForJBlock extends BasicJBlock implements JFor
  • Field Details

  • Constructor Details

  • Method Details

    • init

      public JVarDeclaration init(int mods, String type, String name, JExpr value)
      Description copied from interface: JFor
      Add a loop initializer.
      Specified by:
      init in interface JFor
      Parameters:
      mods - the modifiers for the initializer variable declaration
      type - the type of the initializer variables
      name - the name of the first initializer variable
      value - the initial value for the first initializer variable
      Returns:
      the initializer variable declaration
    • init

      public JVarDeclaration init(int mods, JType type, String name, JExpr value)
      Description copied from interface: JFor
      Add a loop initializer.
      Specified by:
      init in interface JFor
      Parameters:
      mods - the modifiers for the initializer variable declaration
      type - the type of the initializer variables
      name - the name of the first initializer variable
      value - the initial value for the first initializer variable
      Returns:
      the initializer variable declaration
    • init

      public JVarDeclaration init(int mods, Class<?> type, String name, JExpr value)
      Description copied from interface: JFor
      Add a loop initializer.
      Specified by:
      init in interface JFor
      Parameters:
      mods - the modifiers for the initializer variable declaration
      type - the type of the initializer variables
      name - the name of the first initializer variable
      value - the initial value for the first initializer variable
      Returns:
      the initializer variable declaration
    • test

      public JFor test(JExpr expr)
      Description copied from interface: JFor
      Add a test expression.
      Specified by:
      test in interface JFor
      Parameters:
      expr - the test expression
      Returns:
      this for loop
    • update

      public JFor update(JExpr updateExpr)
      Description copied from interface: JFor
      Add an update expression.
      Specified by:
      update in interface JFor
      Parameters:
      updateExpr - the update expression
      Returns:
      this for loop
    • write

      public void write(SourceFileWriter writer) throws IOException
      Specified by:
      write in interface Writable
      Overrides:
      write in class BasicJBlock
      Throws:
      IOException