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 SQLCompareExpr extends SimpleNode {
10: public SQLCompareExpr(int id) {
11: super (id);
12: }
13:
14: public void write(Writer out) throws IOException {
15: children[0].write(out);
16: if (children.length > 1)
17: children[1].write(out);
18: }
19:
20: public Object execute(Object context) {
21: Boolean result;
22: Object lhs = children[0].execute(context);
23: if (children.length == 1) {
24: result = (Boolean) lhs;
25: } else {
26: result = (Boolean) children[1].execute(context, lhs);
27: }
28: return result;
29: }
30: }
|