Class AbstractRangeQueryNode<T extends FieldValuePairQueryNode<?>>
java.lang.Object
org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl
org.apache.lucene.queryparser.flexible.standard.nodes.AbstractRangeQueryNode<T>
- Type Parameters:
T- the type of the range query bounds (lower and upper)
- All Implemented Interfaces:
Cloneable,FieldableNode,QueryNode,RangeQueryNode<FieldValuePairQueryNode<?>>
- Direct Known Subclasses:
PointRangeQueryNode,TermRangeQueryNode
public class AbstractRangeQueryNode<T extends FieldValuePairQueryNode<?>>
extends QueryNodeImpl
implements RangeQueryNode<FieldValuePairQueryNode<?>>
This class should be extended by nodes intending to represent range queries.
-
Field Summary
Fields inherited from class org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl
PLAINTEXT_FIELD_NAME, toQueryStringIgnoreFields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs anAbstractRangeQueryNode, it should be invoked only by its extenders. -
Method Summary
Modifier and TypeMethodDescriptiongetField()Returns the field associated with this node.Returns the lower bound node.Returns the upper bound node.booleanReturns whether the lower bound is inclusive or exclusive.booleanReturns whether the upper bound is inclusive or exclusive.voidSets the lower and upper bounds.voidsetField(CharSequence fieldName) Sets the field associated with this node.toQueryString(EscapeQuerySyntax escapeSyntaxParser) convert to a query string understood by the query parsertoString()Every implementation of this class should return pseudo xml like this:Methods inherited from class org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl
add, add, allocate, clone, cloneTree, containsTag, getChildren, getParent, getTag, getTagMap, isDefaultField, isLeaf, isRoot, removeChildren, removeFromParent, set, setLeaf, setTag, unsetTagMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.queryparser.flexible.core.nodes.QueryNode
add, add, cloneTree, containsTag, getChildren, getParent, getTag, getTagMap, isLeaf, removeChildren, removeFromParent, set, setTag, unsetTag
-
Constructor Details
-
AbstractRangeQueryNode
protected AbstractRangeQueryNode()Constructs anAbstractRangeQueryNode, it should be invoked only by its extenders.
-
-
Method Details
-
getField
Returns the field associated with this node.- Specified by:
getFieldin interfaceFieldableNode- Returns:
- the field associated with this node
- See Also:
-
setField
Sets the field associated with this node.- Specified by:
setFieldin interfaceFieldableNode- Parameters:
fieldName- the field associated with this node
-
getLowerBound
Returns the lower bound node.- Specified by:
getLowerBoundin interfaceRangeQueryNode<T extends FieldValuePairQueryNode<?>>- Returns:
- the lower bound node.
-
getUpperBound
Returns the upper bound node.- Specified by:
getUpperBoundin interfaceRangeQueryNode<T extends FieldValuePairQueryNode<?>>- Returns:
- the upper bound node.
-
isLowerInclusive
public boolean isLowerInclusive()Returns whether the lower bound is inclusive or exclusive.- Specified by:
isLowerInclusivein interfaceRangeQueryNode<T extends FieldValuePairQueryNode<?>>- Returns:
trueif the lower bound is inclusive, otherwise,false
-
isUpperInclusive
public boolean isUpperInclusive()Returns whether the upper bound is inclusive or exclusive.- Specified by:
isUpperInclusivein interfaceRangeQueryNode<T extends FieldValuePairQueryNode<?>>- Returns:
trueif the upper bound is inclusive, otherwise,false
-
setBounds
Sets the lower and upper bounds.- Parameters:
lower- the lower bound,nullif lower bound is openupper- the upper bound,nullif upper bound is openlowerInclusive-trueif the lower bound is inclusive, otherwise,falseupperInclusive-trueif the upper bound is inclusive, otherwise,false- See Also:
-
toQueryString
Description copied from interface:QueryNodeconvert to a query string understood by the query parser- Specified by:
toQueryStringin interfaceQueryNode
-
toString
Description copied from class:QueryNodeImplEvery implementation of this class should return pseudo xml like this:For FieldQueryNode: <field start='1' end='2' field='subject' text='foo'/>
- Specified by:
toStringin interfaceQueryNode- Overrides:
toStringin classQueryNodeImpl- See Also:
-