Finish (more or less) to CQL-to-PQF translator.
[cql-java-moved-to-github.git] / src / org / z3950 / zing / cql / CQLRelation.java
index ff8db8f..0d98674 100644 (file)
@@ -1,14 +1,14 @@
-// $Id: CQLRelation.java,v 1.2 2002-10-31 22:22:01 mike Exp $
+// $Id: CQLRelation.java,v 1.5 2002-11-06 20:13:45 mike Exp $
 
 package org.z3950.zing.cql;
 import java.util.Vector;
+import java.util.Properties;
 import java.lang.StringBuffer;
 
 /**
  * Represents a relation between a CQL qualifier and term.
- * ##
  *
- * @version    $Id: CQLRelation.java,v 1.2 2002-10-31 22:22:01 mike Exp $
+ * @version    $Id: CQLRelation.java,v 1.5 2002-11-06 20:13:45 mike Exp $
  */
 public class CQLRelation extends CQLNode {
     ModifierSet ms;
@@ -17,10 +17,24 @@ public class CQLRelation extends CQLNode {
        ms = new ModifierSet(base);
     }
 
+    public String getBase() {
+       return ms.getBase();
+    }
+
     public void addModifier(String modifier) {
        ms.addModifier(null, modifier);
     }
 
+    public String[] getModifiers() {
+       Vector[] v = ms.getModifiers();
+       int n = v.length;
+       String[] s = new String[n];
+       for (int i = 0; i < n; i++) {
+           s[i] = (String) v[i].get(1);
+       }
+       return s;
+    }
+
     public String toXCQL(int level) {
        return ms.toXCQL(level, "relation");
     }
@@ -28,4 +42,8 @@ public class CQLRelation extends CQLNode {
     public String toCQL() {
        return ms.toCQL();
     }
+
+    public String toPQF(Properties config) throws PQFTranslationException {
+       throw new Error("CQLRelation.toPQF() can never be called");
+    }
 }