01: /**********************************************************************
02: Copyright (c) 2008 Andy Jefferson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15: Contributors:
16: ...
17: **********************************************************************/package org.jpox.store.expression;
18:
19: /**
20: * Expression for something being "in"/"not in" something else.
21: */
22: public class InExpression extends BooleanExpression {
23: ScalarExpression expr1;
24: ScalarExpression expr2;
25:
26: /**
27: * Constructor for expr1 being IN expr2.
28: * @param op the operator (OP_IN, OP_NOTIN)
29: * @param expr1 the expression being contained
30: * @param expr2 the expression that contains
31: */
32: public InExpression(ScalarExpression expr1, DyadicOperator op,
33: ScalarExpression expr2) {
34: super (expr1, op, expr2);
35: this .expr1 = expr1;
36: this .expr2 = expr2;
37: }
38:
39: /**
40: * Method to return a boolean expression for expr1 NOT IN expr2.
41: * @return The boolean expression for NOT IN
42: */
43: public BooleanExpression not() {
44: return new InExpression(expr1, OP_NOTIN, expr2);
45: }
46: }
|