KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > store > NullComparisonExpression


1 /*
2  * Copyright 2002 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: NullComparisonExpression.java,v 1.3 2003/08/04 16:40:35 pierreg0 Exp $
9  */

10
11 package com.triactive.jdo.store;
12
13
14 class NullComparisonExpression extends BooleanExpression
15 {
16     private SQLExpression expr;
17     private boolean equalityTest;
18     private NullLiteral lit;
19
20     public NullComparisonExpression(SQLExpression expr, boolean equalityTest, NullLiteral lit)
21     {
22         super(expr, equalityTest ? OP_IS : OP_ISNOT, lit);
23
24         this.expr = expr;
25         this.equalityTest = equalityTest;
26     }
27
28     public BooleanExpression not()
29     {
30         return new NullComparisonExpression(expr, !equalityTest, lit);
31     }
32 }
33
Popular Tags