code: private int extractFields(String[] fieldListSpec,
                              ArrayList<Integer> fieldList) {
      int allFieldsFrom = -1;
      int i = 0;
      int j = 0;
      int pos = -1;
      String fieldSpec = null;
      for (i = 0; i < fieldListSpec.length; i++) {
        fieldSpec = fieldListSpec[i];
        if (fieldSpec.length() == 0) {
          continue;
        }
        pos = fieldSpec.indexOf('-');
        if (pos < 0) {
          Integer fn = new Integer(fieldSpec);
          fieldList.add(fn);
        } else {
          String start = fieldSpec.substring(0, pos);
          String end = fieldSpec.substring(pos + 1);
          if (start.length() == 0) {
            start = "0";
          }
          if (end.length() == 0) {
            allFieldsFrom = Integer.parseInt(start);
            continue;
          }
          int startPos = Integer.parseInt(start);
          int endPos = Integer.parseInt(end);
          for (j = startPos; j <= endPos; j++) {
            fieldList.add(j);
          }
        }
      }
      return allFieldsFrom;
    }
docs: Extract the actual field numbers from the given field specs.
  If a field spec is in the form of "n-" (like 3-), then n will be the
  return value. Otherwise, -1 will be returned.
  @param fieldListSpec an array of field specs
  @param fieldList an array of field numbers extracted from the specs.
  @return number n if some field spec is in the form of "n-", -1 otherwise.