-// $Id: CQLRelation.java,v 1.11 2003-09-04 21:56:46 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.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.11 2003-09-04 21:56:46 mike Exp $
+ * @version $Id: CQLRelation.java,v 1.17 2007-06-29 10:23:02 mike Exp $
*/
public class CQLRelation extends CQLNode {
ModifierSet ms;
* server-choice relation <TT>scr</TT> and profiled relations of
* the form <TT><I>prefix</I>.<I>name</I></TT>.
*/
+ // ### Seems wrong: a modifier set should not have a base, a
+ // relation should
public CQLRelation(String base) {
ms = new ModifierSet(base);
}
}
/**
- * Adds a new relation modifier to the specified CQLRelation.
+ * Sets the modifiers of the specified CQLRelation.
* Typical relation modifiers include <TT>relevant</TT>,
* <TT>fuzzy</TT>, <TT>stem</TT> and <TT>phonetic</TT>. 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 <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) {