code: public int getCaseIndex(int accessor, String name) {
      JMFFieldDef field = getFieldDef(accessor);
      if (!(field instanceof JSVariant))
        return -1;
      JMFType target = findVariantChildByName((JSVariant)field, name);
      if (target != null)
        return getEffectiveSiblingPosition(target);
      else
        return -1;
    }
docs: Resolve a case name to a case index
  
  @param accessor the accessor of a JSVariant in the schema in whose scope the case
  name is to be resolved
  @param name the case name to be resolved
  @return the case index associated with the name or -1 if either the accessor does not
  refer to a JSVariant in this schema or the name doesn't name one of its cases