/** * 根据区名获取该区的热帖列表 * * @param zone * @return */ public List<ArticleBase> getBaseZone(String zone) { List<ArticleBase> resultList = new ArrayList<ArticleBase>(); for (int i = 0; i < itemList.size(); i++) { String boardStr = itemList.get(i).getBoard(); Board board = boardSource.getById(boardStr); if (board != null) { String z = board.getZoneBelong(); if (z != null && z.equals(zone)) resultList.add(itemList.get(i)); } } return resultList; }
/** * 获取当前存在的各区热帖的区列表 * * @return */ public List<String> getZoneList() { List<String> resultList = new ArrayList<String>(); for (int i = 0; i < itemList.size(); i++) { String boardStr = itemList.get(i).getBoard(); Board board = boardSource.getById(boardStr); if (board != null) { String zone = board.getZoneBelong(); if (!resultList.contains(zone)) resultList.add(zone); } } return resultList; }