public static final int typeIndex(Class type){
  Class[] list=primitiveTypes;
  int n=list.length;
  for (int i=0; i < n; i++)   if (list[i] == type)   return i;
  throw new RuntimeException("bad type:" + type.getName());
}

public static final int typeIndex ( Class type ) { Class [ ] list = primitiveTypes ; int n = list . length ; for ( int i = 0 ; i < n ; i ++ ) if ( list [ i ] == type ) return i ; throw new RuntimeException ( "bad type:" + type . getName ( ) ) ; }
returns an index for accessing arrays in this class .
