The simplest JAVA pagination algorithm. .

xiaoxiao2021-03-06  136

Define two vectors, one to store all recorded Totalv, another record of record currentpagev; total record number: int totalsize = Totalv.getsize (); per page Show number: int countPage; total pages : Int totalpagenum = totalsize / countperpage; if the total number of records and the number of records per page are greater than zero, then the total number of pages plus one; if (Totalsize% CountPage> 0) {TotalPagenum = Totalsize / CountperPage 1;} Current page number: Pagenum; Page: Add records from TotalV to CURRENTPAGEV from TotalV according to the current pages and records per page; if the current record is (current page number -1) * per page Documentary (including) and current page number * When the number of records (not included) per page is displayed; it belongs to the data of this page; for (int J = 0; j = (PAGENUM - 1) * countryPage) && (j

转载请注明原文地址:https://www.9cbs.com/read-99836.html

New Post(0)