Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.search.bean
Class Search  view Search download Search.java

java.lang.Object
  extended bycom.RuntimeCollective.search.bean.Search

public class Search
extends java.lang.Object

Represents a search query made by a user. A search is performed by creating this Search object, adding criteria using addCriterion(), then calling getResults().

Version:
$Id: Search.java,v 1.10 2003/09/30 15:12:57 joe Exp $

Field Summary
private  java.util.Vector criteria
           
protected  int maxNoResults
          The max number of results that you want to get, NO_MAX_NO_RESULTS if no limit.
static int NO_MAX_NO_RESULTS
          When no max number of results is set.
private  com.RuntimeCollective.search.SearchIndex searchIndex
           
protected  boolean useAndNotOr
          Whether to use AND (the default) or OR to join the criteria.
 
Constructor Summary
Search()
          Make a new search.
 
Method Summary
 void addCriterion(SearchCriterion sc)
          Adds a criterion to this search.
 java.util.Iterator getCriteria()
          Gets an Iterator of SearchCriterion objects, that have been added to this search
 SearchCriterion[] getCriteriaAsArray()
           
 int getMaxNoResults()
          Get the max number of results.
 SearchResults getResults()
           
 boolean getUseAndNotOr()
          Get the max number of results.
private  void logCriteria()
          Log the search criteria in the database
 void removeCriterion(SearchCriterion sc)
          Removes a criterion from this search.
 void setMaxNoResults(int no)
          Set the max number of results.
 void setNoMaxNoResults()
          Say we don't want to have any max number of results for this query.
 void setUseAndNotOr(boolean uano)
          Set the max number of results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

criteria

private java.util.Vector criteria

searchIndex

private com.RuntimeCollective.search.SearchIndex searchIndex

NO_MAX_NO_RESULTS

public static int NO_MAX_NO_RESULTS
When no max number of results is set.


maxNoResults

protected int maxNoResults
The max number of results that you want to get, NO_MAX_NO_RESULTS if no limit.


useAndNotOr

protected boolean useAndNotOr
Whether to use AND (the default) or OR to join the criteria.

Constructor Detail

Search

public Search()
Make a new search.

Method Detail

addCriterion

public void addCriterion(SearchCriterion sc)
Adds a criterion to this search.


removeCriterion

public void removeCriterion(SearchCriterion sc)
Removes a criterion from this search.


getCriteria

public java.util.Iterator getCriteria()
Gets an Iterator of SearchCriterion objects, that have been added to this search


getCriteriaAsArray

public SearchCriterion[] getCriteriaAsArray()

setMaxNoResults

public void setMaxNoResults(int no)
Set the max number of results.


getMaxNoResults

public int getMaxNoResults()
Get the max number of results.


setNoMaxNoResults

public void setNoMaxNoResults()
Say we don't want to have any max number of results for this query.


setUseAndNotOr

public void setUseAndNotOr(boolean uano)
Set the max number of results.


getUseAndNotOr

public boolean getUseAndNotOr()
Get the max number of results.


getResults

public SearchResults getResults()
                         throws com.RuntimeCollective.search.SearchException

logCriteria

private void logCriteria()
                  throws com.RuntimeCollective.search.SearchException
Log the search criteria in the database