Class BinaryComparisonAbstract

  • All Implemented Interfaces:
    Filter, MultiValuedFilter, FilterType
    Direct Known Subclasses:
    CompareFilterImpl, GeometryFilterImpl

    public abstract class BinaryComparisonAbstract
    extends AbstractFilter
    implements MultiValuedFilter
    Abstract implementation for binary filters.

    This implementation gathers up expression1, expression2 and match action support.

    For the SAX parsers setExpression1 and setExpression2 can be used to fill in the filter after creation. Everyone else is asked to treat the filter as immutable and use the appropriate FilterFactory creation method.

    Author:
    Justin Deoliveira (Boundless)
    • Constructor Detail

      • BinaryComparisonAbstract

        protected BinaryComparisonAbstract()
        No argument constructor for use by SAX parsers.
      • BinaryComparisonAbstract

        protected BinaryComparisonAbstract​(Expression expression1,
                                           Expression expression2)
        Immutable constructor for use by FilterFactory
      • BinaryComparisonAbstract

        protected BinaryComparisonAbstract​(Expression expression1,
                                           Expression expression2,
                                           boolean matchingCase)
        Immutable constructor for use by FilterFactory
    • Method Detail

      • getExpression1

        public Expression getExpression1()
      • setExpression1

        public void setExpression1​(Expression expression)
      • getExpression2

        public Expression getExpression2()
      • setExpression2

        public void setExpression2​(Expression expression)
      • isMatchingCase

        public boolean isMatchingCase()
      • getMatchAction

        public MultiValuedFilter.MatchAction getMatchAction()
        Description copied from interface: MultiValuedFilter
        * Flag Controlling MatchAction property When one or more of the operands evaluates to multiple values rather than a single value, which action should be taken? If there are n values for the left operand and m values for the right operand, there are n * m possible combinations that can be compared,

        ANY - if any of the possible combinations match, the result is true (aggregated OR) ALL - only if all of the possible combinations match, the result is true (aggregated AND) ONE - only if exactly one of the possible combinations match, the result is true (aggregated XOR)

        Specified by:
        getMatchAction in interface MultiValuedFilter
        Returns:
        MatchAction flag
      • eval

        protected Object[] eval​(Object object)
        Convenience method which evaluates the expressions and trys to align the values to be of the same type.

        If the values can not be aligned, the original values are returned.

      • eval

        protected Object[] eval​(Object v1,
                                Object v2)
        Convenience method which evaluates the expressions and trys to align the values to be of the same type.

        If the values can not be aligned, the original values are returned.

      • comparable

        protected final Comparable comparable​(Object value)
        Wraps an object in a Comparable.
        Parameters:
        value - The original value.
        Returns:
        A comparable