Package com.sun.codemodel
Class JConditional
- java.lang.Object
-
- com.sun.codemodel.JConditional
-
- All Implemented Interfaces:
JStatement
public class JConditional extends java.lang.Object implements JStatement
If statement, with optional else clause
-
-
Constructor Summary
Constructors Constructor Description JConditional(JExpression test)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JBlock
_else()
Create a block to be executed by "else" branchJConditional
_elseif(JExpression boolExp)
Creates ...JBlock
_then()
Return the block to be excuted by the "then" branchvoid
state(JFormatter f)
-
-
-
Field Detail
-
test
private JExpression test
JExpression to test to determine branching
-
_then
private JBlock _then
JBlock of statements for "then" clause
-
_else
private JBlock _else
JBlock of statements for optional "else" clause
-
-
Constructor Detail
-
JConditional
JConditional(JExpression test)
Constructor- Parameters:
test
- JExpression which will determine branching
-
-
Method Detail
-
_then
public JBlock _then()
Return the block to be excuted by the "then" branch- Returns:
- Then block
-
_else
public JBlock _else()
Create a block to be executed by "else" branch- Returns:
- Newly generated else block
-
_elseif
public JConditional _elseif(JExpression boolExp)
Creates ... else if(...) ... code.
-
state
public void state(JFormatter f)
- Specified by:
state
in interfaceJStatement
-
-