org.cpsolver.ifs.util

## Class Query.CompositeTerm

- java.lang.Object
- - org.cpsolver.ifs.util.Query.CompositeTerm

- All Implemented Interfaces:
    Serializable, Query.Term
  Direct Known Subclasses:
    Query.AndTerm, Query.OrTerm
  Enclosing class:
    Query

      public abstract static class Query.CompositeTerm
      extends Object
      implements Query.Term

  Composition of one or more terms in a query (e.g., A and B and C)
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositeTerm()`
    `CompositeTerm(Collection<Query.Term> terms)`
    `CompositeTerm(Query.Term... terms)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(Query.Term t)` Add a term
    `abstract String` | `getOp()` Operation over the terms, such as AND or OR
    `boolean` | `hasAttribute(String attribute)` Check if this term (or its sub-terms) contain a given attribute
    `void` | `remove(Query.Term t)` Remove a term
    `protected List<Query.Term>` | `terms()` List terms
    `String` | `toString()`
    `String` | `toString(Query.QueryFormatter f)` Print the term/sub-query

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

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

    - ### Methods inherited from interface org.cpsolver.ifs.util.Query.Term

      `match, match`

- - ### Constructor Detail

    - #### CompositeTerm

          public CompositeTerm()

    - #### CompositeTerm

          public CompositeTerm(Query.Term... terms)

    - #### CompositeTerm

          public CompositeTerm(Collection<Query.Term> terms)

  - ### Method Detail

    - #### add

          public void add(Query.Term t)

      Add a term

    - #### remove

          public void remove(Query.Term t)

      Remove a term

    - #### terms

          protected List<Query.Term> terms()

      List terms

    - #### getOp

          public abstract String getOp()

      Operation over the terms, such as AND or OR

    - #### hasAttribute

          public boolean hasAttribute(String attribute)

      Description copied from interface: `Query.Term`
      Check if this term (or its sub-terms) contain a given attribute
      Specified by:
        `hasAttribute` in interface `Query.Term`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toString

          public String toString(Query.QueryFormatter f)

      Description copied from interface: `Query.Term`
      Print the term/sub-query
      Specified by:
        `toString` in interface `Query.Term`