-// $Id: CQLNode.java,v 1.20 2002-12-11 17:14:20 mike Exp $
+// $Id: CQLNode.java,v 1.24 2007-06-06 13:19:28 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.20 2002-12-11 17:14:20 mike Exp $
+ * @version $Id: CQLNode.java,v 1.24 2007-06-06 13:19:28 mike Exp $
*/
public abstract class CQLNode {
CQLNode() {} // prevent javadoc from documenting this
/**
+ * Returns the name of the result-set to which this query is a
+ * reference, if and only if the entire query consists only of a
+ * result-set reference. If it's anything else, including a
+ * boolean combination of a result-set reference with something
+ * else, then null is returned instead.
+ * @return the name of the referenced result-set
+ */
+ public String getResultSetName() {
+ return null;
+ }
+
+ /**
* Translates a parse-tree into an XCQL document.
* <P>
* @param level
* 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)
/**
* Put a length directly into a BER record.
*
- * @param length length to put into record
+ * @param len length to put into record
* @return the new, incremented value of the offset parameter.
*/
public // ### shouldn't this be protected?
/**
* Get the length needed to represent the given number.
*
- * @param number determine length needed to encode this
+ * @param num determine length needed to encode this
* @return length needed to encode given number
*/
protected static final int numLen(long num) {
}
// 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;