Interface CodeBlockIf
- All Superinterfaces:
CodeBlock, CodeBlockStatement, CodeBlockWithCondition, CodeItem, CodeItemWithVariables, CodeMutable, CodeMutableItem, CodeNode, CodeNodeItem, CodeNodeItemCopyable<CodeBlock, CodeBlockIf>, CodeStatement, CodeWithContext
public interface CodeBlockIf
extends CodeBlockWithCondition, CodeNodeItemCopyable<CodeBlock, CodeBlockIf>
CodeBlock for an if block. Syntax:
if («condition») {
«statements»
} else if («condition») {
«statements»
} else {
«statements»
} - Since:
- 1.0.0
- Author:
- hohwille
-
Field Summary
Fields inherited from interface CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Method Summary
Methods inherited from interface CodeBlock
add, addText, getStatements, getVariable, getVariable, isEmptyMethods inherited from interface CodeBlockStatement
getParentMethods inherited from interface CodeBlockWithCondition
getConditionMethods inherited from interface CodeItem
getLanguage, getSourceCode, write, write, write, write, write, writeMethods inherited from interface CodeMutable
isImmutable, isMutableMethods inherited from interface CodeMutableItem
getReflectiveObject, setImmutableMethods inherited from interface CodeNodeItemCopyable
copy, getParentMethods inherited from interface CodeWithContext
getContext, getSource
-
Method Details
-
getElse
CodeBlockIf getElse()- Returns:
- the next
else(if) block ornullfor none (if the end has been reached).
-
copy
CodeBlockIf copy()- Specified by:
copyin interfaceCodeBlock- Specified by:
copyin interfaceCodeBlockStatement- Specified by:
copyin interfaceCodeMutableItem- Specified by:
copyin interfaceCodeNodeItem- Specified by:
copyin interfaceCodeNodeItemCopyable<CodeBlock, CodeBlockIf>- Returns:
- a new
mutablecopy of thisCodeMutableItem. Will be a deep-copy with copies of all childCodeMutableItems.
-