Example #1
0
 /// <summary> Append a double value. This increases the array's length by one.
 ///
 /// </summary>
 /// <param name="value">A double value.
 /// </param>
 /// <throws>  JSONException if the value is not finite. </throws>
 /// <returns> this.
 /// </returns>
 public virtual JSONArray put(double value_Renamed)
 {
     System.Double d = (double)value_Renamed;
     JSONObject.testValidity((System.Object)d);
     put((System.Object)d);
     return(this);
 }
Example #2
0
 /// <summary> Put or replace an object value in the JSONArray. If the index is greater
 /// than the length of the JSONArray, then null elements will be added as
 /// necessary to pad it out.
 /// </summary>
 /// <param name="index">The subscript.
 /// </param>
 /// <param name="value">The value to put into the array. The value should be a
 /// Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the
 /// JSONObject.NULL object.
 /// </param>
 /// <returns> this.
 /// </returns>
 /// <throws>  JSONException If the index is negative or if the the value is </throws>
 /// <summary>  an invalid number.
 /// </summary>
 public virtual JSONArray put(int index, System.Object value_Renamed)
 {
     JSONObject.testValidity(value_Renamed);
     if (index < 0)
     {
         throw new JSONException("JSONArray[" + index + "] not found.");
     }
     if (index < length())
     {
         this.myArrayList[index] = value_Renamed;
     }
     else
     {
         while (index != length())
         {
             put(JSONObject.NULL);
         }
         put(value_Renamed);
     }
     return(this);
 }