org.apache.lucene.xmlparser.builders
Class NumericRangeFilterBuilder

java.lang.Object
  extended by org.apache.lucene.xmlparser.builders.NumericRangeFilterBuilder
All Implemented Interfaces:
FilterBuilder

public class NumericRangeFilterBuilder
extends Object
implements FilterBuilder

Creates a NumericRangeFilter. The table below specifies the required attributes and the defaults if optional attributes are omitted. For more detail on what each of the attributes actually do, consult the documentation for NumericRangeFilter:

Attribute name Values Required Default
fieldName String Yes N/A
lowerTerm Specified by type Yes N/A
upperTerm Specified by type Yes N/A
type int, long, float, double No int
includeLower true, false No true
includeUpper true, false No true
precisionStep Integer No 4

If an error occurs parsing the supplied lowerTerm or upperTerm into the numeric type specified by type, then the error will be silently ignored and the resulting filter will not match any documents.


Constructor Summary
NumericRangeFilterBuilder()
           
 
Method Summary
 Filter getFilter(Element e)
           
 void setStrictMode(boolean strictMode)
          Specifies how this NumericRangeFilterBuilder will handle errors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericRangeFilterBuilder

public NumericRangeFilterBuilder()
Method Detail

setStrictMode

public void setStrictMode(boolean strictMode)
Specifies how this NumericRangeFilterBuilder will handle errors.

If this is set to true, getFilter(Element) will throw a ParserException if it is unable to parse the lowerTerm or upperTerm into the appropriate numeric type. If this is set to false, then this exception will be silently ignored and the resulting filter will not match any documents.

Defaults to false.

Parameters:
strictMode -

getFilter

public Filter getFilter(Element e)
                 throws ParserException
Specified by:
getFilter in interface FilterBuilder
Throws:
ParserException


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.