org.z3950.zing.cql
Class ModifierSet

java.lang.Object
  extended by org.z3950.zing.cql.ModifierSet

public class ModifierSet
extends java.lang.Object

Represents a base String and a set of Modifiers.

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

A ModifierSet consists of a ``base'' string together with a set of zero or more type comparison value pairs, where type, comparison and value are all strings.

Version:
$Id: ModifierSet.java,v 1.13 2007-07-03 13:30:18 mike Exp $

Constructor Summary
ModifierSet(java.lang.String base)
          Creates a new ModifierSet with the specified base.
 
Method Summary
 void addModifier(java.lang.String type)
          Adds a modifier of the specified type, but with no comparison and value, to a ModifierSet.
 void addModifier(java.lang.String type, java.lang.String comparison, java.lang.String value)
          Adds a modifier of the specified type, comparison and value to a ModifierSet.
 java.lang.String getBase()
          Returns the base string with which the ModifierSet was created.
 java.util.Vector<Modifier> getModifiers()
          Returns an array of the modifiers in a ModifierSet.
static void main(java.lang.String[] args)
           
 java.lang.String modifier(java.lang.String type)
          Returns the value of the modifier in the specified ModifierSet that corresponds to the specified type.
 java.lang.String sortKeyToXCQL(int level)
           
 java.lang.String toCQL()
           
 java.lang.String toXCQL(int level, java.lang.String topLevelElement)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModifierSet

public ModifierSet(java.lang.String base)
Creates a new ModifierSet with the specified base.

Method Detail

getBase

public java.lang.String getBase()
Returns the base string with which the ModifierSet was created.


addModifier

public void addModifier(java.lang.String type,
                        java.lang.String comparison,
                        java.lang.String value)
Adds a modifier of the specified type, comparison and value to a ModifierSet.


addModifier

public void addModifier(java.lang.String type)
Adds a modifier of the specified type, but with no comparison and value, to a ModifierSet.


modifier

public java.lang.String modifier(java.lang.String type)
Returns the value of the modifier in the specified ModifierSet that corresponds to the specified type.


getModifiers

public java.util.Vector<Modifier> getModifiers()
Returns an array of the modifiers in a ModifierSet.

Returns:
An array of Modifiers.

toXCQL

public java.lang.String toXCQL(int level,
                               java.lang.String topLevelElement)

sortKeyToXCQL

public java.lang.String sortKeyToXCQL(int level)

toCQL

public java.lang.String toCQL()

main

public static void main(java.lang.String[] args)