org.gusdb.wdk.model
Class BooleanQuery

java.lang.Object
  extended by org.gusdb.wdk.model.Query
      extended by org.gusdb.wdk.model.BooleanQuery

public class BooleanQuery
extends Query

BooleanQuery.java A Query representing the pairing of two other Queries (known as 'boolean operands') in a boolean operation (Union, Intersect, Subtract, etc.). The expected use of a BooleanQuery is as the ID Query for a Question and thus a BooleanQuery is fundamentally tied to other Questions and their Answers. A BooleanQuery has three parameters. Two are AnswerParams, representing Answers to Questions whose Queries are the boolean operands. The Questions must have the same RecordClasses in order to be operands. The third is the operation to be performed which is a StringParam. BooleanQueries are recursive, and thus the operand Queries can themselves be BooleanQueries. BooleanQueries are used like any other Query by making BooleanQueryInstances; the result is the result of the two operand Queries joined by the operation. BooleanQueries differ from other Queries in that a different one should be used every time a BooleanQuery is run (rather than the normal use of one Query providing many QueryInstances). Queries need to declare their columns, so a BooleanQuery provides this, but only when a BooleanQueryInstance has been created and its AnswerParameters have been set. The columns of the BooleanQuery then become the Columns of the ID Queries in the Answer's Question. The two Query operands in a BooleanQuery must have the same declared columns. It is the responsibility of whoever creates a BooleanQuery to set its RDBMSPlatform and ResultFactory (this differs from other Queries whose resources are set by the WdkModel upon instantiation). Created: Fri May 21 1821:30 EDT 2004


Field Summary
static java.lang.String BOOLEAN_PARAM_SET_NAME
          ParamSet for all boolean parameters.
static java.lang.String FIRST_ANSWER_PARAM_NAME
          Name of the AnswerParam whose value is the first Answer operand in the BooleanQuery.
static java.lang.String OPERATION_PARAM_NAME
          Name of the StringParam whose value is the operation in this BooleanQuery.
static java.lang.String SECOND_ANSWER_PARAM_NAME
          Name of the AnswerParam whose value is the second Answer operand in the BooleanQuery.
 
Constructor Summary
BooleanQuery()
          Normal constructor for a BooleanQuery; handles parameter creation.
 
Method Summary
 RDBMSPlatformI getRDBMSPlatform()
           
 ResultFactory getResultFactory()
           
 QueryInstance makeInstance()
           
 
Methods inherited from class org.gusdb.wdk.model.Query
addColumn, addParamRef, getColumn, getColumnMap, getColumns, getDescription, getDisplayName, getFullName, getHelp, getInternalParamValues, getIsCacheable, getName, getParams, setDescription, setDisplayName, setHelp, setIsCacheable, setName, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIRST_ANSWER_PARAM_NAME

public static final java.lang.String FIRST_ANSWER_PARAM_NAME
Name of the AnswerParam whose value is the first Answer operand in the BooleanQuery.

See Also:
Constant Field Values

SECOND_ANSWER_PARAM_NAME

public static final java.lang.String SECOND_ANSWER_PARAM_NAME
Name of the AnswerParam whose value is the second Answer operand in the BooleanQuery.

See Also:
Constant Field Values

OPERATION_PARAM_NAME

public static final java.lang.String OPERATION_PARAM_NAME
Name of the StringParam whose value is the operation in this BooleanQuery.

See Also:
Constant Field Values

BOOLEAN_PARAM_SET_NAME

public static final java.lang.String BOOLEAN_PARAM_SET_NAME
ParamSet for all boolean parameters.

See Also:
Constant Field Values
Constructor Detail

BooleanQuery

public BooleanQuery()
Normal constructor for a BooleanQuery; handles parameter creation.

Method Detail

getRDBMSPlatform

public RDBMSPlatformI getRDBMSPlatform()

getResultFactory

public ResultFactory getResultFactory()
Overrides:
getResultFactory in class Query

makeInstance

public QueryInstance makeInstance()
Specified by:
makeInstance in class Query
Returns:
BooleanQueryInstance on which one can set Answers and operations as values.