1 // $Id: CQLNode.java,v 1.10 2002-11-05 17:21:30 mike Exp $
3 package org.z3950.zing.cql;
7 * Represents a node in a CQL parse-tree.
10 * @version $Id: CQLNode.java,v 1.10 2002-11-05 17:21:30 mike Exp $
12 public abstract class CQLNode {
13 abstract public String toXCQL(int level);
14 abstract public String toCQL();
16 // Utility-function abbreviations for the use of subclasses
17 protected static String indent(int level) { return Utils.indent(level); }
18 protected static String xq(String str) { return Utils.xq(str); }
21 public static void main (String[] args) {
22 CQLNode n1 = new CQLTermNode("dc.author",
25 CQLNode n2 = new CQLTermNode("dc.title",
26 new CQLRelation("all"),
28 CQLNode root = new CQLAndNode(n1, n2);
29 System.out.println(root.toXCQL(0));