package org.jcodegen.java;

/**
 * ...
 */
public class WhileBlock extends ConditionalBlock<WhileBlock> {

    public WhileBlock(final Condition condition) {
        this(condition, 0);
    }

    public WhileBlock(final Condition condition, final int indentationLevel) {
        super("while", indentationLevel, condition);
    }


    @Override
    protected WhileBlock getThis() {
        return this;
    }


    @Override
    public String toString() {
        final StringBuilder buf = new StringBuilder();

        buf.append(getTabs());
        buf.append("while");
        appendCondition(buf);

        if (contentIsAOneLiner())
            appendOneLinerContent(buf);
        else {
            buf.append(" ");
            appendContent(buf);
        }

        buf.append("\n");

        return buf.toString();
    }
}

@@ -114,38 +114,32 @@
 blic WhileBlock(
-final 
 Condition condit
@@ -141,24 +141,24 @@
 ondition) %7B%0A
+
         this
@@ -202,22 +202,16 @@
 leBlock(
-final 
 Conditio
@@ -222,22 +222,16 @@
 ndition,
- final
  int ind
@@ -445,14 +445,8 @@
     
-final 
 Stri
@@ -735,24 +735,24 @@
      %7D%0A%0A
-
         
 buf.appe
@@ -735,32 +735,34 @@
      %7D%0A%0A        
+//
 buf.append(%22%5Cn%22)

Remove unnecessary newline