'qualifier' replaced by 'index' throughout
[cql-java-moved-to-github.git] / src / org / z3950 / zing / cql / CQLRelation.java
index dc04417..6e4ec9b 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: CQLRelation.java,v 1.8 2002-12-05 17:14:52 mike Exp $
+// $Id: CQLRelation.java,v 1.15 2007-06-27 22:39:55 mike Exp $
 
 package org.z3950.zing.cql;
 import java.util.Vector;
@@ -6,9 +6,9 @@ import java.util.Properties;
 import java.lang.StringBuffer;
 
 /**
- * Represents a relation between a CQL qualifier and term.
+ * Represents a relation between a CQL index and term.
  *
- * @version    $Id: CQLRelation.java,v 1.8 2002-12-05 17:14:52 mike Exp $
+ * @version    $Id: CQLRelation.java,v 1.15 2007-06-27 22:39:55 mike Exp $
  */
 public class CQLRelation extends CQLNode {
     ModifierSet ms;
@@ -17,8 +17,9 @@ public class CQLRelation extends CQLNode {
      * Creates a new CQLRelation with the specified base relation.
      * Typical base relations include the usual six ordering relations
      * (<TT>&lt;=</TT>, <TT>&gt</TT>, <I>etc.</I>), the text
-     * relations <TT>any</TT>, <TT>all</TT> and <TT>exact</TT> and the
-     * server-choice relation <TT>scr</TT>.
+     * relations <TT>any</TT>, <TT>all</TT> and <TT>exact</TT>, the
+     * server-choice relation <TT>scr</TT> and profiled relations of
+     * the form <TT><I>prefix</I>.<I>name</I></TT>.
      */
     public CQLRelation(String base) {
        ms = new ModifierSet(base);
@@ -40,23 +41,16 @@ public class CQLRelation extends CQLNode {
      * for the text relations.
      */
     public void addModifier(String modifier) {
-       ms.addModifier(null, modifier);
+       ms.addModifier(modifier, null, null);
     }
 
     /**
      * Returns an array of the modifiers associated with a CQLRelation.
      * @return
-     * An array of zero or more <TT>String</TT>s, each representing a
-     * modifier associated with the specified CQLRelation.
+     * An array of Modifier objects.
      */
-    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 Vector<Modifier> getModifiers() {
+       return ms.getModifiers();
     }
 
     public String toXCQL(int level, Vector prefixes) {
@@ -71,9 +65,7 @@ public class CQLRelation extends CQLNode {
        throw new Error("CQLRelation.toPQF() can never be called");
     }
 
-    // ### THIS IS NOT THE REAL CODE.  I'm waiting for Ralph to send it.
-    public byte[] toType1(Properties config) {
-       byte[] op = new byte[0];
-       return op;
+    public byte[] toType1BER(Properties config) {
+       throw new Error("CQLRelation.toType1BER() can never be called");
     }
 }