01: package org.obe.sql;
02:
03: import java.io.IOException;
04: import java.io.Writer;
05:
06: /**
07: * @author Adrian Price
08: */
09: public class SQLNotExpr extends SQLInvertibleClause {
10: public SQLNotExpr(int id) {
11: super (id);
12: }
13:
14: public void write(Writer out) throws IOException {
15: if (invert)
16: out.write(" NOT ");
17: children[0].write(out);
18: }
19:
20: public Object execute(Object context) {
21: boolean b = ((Boolean) children[0].execute(context))
22: .booleanValue();
23: return b ^ invert ? Boolean.TRUE : Boolean.FALSE;
24: }
25: }
|