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>
public class PointQueryNode extends QueryNodeImpl implements FieldValuePairQueryNode<Number>
This query node represents a field query that holds a point value. It is similar toFieldQueryNode
, however thegetValue()
returns aNumber
.- See Also:
PointsConfig
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl
PLAINTEXT_FIELD_NAME, toQueryStringIgnoreFields
-
-
Constructor Summary
Constructors Constructor Description PointQueryNode(CharSequence field, Number value, NumberFormat numberFormat)
Creates aPointQueryNode
object using the given field,Number
value andNumberFormat
used to convert the value toString
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharSequence
getField()
Returns the field associated with this node.NumberFormat
getNumberFormat()
Returns theNumberFormat
used to convert the value toString
.protected CharSequence
getTermEscaped(EscapeQuerySyntax escaper)
This method is used to get the value converted toString
and escaped using the givenEscapeQuerySyntax
.Number
getValue()
Returns the numeric value asNumber
.void
setField(CharSequence fieldName)
Sets the field associated with this node.void
setNumberFormat(NumberFormat format)
Sets theNumberFormat
used to convert the value toString
.void
setValue(Number value)
Sets the numeric value.CharSequence
toQueryString(EscapeQuerySyntax escapeSyntaxParser)
convert to a query string understood by the query parserString
toString()
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, unsetTag
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods 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 Detail
-
PointQueryNode
public PointQueryNode(CharSequence field, Number value, NumberFormat numberFormat)
Creates aPointQueryNode
object using the given field,Number
value andNumberFormat
used to convert the value toString
.- Parameters:
field
- the field associated with this query nodevalue
- the value hold by this nodenumberFormat
- theNumberFormat
used to convert the value toString
-
-
Method Detail
-
getField
public CharSequence getField()
Returns the field associated with this node.- Specified by:
getField
in interfaceFieldableNode
- Returns:
- the field associated with this node
-
setField
public void setField(CharSequence fieldName)
Sets the field associated with this node.- Specified by:
setField
in interfaceFieldableNode
- Parameters:
fieldName
- the field associated with this node
-
getTermEscaped
protected CharSequence getTermEscaped(EscapeQuerySyntax escaper)
This method is used to get the value converted toString
and escaped using the givenEscapeQuerySyntax
.- Parameters:
escaper
- theEscapeQuerySyntax
used to escape the valueString
- Returns:
- the value converted to
String
and escaped
-
toQueryString
public CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser)
Description copied from interface:QueryNode
convert to a query string understood by the query parser- Specified by:
toQueryString
in interfaceQueryNode
-
setNumberFormat
public void setNumberFormat(NumberFormat format)
Sets theNumberFormat
used to convert the value toString
.- Parameters:
format
- theNumberFormat
used to convert the value toString
-
getNumberFormat
public NumberFormat getNumberFormat()
Returns theNumberFormat
used to convert the value toString
.- Returns:
- the
NumberFormat
used to convert the value toString
-
getValue
public Number getValue()
Returns the numeric value asNumber
.- Specified by:
getValue
in interfaceValueQueryNode<Number>
- Returns:
- the numeric value
-
setValue
public void setValue(Number value)
Sets the numeric value.- Specified by:
setValue
in interfaceValueQueryNode<Number>
- Parameters:
value
- the numeric value
-
toString
public String toString()
Description copied from class:QueryNodeImpl
Every implementation of this class should return pseudo xml like this:For FieldQueryNode: <field start='1' end='2' field='subject' text='foo'/>
- Specified by:
toString
in interfaceQueryNode
- Overrides:
toString
in classQueryNodeImpl
- See Also:
QueryNode.toString()
-
-