package org.obe.sql;
import java.io.IOException;
import java.io.Writer;
/**
* @author Adrian Price
*/
public class SQLOrExpr extends SimpleNode {
public SQLOrExpr(int id) {
super(id);
}
public void write(Writer out) throws IOException {
boolean or = false;
for (int i = 0; i < children.length; i++) {
if (or)
out.write(" OR ");
children[i].write(out);
or = true;
}
}
public Object execute(Object context) {
Boolean result = Boolean.FALSE;
for (int i = 0; i < children.length; i++) {
if (((Boolean)children[i].execute(context)).booleanValue()) {
result = Boolean.TRUE;
break;
}
}
return result;
}
}
|