org.brains2b.typewriter
Class LoopTemplate
java.lang.Object
org.brains2b.typewriter.ContentTemplate
org.brains2b.typewriter.LoopTemplate
- All Implemented Interfaces:
- Template
- public class LoopTemplate
- extends ContentTemplate
Create a loop element in a method
A loop can either be
- DO
- WHILE
- FOR
- Version:
- 0.10 [revision date]
- Author:
- dennis@brains2b.nl
Field Summary |
static int |
DO
|
static int |
FOR
|
static int |
WHILE
|
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 |
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
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
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