MyPage.java
上传用户:liangcc
上传日期:2019-05-24
资源大小:4412k
文件大小:1k
- package com.softeem.page;
- import java.util.ArrayList;
- import java.util.List;
- public class MyPage {
- public List anlist(int page, List list) {
- List anlist = new ArrayList();
- if ((list.size() % 10) == 0) {
- anlist = list.subList((page - 1) * 10, 10 * page);
- } else {
- if (page != (int) list.size() / 10 + 1) {
- anlist = list.subList((page - 1) * 10, 10 * page);
- } else {
- anlist = list.subList((page - 1) * 10, list.size());
- }
- }
- return anlist;
- }
- public List thlist(List list) {
- List thlist = new ArrayList();
- if (list.size() >= 10) {
- thlist = list.subList(0, 10);
- } else {
- thlist = list.subList(0, list.size());
- }
- return thlist;
- }
- }