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 aPointQueryNodeobject using the given field,Numbervalue andNumberFormatused to convert the value toString.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharSequencegetField()Returns the field associated with this node.NumberFormatgetNumberFormat()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.NumbergetValue()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.voidsetValue(Number value)Sets the numeric value.CharSequencetoQueryString(EscapeQuerySyntax escapeSyntaxParser)convert to a query string understood by the query parserStringtoString()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 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 Detail
-
getField
public CharSequence getField()
Returns the field associated with this node.- Specified by:
getFieldin interfaceFieldableNode- Returns:
- the field associated with this node
-
setField
public void setField(CharSequence fieldName)
Sets the field associated with this node.- Specified by:
setFieldin interfaceFieldableNode- Parameters:
fieldName- the field associated with this node
-
getTermEscaped
protected CharSequence getTermEscaped(EscapeQuerySyntax escaper)
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
public CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser)
Description copied from interface:QueryNodeconvert to a query string understood by the query parser- Specified by:
toQueryStringin interfaceQueryNode
-
setNumberFormat
public void setNumberFormat(NumberFormat format)
Sets theNumberFormatused to convert the value toString.- Parameters:
format- theNumberFormatused to convert the value toString
-
getNumberFormat
public NumberFormat getNumberFormat()
Returns theNumberFormatused to convert the value toString.- Returns:
- the
NumberFormatused to convert the value toString
-
getValue
public Number getValue()
Returns the numeric value asNumber.- Specified by:
getValuein interfaceValueQueryNode<Number>- Returns:
- the numeric value
-
setValue
public void setValue(Number value)
Sets the numeric value.- Specified by:
setValuein interfaceValueQueryNode<Number>- Parameters:
value- the numeric value
-
toString
public String 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:
QueryNode.toString()
-
-