Class ComparisonOperator
java.lang.Object
com.tangosol.coherence.dslquery.operator.BaseOperator<ComparisonFilter>
com.tangosol.coherence.dslquery.operator.ComparisonOperator
- Direct Known Subclasses:
EqualsOperator
,GreaterEqualsOperator
,GreaterOperator
,LessEqualsOperator
,LessOperator
,NotEqualsOperator
A base class for comparison operators, which are operators
that are used in conditional clauses such as equals, greater than,
less than, etc.
- Since:
- Coherence 12.2.1
- Author:
- jk 2013.12.03
-
Field Summary
Fields inherited from class com.tangosol.coherence.dslquery.operator.BaseOperator
f_asAlias, f_fConditional, f_sSymbol
-
Constructor Summary
ModifierConstructorDescriptionprotected
ComparisonOperator
(String sSymbol, String... asAliases) Construct a comparison operator with the given symbol and aliases. -
Method Summary
Modifier and TypeMethodDescriptionabstract BaseOperator
<ComparisonFilter> flip()
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.makeFilter
(Term termLeft, Term termRight, TermWalker walker) Methods inherited from class com.tangosol.coherence.dslquery.operator.BaseOperator
addAliases, addToTokenTable, getAliases, getSymbol, isConditional, makeExtractor, makeExtractor, makeFilter, toString, unmodifiableSet
-
Constructor Details
-
ComparisonOperator
Construct a comparison operator with the given symbol and aliases.- Parameters:
sSymbol
- the symbol for this operatorasAliases
- any aliases for this operator
-
-
Method Details
-
makeFilter
Description copied from class:BaseOperator
Create aFilter
for thisBaseOperator
using the specified left and rightTerm
s.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 classBaseOperator<ComparisonFilter>
- Parameters:
termLeft
- the left term to use to build a FiltertermRight
- the right term to use to build a Filterwalker
- theTermWalker
to use to process the left and right terms- Returns:
- a Filter representing this operation.
-
flip
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 <=- 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.
-