Add override annotations
authorJakub Skoczen <jakub@indexdata.dk>
Fri, 22 Jul 2011 12:19:31 +0000 (14:19 +0200)
committerJakub Skoczen <jakub@indexdata.dk>
Fri, 22 Jul 2011 12:19:31 +0000 (14:19 +0200)
src/main/java/org/z3950/zing/cql/CQLAndNode.java
src/main/java/org/z3950/zing/cql/CQLBooleanNode.java
src/main/java/org/z3950/zing/cql/CQLLexer.java
src/main/java/org/z3950/zing/cql/CQLNotNode.java
src/main/java/org/z3950/zing/cql/CQLOrNode.java
src/main/java/org/z3950/zing/cql/CQLPrefixNode.java
src/main/java/org/z3950/zing/cql/CQLProxNode.java
src/main/java/org/z3950/zing/cql/CQLRelation.java
src/main/java/org/z3950/zing/cql/CQLSortNode.java
src/main/java/org/z3950/zing/cql/CQLTermNode.java

index dc452db..a1ebf76 100644 (file)
@@ -18,6 +18,7 @@ public class CQLAndNode extends CQLBooleanNode {
     }
 
     // ### Too much code duplication here with OR and NOT
+    @Override
     byte[] opType1() {
        byte[] op = new byte[5];
        putTag(CONTEXT, 46, CONSTRUCTED, op, 0); // Operator
index dafb19b..465b725 100644 (file)
@@ -44,6 +44,7 @@ public abstract class CQLBooleanNode extends CQLNode {
        this.ms = ms;
     }
 
+    @Override
     public String toXCQL(int level, List<CQLPrefix> prefixes,
                         List<ModifierSet> sortkeys) {
        return (indent(level) + "<triple>\n" +
@@ -59,6 +60,7 @@ public abstract class CQLBooleanNode extends CQLNode {
                indent(level) + "</triple>\n");
     }
 
+    @Override
     public String toCQL() {
        // ### We don't always need parens around the operands
        return ("(" + left.toCQL() + ")" +
@@ -66,6 +68,7 @@ public abstract class CQLBooleanNode extends CQLNode {
                "(" + right.toCQL() + ")");
     }
 
+    @Override
     public String toPQF(Properties config) throws PQFTranslationException {
        return ("@" + opPQF() +
                " " + left.toPQF(config) +
@@ -75,6 +78,7 @@ public abstract class CQLBooleanNode extends CQLNode {
     // represents the operation for PQF: overridden for CQLProxNode
     String opPQF() { return ms.getBase(); }
 
+    @Override
     public byte[] toType1BER(Properties config) throws PQFTranslationException {
         System.out.println("in CQLBooleanNode.toType1BER(): PQF=" +
                           toPQF(config));
index b0da745..7bbf115 100644 (file)
@@ -93,6 +93,7 @@ class CQLLexer extends StreamTokenizer {
        saved_sval = sval;
     }
 
+    @Override
     public int nextToken() throws java.io.IOException {
        if (saved_ttype != TT_UNDEFINED) {
            ttype = saved_ttype;
index 7b56de3..90346f4 100644 (file)
@@ -17,6 +17,7 @@ public class CQLNotNode extends CQLBooleanNode {
        super(left, right, ms);
     }
 
+    @Override
     byte[] opType1() {
        byte[] op = new byte[5];
        putTag(CONTEXT, 46, CONSTRUCTED, op, 0); // Operator
index 9e7d66e..67a292d 100644 (file)
@@ -17,6 +17,7 @@ public class CQLOrNode extends CQLBooleanNode {
        super(left, right, ms);
     }
 
+    @Override
     byte[] opType1() {
        byte[] op = new byte[5];
        putTag(CONTEXT, 46, CONSTRUCTED, op, 0); // Operator
index 84fb9a7..c793d2f 100644 (file)
@@ -41,6 +41,7 @@ public class CQLPrefixNode extends CQLNode {
        this.subtree = subtree;
     }
 
+    @Override
     public String toXCQL(int level, List<CQLPrefix> prefixes,
                         List<ModifierSet> sortkeys) {
        List<CQLPrefix> tmp = (prefixes == null ?
@@ -50,6 +51,7 @@ public class CQLPrefixNode extends CQLNode {
        return subtree.toXCQL(level, tmp, sortkeys);
     }
 
+    @Override
     public String toCQL() {
        // ### We don't always need parens around the subtree
        if (prefix.name == null) {
@@ -61,6 +63,7 @@ public class CQLPrefixNode extends CQLNode {
        }
     }
 
+    @Override
     public String toPQF(Properties config) throws PQFTranslationException {
        // Prefixes and their identifiers don't actually play any role
        // in PQF translation, since the meanings of the indexes,
@@ -69,6 +72,7 @@ public class CQLPrefixNode extends CQLNode {
        return subtree.toPQF(config);
     }
 
+    @Override
     public byte[] toType1BER(Properties config) throws PQFTranslationException {
        // See comment on toPQF()
        return subtree.toType1BER(config);
index 2ce355f..9f1f0c3 100644 (file)
@@ -29,6 +29,7 @@ public class CQLProxNode extends CQLBooleanNode {
      * which-code ::= 'known' | 'private' | integer.
      * unit-code ::= integer.
      */
+    @Override
     String opPQF() {
        int relCode = getRelCode();
        int unitCode = getProxUnitCode();
@@ -77,6 +78,7 @@ public class CQLProxNode extends CQLBooleanNode {
     }
 
 
+    @Override
     byte[] opType1() {
        byte[] op = new byte[100];
        int offset, value;
index 9e17d27..44a55e6 100644 (file)
@@ -43,6 +43,7 @@ public class CQLRelation extends CQLNode {
        return ms.getModifiers();
     }
 
+    @Override
     public String toXCQL(int level, List<CQLPrefix> prefixes,
       List<ModifierSet> sortkeys) {
        if (sortkeys != null)
@@ -51,14 +52,17 @@ public class CQLRelation extends CQLNode {
        return ms.toXCQL(level, "relation");
     }
 
+    @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");
     }
index 306f8c6..1c3aa14 100644 (file)
@@ -42,6 +42,7 @@ public class CQLSortNode extends CQLNode {
        return keys;
     }
 
+    @Override
     public String toXCQL(int level, List<CQLPrefix> prefixes,
                         List<ModifierSet> sortkeys) {
        if (sortkeys != null)
@@ -49,6 +50,7 @@ public class CQLSortNode extends CQLNode {
        return subtree.toXCQL(level, prefixes, keys);
     }
 
+    @Override
     public String toCQL() {
        StringBuffer buf = new StringBuffer(subtree.toCQL());
 
@@ -63,10 +65,12 @@ public class CQLSortNode extends CQLNode {
        return buf.toString();
     }
 
+    @Override
     public String toPQF(Properties config) throws PQFTranslationException {
        return "@attr 1=oops \"###\"";
     }
 
+    @Override
     public byte[] toType1BER(Properties config)
        throws PQFTranslationException {
        // There is no way to represent sorting in a standard Z39.50
index 1f03a4e..b45abdc 100644 (file)
@@ -52,6 +52,7 @@ public class CQLTermNode extends CQLNode {
            return null;
     }
 
+    @Override
     public String toXCQL(int level, List<CQLPrefix> prefixes,
                         List<ModifierSet> sortkeys) {
        return (indent(level) + "<searchClause>\n" +
@@ -63,6 +64,7 @@ public class CQLTermNode extends CQLNode {
                indent(level) + "</searchClause>\n");
     }
 
+    @Override
     public String toCQL() {
        String quotedIndex = maybeQuote(index);
        String quotedTerm = maybeQuote(term);
@@ -158,6 +160,7 @@ public class CQLTermNode extends CQLNode {
        return attrs;
     }
 
+    @Override
     public String toPQF(Properties config) throws PQFTranslationException {
        if (isResultSetIndex(index)) {
            // Special case: ignore relation, modifiers, wildcards, etc.
@@ -204,6 +207,7 @@ public class CQLTermNode extends CQLNode {
        return str;
     }
 
+    @Override
     public byte[] toType1BER(Properties config) throws PQFTranslationException {
        if (isResultSetIndex(index)) {
            // Special case: ignore relation, modifiers, wildcards, etc.