code: private int string_index_(dictionary_delta dict_delta, MetricValue str) {
          assert(str.getStrValue() != null);
          final BiMap<MetricValue, Integer> dict = from_.getStrvalDict().inverse();
          final Integer resolved = dict.get(str);
          if (resolved != null) return resolved;
  
          final int allocated = allocate_index_(dict);
          dict.put(str, allocated);
  
          // Create new pdd for serialization.
          strval_dictionary_delta sdd = new strval_dictionary_delta();
          sdd.id = allocated;
          sdd.value = str.getStrValue();
          // Append new entry to array.
          dict_delta.sdd = Stream.concat(Arrays.stream(dict_delta.sdd), Stream.of(sdd))
                  .toArray(strval_dictionary_delta[]::new);
          LOG.log(Level.FINE, "dict_delta.sdd: {0} items (added {1})", new Object[]{dict_delta.sdd.length, quotedString(sdd.value)});
  
          return allocated;
      }
docs: Lookup the index for the argument, or if it isn't present, create one.