org.apache.lucene.queryparser.flexible.core.util

## Class QueryNodeOperation

- java.lang.Object
- - org.apache.lucene.queryparser.flexible.core.util.QueryNodeOperation

-     public final class QueryNodeOperation
      extends Object

  Allow joining 2 QueryNode Trees, into one.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static QueryNode` | `logicalAnd(QueryNode q1, QueryNode q2)` perform a logical and of 2 QueryNode trees.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### logicalAnd

          public static final QueryNode logicalAnd(QueryNode q1,
                                                   QueryNode q2)

      perform a logical and of 2 QueryNode trees. if q1 and q2 are ANDQueryNode nodes it uses head Node from q1 and adds the children of q2 to q1 if q1 is a AND node and q2 is not, add q2 as a child of the head node of q1 if q2 is a AND node and q1 is not, add q1 as a child of the head node of q2 if q1 and q2 are not ANDQueryNode nodes, create a AND node and make q1 and q2 children of that node if q1 or q2 is null it returns the not null node if q1 = q2 = null it returns null

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