-// $Id: CQLProxNode.java,v 1.8 2007-06-27 17:02:01 mike Exp $
+// $Id: CQLProxNode.java,v 1.9 2007-06-27 22:15:04 mike Exp $
package org.z3950.zing.cql;
import java.util.Vector;
* candidate records which are sufficiently close to each other, as
* specified by a set of proximity parameters.
*
- * @version $Id: CQLProxNode.java,v 1.8 2007-06-27 17:02:01 mike Exp $
+ * @version $Id: CQLProxNode.java,v 1.9 2007-06-27 22:15:04 mike Exp $
*/
public class CQLProxNode extends CQLBooleanNode {
ModifierSet ms;
}
/**
- * Adds a modifier of the specified <TT>type</TT> and
- * <TT>value</TT> to a proximity node. Valid types are
- * <TT>relation</TT>, <TT>distance</TT>, <TT>unit</TT> and
- * <TT>ordering</TT>.
- * <P>
- * For information on the semantics of these paramaters, see
- * <A href="http://zing.z3950.org/cql/intro.html#3.1"
- * >section 3.1 (Proximity)</A> of
- * <I>A Gentle Introduction to CQL</I></A>.
+ * Adds a modifier of the specified <TT>type</TT>,
+ * <TT>comparison</TT> and <TT>value</TT> to a proximity node.
*/
- public void addModifier(String type, String value) {
- ms.addModifier(type, value);
+ public void addModifier(String type, String comparison, String value) {
+ ms.addModifier(type, comparison, value);
}
/**
-// $Id: ModifierSet.java,v 1.9 2007-06-27 17:01:38 mike Exp $
+// $Id: ModifierSet.java,v 1.10 2007-06-27 22:14:03 mike Exp $
package org.z3950.zing.cql;
import java.util.Vector;
* zero or more <I>type</I> <I>comparison</I> <I>value</I> pairs,
* where type, comparison and value are all strings.
*
- * @version $Id: ModifierSet.java,v 1.9 2007-06-27 17:01:38 mike Exp $
+ * @version $Id: ModifierSet.java,v 1.10 2007-06-27 22:14:03 mike Exp $
*/
public class ModifierSet {
String base;
}
/**
- * Adds a modifier of the specified <TT>type</TT> and
+ * Adds a modifier of the specified <TT>type</TT>, <TT>comparison</TT> and
* <TT>value</TT> to a ModifierSet.
*/
- public void addModifier(String type, String value) {
+ public void addModifier(String type, String comparison, String value) {
// ### Need to have comparison passed in
- Modifier modifier = new Modifier(type, null, value);
+ Modifier modifier = new Modifier(type, comparison, value);
modifiers.add(modifier);
}
public static void main(String[] args) {
if (args.length < 1) {
- System.err.println("Usage: ModifierSet <base> [<type> <name>]...");
+ System.err.println("Usage: ModifierSet <base> [<type> <comparison> <name>]...");
System.exit(1);
}
ModifierSet res = new ModifierSet(args[0]);
- for (int i = 1; i < args.length; i += 2) {
- res.addModifier(args[i], args[i+1]);
+ for (int i = 1; i < args.length; i += 3) {
+ res.addModifier(args[i], args[i+1], args[i+2]);
}
System.out.println(res.toCQL());