public class LoopTemplate extends ContentTemplate
| Modifier and Type | Field and Description |
|---|---|
static int |
DO
constant to define a do while loop
|
static int |
FOR
constant to define a for loop
|
static int |
WHILE
constant to define a while loop
|
m_content| Constructor and Description |
|---|
LoopTemplate(int type,
java.lang.String condition)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCondition() |
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. |
addImport, addText, createFor, createIf, createTry, createTry, createWhile, getContent, getParent, makeInstance, makeInstance, makeInstance, setContent, setParentpublic static final int DO
public static final int WHILE
public static final int FOR
public LoopTemplate(int type,
java.lang.String condition)
type - int, one of the loop types (DO|WHILE|FOR)condition - String, a complete condition for this loop i.e.
int i=0;i<x.size();i++ in a for loop.public void write(java.io.PrintWriter writer,
int indent)
ContentTemplatesuper.write(PrintWriter,int) to write out
the content for this method.write in interface Templatewrite in class ContentTemplatewriter - PrintWriter, an initialized PrintWriter to write this
element of the Class toindent - int, the indention for this element.
Value is multiplied by four to give the number of spaces used for indention
Template.write(java.io.PrintWriter, int)public void setCondition(java.lang.String condition)
condition - String, the condition for this looppublic java.lang.String getCondition()