Interface LogicalOperator<R>

Type Parameters:
R - the type of resources (e.g. Feature) to filter.
All Superinterfaces:
Filter<R>, Predicate<R>

@Classifier(ABSTRACT) @UML(identifier="LogicalOperator", specification=ISO_19143) public interface LogicalOperator<R> extends Filter<R>
Combination of one or more conditional expressions. The logical operator AND evaluates to true if all the combined expressions evaluate to true. The operator OR evaluates to true is any of the combined expressions evaluate to true. The NOT operator reverses the logical value of an expression.

The arity is determined the length of the operands list. If 1, this operator is an unary logic operator. If 2 or more, this operator is a binary logic operator. The length may be more than 2 if the AND or OR operation is repeated for all operands.

Since:
3.1
  • Method Details

    • getOperatorType

      @UML(identifier="UnaryLogicOperator.operatorType, BinaryLogicOperator.operatorType", obligation=MANDATORY, specification=ISO_19143) LogicalOperatorName getOperatorType()
      Returns the nature of the operator.
      Specified by:
      getOperatorType in interface Filter<R>
      Returns:
      the nature of the operator.
    • getExpressions

      default List<Expression<? super R,?>> getExpressions()
      Returns a view of filter operands as expressions having Boolean return values. The expression list shall have the same size than the operands list. For each index i valid for the lists, the following relation shall hold:
      R any = ...;
      Object  e = expressions.get(i).apply(any);
      Boolean f = filters.get(i).test(any);
      assert e.equals(f);
      
      Specified by:
      getExpressions in interface Filter<R>
      Returns:
      a view of operands list as expressions.
    • getOperands

      @UML(identifier="UnaryLogicOperator.operands, BinaryLogicOperator.operands", obligation=MANDATORY, specification=ISO_19143) List<Filter<? super R>> getOperands()
      Returns a list containing all of the child filters of this object. This list will contain at least one element, and each element will be an instance of Filter.
      Returns:
      all child filters used as operands.