## org.apache.lucene.queryParser.core.nodes
Class QueryNodeImpl

    java.lang.Object
      org.apache.lucene.queryParser.core.nodes.QueryNodeImpl

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, QueryNode

Direct Known Subclasses:
  BooleanQueryNode, BoostQueryNode, DeletedQueryNode, FieldQueryNode, GroupQueryNode, MatchAllDocsQueryNode, ModifierQueryNode, MultiPhraseQueryNode, OpaqueQueryNode, ParametricRangeQueryNode, PathQueryNode, PhraseSlopQueryNode, SlopQueryNode, TokenizedPhraseQueryNode

    public abstract class QueryNodeImpl

extends java.lang.Object
implements QueryNode, java.lang.Cloneable

A `QueryNodeImpl` is the default implementation of the interface `QueryNode`

See Also:
  Serialized Form

Field Summary
`static java.lang.String` `PLAINTEXT_FIELD_NAME`
`protected boolean` `toQueryStringIgnoreFields` If set to true the the method toQueryString will not write field names

Constructor Summary
`QueryNodeImpl()`

Method Summary
`void` `add(java.util.List<QueryNode> children)`
`void` `add(QueryNode child)`
`protected void` `allocate()`
`java.lang.Object` `clone()`
`QueryNode` `cloneTree()` Recursive clone the QueryNode tree The tags are not copied to the new tree when you call the cloneTree() method
`boolean` `containsTag(java.lang.CharSequence tagName)` verify if a node contains a tag
`java.util.List<QueryNode>` `getChildren()` get Children nodes
`QueryNode` `getParent()`
`java.lang.Object` `getTag(java.lang.CharSequence tagName)`
`java.util.Map<java.lang.CharSequence,java.lang.Object>` `getTags()`
`protected boolean` `isDefaultField(java.lang.CharSequence fld)` This method is use toQueryString to detect if fld is the default field
`boolean` `isLeaf()` verify if a node is a Leaf node
`protected boolean` `isRoot()`
`void` `set(java.util.List<QueryNode> children)`
`protected void` `setLeaf(boolean isLeaf)`
`void` `setTag(java.lang.CharSequence tagName, java.lang.Object value)` Associate the specified value with the specified tagName.
`java.lang.String` `toString()` Every implementation of this class should return pseudo xml like this: For FieldQueryNode:
`void` `unsetTag(java.lang.CharSequence 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 java.lang.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

Constructor Detail

### QueryNodeImpl

    public QueryNodeImpl()

Method Detail

### allocate

    protected void allocate()

### add

    public final void add(QueryNode child)

  Specified by:
    `add` in interface `QueryNode`

### add

    public final void add(java.util.List<QueryNode> children)

  Specified by:
    `add` in interface `QueryNode`

### isLeaf

    public boolean isLeaf()

  Description copied from interface: `QueryNode`
  verify if a node is a Leaf node

  Specified by:
    `isLeaf` in interface `QueryNode`

### set

    public final void set(java.util.List<QueryNode> children)

  Specified by:
    `set` in interface `QueryNode`

### cloneTree

    public QueryNode cloneTree()
                        throws java.lang.CloneNotSupportedException

  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 interface `QueryNode`
  Returns:
    the cloned tree
  Throws:
    `java.lang.CloneNotSupportedException`

### clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException

  Overrides:
    `clone` in class `java.lang.Object`
  Throws:
    `java.lang.CloneNotSupportedException`

### setLeaf

    protected void setLeaf(boolean isLeaf)

### getChildren

    public final java.util.List<QueryNode> getChildren()

  Description copied from interface: `QueryNode`
  get Children nodes

  Specified by:
    `getChildren` in interface `QueryNode`
  Returns:
    a List for QueryNode object. Returns null, for nodes that do not contain children. All leaf Nodes return null.

### setTag

    public void setTag(java.lang.CharSequence tagName,
                       java.lang.Object value)

  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.

  Specified by:
    `setTag` in interface `QueryNode`

### unsetTag

    public void unsetTag(java.lang.CharSequence tagName)

  Description copied from interface: `QueryNode`
  Unset a tag. tagName will be converted to lowercase.

  Specified by:
    `unsetTag` in interface `QueryNode`

### containsTag

    public boolean containsTag(java.lang.CharSequence tagName)

  Description copied from interface: `QueryNode`
  verify if a node contains a tag

  Specified by:
    `containsTag` in interface `QueryNode`

### getTag

    public java.lang.Object getTag(java.lang.CharSequence tagName)

  Specified by:
    `getTag` in interface `QueryNode`
  Returns:
    of stored on under that tag name

### getParent

    public QueryNode getParent()

  Specified by:
    `getParent` in interface `QueryNode`

### isRoot

    protected boolean isRoot()

### isDefaultField

    protected boolean isDefaultField(java.lang.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 java.lang.String toString()

  Every implementation of this class should return pseudo xml like this: For FieldQueryNode:

  Specified by:
    `toString` in interface `QueryNode`
  Overrides:
    `toString` in class `java.lang.Object`
  See Also:
    `QueryNode.toString()`

### getTags

    public java.util.Map<java.lang.CharSequence,java.lang.Object> getTags()

  Specified by:
    `getTags` in interface `QueryNode`
  Returns:
    a Map with all tags for this QueryNode
  See Also:
    `QueryNode.getTag(CharSequence)`

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.