/**
 * 利用subList方法进行分页
 *
 * @param list        分页数据
 * @param pagesize    页面大小
 * @param currentPage 当前页面
 */
private List pageBySubList(List list, int pagesize, int currentPage) {
    int totalcount = list.size();
    int pagecount = 0;
    List<String> subList;
    int m = totalcount % pagesize;
    if (m > 0) {
        pagecount = totalcount / pagesize + 1;
    } else {
        pagecount = totalcount / pagesize;
    }
    if (m == 0) {
        subList = list.subList((currentPage - 1) * pagesize, pagesize * (currentPage));
    } else {
        if (currentPage == pagecount) {
            subList = list.subList((currentPage - 1) * pagesize, totalcount);
        } else {
            subList = list.subList((currentPage - 1) * pagesize, pagesize * (currentPage));
        }
    }
    return subList;
}

鸣蜩IV
4 声望5 粉丝