code: public void matchSet(String[] elementNames, String[] elementValues,
                           int op) throws DBException
      {
  
          // Delete the old search criteria
          criteria = new Criteria();
  
          if (op == OR)
          {
              // For each of the elements in the array, create a leaf node for the match
              for (int i = 0; i < elementNames.length; i++)
              {
                  Criteria tempCrit = new Criteria();
  
                  tempCrit.addEqualTo(elementNames[i], elementValues[i]);
                  criteria.addOrCriteria(tempCrit);
              }
          }
          else if (op == AND)
          {
              for (int i = 0; i < elementNames.length; i++)
              {
                  criteria.addEqualTo(elementNames[i], elementValues[i]);
              }
          }
          else
          {
              throw new DBException();
          }
      }
docs: Change the search filter to one that specifies a set of elements and their values
  that must match, and the operator to use to combine the elements.
  Each element name is compared for an equal match to the value, and all
  comparisons are combined by the specified logical operator (OR or AND).
  The old search filter is deleted.
  
  @param elementNames is an array of names of elements to be tested
  @param elementValues is an array of values for the corresponding element
  @param op is the logical operator to be used to combine the comparisons
  @exception DBException