org.apache.oodt.cas.filemgr.structs
Class FreeTextQueryCriteria

java.lang.Object
  extended by org.apache.oodt.cas.filemgr.structs.QueryCriteria
      extended by org.apache.oodt.cas.filemgr.structs.FreeTextQueryCriteria
All Implemented Interfaces:
Cloneable

public class FreeTextQueryCriteria
extends QueryCriteria

Version:
$Revision: 9683 $

A Free Text Criteria element for a Query to the Catalog.

Author:
woollard, bfoster

Constructor Summary
FreeTextQueryCriteria()
          Default constructor.
FreeTextQueryCriteria(String elementName, List<String> v)
          Constructor for the FreeTextQueryECriteria Class.
 
Method Summary
 void addFreeText(String text)
          A method for adding unparsed free text to the FreeTextCriteria.
 void addValue(String v)
          A method for adding a value to search on to the list of values.
 String getElementName()
          Implementation of the abstract method inherited from QueryCriteria for accessing the element ID to search on.
 List<String> getValues()
          Accessor method for the values of the element to search on.
 void setElementName(String elementName)
          Implementation of the abstract method inherited from QueryCriteria for mutating the element ID to search on.
 void setValue(List<String> v)
          Mutator method for the values of the element to search on.
 String toString()
          Implementation of the abstract method inherited from QueryCriteria for generating a human-parsable string version of the query criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FreeTextQueryCriteria

public FreeTextQueryCriteria()
Default constructor.


FreeTextQueryCriteria

public FreeTextQueryCriteria(String elementName,
                             List<String> v)
Constructor for the FreeTextQueryECriteria Class.

Parameters:
elementId - The name of the element to search on.
v - A List of terms to search for.
Method Detail

getValues

public List<String> getValues()
Accessor method for the values of the element to search on.

Returns:
The values of the element to search on as a List of Strings.

setValue

public void setValue(List<String> v)
Mutator method for the values of the element to search on. This method should be used when keywords have been parsed out of user-entered free text. The query will JOIN on all of these values. In order to add unparsed free text to a Query, see the addFreeText method of this class.

Parameters:
value - The values of the element to search on as a List of Strings.

addValue

public void addValue(String v)
A method for adding a value to search on to the list of values.

Parameters:
v - The value to be added to the search as a String.

addFreeText

public void addFreeText(String text)
A method for adding unparsed free text to the FreeTextCriteria. Free text entered as a string is tokenized and punctuation and common words are dropped before the values are added to the query. In order to query for pre-parsed keywords, see the setValues method of this class.

Parameters:
text - The free text to be parsed and searched on.

getElementName

public String getElementName()
Implementation of the abstract method inherited from QueryCriteria for accessing the element ID to search on.

Specified by:
getElementName in class QueryCriteria
Returns:
The element ID to search on as a String.

setElementName

public void setElementName(String elementName)
Implementation of the abstract method inherited from QueryCriteria for mutating the element ID to search on.

Specified by:
setElementName in class QueryCriteria
Parameters:
elementId - The element ID to search on as a String.

toString

public String toString()
Implementation of the abstract method inherited from QueryCriteria for generating a human-parsable string version of the query criteria. Note that the returned String follows the Lucene query language.

Specified by:
toString in class QueryCriteria
Returns:
The query as a String.


Copyright © 1999-2011 Apache OODT. All Rights Reserved.