Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addBodyElement​(int index, IRuleElement element)
      Changes the given rule block.
      IRuleElement getBodyElement​(int index)
      Get the element of this rule at the specified index.
      int getBodyElementCount()
      Get the number of body elements of this rule.
      boolean isVirtual()
      Returns whether this block is a real block or consists just of a block element without brackets.
      boolean returnActualValue()
      Returns whether this body shall return an actual value (function) or a rule execution result.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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: IRuleBlock
        Get the number of body elements of this rule.
        Specified by:
        getBodyElementCount in interface IRuleBlock
        Returns:
        The number of body elements of this rule.
      • getBodyElement

        public IRuleElement getBodyElement​(int index)
        Description copied from interface: IRuleBlock
        Get the element of this rule at the specified index.
        Specified by:
        getBodyElement in interface IRuleBlock
        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: IRuleBlock
        Returns whether this block is a real block or consists just of a block element without brackets.
        Specified by:
        isVirtual in interface IRuleBlock
        Returns:
        true if this block is virtual, false else
      • addBodyElement

        public void addBodyElement​(int index,
                                   IRuleElement element)
                            throws VilException
        Description copied from interface: IRuleBlock
        Changes the given rule block. Shifts elements if necessary.
        Specified by:
        addBodyElement in interface IRuleBlock
        Parameters:
        index - index at which the specified element is to be inserted
        element - the element to be inserted
        Throws:
        VilException - in case that adding the element fails
      • returnActualValue

        public boolean returnActualValue()
        Description copied from interface: IRuleBlock
        Returns whether this body shall return an actual value (function) or a rule execution result.
        Specified by:
        returnActualValue in interface IRuleBlock
        Returns:
        true in case of an actual value, false else