Class QueryNodeImpl
- java.lang.Object
-
- org.apache.lucene.queryParser.core.nodes.QueryNodeImpl
-
- All Implemented Interfaces:
Serializable,Cloneable,QueryNode
- Direct Known Subclasses:
AbstractRangeQueryNode,BooleanQueryNode,BoostQueryNode,DeletedQueryNode,FieldQueryNode,GroupQueryNode,MatchAllDocsQueryNode,ModifierQueryNode,MultiPhraseQueryNode,NumericQueryNode,OpaqueQueryNode,ParametricRangeQueryNode,PathQueryNode,PhraseSlopQueryNode,SlopQueryNode,TokenizedPhraseQueryNode
public abstract class QueryNodeImpl extends Object implements QueryNode, Cloneable
AQueryNodeImplis the default implementation of the interfaceQueryNode- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringPLAINTEXT_FIELD_NAMEprotected booleantoQueryStringIgnoreFieldsIf set to true the the method toQueryString will not write field names
-
Constructor Summary
Constructors Constructor Description QueryNodeImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(List<QueryNode> children)voidadd(QueryNode child)protected voidallocate()Objectclone()QueryNodecloneTree()Recursive clone the QueryNode tree The tags are not copied to the new tree when you call the cloneTree() methodbooleancontainsTag(CharSequence tagName)Deprecated.usecontainsTag(String)insteadbooleancontainsTag(String tagName)verify if a node contains a tagList<QueryNode>getChildren()get Children nodesQueryNodegetParent()ObjectgetTag(CharSequence tagName)Deprecated.usegetTag(String)insteadObjectgetTag(String tagName)Map<String,Object>getTagMap()Returns a map containing all tags attached to this query node.Map<CharSequence,Object>getTags()Deprecated.usegetTagMap()insteadprotected booleanisDefaultField(CharSequence fld)This method is use toQueryString to detect if fld is the default fieldbooleanisLeaf()verify if a node is a Leaf nodeprotected booleanisRoot()voidset(List<QueryNode> children)protected voidsetLeaf(boolean isLeaf)voidsetTag(CharSequence tagName, Object value)Deprecated.usesetTag(String, Object)insteadvoidsetTag(String tagName, Object value)Associate the specified value with the specified tagName.StringtoString()Every implementation of this class should return pseudo xml like this: For FieldQueryNode:voidunsetTag(CharSequence tagName)Deprecated.useunsetTag(String)voidunsetTag(String tagName)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.core.nodes.QueryNode
toQueryString
-
-
-
-
Field Detail
-
PLAINTEXT_FIELD_NAME
public static final String PLAINTEXT_FIELD_NAME
- See Also:
- Constant Field Values
-
toQueryStringIgnoreFields
protected boolean toQueryStringIgnoreFields
If set to true the the method toQueryString will not write field names
-
-
Method Detail
-
allocate
protected void allocate()
-
isLeaf
public boolean isLeaf()
Description copied from interface:QueryNodeverify if a node is a Leaf node
-
cloneTree
public QueryNode cloneTree() throws CloneNotSupportedException
Description copied from interface:QueryNodeRecursive clone the QueryNode tree The tags are not copied to the new tree when you call the cloneTree() method- Specified by:
cloneTreein interfaceQueryNode- Returns:
- the cloned tree
- Throws:
CloneNotSupportedException
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
setLeaf
protected void setLeaf(boolean isLeaf)
-
getChildren
public final List<QueryNode> getChildren()
Description copied from interface:QueryNodeget Children nodes- Specified by:
getChildrenin interfaceQueryNode- Returns:
- a List for QueryNode object. Returns null, for nodes that do not contain children. All leaf Nodes return null.
-
setTag
@Deprecated public void setTag(CharSequence tagName, Object value)
Deprecated.usesetTag(String, Object)insteadDescription copied from interface:QueryNodeAssociate 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.
-
setTag
public void setTag(String tagName, Object value)
Description copied from interface:QueryNodeAssociate 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
public void unsetTag(String tagName)
Description copied from interface:QueryNodeUnset a tag. tagName will be converted to lowercase.
-
unsetTag
@Deprecated public void unsetTag(CharSequence tagName)
Deprecated.useunsetTag(String)Description copied from interface:QueryNodeUnset a tag. tagName will be converted to lowercase.
-
containsTag
@Deprecated public boolean containsTag(CharSequence tagName)
Deprecated.usecontainsTag(String)insteadverify if a node contains a tag- Specified by:
containsTagin interfaceQueryNode
-
containsTag
public boolean containsTag(String tagName)
verify if a node contains a tag- Specified by:
containsTagin interfaceQueryNode
-
getTag
@Deprecated public Object getTag(CharSequence tagName)
Deprecated.usegetTag(String)instead
-
isRoot
protected boolean isRoot()
-
isDefaultField
protected boolean isDefaultField(CharSequence fld)
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
public String toString()
Every implementation of this class should return pseudo xml like this: For FieldQueryNode:- Specified by:
toStringin interfaceQueryNode- Overrides:
toStringin classObject- See Also:
QueryNode.toString()
-
getTags
@Deprecated public Map<CharSequence,Object> getTags()
Deprecated.usegetTagMap()insteadDescription copied from interface:QueryNodeReturns a map containing all tags attached to this query node.- Specified by:
getTagsin interfaceQueryNode- Returns:
- a Map with all tags for this QueryNode
- See Also:
QueryNode.getTag(String)
-
-