|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.queryParser.core.nodes.QueryNodeImpl org.apache.lucene.queryParser.standard.nodes.NumericQueryNode
public class NumericQueryNode
This query node represents a field query that holds a numeric value. It is
similar to FieldQueryNode
,
however the getValue()
returns a Number
.
NumericConfig
,
Serialized FormField Summary |
---|
Fields inherited from class org.apache.lucene.queryParser.core.nodes.QueryNodeImpl |
---|
PLAINTEXT_FIELD_NAME, toQueryStringIgnoreFields |
Constructor Summary | |
---|---|
NumericQueryNode(CharSequence field,
Number value,
NumberFormat numberFormat)
Creates a NumericQueryNode object using the given field,
Number value and NumberFormat used to convert the value to
String . |
Method Summary | |
---|---|
CharSequence |
getField()
Returns the field associated with this node. |
NumberFormat |
getNumberFormat()
Returns the NumberFormat used to convert the value to String . |
protected CharSequence |
getTermEscaped(EscapeQuerySyntax escaper)
This method is used to get the value converted to String and
escaped using the given EscapeQuerySyntax . |
Number |
getValue()
Returns the numeric value as Number . |
void |
setField(CharSequence fieldName)
Sets the field associated with this node. |
void |
setNumberFormat(NumberFormat format)
Sets the NumberFormat used to convert the value to String . |
void |
setValue(Number value)
Sets the numeric value. |
CharSequence |
toQueryString(EscapeQuerySyntax escapeSyntaxParser)
convert to a query string understood by the query parser |
String |
toString()
Every implementation of this class should return pseudo xml like this: For FieldQueryNode: |
Methods inherited from class org.apache.lucene.queryParser.core.nodes.QueryNodeImpl |
---|
add, add, allocate, clone, cloneTree, containsTag, containsTag, getChildren, getParent, getTag, getTag, getTagMap, getTags, isDefaultField, isLeaf, isRoot, set, setLeaf, setTag, setTag, unsetTag, 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.core.nodes.QueryNode |
---|
add, add, cloneTree, containsTag, containsTag, getChildren, getParent, getTag, getTag, getTagMap, getTags, isLeaf, set, setTag, setTag, unsetTag, unsetTag |
Constructor Detail |
---|
public NumericQueryNode(CharSequence field, Number value, NumberFormat numberFormat)
NumericQueryNode
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
Method Detail |
---|
public CharSequence getField()
getField
in interface FieldableNode
public void setField(CharSequence fieldName)
setField
in interface FieldableNode
fieldName
- the field associated with this nodeprotected CharSequence getTermEscaped(EscapeQuerySyntax escaper)
String
and
escaped using the given EscapeQuerySyntax
.
escaper
- the EscapeQuerySyntax
used to escape the value String
String
and escapedpublic CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser)
QueryNode
toQueryString
in interface QueryNode
public void setNumberFormat(NumberFormat format)
NumberFormat
used to convert the value to String
.
format
- the NumberFormat
used to convert the value to String
public NumberFormat getNumberFormat()
NumberFormat
used to convert the value to String
.
NumberFormat
used to convert the value to String
public Number getValue()
Number
.
getValue
in interface ValueQueryNode<Number>
public void setValue(Number value)
setValue
in interface ValueQueryNode<Number>
value
- the numeric valuepublic String toString()
QueryNodeImpl
toString
in interface QueryNode
toString
in class QueryNodeImpl
QueryNode.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |