X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Forg%2Fz3950%2Fzing%2Fcql%2FCQLAndNode.java;h=d2e9f0f15b90d09f933cb1b706bea9ff35003fd2;hb=9173662a54173b877dc1ac5606e3064c24ac4881;hp=1893a3eeb3acb944b8baa423aac22b7fbdc11669;hpb=70be8275aabe87c909bf11148bb279c3e1380bb2;p=cql-java-moved-to-github.git diff --git a/src/org/z3950/zing/cql/CQLAndNode.java b/src/org/z3950/zing/cql/CQLAndNode.java index 1893a3e..d2e9f0f 100644 --- a/src/org/z3950/zing/cql/CQLAndNode.java +++ b/src/org/z3950/zing/cql/CQLAndNode.java @@ -1,21 +1,33 @@ -// $Id: CQLAndNode.java,v 1.3 2002-10-30 09:19:26 mike Exp $ +// $Id: CQLAndNode.java,v 1.8 2007-06-29 11:54:56 mike Exp $ package org.z3950.zing.cql; /** * Represents an AND node in a CQL parse-tree. - * ### * - * @version $Id: CQLAndNode.java,v 1.3 2002-10-30 09:19:26 mike Exp $ + * @version $Id: CQLAndNode.java,v 1.8 2007-06-29 11:54:56 mike Exp $ */ public class CQLAndNode extends CQLBooleanNode { - public CQLAndNode(CQLNode left, CQLNode right) { - this.left = left; - this.right = right; + /** + * Creates a new AND node with the specified left- and right-hand + * sides and modifiers. + */ + public CQLAndNode(CQLNode left, CQLNode right, ModifierSet ms) { + super(left, right, ms); } String op() { return "and"; } + + // ### Too much code duplication here with OR and NOT + byte[] opType1() { + byte[] op = new byte[5]; + putTag(CONTEXT, 46, CONSTRUCTED, op, 0); // Operator + putLen(2, op, 2); + putTag(CONTEXT, 0, PRIMITIVE, op, 3); // and + putLen(0, op, 4); + return op; + } }