code: public long getLong(String key) throws JSONException {
          Object o = get(key);
          return o instanceof Number ?
                  ((Number) o).longValue() : (long) getDouble(key);
      }
docs: Get the long value associated with a key. If the number value is too
  long for a long, it will be clipped.
  
  @param key A key string.
  @return The long value.
  @throws JSONException if the key is not found or if the value cannot
  be converted to a long.