X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Forg%2Fz3950%2Fzing%2Fcql%2FModifierSet.java;h=8c5ec16a67132ed2a0efe56c7d406e26e77ce5ee;hb=af923f9b50aecdbf896af612e733817f96c4388a;hp=ee185a3b5b83391309351d2b1ffa0d5c2b1d43ec;hpb=8cf2c45ba7e58c2940d1f73923c7ade542fd5086;p=cql-java-moved-to-github.git diff --git a/src/org/z3950/zing/cql/ModifierSet.java b/src/org/z3950/zing/cql/ModifierSet.java index ee185a3..8c5ec16 100644 --- a/src/org/z3950/zing/cql/ModifierSet.java +++ b/src/org/z3950/zing/cql/ModifierSet.java @@ -1,4 +1,4 @@ -// $Id: ModifierSet.java,v 1.10 2007-06-27 22:14:03 mike Exp $ +// $Id: ModifierSet.java,v 1.12 2007-06-29 10:20:41 mike Exp $ package org.z3950.zing.cql; import java.util.Vector; @@ -15,7 +15,7 @@ import java.lang.StringBuffer; * zero or more type comparison value pairs, * where type, comparison and value are all strings. * - * @version $Id: ModifierSet.java,v 1.10 2007-06-27 22:14:03 mike Exp $ + * @version $Id: ModifierSet.java,v 1.12 2007-06-29 10:20:41 mike Exp $ */ public class ModifierSet { String base; @@ -37,16 +37,24 @@ public class ModifierSet { } /** - * Adds a modifier of the specified type, comparison and - * value to a ModifierSet. + * Adds a modifier of the specified type, + * comparison and value to a ModifierSet. */ public void addModifier(String type, String comparison, String value) { - // ### Need to have comparison passed in Modifier modifier = new Modifier(type, comparison, value); modifiers.add(modifier); } /** + * Adds a modifier of the specified type, but with no + * comparison and value, to a ModifierSet. + */ + public void addModifier(String type) { + Modifier modifier = new Modifier(type); + modifiers.add(modifier); + } + + /** * Returns the value of the modifier in the specified ModifierSet * that corresponds to the specified type. */ @@ -77,7 +85,7 @@ public class ModifierSet { if (modifiers.size() > 0) { buf.append(Utils.indent(level+1) + "\n"); for (int i = 0; i < modifiers.size(); i++) { - buf.append(modifiers.get(i).toXCQL(level+2, "relation")); + buf.append(modifiers.get(i).toXCQL(level+2, "comparison")); } buf.append(Utils.indent(level+1) + "\n"); }