Change obsolete collections, remove redundant imports
[cql-java-moved-to-github.git] / src / main / java / org / z3950 / zing / cql / CQLRelation.java
1 // $Id: CQLRelation.java,v 1.19 2007-07-03 13:40:58 mike Exp $
2
3 package org.z3950.zing.cql;
4 import java.util.List;
5 import java.util.Properties;
6
7 /**
8  * Represents a relation between a CQL index and term.
9  *
10  * @version     $Id: CQLRelation.java,v 1.19 2007-07-03 13:40:58 mike Exp $
11  */
12 public class CQLRelation extends CQLNode {
13     ModifierSet ms;
14
15     /**
16      * Creates a new CQLRelation with the specified base relation.
17      * Typical base relations include the usual six ordering relations
18      * (<TT>&lt;=</TT>, <TT>&gt</TT>, <I>etc.</I>), the text
19      * relations <TT>any</TT>, <TT>all</TT> and <TT>exact</TT>, the
20      * old server-choice relation <TT>scr</TT> and profiled relations of
21      * the form <TT><I>prefix</I>.<I>name</I></TT>.
22      */
23     // ### Seems wrong: a modifier set should not have a base, a
24     // relation should
25     public CQLRelation(String base) {
26         ms = new ModifierSet(base);
27     }
28
29     /**
30      * Returns the base relation with which the CQLRelation was
31      * originally created.
32      */
33     public String getBase() {
34         return ms.getBase();
35     }
36
37     /**
38      * Returns an array of the modifiers associated with a CQLRelation.
39      * @return
40      *  An array of Modifier objects.
41      */
42     public List<Modifier> getModifiers() {
43         return ms.getModifiers();
44     }
45
46     public String toXCQL(int level, List<CQLPrefix> prefixes,
47       List<ModifierSet> sortkeys) {
48         if (sortkeys != null)
49             throw new Error("CQLRelation.toXCQL() called with sortkeys");
50
51         return ms.toXCQL(level, "relation");
52     }
53
54     public String toCQL() {
55         return ms.toCQL();
56     }
57
58     public String toPQF(Properties config) throws PQFTranslationException {
59         throw new Error("CQLRelation.toPQF() can never be called");
60     }
61
62     public byte[] toType1BER(Properties config) {
63         throw new Error("CQLRelation.toType1BER() can never be called");
64     }
65 }