public class Pagemodel {
private int page = 1; Current page
public int totalpages = 0; Total pages
private int pagerecorders;//per page 5 piece of data
private int totalrows = 0; Total number of data
private int pagestartrow = 0;//number of starts per page
private int pageendrow = 0; Number of terminations per page showing data
Private Boolean hasnextpage = false; Whether there is a next page
Private Boolean haspreviouspage = false; Is there a previous page
Private list List;
Private iterator it;
Public Pagemodel (list list, int pagerecorders) {
Init (list, pagerecorders);//By object Set, total number of records divided
}
/** *//**
* Initialize list and tell the number of records per page of the list
* @param list
* @param pagerecorders
*/
public void init (list list, int pagerecorders) {
This.pagerecorders = pagerecorders;
This.list = list;
Totalrows = List.size ();
it = List.iterator ();
Haspreviouspage = false;
if ((totalrows% pagerecorders) = = 0) {
TotalPages = totalrows/pagerecorders;
} else {
TotalPages = totalrows/pagerecorders + 1;
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service