public class PointQueryNode extends QueryNodeImpl implements FieldValuePairQueryNode<java.lang.Number>
FieldQueryNode
, however the getValue()
returns a
Number
.PointsConfig
Modifier and Type | Field and Description |
---|---|
private java.lang.CharSequence |
field |
private java.text.NumberFormat |
numberFormat |
private java.lang.Number |
value |
PLAINTEXT_FIELD_NAME, toQueryStringIgnoreFields
Constructor and Description |
---|
PointQueryNode(java.lang.CharSequence field,
java.lang.Number value,
java.text.NumberFormat numberFormat)
Creates a
PointQueryNode object using the given field,
Number value and NumberFormat used to convert the value to
String . |
Modifier and Type | Method and Description |
---|---|
java.lang.CharSequence |
getField()
Returns the field associated with this node.
|
java.text.NumberFormat |
getNumberFormat()
Returns the
NumberFormat used to convert the value to String . |
protected java.lang.CharSequence |
getTermEscaped(EscapeQuerySyntax escaper)
This method is used to get the value converted to
String and
escaped using the given EscapeQuerySyntax . |
java.lang.Number |
getValue()
Returns the numeric value as
Number . |
void |
setField(java.lang.CharSequence fieldName)
Sets the field associated with this node.
|
void |
setNumberFormat(java.text.NumberFormat format)
Sets the
NumberFormat used to convert the value to String . |
void |
setValue(java.lang.Number value)
Sets the numeric value.
|
java.lang.CharSequence |
toQueryString(EscapeQuerySyntax escapeSyntaxParser)
convert to a query string understood by the query parser
|
java.lang.String |
toString()
Every implementation of this class should return pseudo xml like this:
For FieldQueryNode: <field start='1' end='2' field='subject' text='foo'/>
|
add, add, allocate, clone, cloneTree, containsTag, getChildren, getParent, getTag, getTagMap, isDefaultField, isLeaf, isRoot, removeChildren, removeFromParent, set, setLeaf, setTag, unsetTag
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, add, cloneTree, containsTag, getChildren, getParent, getTag, getTagMap, isLeaf, removeChildren, removeFromParent, set, setTag, unsetTag
private java.text.NumberFormat numberFormat
private java.lang.CharSequence field
private java.lang.Number value
public PointQueryNode(java.lang.CharSequence field, java.lang.Number value, java.text.NumberFormat numberFormat)
PointQueryNode
object using the given field,
Number
value and NumberFormat
used to convert the value to
String
.field
- the field associated with this query nodevalue
- the value hold by this nodenumberFormat
- the NumberFormat
used to convert the value to String
public java.lang.CharSequence getField()
getField
in interface FieldableNode
public void setField(java.lang.CharSequence fieldName)
setField
in interface FieldableNode
fieldName
- the field associated with this nodeprotected java.lang.CharSequence getTermEscaped(EscapeQuerySyntax escaper)
String
and
escaped using the given EscapeQuerySyntax
.escaper
- the EscapeQuerySyntax
used to escape the value String
String
and escapedpublic java.lang.CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser)
QueryNode
toQueryString
in interface QueryNode
public void setNumberFormat(java.text.NumberFormat format)
NumberFormat
used to convert the value to String
.format
- the NumberFormat
used to convert the value to String
public java.text.NumberFormat getNumberFormat()
NumberFormat
used to convert the value to String
.NumberFormat
used to convert the value to String
public java.lang.Number getValue()
Number
.getValue
in interface ValueQueryNode<java.lang.Number>
public void setValue(java.lang.Number value)
setValue
in interface ValueQueryNode<java.lang.Number>
value
- the numeric valuepublic java.lang.String toString()
QueryNodeImpl
toString
in interface QueryNode
toString
in class QueryNodeImpl
QueryNode.toString()