Exemple #1
0
 /// <summary>Construct a SpanOrQuery merging the provided clauses. </summary>
 public SpanOrQuery(SpanQuery[] clauses)
 {
     // copy clauses array into an ArrayList
     this.clauses = new SupportClass.EquatableList <SpanQuery>(clauses.Length);
     for (int i = 0; i < clauses.Length; i++)
     {
         SpanQuery clause = clauses[i];
         if (i == 0)
         {
             // check field
             field = clause.GetField();
         }
         else if (!clause.GetField().Equals(field))
         {
             throw new System.ArgumentException("Clauses must have same field.");
         }
         this.clauses.Add(clause);
     }
 }
Exemple #2
0
 /// <summary>Construct a SpanOrQuery merging the provided clauses. </summary>
 public SpanOrQuery(SpanQuery[] clauses)
 {
     // copy clauses array into an ArrayList
     this.clauses = new SupportClass.EquatableList<SpanQuery>(clauses.Length);
     for (int i = 0; i < clauses.Length; i++)
     {
         SpanQuery clause = clauses[i];
         if (i == 0)
         {
             // check field
             field = clause.GetField();
         }
         else if (!clause.GetField().Equals(field))
         {
             throw new System.ArgumentException("Clauses must have same field.");
         }
         this.clauses.Add(clause);
     }
 }