Class LogicalRule

  • All Implemented Interfaces:
    TypeRule, java.io.Serializable

    public class LogicalRule
    extends java.lang.Object
    implements TypeRule
    The logical rule describes a conjunction (AND), disjunction (OR) or negation (NOT) of the child rules. Note: The operator NOT can only take one argument.
    See Also:
    Serialized Form
    • Constructor Detail

      • LogicalRule

        public LogicalRule​(TypeRule.LogicalOperator operator)
        Constructs a new LogicalRule.
        Parameters:
        operator - the logical operator (AND, OR, NOT).
    • Method Detail

      • addOperand

        public void addOperand​(TypeRule rule)
        Adds a new operand, for the operator NOT, only one operand is allowed. TODO check that the NOT operator can only be used with one operand.
        Parameters:
        rule - a rule that is added as operand
      • getOperands

        public java.util.List<TypeRule> getOperands()
        Returns a list of rules that is combined by the logical operator. If NOT is used, the list has to contain exactly one entry.
        Returns:
        Returns all operands.