1   package com.atlassian.user.search.query;
2   
3   import java.util.List;
4   import java.util.ArrayList;
5   
6   public abstract class AbstractBooleanQuery implements BooleanQuery
7   {
8       protected boolean anding;
9       protected List<Query> queries = new ArrayList<Query>();
10  
11      protected AbstractBooleanQuery(boolean anding)
12      {
13          this.anding = anding;
14      }
15  
16      protected AbstractBooleanQuery(String anding)
17      {
18          if (anding.equals(AND))
19              this.anding = true;
20      }
21  
22      /**
23       * It is impossible for isAND() and isOR() to both return true or false.
24       *
25       * @return true if the clause is set to AND the two queries.
26       */
27      public boolean isAND()
28      {
29          return anding;
30      }
31  
32      /**
33       * @return true if the clause is set to OR the two queries
34       */
35      public boolean isOR()
36      {
37          return !anding;
38      }
39  
40      public List<Query> getQueries()
41      {
42          return queries;
43      }
44  }