JavaCC generate the changes Doug has made

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@156443 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2005-03-07 20:18:58 +00:00
parent 62855478e8
commit 4ed95e7f75
3 changed files with 25 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import org.apache.lucene.index.Term;
import org.apache.lucene.analysis.*;
import org.apache.lucene.document.*;
import org.apache.lucene.search.*;
import org.apache.lucene.util.Parameter;
public class QueryParserTokenManager implements QueryParserConstants
{

View File

@ -428,11 +428,31 @@ public class PrecedenceQueryParser implements PrecedenceQueryParserConstants {
* @exception ParseException throw in overridden method to disallow
*/
protected Query getBooleanQuery(Vector clauses) throws ParseException
{
return getBooleanQuery(clauses, false);
}
/**
* Factory method for generating query, given a set of clauses.
* By default creates a boolean query composed of clauses passed in.
*
* Can be overridden by extending classes, to modify query being
* returned.
*
* @param clauses Vector that contains {@link BooleanClause} instances
* to join.
* @param disableCoord true if coord scoring should be disabled.
*
* @return Resulting {@link Query} object.
* @exception ParseException throw in overridden method to disallow
*/
protected Query getBooleanQuery(Vector clauses, boolean disableCoord)
throws ParseException
{
if (clauses == null || clauses.size() == 0)
return null;
BooleanQuery query = new BooleanQuery();
BooleanQuery query = new BooleanQuery(disableCoord);
for (int i = 0; i < clauses.size(); i++) {
query.add((BooleanClause)clauses.elementAt(i));
}

View File

@ -451,8 +451,10 @@ public class PrecedenceQueryParser {
* @exception ParseException throw in overridden method to disallow
*/
protected Query getBooleanQuery(Vector clauses) throws ParseException
getBooleanQuery(clauses, false);
{
return getBooleanQuery(clauses, false);
}
/**
* Factory method for generating query, given a set of clauses.
* By default creates a boolean query composed of clauses passed in.