X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Forg%2Fz3950%2Fzing%2Fcql%2FCQLRelation.java;h=570afffd94d906969e9b29c4f37ed1bffc7b5eb0;hb=af9fc1ccd0a8d9048d0b469a72b11bead020b719;hp=0d986747e4ea63546d9686080737809aa2936212;hpb=fc82b225d39cc66cb85c2557db0c0d4a4c5a6e27;p=cql-java-moved-to-github.git
diff --git a/src/org/z3950/zing/cql/CQLRelation.java b/src/org/z3950/zing/cql/CQLRelation.java
index 0d98674..570afff 100644
--- a/src/org/z3950/zing/cql/CQLRelation.java
+++ b/src/org/z3950/zing/cql/CQLRelation.java
@@ -1,4 +1,4 @@
-// $Id: CQLRelation.java,v 1.5 2002-11-06 20:13:45 mike Exp $
+// $Id: CQLRelation.java,v 1.19 2007-07-03 13:40:58 mike Exp $
package org.z3950.zing.cql;
import java.util.Vector;
@@ -6,36 +6,59 @@ 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.5 2002-11-06 20:13:45 mike Exp $
+ * @version $Id: CQLRelation.java,v 1.19 2007-07-03 13:40:58 mike Exp $
*/
public class CQLRelation extends CQLNode {
ModifierSet ms;
+ /**
+ * Creates a new CQLRelation with the specified base relation.
+ * Typical base relations include the usual six ordering relations
+ * (<=, >, etc.), the text
+ * relations any, all and exact, the
+ * old server-choice relation scr and profiled relations of
+ * the form prefix.name.
+ */
+ // ### Seems wrong: a modifier set should not have a base, a
+ // relation should
public CQLRelation(String base) {
ms = new ModifierSet(base);
}
+ /**
+ * Returns the base relation with which the CQLRelation was
+ * originally created.
+ */
public String getBase() {
return ms.getBase();
}
- public void addModifier(String modifier) {
- ms.addModifier(null, modifier);
+ /**
+ * Sets the modifiers of the specified CQLRelation.
+ * Typical relation modifiers include relevant,
+ * fuzzy, stem and phonetic. On the
+ * whole, these modifiers have a meaningful interpretation only
+ * for the text relations.
+ */
+ public void setModifiers(ModifierSet ms) {
+ this.ms = ms;
}
- 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;
+ /**
+ * Returns an array of the modifiers associated with a CQLRelation.
+ * @return
+ * An array of Modifier objects.
+ */
+ public Vector getModifiers() {
+ return ms.getModifiers();
}
- public String toXCQL(int level) {
+ public String toXCQL(int level, Vector prefixes, Vector sortkeys) {
+ if (sortkeys != null)
+ throw new Error("CQLRelation.toXCQL() called with sortkeys");
+
return ms.toXCQL(level, "relation");
}
@@ -46,4 +69,8 @@ public class CQLRelation extends CQLNode {
public String toPQF(Properties config) throws PQFTranslationException {
throw new Error("CQLRelation.toPQF() can never be called");
}
+
+ public byte[] toType1BER(Properties config) {
+ throw new Error("CQLRelation.toType1BER() can never be called");
+ }
}