1 // $Id: CQLRelation.java,v 1.19 2007-07-03 13:40:58 mike Exp $
3 package org.z3950.zing.cql;
4 import java.util.Vector;
5 import java.util.Properties;
6 import java.lang.StringBuffer;
9 * Represents a relation between a CQL index and term.
11 * @version $Id: CQLRelation.java,v 1.19 2007-07-03 13:40:58 mike Exp $
13 public class CQLRelation extends CQLNode {
17 * Creates a new CQLRelation with the specified base relation.
18 * Typical base relations include the usual six ordering relations
19 * (<TT><=</TT>, <TT>></TT>, <I>etc.</I>), the text
20 * relations <TT>any</TT>, <TT>all</TT> and <TT>exact</TT>, the
21 * old server-choice relation <TT>scr</TT> and profiled relations of
22 * the form <TT><I>prefix</I>.<I>name</I></TT>.
24 // ### Seems wrong: a modifier set should not have a base, a
26 public CQLRelation(String base) {
27 ms = new ModifierSet(base);
31 * Returns the base relation with which the CQLRelation was
34 public String getBase() {
39 * Sets the modifiers of the specified CQLRelation.
40 * Typical relation modifiers include <TT>relevant</TT>,
41 * <TT>fuzzy</TT>, <TT>stem</TT> and <TT>phonetic</TT>. On the
42 * whole, these modifiers have a meaningful interpretation only
43 * for the text relations.
45 public void setModifiers(ModifierSet ms) {
50 * Returns an array of the modifiers associated with a CQLRelation.
52 * An array of Modifier objects.
54 public Vector<Modifier> getModifiers() {
55 return ms.getModifiers();
58 public String toXCQL(int level, Vector prefixes, Vector sortkeys) {
60 throw new Error("CQLRelation.toXCQL() called with sortkeys");
62 return ms.toXCQL(level, "relation");
65 public String toCQL() {
69 public String toPQF(Properties config) throws PQFTranslationException {
70 throw new Error("CQLRelation.toPQF() can never be called");
73 public byte[] toType1BER(Properties config) {
74 throw new Error("CQLRelation.toType1BER() can never be called");