X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Forg%2Fz3950%2Fzing%2Fcql%2FModifierSet.java;h=c88a694d58a5eb8738ddefbd1d7e632cf7682ce7;hb=394625a21876d096000c4940049305c27de90321;hp=8b8c24509a41b72acadea7754c359f35968a422b;hpb=1b33e1aa62c7f3214383648abc99fedcf950977a;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 8b8c245..c88a694 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.4 2002-11-06 20:13:45 mike Exp $ +// $Id: ModifierSet.java,v 1.5 2002-11-17 23:29:02 mike Exp $ package org.z3950.zing.cql; import java.util.Vector; @@ -9,23 +9,37 @@ import java.lang.StringBuffer; *

* This class is used as a workhorse delegate by both CQLRelation and * CQLProxNode - two functionally very separate classes that happen to - * require the same data structures and functionality. + * require similar data structures and functionality. + *

+ * A ModifierSet consists of a ``base'' string together with a set of + * zero or more type=value pairs, where both type and + * value are strings. Types may be null, values may not. * - * @version $Id: ModifierSet.java,v 1.4 2002-11-06 20:13:45 mike Exp $ + * @version $Id: ModifierSet.java,v 1.5 2002-11-17 23:29:02 mike Exp $ */ public class ModifierSet { String base; Vector modifiers; + /** + * Creates a new ModifierSet with the specified base. + */ public ModifierSet(String base) { this.base = base; modifiers = new Vector(); } + /** + * Returns the base string with which the ModifierSet was created. + */ public String getBase() { return base; } + /** + * Adds a modifier of the specified type and + * value to a ModifierSet. + */ public void addModifier(String type, String value) { Vector modifier = new Vector(); modifier.add(type); @@ -33,6 +47,10 @@ public class ModifierSet { modifiers.add(modifier); } + /** + * Returns the value of the modifier in the specified ModifierSet + * that corresponds to the specified type. + */ public String modifier(String type) { int n = modifiers.size(); for (int i = 0; i < n; i++) { @@ -43,6 +61,13 @@ public class ModifierSet { return null; } + /** + * Returns an array of the modifiers in a ModifierSet. + * @return + * An array of modifiers, each represented by a two-element + * Vector, in which element 0 is the modifier type and + * element 1 is the associated value. + */ public Vector[] getModifiers() { int n = modifiers.size(); Vector[] res = new Vector[n];