com.arsdigita.search
Class QuerySpecification

java.lang.Object
  extended bycom.arsdigita.search.QuerySpecification

public class QuerySpecification
extends Object

Represents the set of parameters for a search query. This is a combination of a search string and a number of filter specifications. The search terms string is considered opaque and passed straight through to the underlying QueryEngine implementation. Thus the operators it supports (AND, OR, *, etc) are implementation defined

See Also:
FilterSpecification

Constructor Summary
QuerySpecification(String terms, boolean partial)
          Creates a query specification for a simple search string, with no filters
QuerySpecification(String terms, boolean partial, FilterSpecification[] filters)
          Creates a query specification for a simple search string, with a number of filters
 
Method Summary
 void addFilter(FilterSpecification filter)
           
 boolean allowPartialMatch()
          Returns flag indicating whether partial (ie substring) matches should be allowed.
 boolean equals(Object o)
          Two query specifications compare equal if they have the same search term, have the same setting for partial matches and contain the same set of filter specifications.
 FilterSpecification[] getFilters()
          Returns the filter specifications
 String getTerms()
          Returns the raw search string
 int hashCode()
          Returns a hashcode compatible with the definition of the equals() method
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuerySpecification

public QuerySpecification(String terms,
                          boolean partial)
Creates a query specification for a simple search string, with no filters

Parameters:
terms - the raw search string

QuerySpecification

public QuerySpecification(String terms,
                          boolean partial,
                          FilterSpecification[] filters)
Creates a query specification for a simple search string, with a number of filters

Parameters:
terms - the raw search string
filters - a number of filter specifications
Method Detail

addFilter

public void addFilter(FilterSpecification filter)

getTerms

public String getTerms()
Returns the raw search string

Returns:
the search string

allowPartialMatch

public boolean allowPartialMatch()
Returns flag indicating whether partial (ie substring) matches should be allowed.

Returns:
true if partial matches are allowed, false otherwise

getFilters

public FilterSpecification[] getFilters()
Returns the filter specifications

Returns:
the filter specifications

hashCode

public int hashCode()
Returns a hashcode compatible with the definition of the equals() method


equals

public boolean equals(Object o)
Two query specifications compare equal if they have the same search term, have the same setting for partial matches and contain the same set of filter specifications.


toString

public String toString()


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC