李忠X64架構(gòu)匯編語(yǔ)言和操作系統(tǒng)基礎(chǔ)
2023-08-26 21:35 作者:bili_57619593086 | 我要投稿
java分頁(yè)代碼實(shí)現(xiàn)
public class PageBean { ?
? ? private int curPage; //當(dāng)前頁(yè)
? ? private int pageCount; //總頁(yè)數(shù)
? ? private int rowsCount; //總行數(shù)
? ? private int pageSize=10; //每頁(yè)多少行
? ?
? public PageBean(int rows){
? ? ? ? this.setRowsCount(rows);
? ? ? ? if(this.rowsCount % this.pageSize == 0){
? ? ? ? ? ?this.pageCount=this.rowsCount / this.pageSize;
? ? ? ? }
? ? ? ? else if(rows<this.pageSize){
? ? ? ? ? ? this.pageCount=1;
? ? ? ?}
? ? ? ? else{
? ? ? ? ? ? this.pageCount=this.rowsCount / this.pageSize +1;
? ? ? ? }
? ? }
標(biāo)簽: