<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    tinguo002

     

    JSONObject put,accumulate,element的區別

    public Object put (Object key, Object value) 將value映射到key下。如果此JSONObject對象之前存在一個value在這個key下,當前的value會替換掉之前的value
    Associates the specified value with the specified key in this map(optional operation). If the map previously contained . a mapping for this key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true .))
    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.

    轉載:http://ljhzzyx.blog.163.com/blog/static/3838031220126810430157/


    歡迎大家訪問我的個人網站 萌萌的IT人

    posted on 2014-02-27 23:24 一堣而安 閱讀(1000) 評論(0)  編輯  收藏 所屬分類: js_css

    導航

    統計

    常用鏈接

    留言簿(1)

    隨筆分類

    隨筆檔案

    收藏夾

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产真人无遮挡作爱免费视频| 亚洲精品在线免费观看| 国产伦一区二区三区免费| 国产精品亚洲片在线va| 成年女性特黄午夜视频免费看| 精品亚洲AV无码一区二区| 99久久这里只精品国产免费| 精品久久久久久亚洲精品| 野花高清在线电影观看免费视频| 亚洲卡一卡2卡三卡4麻豆| 波多野结衣免费在线观看| 亚洲国产最大av| 大陆一级毛片免费视频观看i| 亚洲一区二区三区写真| 日本一道一区二区免费看| 免费的黄网站男人的天堂| 久久亚洲精品无码观看不卡| 国产在线播放线91免费| 亚洲高清在线播放| 国产一卡2卡3卡4卡2021免费观看| 亚洲中文字幕无码久久| 国产成人免费a在线视频色戒| 一级白嫩美女毛片免费| 久久亚洲精品成人777大小说| 最近中文字幕免费2019| 亚洲GV天堂无码男同在线观看| 亚洲精品网站在线观看不卡无广告| 岛国岛国免费V片在线观看| 亚洲精品在线不卡| 手机看片久久国产免费| 男女拍拍拍免费视频网站| 亚洲精品欧洲精品| 国产精品免费_区二区三区观看| 成人免费无码H在线观看不卡| 亚洲成a人片在线观看中文app| 男女交性永久免费视频播放| 久久精品免费网站网| 亚洲Av无码一区二区二三区| 亚洲成A人片在线观看中文| 免费人成在线观看网站品爱网| 亚洲gay片在线gv网站|