-// $Id: CQLBooleanNode.java,v 1.13 2002-12-11 17:14:20 mike Exp $
+// $Id: CQLBooleanNode.java,v 1.14 2007-06-06 12:22:01 mike Exp $
package org.z3950.zing.cql;
import java.util.Properties;
/**
* Represents a boolean node in a CQL parse-tree.
*
- * @version $Id: CQLBooleanNode.java,v 1.13 2002-12-11 17:14:20 mike Exp $
+ * @version $Id: CQLBooleanNode.java,v 1.14 2007-06-06 12:22:01 mike Exp $
*/
public abstract class CQLBooleanNode extends CQLNode {
CQLBooleanNode() {} // prevent javadoc from documenting this
public CQLNode right;
public String toXCQL(int level, Vector prefixes) {
+ // ### Should this use CQLNode.toXCQL(level+2, prefixes)?
return (indent(level) + "<triple>\n" +
renderPrefixes(level+1, prefixes) +
opXCQL(level+1) +
indent(level+1) + "<leftOperand>\n" +
- left.toXCQL(level+2, new Vector()) +
+ left.toXCQL(level+2) +
indent(level+1) + "</leftOperand>\n" +
indent(level+1) + "<rightOperand>\n" +
- right.toXCQL(level+2, new Vector()) +
+ right.toXCQL(level+2) +
indent(level+1) + "</rightOperand>\n" +
indent(level) + "</triple>\n");
}
-// $Id: CQLNode.java,v 1.22 2002-12-12 15:03:50 mike Exp $
+// $Id: CQLNode.java,v 1.23 2007-06-06 12:22:01 mike Exp $
package org.z3950.zing.cql;
import java.util.Properties;
/**
* Represents a node in a CQL parse-tree.
*
- * @version $Id: CQLNode.java,v 1.22 2002-12-12 15:03:50 mike Exp $
+ * @version $Id: CQLNode.java,v 1.23 2007-06-06 12:22:01 mike Exp $
*/
public abstract class CQLNode {
CQLNode() {} // prevent javadoc from documenting this
* parse-tree whose root is this node.
*/
public String toXCQL(int level) {
- return toXCQL(level, new Vector());
+ return toXCQL(level, new Vector<CQLPrefix>());
}
- abstract public String toXCQL(int level, Vector prefixes);
+ abstract public String toXCQL(int level, Vector<CQLPrefix> prefixes);
protected static String renderPrefixes(int level, Vector prefixes) {
if (prefixes.size() == 0)
}
// Used only by the makeOID() method
- private static final java.util.Hashtable madeOIDs =
- new java.util.Hashtable(10);
+ private static final java.util.Hashtable<String, byte[]> madeOIDs =
+ new java.util.Hashtable<String, byte[]>(10);
protected static final byte[] makeOID(String oid) {
byte[] o;
-// $Id: CQLParser.java,v 1.23 2003-09-04 21:56:46 mike Exp $
+// $Id: CQLParser.java,v 1.24 2007-06-06 12:22:01 mike Exp $
package org.z3950.zing.cql;
import java.io.IOException;
/**
* Compiles CQL strings into parse trees of CQLNode subtypes.
*
- * @version $Id: CQLParser.java,v 1.23 2003-09-04 21:56:46 mike Exp $
+ * @version $Id: CQLParser.java,v 1.24 2007-06-06 12:22:01 mike Exp $
* @see <A href="http://zing.z3950.org/cql/index.html"
* >http://zing.z3950.org/cql/index.html</A>
*/
char mode = 'x'; // x=XCQL, c=CQL, p=PQF
String pfile = null;
- Vector argv = new Vector();
+ Vector<String> argv = new Vector<String>();
for (int i = 0; i < args.length; i++) {
argv.add(args[i]);
}
-// $Id: CQLPrefixNode.java,v 1.5 2002-12-11 17:14:20 mike Exp $
+// $Id: CQLPrefixNode.java,v 1.6 2007-06-06 12:22:01 mike Exp $
package org.z3950.zing.cql;
import java.lang.String;
/**
* Represents a prefix node in a CQL parse-tree.
*
- * @version $Id: CQLPrefixNode.java,v 1.5 2002-12-11 17:14:20 mike Exp $
+ * @version $Id: CQLPrefixNode.java,v 1.6 2007-06-06 12:22:01 mike Exp $
*/
public class CQLPrefixNode extends CQLNode {
/**
this.subtree = subtree;
}
- public String toXCQL(int level, Vector prefixes) {
+ public String toXCQL(int level, Vector<CQLPrefix> prefixes) {
// String maybeName = "";
// if (prefix.name != null)
// maybeName = indent(level+1) + "<name>" + prefix.name + "</name>\n";
// "<identifier>" + prefix.identifier + "</identifier>\n" +
// subtree.toXCQL(level+1, prefixes) +
// indent(level) + "</prefix>\n");
- Vector tmp = new Vector(prefixes);
+ Vector<CQLPrefix> tmp = new Vector<CQLPrefix>(prefixes);
tmp.add(prefix);
return subtree.toXCQL(level, tmp);
}
-// $Id: CQLTermNode.java,v 1.22 2006-06-14 14:36:36 mike Exp $
+// $Id: CQLTermNode.java,v 1.23 2007-06-06 12:22:01 mike Exp $
package org.z3950.zing.cql;
import java.util.Properties;
* these must be provided - you can't have a qualifier without a
* relation or vice versa.
*
- * @version $Id: CQLTermNode.java,v 1.22 2006-06-14 14:36:36 mike Exp $
+ * @version $Id: CQLTermNode.java,v 1.23 2007-06-06 12:22:01 mike Exp $
*/
public class CQLTermNode extends CQLNode {
private String qualifier;
return (indent(level) + "<searchClause>\n" +
renderPrefixes(level+1, prefixes) +
indent(level+1) + "<index>" + xq(qualifier) + "</index>\n" +
- relation.toXCQL(level+1, new Vector()) +
+ relation.toXCQL(level+1, new Vector<String>()) +
indent(level+1) + "<term>" + xq(term) + "</term>\n" +
indent(level) + "</searchClause>\n");
}
// regards truncation of the term and generation of truncation
// attributes. Change the interface to fix this.
private Vector getAttrs(Properties config) throws PQFTranslationException {
- Vector attrs = new Vector();
+ Vector<String> attrs = new Vector<String>();
// Do this first so that if any other truncation or
// completeness attributes are generated, they "overwrite"
-// $Id: ModifierSet.java,v 1.7 2002-11-20 17:56:22 mike Exp $
+// $Id: ModifierSet.java,v 1.8 2007-06-06 12:22:01 mike Exp $
package org.z3950.zing.cql;
import java.util.Vector;
* zero or more <I>type</I>=<I>value</I> pairs, where both type and
* value are strings. Types may be null, values may not.
*
- * @version $Id: ModifierSet.java,v 1.7 2002-11-20 17:56:22 mike Exp $
+ * @version $Id: ModifierSet.java,v 1.8 2007-06-06 12:22:01 mike Exp $
*/
public class ModifierSet {
String base;
- Vector modifiers;
+ Vector<Vector> modifiers;
/**
* Creates a new ModifierSet with the specified base.
*/
public ModifierSet(String base) {
this.base = base;
- modifiers = new Vector();
+ modifiers = new Vector<Vector>();
}
/**
* <TT>value</TT> to a ModifierSet.
*/
public void addModifier(String type, String value) {
- Vector modifier = new Vector();
+ Vector<String> modifier = new Vector<String>();
modifier.add(type);
modifier.add(value);
modifiers.add(modifier);