Class BaseBlockDoWhile

All Implemented Interfaces:
io.github.mmm.code.api.block.CodeBlock, io.github.mmm.code.api.block.CodeBlockDoWhile, io.github.mmm.code.api.block.CodeBlockStatement, io.github.mmm.code.api.block.CodeBlockWithCondition, io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.block.CodeBlock, io.github.mmm.code.api.block.CodeBlockDoWhile>, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithVariables, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.object.CodeMutable, io.github.mmm.code.api.statement.CodeStatement

public class BaseBlockDoWhile extends BaseBlockStatementWithCondition implements io.github.mmm.code.api.block.CodeBlockDoWhile
Base implementation of CodeBlockDoWhile.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Constructor Details

    • BaseBlockDoWhile

      public BaseBlockDoWhile(BaseBlock parent, io.github.mmm.code.api.expression.CodeCondition condition, io.github.mmm.code.api.statement.CodeStatement... statements)
      The constructor.
      Parameters:
      parent - the parent.
      condition - the condition.
      statements - the statements.
    • BaseBlockDoWhile

      public BaseBlockDoWhile(BaseBlock parent, io.github.mmm.code.api.expression.CodeCondition condition, List<io.github.mmm.code.api.statement.CodeStatement> statements)
      The constructor.
      Parameters:
      parent - the parent.
      condition - the condition.
      statements - the statements.
    • BaseBlockDoWhile

      public BaseBlockDoWhile(BaseBlockDoWhile template, io.github.mmm.code.api.copy.CodeCopyMapper mapper)
      The copy-constructor.
      Parameters:
      template - the BaseBlockStatementWithCondition to copy.
      mapper - the CodeCopyMapper.
  • Method Details

    • copy

      public BaseBlockDoWhile copy()
      Specified by:
      copy in interface io.github.mmm.code.api.block.CodeBlock
      Specified by:
      copy in interface io.github.mmm.code.api.block.CodeBlockDoWhile
      Specified by:
      copy in interface io.github.mmm.code.api.block.CodeBlockStatement
      Specified by:
      copy in interface io.github.mmm.code.api.item.CodeMutableItem
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItem
      Specified by:
      copy in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.block.CodeBlock, io.github.mmm.code.api.block.CodeBlockDoWhile>
    • copy

      public BaseBlockDoWhile copy(io.github.mmm.code.api.copy.CodeCopyMapper mapper)
      Specified by:
      copy in interface io.github.mmm.code.api.item.CodeMutableItem
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItem
      Specified by:
      copy in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.block.CodeBlock, io.github.mmm.code.api.block.CodeBlockDoWhile>
    • writePrefix

      protected void writePrefix(Appendable sink, String newline, String defaultIndent, String currentIndent) throws IOException
      Description copied from class: BaseBlock
      Writes a prefix e.g. for loops.
      Overrides:
      writePrefix in class BaseBlock
      Parameters:
      sink - the Appendable where to append the code from this CodeItem.
      newline - the newline String.
      defaultIndent - the String used for indentation (e.g. a number of spaces to insert per indent level).
      currentIndent - the current indent (number of spaces). Initially the empty string (""). Before a recursion the indent will be appended.
      Throws:
      IOException - if thrown by Appendable.
    • writeSuffix

      protected void writeSuffix(Appendable sink, String newline, String defaultIndent, String currentIndent) throws IOException
      Description copied from class: BaseBlock
      Writes a suffix e.g. for do-while loops.
      Overrides:
      writeSuffix in class BaseBlock
      Parameters:
      sink - the Appendable where to append the code from this CodeItem.
      newline - the newline String.
      defaultIndent - the String used for indentation (e.g. a number of spaces to insert per indent level).
      currentIndent - the current indent (number of spaces). Initially the empty string (""). Before a recursion the indent will be appended.
      Throws:
      IOException - if thrown by Appendable.