X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Forg%2Fz3950%2Fzing%2Fcql%2FCQLRelation.java;h=c34f67ba1a491af3811fd6e234749f1249f37f4a;hb=8e35f984081a29de9b53af7c1b2fbf981c474d88;hp=6f007bc41dcf5d93184d7a3d7769a7dba79f928f;hpb=f744abfa23a7e569a156e4686e0e8e3cec242652;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 6f007bc..c34f67b 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.7 2002-11-20 01:15:15 mike Exp $
+// $Id: CQLRelation.java,v 1.17 2007-06-29 10:23:02 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.7 2002-11-20 01:15:15 mike Exp $
+ * @version $Id: CQLRelation.java,v 1.17 2007-06-29 10:23:02 mike Exp $
*/
public class CQLRelation extends CQLNode {
ModifierSet ms;
@@ -17,9 +17,12 @@ public class CQLRelation extends CQLNode {
* 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 and the
- * server-choice relation scr.
+ * relations any, all and exact, the
+ * 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);
}
@@ -33,30 +36,23 @@ public class CQLRelation extends CQLNode {
}
/**
- * Adds a new relation modifier to the specified CQLRelation.
+ * 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 addModifier(String modifier) {
- ms.addModifier(null, modifier);
+ public void setModifiers(ModifierSet ms) {
+ this.ms = ms;
}
/**
* Returns an array of the modifiers associated with a CQLRelation.
* @return
- * An array of zero or more Strings, 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 getModifiers() {
+ return ms.getModifiers();
}
public String toXCQL(int level, Vector prefixes) {
@@ -70,4 +66,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");
+ }
}