Class EqualsOperator


  • public class EqualsOperator
    extends ComparisonOperator
    An operator implementation representing the equality operator.
    Since:
    Coherence 12.2.1
    Author:
    jk 2013.12.03
    • Field Detail

      • INSTANCE

        public static final EqualsOperator INSTANCE
        An instance of the EqualsOperator.
    • Constructor Detail

      • EqualsOperator

        protected EqualsOperator()
        Construct a EqualsOperator.
    • Method Detail

      • flip

        public ComparisonOperator flip()
        Description copied from class: ComparisonOperator
        Return the operator to use if this operation needs to be flipped due to the CohQL statement having the literal on the left hand side. For example if the statement was "2 == foo" this would need to be flipped to put the literal on the right so giving the statement "foo == 2" and the flipped operator is still ==. But for another example such as "2 >= foo" flipping this give the statement "foo <= 2" so the operator has changed from >= to <=
        Specified by:
        flip in class ComparisonOperator
        Returns:
        the operator to use if this operation needs to be flipped due to the CohQL statement having the literal on the left hand side.
      • makeFilter

        public ComparisonFilter makeFilter​(Term termLeft,
                                           Term termRight,
                                           TermWalker walker)
        Description copied from class: BaseOperator
        Create a Filter for this BaseOperator using the specified left and right Terms.

        Note: This method should be thread safe as operators are stored in a static map so may be called by multiple threads.

        Overrides:
        makeFilter in class ComparisonOperator
        Parameters:
        termLeft - the left term to use to build a Filter
        termRight - the right term to use to build a Filter
        walker - the TermWalker to use to process the left and right terms
        Returns:
        a Filter representing this operation.
      • makeFilter

        public ComparisonFilter makeFilter​(Object oLeft,
                                           Object oRight)
        Description copied from class: BaseOperator
        Create a Filter for this BaseOperator using the specified left and right values.

        Note: This method should be thread safe as operators are stored in a static map so may be called by multiple threads.

        Overrides:
        makeFilter in class BaseOperator<ComparisonFilter>
        Parameters:
        oLeft - the left value to use to build a Filter
        oRight - the right value to use to build a Filter
        Returns:
        a Filter representing this operation
      • addToTokenTable

        public void addToTokenTable​(TokenTable tokenTable)
        Description copied from class: BaseOperator
        Add this operator to the given TokenTable. This typically means adding this operator using its symbol and also adding any aliases.
        Specified by:
        addToTokenTable in class BaseOperator<ComparisonFilter>
        Parameters:
        tokenTable - the TokenTable to add this operator to