edu.northwestern.at.wordhoard.swing.calculator.cql
Class CQLTermSet

java.lang.Object
  extended by edu.northwestern.at.wordhoard.swing.calculator.cql.CQLTermSet

public class CQLTermSet
extends java.lang.Object

A WordHoard Corpus Query Language term set.


Field Summary
protected  java.util.Set queryTerms
          The search terms to match for a given word.
 
Constructor Summary
CQLTermSet()
          Create a search term set.
CQLTermSet(java.util.Collection queryTerms)
          Create a query term set from a collection of query terms.
CQLTermSet(CQLQueryTokenizer tokenizer)
          Create a new term set from a CQLQueryTokenizer.
CQLTermSet(CQLTerm[] queryTerms)
          Create a query term set from a collection of query terms.
 
Method Summary
 java.util.Collection getQueryTerms()
          Get the query terms for this term set.
 boolean hasSpeaker()
          Determine if any constituent query term refers to a speaker.
 boolean hasSpeech()
          Determine if any constituent query term refers to a speech.
 boolean hasWordPart()
          Determine if any constituent query term refers to a word part.
 java.lang.String toHQL(java.lang.String queryField, int fieldIndexBogus, boolean doingWords)
          Get HQL version of query term set.
 java.lang.String toString()
          Displayable version of term set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

queryTerms

protected java.util.Set queryTerms
The search terms to match for a given word.

Constructor Detail

CQLTermSet

public CQLTermSet()
Create a search term set.


CQLTermSet

public CQLTermSet(CQLQueryTokenizer tokenizer)
           throws InvalidCQLQueryException
Create a new term set from a CQLQueryTokenizer.

Parameters:
tokenizer - The CQLQueryTokenizer. Should be pointing at the start of a set of CQLTerm definitions.
Throws:
InvalidCQLQueryException - if the CQL syntax is bad.

CQLTermSet

public CQLTermSet(java.util.Collection queryTerms)
Create a query term set from a collection of query terms.

Parameters:
queryTerms - The query terms defining the query term set.

CQLTermSet

public CQLTermSet(CQLTerm[] queryTerms)
Create a query term set from a collection of query terms.

Parameters:
queryTerms - The query terms defining the query term set.
Method Detail

getQueryTerms

public java.util.Collection getQueryTerms()
Get the query terms for this term set.

Returns:
The list of query terms.

toString

public java.lang.String toString()
Displayable version of term set.

Overrides:
toString in class java.lang.Object

toHQL

public java.lang.String toHQL(java.lang.String queryField,
                              int fieldIndexBogus,
                              boolean doingWords)
Get HQL version of query term set.

Parameters:
queryField - The name of field to which this term set applies.
fieldIndexBogus - The index of this field in the select clause.
doingWords - true if word results, false for work part results.
Returns:
HQL version of query term set for specified field.

hasSpeaker

public boolean hasSpeaker()
Determine if any constituent query term refers to a speaker.

Returns:
true if a constituent term refers to a speaker.

hasSpeech

public boolean hasSpeech()
Determine if any constituent query term refers to a speech.

Returns:
true if a constituent term refers to a speech.

hasWordPart

public boolean hasWordPart()
Determine if any constituent query term refers to a word part.

Returns:
true if a constituent term refers to a word part.