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

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

public class CQLWord
extends java.lang.Object

A WordHoard Corpus Query Language word position.


Field Summary
protected  java.util.Set queryTermSets
          The query term sets for matching for a given word position.
 
Constructor Summary
CQLWord()
          Create a query word.
CQLWord(java.util.Collection queryTermSets)
          Create a query word from a collection of query term sets.
CQLWord(CQLQueryTokenizer tokenizer)
          Create a new word from a CQLQueryTokenizer.
CQLWord(CQLTermSet[] queryTermSets)
          Create a query word from a collection of query term sets.
 
Method Summary
 java.util.Collection getQueryTermSets()
          Get the query term set for this word.
 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 fieldIndex, boolean doingWords)
          Get HQL version of query term set.
 java.lang.String toString()
          Get string version of query word for display.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

queryTermSets

protected java.util.Set queryTermSets
The query term sets for matching for a given word position.

Constructor Detail

CQLWord

public CQLWord()
Create a query word.


CQLWord

public CQLWord(java.util.Collection queryTermSets)
Create a query word from a collection of query term sets.

Parameters:
queryTermSets - The query term sets defining the query word.

CQLWord

public CQLWord(CQLTermSet[] queryTermSets)
Create a query word from a collection of query term sets.

Parameters:
queryTermSets - The query term sets defining the query word.

CQLWord

public CQLWord(CQLQueryTokenizer tokenizer)
        throws InvalidCQLQueryException
Create a new word 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.
Method Detail

getQueryTermSets

public java.util.Collection getQueryTermSets()
Get the query term set for this word.

Returns:
The list of query term sets.

toHQL

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

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

toString

public java.lang.String toString()
Get string version of query word for display.

Overrides:
toString in class java.lang.Object
Returns:
String version of query word.

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.