code: public int getKeyFieldIndex(Field[] fields) {
          String keyField = getKeyFieldName();
          return Field.getFieldIndex(fields, keyField);
      }
docs: Returns the index of the key field within the array of fields provided for a given table.
  @param fields array of fields (intended to be derived from the headers of a csv text file)