public int indexOf(Type type) {
    if (type == null) {
      throw new NullPointerException("type == null");
    }

    throwIfNotPrepared();

    TypeIdItem item = typeIds.get(type);

    if (item == null) {
      throw new IllegalArgumentException("not found: " + type);
    }

    return item.getIndex();
  }
Gets the index of the given type, which must have been added to this instance.

@param type {@code non-null;} the type to look up
@return {@code >= 0;} the reference's index
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/TypeIdsSection.java