X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Forg%2Fz3950%2Fzing%2Fcql%2FCQLBooleanNode.java;h=ec0608c8fe18bbd671d145da91cf1bf16825f44b;hb=af9fc1ccd0a8d9048d0b469a72b11bead020b719;hp=c449ce957fd1d6c6da0a85eeb04f3c3d7860a3b4;hpb=b6207f73b2c9cf685b2a216ad27e1ad4722535cc;p=cql-java-moved-to-github.git diff --git a/src/org/z3950/zing/cql/CQLBooleanNode.java b/src/org/z3950/zing/cql/CQLBooleanNode.java index c449ce9..ec0608c 100644 --- a/src/org/z3950/zing/cql/CQLBooleanNode.java +++ b/src/org/z3950/zing/cql/CQLBooleanNode.java @@ -1,4 +1,4 @@ -// $Id: CQLBooleanNode.java,v 1.15 2007-06-29 10:21:30 mike Exp $ +// $Id: CQLBooleanNode.java,v 1.18 2007-07-03 16:03:00 mike Exp $ package org.z3950.zing.cql; import java.util.Properties; @@ -8,7 +8,7 @@ import java.util.Vector; /** * Represents a boolean node in a CQL parse-tree. * - * @version $Id: CQLBooleanNode.java,v 1.15 2007-06-29 10:21:30 mike Exp $ + * @version $Id: CQLBooleanNode.java,v 1.18 2007-07-03 16:03:00 mike Exp $ */ public abstract class CQLBooleanNode extends CQLNode { /** @@ -32,8 +32,8 @@ public abstract class CQLBooleanNode extends CQLNode { this.ms = ms; } - public String toXCQL(int level, Vector prefixes) { - // ### Should this use CQLNode.toXCQL(level+2, prefixes)? + public String toXCQL(int level, Vector prefixes, + Vector sortkeys) { return (indent(level) + "\n" + renderPrefixes(level+1, prefixes) + ms.toXCQL(level+1, "boolean") + @@ -43,12 +43,15 @@ public abstract class CQLBooleanNode extends CQLNode { indent(level+1) + "\n" + right.toXCQL(level+2) + indent(level+1) + "\n" + + renderSortKeys(level+1, sortkeys) + indent(level) + "\n"); } public String toCQL() { // ### We don't always need parens around the operands - return "(" + left.toCQL() + ") " + op() + " (" + right.toCQL() + ")"; + return ("(" + left.toCQL() + ")" + + " " + ms.toCQL() + " " + + "(" + right.toCQL() + ")"); } public String toPQF(Properties config) throws PQFTranslationException { @@ -58,9 +61,7 @@ public abstract class CQLBooleanNode extends CQLNode { } // represents the operation for PQF: overridden for CQLProxNode - String opPQF() { return op(); } - - abstract String op(); + String opPQF() { return ms.getBase(); } public byte[] toType1BER(Properties config) throws PQFTranslationException { System.out.println("in CQLBooleanNode.toType1BER(): PQF=" +