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