首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

过滤抉择信息

2013-02-27 
过滤选择信息//取已选择信息ListLong idsList new ArrayListLong()ListJavaABean destList ser

过滤选择信息

//取已选择信息List<Long> idsList = new ArrayList<Long>();List<JavaABean> destList = service.getJavaABeanList();for (JavaABean bean : destList) {idsList.add(bean.getId());}//取所有信息List<JavaABean> commands = service.getJavaABoListByParentId(parentId);int idscount = commands.size();if (null != idsList && idsList.size() > 0) {//过滤信息for (int i = idscount - 1; i >= 0; i--) {JavaABo bo = (JavaABo) commands.get(i);Long id = (Long) bo.getId();if (idsList.contains(id)) {commands.remove(bo);//将已存在信息过滤掉}}}

热点排行