-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPageUtil.java
More file actions
55 lines (42 loc) · 1.34 KB
/
PageUtil.java
File metadata and controls
55 lines (42 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package uitl;
import java.util.List;
public class PageUtil<E> {
private int currPageNo = 1;// 当前页码
private int pageSie = 2;// 页面大小,每页显示的数量
private int totalCount;// 记录总数
private int totalPageCount;// 总页数
private List<E> userList;//用户列表
public List<E> getUserList() {
return userList;
}
public void setUserList(List<E> userList) {
this.userList = userList;
}
public int getCurrPageNo() {
return currPageNo;
}
public void setCurrPageNo(int currPageNo) {
this.currPageNo = (currPageNo>totalPageCount)?totalPageCount:currPageNo;
}
public int getPageSie() {
return pageSie;
}
public void setPageSie(int pageSie) {
this.pageSie = (pageSie==0)?2:pageSie;
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
if (totalCount > 0) {
this.totalCount = totalCount;
totalPageCount=(totalCount%pageSie==0)?totalCount/pageSie:totalCount/pageSie+1;
}
}
public int getTotalPageCount() {
return totalPageCount;
}
public void setTotalPageCount(int totalPageCount) {
this.totalPageCount = totalPageCount;
}
}