Class PointQueryNode
java.lang.Object
org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl
org.apache.lucene.queryparser.flexible.standard.nodes.PointQueryNode
- All Implemented Interfaces:
Cloneable,FieldableNode,FieldValuePairQueryNode<Number>,QueryNode,ValueQueryNode<Number>
This query node represents a field query that holds a point value. It is similar to
FieldQueryNode, however the getValue() returns a Number.- See Also:
-
Field Summary
Fields inherited from class org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl
PLAINTEXT_FIELD_NAME, toQueryStringIgnoreFields -
Constructor Summary
ConstructorsConstructorDescriptionPointQueryNode(CharSequence field, Number value, NumberFormat numberFormat) Creates aPointQueryNodeobject using the given field,Numbervalue andNumberFormatused to convert the value toString. -
Method Summary
Modifier and TypeMethodDescriptiongetField()Returns the field associated with this node.Returns theNumberFormatused to convert the value toString.protected CharSequencegetTermEscaped(EscapeQuerySyntax escaper) This method is used to get the value converted toStringand escaped using the givenEscapeQuerySyntax.getValue()Returns the numeric value asNumber.voidsetField(CharSequence fieldName) Sets the field associated with this node.voidsetNumberFormat(NumberFormat format) Sets theNumberFormatused to convert the value toString.voidSets the numeric value.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
-
PointQueryNode
Creates aPointQueryNodeobject using the given field,Numbervalue andNumberFormatused to convert the value toString.- Parameters:
field- the field associated with this query nodevalue- the value hold by this nodenumberFormat- theNumberFormatused to convert the value toString
-
-
Method Details
-
getField
Returns the field associated with this node.- Specified by:
getFieldin interfaceFieldableNode- Returns:
- the field associated with this node
-
setField
Sets the field associated with this node.- Specified by:
setFieldin interfaceFieldableNode- Parameters:
fieldName- the field associated with this node
-
getTermEscaped
This method is used to get the value converted toStringand escaped using the givenEscapeQuerySyntax.- Parameters:
escaper- theEscapeQuerySyntaxused to escape the valueString- Returns:
- the value converted to
Stringand escaped
-
toQueryString
Description copied from interface:QueryNodeconvert to a query string understood by the query parser- Specified by:
toQueryStringin interfaceQueryNode
-
setNumberFormat
Sets theNumberFormatused to convert the value toString.- Parameters:
format- theNumberFormatused to convert the value toString
-
getNumberFormat
Returns theNumberFormatused to convert the value toString.- Returns:
- the
NumberFormatused to convert the value toString
-
getValue
Returns the numeric value asNumber.- Specified by:
getValuein interfaceValueQueryNode<Number>- Returns:
- the numeric value
-
setValue
Sets the numeric value.- Specified by:
setValuein interfaceValueQueryNode<Number>- Parameters:
value- the numeric value
-
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:
-