QueryNode (Lucene 10.5.0 queryparser API)
Description: declaration: package: org.apache.lucene.queryparser.flexible.core.nodes, interface: QueryNode

Package org.apache.lucene.queryparser.flexible.core.nodes

# Interface QueryNode

All Known Subinterfaces:
  `FieldableNode`, `FieldValuePairQueryNode<T>`, `RangeQueryNode<T>`, `ValueQueryNode<T>`

All Known Implementing Classes:
  `AbstractRangeQueryNode`, `AndQueryNode`, `AnyQueryNode`, `BooleanModifierNode`, `BooleanQueryNode`, `BoostQueryNode`, `DeletedQueryNode`, `FieldQueryNode`, `FuzzyQueryNode`, `GroupQueryNode`, `IntervalQueryNode`, `MatchAllDocsQueryNode`, `MatchNoDocsQueryNode`, `MinShouldMatchNode`, `ModifierQueryNode`, `MultiPhraseQueryNode`, `NoTokenFoundQueryNode`, `OpaqueQueryNode`, `OrQueryNode`, `PathQueryNode`, `PhraseSlopQueryNode`, `PointQueryNode`, `PointRangeQueryNode`, `PrefixWildcardQueryNode`, `ProximityQueryNode`, `QueryNodeImpl`, `QuotedFieldQueryNode`, `RegexpQueryNode`, `SlopQueryNode`, `SynonymQueryNode`, `TermRangeQueryNode`, `TokenizedPhraseQueryNode`, `WildcardQueryNode`

public interface QueryNode
A `QueryNode` is a interface implemented by all nodes on a QueryNode tree.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(List<QueryNode> children)`
  `void`
  `add(QueryNode child)`
  add a new child to a non Leaf node
  `QueryNode`
  `cloneTree()`
  Recursive clone the QueryNode tree.
  `boolean`
  `containsTag(String tagName)`
  verify if a node contains a tag
  `List<QueryNode>`
  `getChildren()`
  get Children nodes
  `QueryNode`
  `getParent()`
  `Object`
  `getTag(String tagName)`
  Returns object stored under that tag name
  `Map<String,Object>`
  `getTagMap()`
  `boolean`
  `isLeaf()`
  verify if a node is a Leaf node
  `void`
  `removeChildren(QueryNode childNode)`
  Remove a child node
  `void`
  `removeFromParent()`
  Removes this query node from its parent.
  `void`
  `set(List<QueryNode> children)`
  reset the children of a node
  `void`
  `setTag(String tagName, Object value)`
  Associate the specified value with the specified tagName.
  `CharSequence`
  `toQueryString(EscapeQuerySyntax escapeSyntaxParser)`
  convert to a query string understood by the query parser
  `String`
  `toString()`
  for printing
  `void`
  `unsetTag(String tagName)`
  Unset a tag.

- ## Method Details

  - ### toQueryString

    CharSequence toQueryString(EscapeQuerySyntax escapeSyntaxParser)
    convert to a query string understood by the query parser

  - ### toString

    String toString()
    for printing
    Overrides:
      `toString` in class `Object`

  - ### getChildren

    List<QueryNode> getChildren()
    get Children nodes

  - ### isLeaf

    boolean isLeaf()
    verify if a node is a Leaf node

  - ### containsTag

    boolean containsTag(String tagName)
    verify if a node contains a tag

  - ### getTag

    Object getTag(String tagName)
    Returns object stored under that tag name

  - ### getParent

    QueryNode getParent()

  - ### cloneTree

    QueryNode cloneTree() throws CloneNotSupportedException
    Recursive clone the QueryNode tree. The tags are not copied to the new tree when you call the cloneTree() method.
    Returns:
      the cloned tree
    Throws:
      `CloneNotSupportedException`

  - ### add

    void add(QueryNode child)
    add a new child to a non Leaf node

  - ### add

    void add(List<QueryNode> children)

  - ### set

    void set(List<QueryNode> children)
    reset the children of a node

  - ### setTag

    void setTag(String tagName, Object value)
    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

    void unsetTag(String tagName)
    Unset a tag. tagName will be converted to lowercase.

  - ### getTagMap

    Map<String,Object> getTagMap()
    Returns:
      a map containing all tags attached to this query node

  - ### removeFromParent

    void removeFromParent()
    Removes this query node from its parent.

  - ### removeChildren

    void removeChildren(QueryNode childNode)
    Remove a child node
    Parameters:
      `childNode` - Which child to remove