Interface IRuleBlock
-
- All Known Subinterfaces:
IEnumeratingLoop
- All Known Implementing Classes:
AbstractRule,ForStatement,MapExpression,NestedRuleBlock,Rule,RuleBlock,SimpleStatementBlock,VtlRule,WhileStatement
public interface IRuleBlockDefines the interface for a rule block, i.e., a block containingrule elements.- Author:
- Holger Eichelberger
-
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Method Detail
-
getBodyElementCount
int getBodyElementCount()
Get the number of body elements of this rule.- Returns:
- The number of body elements of this rule.
-
getBodyElement
IRuleElement getBodyElement(int index)
Get the element of this rule at the specified index.- Parameters:
index- The 0-based index of the rule element to be returned.- Returns:
- The rule element at the given index.
- Throws:
java.lang.IndexOutOfBoundsException- ifindex < 0 || index >=getBodyElementCount()
-
isVirtual
boolean isVirtual()
Returns whether this block is a real block or consists just of a block element without brackets.- Returns:
trueif this block is virtual,falseelse
-
addBodyElement
void addBodyElement(int index, IRuleElement element) throws VilExceptionChanges the given rule block. Shifts elements if necessary.- 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
boolean returnActualValue()
Returns whether this body shall return an actual value (function) or a rule execution result.- Returns:
truein case of an actual value,falseelse
-
-