Logo Search packages:      
Sourcecode: libjson-java version File versions

JSONArray net::sf::json::JSONArray::element ( int  index,
Collection  value,
JsonConfig  jsonConfig 
) [inline]

Put a value in the JSONArray, where the value will be a JSONArray which is produced from a Collection.

index The subscript.
value A Collection value.
JSONException If the index is negative or if the value is not finite.

Definition at line 1465 of file JSONArray.java.

References element(), elements, and size().

      if( value instanceof JSONArray ){
         if( index < 0 ){
            throw new JSONException( "JSONArray[" + index + "] not found." );
         if( index < size() ){
            elements.set( index, value );
            while( index != size() ){
               element( JSONNull.getInstance() );
            element( value, jsonConfig );
         return this;
         return element( index, _fromCollection( value, jsonConfig ) );

Generated by  Doxygen 1.6.0   Back to index