Constructor accepts a ModifierSet
[cql-java-moved-to-github.git] / src / org / z3950 / zing / cql / CQLAndNode.java
1 // $Id: CQLAndNode.java,v 1.7 2007-06-29 10:22:12 mike Exp $
2
3 package org.z3950.zing.cql;
4
5
6 /**
7  * Represents an AND node in a CQL parse-tree.
8  *
9  * @version     $Id: CQLAndNode.java,v 1.7 2007-06-29 10:22:12 mike Exp $
10  */
11 public class CQLAndNode extends CQLBooleanNode {
12     /**
13      * Creates a new AND node with the specified left- and right-hand sides.
14      */
15     public CQLAndNode(CQLNode left, CQLNode right, ModifierSet ms) {
16         super(left, right, ms);
17     }
18
19     String op() {
20         return "and";
21     }
22
23     // ### Too much code duplication here with OR and NOT
24     byte[] opType1() {
25         byte[] op = new byte[5];
26         putTag(CONTEXT, 46, CONSTRUCTED, op, 0); // Operator
27         putLen(2, op, 2);
28         putTag(CONTEXT, 0, PRIMITIVE, op, 3); // and
29         putLen(0, op, 4);
30         return op;
31     }
32 }