Class SimpleStatementBlock
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.buildlangModel.SimpleStatementBlock
-
- All Implemented Interfaces:
IRuleBlock
public class SimpleStatementBlock extends java.lang.Object implements IRuleBlock
Represents a simple statement as block (without brackets).- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private IRuleElementelement
-
Constructor Summary
Constructors Constructor Description SimpleStatementBlock()Constructor for serialization.SimpleStatementBlock(IRuleElement element)Creates a simple statement block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBodyElement(int index, IRuleElement element)Changes the given rule block.IRuleElementgetBodyElement(int index)Get the element of this rule at the specified index.intgetBodyElementCount()Get the number of body elements of this rule.booleanisVirtual()Returns whether this block is a real block or consists just of a block element without brackets.booleanreturnActualValue()Returns whether this body shall return an actual value (function) or a rule execution result.
-
-
-
Field Detail
-
element
private IRuleElement element
-
-
Constructor Detail
-
SimpleStatementBlock
SimpleStatementBlock()
Constructor for serialization.
-
SimpleStatementBlock
public SimpleStatementBlock(IRuleElement element)
Creates a simple statement block.- Parameters:
element- the element that constitutes the block
-
-
Method Detail
-
getBodyElementCount
public int getBodyElementCount()
Description copied from interface:IRuleBlockGet the number of body elements of this rule.- Specified by:
getBodyElementCountin interfaceIRuleBlock- Returns:
- The number of body elements of this rule.
-
getBodyElement
public IRuleElement getBodyElement(int index)
Description copied from interface:IRuleBlockGet the element of this rule at the specified index.- Specified by:
getBodyElementin interfaceIRuleBlock- Parameters:
index- The 0-based index of the rule element to be returned.- Returns:
- The rule element at the given index.
-
isVirtual
public boolean isVirtual()
Description copied from interface:IRuleBlockReturns whether this block is a real block or consists just of a block element without brackets.- Specified by:
isVirtualin interfaceIRuleBlock- Returns:
trueif this block is virtual,falseelse
-
addBodyElement
public void addBodyElement(int index, IRuleElement element) throws VilExceptionDescription copied from interface:IRuleBlockChanges the given rule block. Shifts elements if necessary.- Specified by:
addBodyElementin interfaceIRuleBlock- Parameters:
index- index at which the specified element is to be insertedelement- the element to be inserted- Throws:
VilException- in case that adding the element fails
-
returnActualValue
public boolean returnActualValue()
Description copied from interface:IRuleBlockReturns whether this body shall return an actual value (function) or a rule execution result.- Specified by:
returnActualValuein interfaceIRuleBlock- Returns:
truein case of an actual value,falseelse
-
-