public int getIndex(int position) {
    if (!hasIndex(position)) {
      throw new IllegalStateException(
          "index not yet set for constant " + position + " value = " + constants[position]);
    }

    return index[position];
  }
Gets the DEX index of a constant. It is only valid to call this after {@link #setIndex} has
been called.

@param position the position of the constant to get the index for.
@return {@code >= 0;} the constant pool index
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/code/MultiCstInsn.java