-// $Id: CQLRelation.java,v 1.19 2007-07-03 13:40:58 mike Exp $
package org.z3950.zing.cql;
-import java.util.Vector;
+import java.util.List;
import java.util.Properties;
-import java.lang.StringBuffer;
/**
* Represents a relation between a CQL index and term.
*
- * @version $Id: CQLRelation.java,v 1.19 2007-07-03 13:40:58 mike Exp $
*/
public class CQLRelation extends CQLNode {
ModifierSet ms;
}
/**
- * 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 setModifiers(ModifierSet ms) {
- this.ms = ms;
- }
-
- /**
* Returns an array of the modifiers associated with a CQLRelation.
* @return
* An array of Modifier objects.
*/
- public Vector<Modifier> getModifiers() {
+ public List<Modifier> getModifiers() {
return ms.getModifiers();
}
- public String toXCQL(int level, Vector prefixes, Vector sortkeys) {
+ @Override
+ public void traverse(CQLNodeVisitor visitor) {
+ visitor.onRelation(this);
+ }
+
+ @Override
+ void toXCQLInternal(XCQLBuilder b, int level, List<CQLPrefix> prefixes,
+ List<ModifierSet> sortkeys) {
if (sortkeys != null)
throw new Error("CQLRelation.toXCQL() called with sortkeys");
-
- return ms.toXCQL(level, "relation");
+ ms.toXCQLInternal(b, level, "relation", "value");
}
+ @Override
public String toCQL() {
return ms.toCQL();
}
+ @Override
public String toPQF(Properties config) throws PQFTranslationException {
throw new Error("CQLRelation.toPQF() can never be called");
}
+ @Override
public byte[] toType1BER(Properties config) {
throw new Error("CQLRelation.toType1BER() can never be called");
}