X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Forg%2Fz3950%2Fzing%2Fcql%2FCQLRelation.java;h=c34f67ba1a491af3811fd6e234749f1249f37f4a;hb=b53fe47e0bd5f0825b0d8ceeb33538e714bf9e7e;hp=ff8db8f48c04eec4a17dc4fce933dc5ec6f40cf8;hpb=f8154c71944186a9b64ddb782082a2026c5a912f;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 ff8db8f..c34f67b 100644
--- a/src/org/z3950/zing/cql/CQLRelation.java
+++ b/src/org/z3950/zing/cql/CQLRelation.java
@@ -1,31 +1,73 @@
-// $Id: CQLRelation.java,v 1.2 2002-10-31 22:22:01 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;
+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.2 2002-10-31 22:22:01 mike Exp $
+ * @version $Id: CQLRelation.java,v 1.17 2007-06-29 10:23:02 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
+ * 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);
}
- public void addModifier(String modifier) {
- ms.addModifier(null, modifier);
+ /**
+ * Returns the base relation with which the CQLRelation was
+ * originally created.
+ */
+ public String getBase() {
+ return ms.getBase();
}
- public String toXCQL(int level) {
+ /**
+ * 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;
+ }
+
+ /**
+ * 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, Vector prefixes) {
return ms.toXCQL(level, "relation");
}
public String toCQL() {
return ms.toCQL();
}
+
+ 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");
+ }
}