edu.northwestern.at.wordhoard.model.search
Class SearchCriteriaLemmaWorkCount

java.lang.Object
  extended by edu.northwestern.at.wordhoard.model.search.SearchCriteria
      extended by edu.northwestern.at.wordhoard.model.search.SearchCriteriaLemmaWorkCount

public class SearchCriteriaLemmaWorkCount
extends SearchCriteria

A set of word search criteria.


Constructor Summary
SearchCriteriaLemmaWorkCount()
          Creates a new empty set of word search criteria.
SearchCriteriaLemmaWorkCount(Corpus corpus, Lemma lemma, Pos pos, Spelling spelling, int strength)
          Creates a new set of word search criteria.
SearchCriteriaLemmaWorkCount(java.lang.String groupByClassname)
          Creates a new set of freq search criteria.
 
Method Summary
 void add(SearchCriterion criterion)
          Adds a criterion.
 boolean contains(java.lang.Class cls)
          Returns true if the critera contains a criterion class.
 Corpus getCorpus()
          Gets the corpus.
 TextLine getDescription(FontInfo[] fontInfo)
          Gets a description of the search criteria.
 java.util.List search(org.hibernate.Session session)
          Executes the query.
 boolean suspicious()
          Returns true if the criteria are "suspicious".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchCriteriaLemmaWorkCount

public SearchCriteriaLemmaWorkCount()
Creates a new empty set of word search criteria.


SearchCriteriaLemmaWorkCount

public SearchCriteriaLemmaWorkCount(Corpus corpus,
                                    Lemma lemma,
                                    Pos pos,
                                    Spelling spelling,
                                    int strength)
Creates a new set of word search criteria.

The collation strengths for spelling searches are:

Parameters:
corpus - The corpus to be searched, or null.
lemma - The lemma, or null.
pos - The part of speech, or null.
spelling - The spelling, or null.
strength - Collation strength for spelling searches.

SearchCriteriaLemmaWorkCount

public SearchCriteriaLemmaWorkCount(java.lang.String groupByClassname)
Creates a new set of freq search criteria.

Parameters:
groupByClassname - The group by class.
Method Detail

add

public void add(SearchCriterion criterion)
Adds a criterion.

Overrides:
add in class SearchCriteria
Parameters:
criterion - Search criterion.

getCorpus

public Corpus getCorpus()
Gets the corpus.

Overrides:
getCorpus in class SearchCriteria
Returns:
The corpus, or null if the set of criteria does not include a corpus criterion.

contains

public boolean contains(java.lang.Class cls)
Returns true if the critera contains a criterion class.

Overrides:
contains in class SearchCriteria
Parameters:
cls - Criterion class.
Returns:
True if the criteria contains a criterion of the specified class.

search

public java.util.List search(org.hibernate.Session session)
                      throws PersistenceException
Executes the query.

Overrides:
search in class SearchCriteria
Parameters:
session - Hibernate session.
Returns:
A list of all the search results which match the search criteria, ordered by location (by work tag, then by ordinal within work).
Throws:
PersistenceException

getDescription

public TextLine getDescription(FontInfo[] fontInfo)
Gets a description of the search criteria.

Overrides:
getDescription in class SearchCriteria
Parameters:
fontInfo - Array of font info indexed by character set.
Returns:
Full description of the search criteria, as a multlingual text line of comma-separated clauses.

suspicious

public boolean suspicious()
Returns true if the criteria are "suspicious".

A set of search criteria is "suspicious" if it contains neither a lemma criterion nor a spelling criterion. Such a search is likely to take a long time and produce a large number of results.

Overrides:
suspicious in class SearchCriteria