edu.ucsb.nceas.metacat.advancedsearch

## Class AdvancedSearchQueryGroup

- java.lang.Object
- - edu.ucsb.nceas.metacat.advancedsearch.AdvancedSearchQueryGroup

-     public class AdvancedSearchQueryGroup
      extends java.lang.Object

  Author:
    dcosta AdvancedSearchQueryGroup holds the data needed to produce a valid querygroup string. A querygroup is composed of one or more querygroups and/or queryterms.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdvancedSearchQueryGroup(java.lang.String operator, java.lang.String indent)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addQueryGroup(AdvancedSearchQueryGroup queryGroup)` Adds a AdvancedSearchQueryGroup to this AdvancedSearchQueryGroup's list of querygroups.
    `void` | `addQueryTerm(AdvancedSearchQueryTerm queryTerm)` Adds a AdvancedSearchQueryTerm to this AdvancedSearchQueryGroup's list of queryterms.
    `void` | `setIncludeOuterQueryGroup(boolean b)` Sets the boolean value of includeOuterQueryGroup.
    `java.lang.String` | `toString()` Creates the XML string that represents this AdvancedSearchQueryGroup, including the querygroups and queryterms that are descendants of this querygroup.

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

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

- - ### Constructor Detail

    - #### AdvancedSearchQueryGroup

          public AdvancedSearchQueryGroup(java.lang.String operator,
                                          java.lang.String indent)

      Constructor. Initializes the operator and the indent.
      Parameters:
        `operator` - Must be either "INTERSECT" or "UNION"
        `indent` - A string of spaces for indenting the xml output

  - ### Method Detail

    - #### addQueryGroup

          public void addQueryGroup(AdvancedSearchQueryGroup queryGroup)

      Adds a AdvancedSearchQueryGroup to this AdvancedSearchQueryGroup's list of querygroups.
      Parameters:
        `queryGroup` - The AdvancedSearchQueryGroup object to be added to the list.

    - #### addQueryTerm

          public void addQueryTerm(AdvancedSearchQueryTerm queryTerm)

      Adds a AdvancedSearchQueryTerm to this AdvancedSearchQueryGroup's list of queryterms.
      Parameters:
        `queryTerm` - The AdvancedSearchQueryTerm object to be added to the list.

    - #### setIncludeOuterQueryGroup

          public void setIncludeOuterQueryGroup(boolean b)

      Sets the boolean value of includeOuterQueryGroup. This enables an optimization. If the user enter search values for only one part of the advanced search form, then includeOuterQueryGroup can be set to false. When false, the QueryGroup object will omit the outer query group from the PathQuery, resulting in a less nested SQL statement.
      Parameters:
        `b` - When false, allows the outer QueryGroup to be stripped off, resulting in a less nested SQL statement.

    - #### toString

          public java.lang.String toString()

      Creates the XML string that represents this AdvancedSearchQueryGroup, including the querygroups and queryterms that are descendants of this querygroup.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A XML string fragment representing this querygroup.

Copyright © 2023 Regents of the University of California. All Rights Reserved.