code: public int getInt( String key ) {
        verifyIsNull();
        Object o = get( key );
        if( o != null ){
           return o instanceof Number ? ((Number) o).intValue() : (int) getDouble( key );
        }
        throw new JSONException( "JSONObject[" + JSONUtils.quote( key ) + "] is not a number." );
     }
docs: Get the int value associated with a key. If the number value is too large
  for an int, it will be clipped.
  
  @param key A key string.
  @return The integer value.
  @throws JSONException if the key is not found or if the value cannot be
  converted to an integer.