Class ZestStructuredExpression

    • Constructor Detail

      • ZestStructuredExpression

        public ZestStructuredExpression()
        Instantiates a new zest structured expression.
      • ZestStructuredExpression

        public ZestStructuredExpression​(List<ZestExpressionElement> childrenExpression)
        Instantiates a new zest structured expression.
        Parameters:
        childrenExpression - the children expression
    • Method Detail

      • setChildrenCondition

        public List<ZestExpressionElement> setChildrenCondition​(List<ZestExpressionElement> new_list)
        sets the list of Children and return the previous list.
        Parameters:
        new_list - the new list of Children Condition
        Returns:
        the previous list of Children Condition
      • getChildrenCondition

        public List<ZestExpressionElement> getChildrenCondition()
        returns the children condition of this Zest Expression.
        Returns:
        the children condition
      • addChildCondition

        public void addChildCondition​(ZestExpressionElement child)
        adds a new Condition to the children (last position).
        Parameters:
        child - the child condition to add
      • removeChildCondition

        public ZestExpressionElement removeChildCondition​(ZestExpressionElement child)
        removes a child from the list of children condition.
        Parameters:
        child - the Expression to remove
        Returns:
        the expression removed if any, null otherwise.
      • removeChildCondition

        public ZestExpressionElement removeChildCondition​(int index)
        removes an element from the list of children condition.
        Parameters:
        index - the index of the element to remove
        Returns:
        the element removed if any.
      • removeAllChildren

        public boolean removeAllChildren​(Collection<ZestExpressionElement> childrenToRemove)
        Removes a collection of Expressions.
        Parameters:
        childrenToRemove - the Expressions, children of this StructuredExpression, which has to be removed
        Returns:
        true if list of children condition changed as a result of the call
      • clearChildren

        public void clearChildren()
        clears the list of children expression.
      • addChildCondition

        public void addChildCondition​(ZestExpressionElement child,
                                      int position)
        adds a new Condition to the children (give position).
        Parameters:
        child - the child condition to add
        position - the position where to add the condition
      • getChild

        public ZestExpressionElement getChild​(int index)
        returns the Condition Child in position i.
        Parameters:
        index - position of the child we're searching for
        Returns:
        the child found at the given position