From e57e14d4481428581265449445514fb426fbea45 Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 11 Dec 2002 17:14:20 +0000 Subject: [PATCH] Rename the toType1() method to the more explicit toType1BER() --- Changes | 8 +++----- src/org/z3950/zing/cql/CQLBooleanNode.java | 12 ++++++------ src/org/z3950/zing/cql/CQLNode.java | 8 ++++---- src/org/z3950/zing/cql/CQLPrefixNode.java | 8 ++++---- src/org/z3950/zing/cql/CQLRelation.java | 8 ++++---- src/org/z3950/zing/cql/CQLTermNode.java | 10 +++++----- 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Changes b/Changes index 06d0cee..39fde05 100644 --- a/Changes +++ b/Changes @@ -1,11 +1,11 @@ -$Id: Changes,v 1.26 2002-12-09 17:01:03 mike Exp $ +$Id: Changes,v 1.27 2002-12-11 17:14:20 mike Exp $ Revision history for the CQL-Java package. See the bottom of this file for a list of things still to do. 0.5 (IN PROGRESS, currently at RC1) - Add an extra back-end method, - byte[] toType1(Properties config) + byte[] toType1BER(Properties config) which generates an opaque BER-encoded PDU suitable for forwarding to Z39.50 server as a pasrt of a searchRequest APDU. This was contributed by Ralph Levan @@ -24,9 +24,7 @@ See the bottom of this file for a list of things still to do. difference to anything: in particular, file-names such as "cql-java.jar" remain the same. - Recreate last-in-field support - - Add srw.resultSet support to the toPFQ() method. I've not - attempted this for the toType1() method: Ralph will have to - do it. + - Add srw.resultSet support to the toPFQ() method. 0.4 Thu Nov 21 10:09:26 2002 - Add support for the new "phonetic" relation modifier, diff --git a/src/org/z3950/zing/cql/CQLBooleanNode.java b/src/org/z3950/zing/cql/CQLBooleanNode.java index 6e772eb..7064784 100644 --- a/src/org/z3950/zing/cql/CQLBooleanNode.java +++ b/src/org/z3950/zing/cql/CQLBooleanNode.java @@ -1,4 +1,4 @@ -// $Id: CQLBooleanNode.java,v 1.12 2002-12-05 17:14:52 mike Exp $ +// $Id: CQLBooleanNode.java,v 1.13 2002-12-11 17:14:20 mike Exp $ package org.z3950.zing.cql; import java.util.Properties; @@ -8,7 +8,7 @@ import java.util.Vector; /** * Represents a boolean node in a CQL parse-tree. * - * @version $Id: CQLBooleanNode.java,v 1.12 2002-12-05 17:14:52 mike Exp $ + * @version $Id: CQLBooleanNode.java,v 1.13 2002-12-11 17:14:20 mike Exp $ */ public abstract class CQLBooleanNode extends CQLNode { CQLBooleanNode() {} // prevent javadoc from documenting this @@ -59,11 +59,11 @@ public abstract class CQLBooleanNode extends CQLNode { abstract String op(); - public byte[] toType1(Properties config) throws PQFTranslationException { - System.out.println("in CQLBooleanNode.toType101(): PQF=" + + public byte[] toType1BER(Properties config) throws PQFTranslationException { + System.out.println("in CQLBooleanNode.toType1BER(): PQF=" + toPQF(config)); - byte[] rpn1 = left.toType1(config); - byte[] rpn2 = right.toType1(config); + byte[] rpn1 = left.toType1BER(config); + byte[] rpn2 = right.toType1BER(config); byte[] op = opType1(); byte[] rpnStructure = new byte[rpn1.length+rpn2.length+op.length+4]; diff --git a/src/org/z3950/zing/cql/CQLNode.java b/src/org/z3950/zing/cql/CQLNode.java index e0fba9d..1eae518 100644 --- a/src/org/z3950/zing/cql/CQLNode.java +++ b/src/org/z3950/zing/cql/CQLNode.java @@ -1,4 +1,4 @@ -// $Id: CQLNode.java,v 1.19 2002-12-09 16:29:44 mike Exp $ +// $Id: CQLNode.java,v 1.20 2002-12-11 17:14:20 mike Exp $ package org.z3950.zing.cql; import java.util.Properties; @@ -8,7 +8,7 @@ import java.util.Vector; /** * Represents a node in a CQL parse-tree. * - * @version $Id: CQLNode.java,v 1.19 2002-12-09 16:29:44 mike Exp $ + * @version $Id: CQLNode.java,v 1.20 2002-12-11 17:14:20 mike Exp $ */ public abstract class CQLNode { CQLNode() {} // prevent javadoc from documenting this @@ -112,7 +112,7 @@ public abstract class CQLNode { * ftp://ftp.rsasecurity.com/pub/pkcs/ascii/layman.asc */ - abstract public byte[] toType1(Properties config) + abstract public byte[] toType1BER(Properties config) throws PQFTranslationException; // ANS.1 classes @@ -304,7 +304,7 @@ public abstract class CQLNode { public static final byte[] makeQuery(CQLNode root, Properties properties) throws PQFTranslationException { - byte[] rpnStructure = root.toType1(properties); + byte[] rpnStructure = root.toType1BER(properties); byte[] qry = new byte[rpnStructure.length+100]; int offset = 0; offset = putTag(CONTEXT, 1, CONSTRUCTED, qry, offset); diff --git a/src/org/z3950/zing/cql/CQLPrefixNode.java b/src/org/z3950/zing/cql/CQLPrefixNode.java index 8841c77..3e2ad87 100644 --- a/src/org/z3950/zing/cql/CQLPrefixNode.java +++ b/src/org/z3950/zing/cql/CQLPrefixNode.java @@ -1,4 +1,4 @@ -// $Id: CQLPrefixNode.java,v 1.4 2002-12-05 17:14:52 mike Exp $ +// $Id: CQLPrefixNode.java,v 1.5 2002-12-11 17:14:20 mike Exp $ package org.z3950.zing.cql; import java.lang.String; @@ -9,7 +9,7 @@ import java.util.Vector; /** * Represents a prefix node in a CQL parse-tree. * - * @version $Id: CQLPrefixNode.java,v 1.4 2002-12-05 17:14:52 mike Exp $ + * @version $Id: CQLPrefixNode.java,v 1.5 2002-12-11 17:14:20 mike Exp $ */ public class CQLPrefixNode extends CQLNode { /** @@ -62,8 +62,8 @@ public class CQLPrefixNode extends CQLNode { return subtree.toPQF(config); } - public byte[] toType1(Properties config) throws PQFTranslationException { + public byte[] toType1BER(Properties config) throws PQFTranslationException { // See comment on toPQF() - return subtree.toType1(config); + return subtree.toType1BER(config); } } diff --git a/src/org/z3950/zing/cql/CQLRelation.java b/src/org/z3950/zing/cql/CQLRelation.java index c2ae57c..cd0c0b9 100644 --- a/src/org/z3950/zing/cql/CQLRelation.java +++ b/src/org/z3950/zing/cql/CQLRelation.java @@ -1,4 +1,4 @@ -// $Id: CQLRelation.java,v 1.9 2002-12-06 12:34:45 mike Exp $ +// $Id: CQLRelation.java,v 1.10 2002-12-11 17:14:20 mike Exp $ package org.z3950.zing.cql; import java.util.Vector; @@ -8,7 +8,7 @@ import java.lang.StringBuffer; /** * Represents a relation between a CQL qualifier and term. * - * @version $Id: CQLRelation.java,v 1.9 2002-12-06 12:34:45 mike Exp $ + * @version $Id: CQLRelation.java,v 1.10 2002-12-11 17:14:20 mike Exp $ */ public class CQLRelation extends CQLNode { ModifierSet ms; @@ -71,7 +71,7 @@ public class CQLRelation extends CQLNode { throw new Error("CQLRelation.toPQF() can never be called"); } - public byte[] toType1(Properties config) { - throw new Error("CQLRelation.toType1() can never be called"); + public byte[] toType1BER(Properties config) { + throw new Error("CQLRelation.toType1BER() can never be called"); } } diff --git a/src/org/z3950/zing/cql/CQLTermNode.java b/src/org/z3950/zing/cql/CQLTermNode.java index 89151a4..46676f4 100644 --- a/src/org/z3950/zing/cql/CQLTermNode.java +++ b/src/org/z3950/zing/cql/CQLTermNode.java @@ -1,4 +1,4 @@ -// $Id: CQLTermNode.java,v 1.16 2002-12-11 00:30:02 mike Exp $ +// $Id: CQLTermNode.java,v 1.17 2002-12-11 17:14:20 mike Exp $ package org.z3950.zing.cql; import java.util.Properties; @@ -12,7 +12,7 @@ import java.util.Vector; * these must be provided - you can't have a qualifier without a * relation or vice versa. * - * @version $Id: CQLTermNode.java,v 1.16 2002-12-11 00:30:02 mike Exp $ + * @version $Id: CQLTermNode.java,v 1.17 2002-12-11 17:14:20 mike Exp $ */ public class CQLTermNode extends CQLNode { private String qualifier; @@ -136,7 +136,7 @@ public class CQLTermNode extends CQLNode { public String toPQF(Properties config) throws PQFTranslationException { if (qualifier.equals("srw.resultSet")) { // Special case: ignore relation, modifiers, wildcards, etc. - // There's parallel code in toType1() + // There's parallel code in toType1BER() return "@set " + maybeQuote(term); } @@ -176,7 +176,7 @@ public class CQLTermNode extends CQLNode { return str; } - public byte[] toType1(Properties config) throws PQFTranslationException { + public byte[] toType1BER(Properties config) throws PQFTranslationException { if (qualifier.equals("srw.resultSet")) { // Special case: ignore relation, modifiers, wildcards, etc. // There's parallel code in toPQF() @@ -204,7 +204,7 @@ public class CQLTermNode extends CQLNode { text = text.substring(0, len-1); String attr, attrList, term = maybeQuote(text); - System.out.println("in CQLTermNode.toType101(): PQF=" + toPQF(config)); + System.out.println("in CQLTermNode.toType1BER(): PQF=" + toPQF(config)); byte[] operand = new byte[text.length()+100]; int i, j, offset, type, value; offset = putTag(CONTEXT, 0, CONSTRUCTED, operand, 0); // op -- 1.7.10.4