The work for releases 1.0, 1.2 and 1.2.1 was sponsored by the National
Library of Australia, whose help we gratefully acknowledge.
+1.8 IN PROGRESS
+ - API changes: more information hiding, introduce getters
+ - make some contants read-only
+
+
1.7 Tue Jul 27 17:35:25 BST 2010
- Patch from Ralph LeVan to recognise
"qualifier.dc.creator"-like properties as well as
* @version $Id: CQLBooleanNode.java,v 1.18 2007-07-03 16:03:00 mike Exp $
*/
public abstract class CQLBooleanNode extends CQLNode {
+
+ private CQLNode left;
+
/**
* The root of a parse-tree representing the left-hand side.
- */
- public CQLNode left;
+ */
+ public CQLNode getLeft() {
+ return left;
+ }
+
+ private CQLNode right;
/**
* The root of a parse-tree representing the right-hand side.
- */
- public CQLNode right;
+ */
+ public CQLNode getRight() {
+ return right;
+ }
+ ModifierSet ms;
/**
* The set of modifiers that are applied to this boolean.
*/
- public ModifierSet ms;
+ public Vector<Modifier> getModifiers() {
+ return ms.getModifiers();
+ }
protected CQLBooleanNode(CQLNode left, CQLNode right, ModifierSet ms) {
this.left = left;
* >http://zing.z3950.org/cql/index.html</A>
*/
public class CQLGenerator {
- Properties params;
- Random rnd;
+ private Properties params;
+ private Random rnd;
static private boolean DEBUG = false;
/**
* @param len length to put into record
* @return the new, incremented value of the offset parameter.
*/
- public // ### shouldn't this be protected?
- static final int putLen(int len, byte[] record, int offset) {
+ static final int putLen(int len, byte[] record, int offset) {
if (len < 128)
record[offset++] = (byte)len;
relation = new CQLRelation(relstr);
match(lexer.ttype);
ModifierSet ms = gatherModifiers(relstr);
- relation.setModifiers(ms);
+ relation.ms = ms;
debug("index='" + index + ", " +
"relation='" + relation.toCQL() + "'");
}
* itself, such as <TT>dc</TT>, as it might be used in an index
* like <TT>dc.title</TT>.
*/
- public String name;
+ String name;
+
+ public String getName() {
+ return name;
+ }
/**
* The full identifier name of the prefix mapping. That is,
* typically, a URI permanently allocated to a specific index
* set, such as <TT>http://zthes.z3950.org/cql/1.0<TT>.
*/
- public String identifier;
+ String identifier;
+
+ public String getIdentifier() {
+ return identifier;
+ }
/**
* Creates a new CQLPrefix mapping, which maps the specified name
/**
* The prefix definition that governs the subtree.
*/
- public CQLPrefix prefix;
+ private CQLPrefix prefix;
+
+ public CQLPrefix getPrefix() {
+ return prefix;
+ }
/**
* The root of a parse-tree representing the part of the query
* that is governed by this prefix definition.
*/
- public CQLNode subtree;
+ private CQLNode subtree;
+
+ public CQLNode getSubtree() {
+ return subtree;
+ }
/**
* Creates a new CQLPrefixNode inducing a mapping from the
}
/**
- * Sets the modifiers of the specified CQLRelation.
- * Typical relation modifiers include <TT>relevant</TT>,
- * <TT>fuzzy</TT>, <TT>stem</TT> and <TT>phonetic</TT>. On the
- * whole, these modifiers have a meaningful interpretation only
- * for the text relations.
- */
- public void setModifiers(ModifierSet ms) {
- this.ms = ms;
- }
-
- /**
* Returns an array of the modifiers associated with a CQLRelation.
* @return
* An array of Modifier objects.
* The root of a subtree representing the query whose result is to
* be sorted.
*/
- public CQLNode subtree;
+ private CQLNode subtree;
/**
* The set of sort keys by which results are to be sorted,
*/
Vector<ModifierSet> keys;
+ public CQLNode getSubtree() {
+ return subtree;
+ }
+
public CQLSortNode(CQLNode subtree) {
this.subtree = subtree;
keys = new Vector<ModifierSet>();
* @version $Id: ModifierSet.java,v 1.13 2007-07-03 13:30:18 mike Exp $
*/
public class ModifierSet {
- String base;
- Vector<Modifier> modifiers;
+ private String base;
+ private Vector<Modifier> modifiers;
/**
* Creates a new ModifierSet with the specified base.