//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package cn.microvideo.framework.core.page;
public class MicrovideoPage {
private int totalPages;
private int pageSize = 10;
private int firstPage;
private int lastPage;
private int currentPage;
private int totalNum;
private int startRow;
private int endRow;
public MicrovideoPage() {
}
public MicrovideoPage(int totalNum, int currentPage, int pageSize) {
if (currentPage <= 0) {
currentPage = 1;
}
if (pageSize <= 0) {
pageSize = 10;
}
this.pageSize = pageSize;
this.totalNum = totalNum;
this.firstPage = totalNum > 0 ? 1 : 0;
this.totalPages = totalNum % pageSize == 0 ? totalNum / pageSize : totalNum / pageSize + 1;
this.lastPage = this.totalPages;
this.currentPage = currentPage >= this.totalPages ? this.totalPages : currentPage;
this.currentPage = currentPage <= this.firstPage ? this.firstPage : currentPage;
this.startRow = currentPage == 0 ? 0 : (currentPage - 1) * pageSize;
this.endRow = currentPage == this.getLastPage() ? this.getTotalNum() : currentPage * pageSize;
this.startRow = this.startRow < 0 ? 0 : this.startRow;
this.endRow = this.endRow < 0 ? 0 : this.endRow;
}
public MicrovideoPage(int totalNum, int currentPage) {
if (currentPage <= 0) {
currentPage = 1;
}
this.totalNum = totalNum;
this.firstPage = totalNum > 0 ? 1 : 0;
this.totalPages = totalNum % this.pageSize == 0 ? totalNum / this.pageSize : totalNum / this.pageSize + 1;
this.lastPage = this.totalPages;
this.currentPage = currentPage >= this.totalPages ? this.totalPages : currentPage;
this.currentPage = currentPage <= this.firstPage ? this.firstPage : currentPage;
this.startRow = currentPage == 0 ? 0 : (currentPage - 1) * this.pageSize;
this.endRow = currentPage == this.getLastPage() ? this.getTotalNum() : currentPage * this.pageSize;
this.startRow = this.startRow < 0 ? 0 : this.startRow;
this.endRow = this.endRow < 0 ? 0 : this.endRow;
}
public int getTotalPages() {
return this.totalPages;
}
public int getPageSize() {
return this.pageSize;
}
public int getFirstPage() {
return this.firstPage;
}
public int getLastPage() {
return this.lastPage;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public int getCurrentPage() {
return this.currentPage;
}
public int getTotalNum() {
return this.totalNum;
}
public void setTotalNum(int totalNum) {
this.totalNum = totalNum;
this.firstPage = totalNum > 0 ? 1 : 0;
this.totalPages = totalNum % this.pageSize == 0 ? totalNum / this.pageSize : totalNum / this.pageSize + 1;
this.lastPage = this.totalPages;
this.currentPage = this.currentPage >= this.totalPages ? this.totalPages : this.currentPage;
this.currentPage = this.currentPage <= this.firstPage ? this.firstPage : this.currentPage;
this.startRow = this.currentPage == 0 ? 0 : (this.currentPage - 1) * this.pageSize;
this.endRow = this.currentPage == this.getLastPage() ? this.getTotalNum() : this.currentPage * this.pageSize;
this.startRow = this.startRow < 0 ? 0 : this.startRow;
this.endRow = this.endRow < 0 ? 0 : this.endRow;
}
public int getNextPage() {
return this.currentPage >= this.getLastPage() ? this.getLastPage() : this.currentPage + 1;
}
public int getPreviousPage() {
return this.currentPage <= this.getFirstPage() ? this.getFirstPage() : this.currentPage - 1;
}
public int getStartRow() {
return this.startRow;
}
public void setStartRow(int startRow) {
this.startRow = startRow;
}
public int getEndRow() {
return this.endRow;
}
public void setEndRow(int endRow) {
this.endRow = endRow;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public void setFirstPage(int firstPage) {
this.firstPage = firstPage;
}
public void setLastPage(int lastPage) {
this.lastPage = lastPage;
}
public String toString() {
return "Page [totalPages=" + this.totalPages + ", pageSize=" + this.pageSize + ", currentPage=" + this.currentPage + ", totalNum=" + this.totalNum + "]";
}
}
关于分页记录
最新推荐文章于 2024-08-24 22:01:16 发布