Get the JSONObject associated with an index.

@param index subscript
@return A JSONObject value.
@throws JSONException If there is no value for the index or if the value
is not a JSONObject
548125
public JSONObject getJSONObject( int index ) {
      Object o = get( index );
      if( JSONNull.getInstance()
            .equals( o ) ){
         return new JSONObject( true );
      }else if( o instanceof JSONObject ){
         return (JSONObject) o;
      }
      throw new JSONException( "JSONArray[" + index + "] is not a JSONObject." );
   }
120879
public JsonElement remove(int index) {
        checkIfFrozen();
        if (index < 0 || index >= values.size()) {
            return null;
        }
        return values.remove(index);
    }
478555
public JSONObject optJSONObject(int index) {
		Object object = opt(index);
		return object instanceof JSONObject ? (JSONObject) object : null;
	}
920073
public static JSONObject getObject(JSONValue value) {
        if (value == null)
            return null;
        if (!(value instanceof JSONObject))
            throw new JSONException(NOT_AN_OBJECT);
        return (JSONObject)value;
    }
1071924
public JSONObject toJson() throws JSONException {
    JSONObject json = new JSONObject();

    for (OperaArgument argument : this) {
      json.put(argument.getArgument(), argument.getValue());
    }

    return json;
  }
1262737
public String getString(int index) throws JSONException {
        Object object = this.get(index);
        if (object instanceof String) {
            return (String) object;
        }
        throw new JSONException("JSONArray[" + index + "] not a string.");
    }
839896
public LazyObject optJSONObject(int index) throws LazyException{
		LazyNode token=getOptionalValueToken(index);
		if(token==null)return null;
		if(token.type==LazyNode.VALUE_NULL)return null;
		if(token.type!=LazyNode.OBJECT)return null;
		LazyObject obj= new LazyObject(token);
		obj.parent=this;
		return obj;
	}
1174843
public static function json($index = null, $default = null)
	{
		static::$json === null and static::hydrate_raw_input('json');
		return (func_num_args() === 0) ? static::$json : \Arr::get(static::$json, $index, $default);
	}
536809
public long getLong( int index ) {
      Object o = get( index );
      if( o != null ){
         return o instanceof Number ? ((Number) o).longValue() : (long) getDouble( index );
      }
      throw new JSONException( "JSONArray[" + index + "] is not a number." );
   }
1025685
public double getDouble(int index) throws JSONException {
    Object o = get(index);
    try {
      return o instanceof Number ? ((Number) o).doubleValue() : Double.valueOf((String) o).doubleValue();
    } catch (Exception e) {
      throw new JSONException("JSONArray[" + index + "] is not a number.");
    }
  }
1134052
public JsonArray getJsonArray(int index) throws JsonException {
        JsonElement el = get(index);
        if (!el.isJsonArray()) {
            throw Util.typeMismatch(index, el, "JsonArray");
        }
        return el.asJsonArray();
    }
683090
public JsonArray optJsonArray(int index) {
        JsonElement el;
        try {
            el = get(index);
        } catch (JsonException e) {
            return null;
        }
        if (!el.isJsonArray()) {
            return null;
        }
        return el.asJsonArray();
    }
599430
public long getLong(int index) throws JSONException {
        Object object = this.get(index);
        try {
            return object instanceof Number ? ((Number) object).longValue()
                    : Long.parseLong((String) object);
        } catch (Exception e) {
            throw new JSONException("JSONArray[" + index + "] is not a number.");
        }
    }
833880
static javax.json.JsonValue map(final JsonValue jsonValue) {
        if (jsonValue instanceof JsonArray)
            return map((JsonArray) jsonValue);
        return map((JsonObject) jsonValue);
    }
925397
@Override
    public Dictionary getDictionary(int index) {
        synchronized (lock) {
            final Object obj = getMValue(internalArray, index).asNative(internalArray);
            return obj instanceof Dictionary ? (Dictionary) obj : null;
        }
    }
953693
protected JSONObject getJSONObject(final JSONArray jsonArray, final int index) {
    JSONObject object = new JSONObject();
    try {
      object = (JSONObject) jsonArray.get(index);
    }
    catch(JSONException e) {
      e.printStackTrace();
    }
    return object;
  }
20225
public JSONArray getJSONArray(int index) throws JSONException {
		Object object = get(index);
		if (object instanceof JSONArray) {
			return (JSONArray) object;
		}
		else {
			throw JSON.typeMismatch(index, object, "JSONArray");
		}
	}