X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Forg%2Fz3950%2Fzing%2Fcql%2FCQLBooleanNode.java;h=a3c37496ce37575a176977a322f62b782289e614;hb=df372083094087da8590a526e0222c81c9ae7fc0;hp=56c212fc66c1595bb29bc17f518222b09a038cdb;hpb=d499738d2422e499fd7cb19c30b7d7fdee86e86d;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 56c212f..a3c3749 100644 --- a/src/org/z3950/zing/cql/CQLBooleanNode.java +++ b/src/org/z3950/zing/cql/CQLBooleanNode.java @@ -1,21 +1,29 @@ -// $Id: CQLBooleanNode.java,v 1.6 2002-10-31 22:22:01 mike Exp $ +// $Id: CQLBooleanNode.java,v 1.7 2002-11-06 00:05:58 mike Exp $ package org.z3950.zing.cql; /** * Represents a boolean node in a CQL parse-tree. - * ## * - * @version $Id: CQLBooleanNode.java,v 1.6 2002-10-31 22:22:01 mike Exp $ + * @version $Id: CQLBooleanNode.java,v 1.7 2002-11-06 00:05:58 mike Exp $ */ public abstract class CQLBooleanNode extends CQLNode { - protected CQLNode left; - protected CQLNode right; + CQLBooleanNode() {} // prevent javadoc from documenting this + + /** + * The root of a parse-tree representing the left-hand side. + */ + public CQLNode left; + + /** + * The root of a parse-tree representing the right-hand side. + */ + public CQLNode right; abstract String op(); - String toXCQL(int level) { + public String toXCQL(int level) { return (indent(level) + "\n" + booleanXQL(level+1) + left.toXCQL(level+1) + @@ -23,13 +31,14 @@ public abstract class CQLBooleanNode extends CQLNode { indent(level) + "\n"); } + // Represents the boolean operation itself: overridden for CQLProxNode String booleanXQL(int level) { return(indent(level) + "\n" + indent(level+1) + "" + op() + "\n" + indent(level) + "\n"); } - String toCQL() { + public String toCQL() { // ### We don't always need parens around the operands return "(" + left.toCQL() + ") " + op() + " (" + right.toCQL() + ")"; }