org.brains2b.typewriter
Class LoopTemplate

java.lang.Object
  extended byorg.brains2b.typewriter.ContentTemplate
      extended byorg.brains2b.typewriter.LoopTemplate
All Implemented Interfaces:
Template

public class LoopTemplate
extends ContentTemplate

Create a loop element in a method

Version:
0.10 [revision date]
Author:
dennis@brains2b.nl

Field Summary
static int DO
           
static int FOR
           
static int WHILE
           
 
Fields inherited from class org.brains2b.typewriter.ContentTemplate
m_content
 
Constructor Summary
LoopTemplate(int type, java.lang.String condition)
          Constructor
 
Method Summary
 void setCondition(java.lang.String condition)
          set the condition.
 void write(java.io.PrintWriter writer, int indent)
          overwrite this to implement a content types specific needs and call super.write(PrintWriter,int) to write out the content for this method.
 
Methods inherited from class org.brains2b.typewriter.ContentTemplate
addImport, addText, createFor, createIf, createTry, createWhile, getContent, getObjectName, getParent, makeInstance, makeInstance, makeInstance, makeInstance, makeInstance, setContent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DO

public static final int DO
See Also:
Constant Field Values

WHILE

public static final int WHILE
See Also:
Constant Field Values

FOR

public static final int FOR
See Also:
Constant Field Values
Constructor Detail

LoopTemplate

public LoopTemplate(int type,
                    java.lang.String condition)
Constructor

Parameters:
type - int, one of the loop types (DO|WHILE|FOR)
condition - String, a complete condition for this loop i.e. int i=0;i
Method Detail

write

public void write(java.io.PrintWriter writer,
                  int indent)
Description copied from class: ContentTemplate
overwrite this to implement a content types specific needs and call super.write(PrintWriter,int) to write out the content for this method.

Specified by:
write in interface Template
Overrides:
write in class ContentTemplate
See Also:
Template.write(java.io.PrintWriter, int)

setCondition

public void setCondition(java.lang.String condition)
set the condition.

Parameters:
condition - String, the condition for this loop