Exemple #1
0
  private void innerParse(KeywordIndex kw) {
    ArrayList<String> input = new ArrayList<>(kw.numArgs());
    for (int i = 0; i < kw.numArgs(); i++) input.add(kw.getArg(i));

    ArrayList<K1> list;
    try {
      // Determine the key(s)
      list = Input.parseEntityList(input.subList(0, 1), keyClass, true);
    } catch (InputErrorException e) {
      // A key was not provided.  Set the "no key" value
      noKeyValue = Input.parseEntityList(input, valClass, true);
      return;
    }

    // The input is of the form: <Key> <value1 value2 value3...>
    // Determine the value
    ArrayList<V> val = Input.parseEntityList(input.subList(1, input.size()), valClass, true);

    // Set the value for the given keys
    for (int i = 0; i < list.size(); i++) {
      hashMap.put(list.get(i), val);
    }
  }