com.alibaba.fastjson.JSONArray.remove()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(697)

本文整理了Java中com.alibaba.fastjson.JSONArray.remove()方法的一些代码示例,展示了JSONArray.remove()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONArray.remove()方法的具体详情如下:
包路径:com.alibaba.fastjson.JSONArray
类名称:JSONArray
方法名:remove

JSONArray.remove介绍

暂无

代码示例

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean remove(Object o) {
  return jsonArray.remove(o);
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public Object remove(int index) {
  return jsonArray.remove(index);
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public boolean remove(Object o) {
  return jsonArray.remove(o);
}

代码示例来源:origin: ltsopensource/light-task-scheduler

@Override
public Object remove(int index) {
  return jsonArray.remove(index);
}

代码示例来源:origin: TommyLemon/APIJSON

throw new NullPointerException("PUT " + path + ", " + realKey + ":" + obj + " 不存在!");
targetArray.remove(obj);

代码示例来源:origin: com.github.ltsopensource/lts-core

@Override
public Object remove(int index) {
  return jsonArray.remove(index);
}

代码示例来源:origin: syhily/elasticsearch-jdbc

@Override
public Object remove(int index) {
  return jsonArray.remove(index);
}

代码示例来源:origin: com.github.ltsopensource/lts-core

@Override
public boolean remove(Object o) {
  return jsonArray.remove(o);
}

代码示例来源:origin: syhily/elasticsearch-jdbc

@Override
public boolean remove(Object o) {
  return jsonArray.remove(o);
}

代码示例来源:origin: com.senseidb/sensei-core

/**
 * Remove an index and close the hole.
 * @param index The index of the element to be removed.
 * @return The value that was associated with the index,
 * or null if there was no value.
 */
public Object remove(int index) {
 Object o = this.opt(index);
 _inner.remove(index);
 return o;
}

代码示例来源:origin: huangfangyi/FanXin

@Override
  public void run() {
    boolean isChange = false;
    try {
      JSONObject jsonObject = JSONObject.parseObject(groupName);
      JSONArray jsonArray = jsonObject.getJSONArray("jsonArray");
      for (int i = 0; i < jsonArray.size(); i++) {
        JSONObject userJson = jsonArray.getJSONObject(i);
        if (hxid.equals(userJson.getString("hxid"))) {
          jsonArray.remove(userJson);
          isChange = true;
        }
      }
      if (isChange) {
        jsonObject.put("jsonArray", jsonArray);
        Message message = hanlder.obtainMessage();
        Bundle bundle = new Bundle();
        bundle.putString("groupId", groupId);
        bundle.putString("groupName", jsonObject.toJSONString());
        message.setData(bundle);
        message.what = UPDATE_GROUP_NAME;
        message.sendToTarget();
      }
    } catch (JSONException e) {
      e.printStackTrace();
    }
  }
}).start();

代码示例来源:origin: huangfangyi/FanXin

cjsons.remove(postion);
setCommentTextClick(ctextView, cjsons, view, goodSize);

代码示例来源:origin: huangfangyi/FanXin

private void deleteComment(String userID, final int postion, String scID,
              int type, TextView ctextView, final JSONArray cjsons, View view,
              int goodSize) {
  if (scID == null) {
    scID = "LOCAL";
  }
  ;
  String tag = cjsons.getJSONObject(postion).getString("tag");
  if (tag == null) {
    tag = String.valueOf(System.currentTimeMillis());
  }
  // 更新UI
  cjsons.remove(postion);
  setCommentTextClick(ctextView, cjsons, view, goodSize);
  List<Param> params = new ArrayList<Param>();
  params.add(new Param("scID", scID));
  params.add(new Param("userID", myuserID));
  params.add(new Param("tag", tag));
  OkHttpManager.getInstance().post(params, FXConstant.URL_SOCIAL_DELETE_COMMENT, new OkHttpManager.HttpCallBack() {
    @Override
    public void onResponse(JSONObject jsonObject) {
    }
    @Override
    public void onFailure(String errorMsg) {
    }
  });
}

代码示例来源:origin: huangfangyi/FanXin

/**
 * 取消点赞
 */
public void cancelGood(String sID, TextView tv_good, JSONArray jsons,
            LinearLayout ll_goodmembers_temp, View view, int cSize) {
  // 即时改变当前UI
  for (int i = 0; i < jsons.size(); i++) {
    JSONObject json = jsons.getJSONObject(i);
    if (json.getString("userID").equals(myuserID)) {
      jsons.remove(i);
    }
  }
  setGoodTextClick(tv_good, jsons, ll_goodmembers_temp, view, cSize);
  List<Param> params = new ArrayList<Param>();
  params.add(new Param("sID", sID));
  params.add(new Param("userID", myuserID));
   OkHttpManager.getInstance().post(params, FXConstant.URL_SOCIAL_GOOD_CANCEL, new OkHttpManager.HttpCallBack() {
    @Override
    public void onResponse(JSONObject jsonObject) {
    }
    @Override
    public void onFailure(String errorMsg) {
    }
  });
}

代码示例来源:origin: huangfangyi/FanXin

cjsons.remove(postion);
setCommentTextClick(ctextView, cjsons, view, goodSize);

代码示例来源:origin: huangfangyi/FanXin

/**
 * 取消点赞
 */
public void cancelGood(String sID, TextView tv_good, JSONArray jsons,
            LinearLayout ll_goodmembers_temp, View view, int cSize) {
  // 即时改变当前UI
  for (int i = 0; i < jsons.size(); i++) {
    JSONObject json = jsons.getJSONObject(i);
    if (json.getString("userID").equals(myuserID)) {
      jsons.remove(i);
    }
  }
  setGoodTextClick(tv_good, jsons, ll_goodmembers_temp, view, cSize);
  List<Param> paramList = new ArrayList<>();
  paramList.add(new Param("sID", sID));
  paramList.add(new Param("userID", myuserID));
  OkHttpManager.getInstance().post(paramList, FXConstant.URL_SOCIAL_GOOD_CANCEL, new OkHttpManager.HttpCallBack() {
    @Override
    public void onResponse(JSONObject jsonObject) {
      int code = jsonObject.getInteger("code");
      if (code != 1000) {
        Toast.makeText(getApplicationContext(), getString(R.string.service_not_response), Toast.LENGTH_SHORT).show();
      }
    }
    @Override
    public void onFailure(String errorMsg) {
      Toast.makeText(getApplicationContext(), getString(R.string.service_not_response), Toast.LENGTH_SHORT).show();
    }
  });
}

代码示例来源:origin: huangfangyi/FanXin

JSONObject json = jsons.getJSONObject(i);
if (json.getString("userID").equals(myuserID)) {
  jsons.remove(i);

代码示例来源:origin: huangfangyi/FanXin

jsonArray.remove(jsonObject1);

代码示例来源:origin: medcl/elasticsearch-partialupdate

for (Object aPArray : pArray) {
  if (jArray.contains(aPArray)) {
    jArray.remove(aPArray);
jArray.remove(v);

相关文章

微信公众号

最新文章

更多