JSONObject accumulate
来源:互联网 发布:淘宝分享有礼怎么领取 编辑:程序博客网 时间:2024/05/18 18:00
原文 http://blog.csdn.net/z69183787/article/details/18655143
public JSONObject accumulate (String key, Object value) 累积value到这个key下。这个方法同element()方法类似,特殊的是,如果当前已经存在一个value在这个key下那么一个JSONArray将会存储在这个key下来保存所有累积的value。如果已经存在一个JSONArray,那么当前的value就会添加到这个JSONArray中
。相比之下replace方法会替代先前的value
Accumulate values under a key. It is similar to the element method except that if there is already an object stored
under the key then a JSONArray is stored under the key to hold all of the accumulated values. If there is already a
JSONArray, then the new value is appended to it. In contrast, the replace method replaces the previous value.
public JSONObject element (String key, Object value) 将键/值对放到这个JSONObject对象里面。如果当前value为空(null),那么如果这个key存在的话,这个key就会移除掉。如果这
个key之前有value值,那么此方法会调用accumulate()方法。
Put a key/value pair in the JSONObject. If the value is null, then the key will be removed from the JSONObject if it is
present. If there is a previous value assigned to the key, it will call accumulate.
0 0
- JSONObject accumulate
- jsonobject的element和accumulate
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject put accumulate element 步骤区别
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject:put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JsonObject put、element、accumulate的区别。
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject中put/element/accumulate区别
- JSONObject put,accumulate,element的区别 和 例子
- accumulate
- Volley
- 从源码说说dispatchTouchEvent与onTouchEvent的关系以及OnTouchListener的用法
- String、StringBuilder和StringBuffer
- iptables之LOG目标
- LeetCode Problem10 Regular Expression Matching
- JSONObject accumulate
- mac os brew install request githup token
- Android Studio 导入eclipse libs工程,.aar生成,引用等步骤
- framebuffer实现命令行下绘图
- 关于hashcode() 方法
- iOS学习笔记1(结合项目)---oc的@property属性
- android 相册 裁剪 提示失败
- 前后端分离的思考与实践(一)
- Camera Calibration 相机标定:Opencv应用方法