JAVA 函数如何对多个JSONArray取交集,取并集

/**
   * 根据JSONArray中JSONObject的id不同取交集
   * @return
   */
    public static JSONArray intersectResult(JSONArray... arrays){
        JSONArray ret = new JSONArray();
        if(arrays==null||arrays.length==0)
            return ret;
        Set first_ids=new HashSet();
        Map objs=new HashMap();
        JSONArray first=arrays[0];
        for(int i=0;i this_ids=new HashSet();
            for(int j=0;j ids=new HashSet();
      for(JSONArray array : arrays){
          if(array==null)
              continue;
          for(int i=0;i

你可能感兴趣的:(程序员)