Class QueryNodeImpl
java.lang.Object
org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl
- Direct Known Subclasses:
AbstractRangeQueryNode
,BooleanQueryNode
,BoostQueryNode
,DeletedQueryNode
,FieldQueryNode
,GroupQueryNode
,IntervalQueryNode
,MatchAllDocsQueryNode
,MinShouldMatchNode
,ModifierQueryNode
,MultiPhraseQueryNode
,OpaqueQueryNode
,PathQueryNode
,PhraseSlopQueryNode
,PointQueryNode
,RegexpQueryNode
,SlopQueryNode
,TokenizedPhraseQueryNode
A
QueryNodeImpl
is the default implementation of the interface QueryNode
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected boolean
If set to true the method toQueryString will not write field names -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
final void
protected void
allocate()
clone()
Recursive clone the QueryNode tree The tags are not copied to the new tree when you call the cloneTree() methodboolean
containsTag
(String tagName) verify if a node contains a tagget Children nodesReturns object stored under that tag nameReturns a map containing all tags attached to this query node.protected boolean
This method is use toQueryString to detect if fld is the default fieldboolean
isLeaf()
verify if a node is a Leaf nodeprotected boolean
isRoot()
void
removeChildren
(QueryNode childNode) Remove a child nodevoid
Removes this query node from its parent.final void
protected void
setLeaf
(boolean isLeaf) void
Associate the specified value with the specified tagName.toString()
Every implementation of this class should return pseudo xml like this:void
Unset a tag.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
toQueryString
-
Field Details
-
PLAINTEXT_FIELD_NAME
- See Also:
-
toQueryStringIgnoreFields
protected boolean toQueryStringIgnoreFieldsIf set to true the method toQueryString will not write field names
-
-
Constructor Details
-
QueryNodeImpl
public QueryNodeImpl()
-
-
Method Details
-
allocate
protected void allocate() -
add
-
add
-
isLeaf
public boolean isLeaf()Description copied from interface:QueryNode
verify if a node is a Leaf node -
set
-
cloneTree
Description copied from interface:QueryNode
Recursive clone the QueryNode tree The tags are not copied to the new tree when you call the cloneTree() method- Specified by:
cloneTree
in interfaceQueryNode
- Returns:
- the cloned tree
- Throws:
CloneNotSupportedException
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
setLeaf
protected void setLeaf(boolean isLeaf) -
getChildren
Description copied from interface:QueryNode
get Children nodes- Specified by:
getChildren
in interfaceQueryNode
- Returns:
- a List for QueryNode object. Returns null, for nodes that do not contain children. All leaf Nodes return null.
-
setTag
Description copied from interface:QueryNode
Associate the specified value with the specified tagName. If the tagName already exists, the old value is replaced. The tagName and value cannot be null. tagName will be converted to lowercase. -
unsetTag
Description copied from interface:QueryNode
Unset a tag. tagName will be converted to lowercase. -
containsTag
verify if a node contains a tag- Specified by:
containsTag
in interfaceQueryNode
-
getTag
Description copied from interface:QueryNode
Returns object stored under that tag name -
getParent
-
isRoot
protected boolean isRoot() -
isDefaultField
This method is use toQueryString to detect if fld is the default field- Parameters:
fld
- - field name- Returns:
- true if fld is the default field
-
toString
Every implementation of this class should return pseudo xml like this:For FieldQueryNode: <field start='1' end='2' field='subject' text='foo'/>
-
getTagMap
Returns a map containing all tags attached to this query node. -
removeChildren
Description copied from interface:QueryNode
Remove a child node- Specified by:
removeChildren
in interfaceQueryNode
- Parameters:
childNode
- Which child to remove
-
removeFromParent
public void removeFromParent()Description copied from interface:QueryNode
Removes this query node from its parent.- Specified by:
removeFromParent
in interfaceQueryNode
-