Method written by Java according to the rules of Google calculation page

xiaoxiao2021-03-06  27

/ ** * In accordance with the method of the Google calculation page number * According to the selected page number, the start code will be displayed (such as: Previous page 1 2 3 4 Next, ie 1 and 4 is the starting code), the calculation results are stored in PageDescription @ @Param selectedPageno int * / private void calculatestart_endpageno (int classpageno) {string log_mm = "calculatestart_endpageno"; int log_index = 0;

Log.info (log_cm log_mm log_index log_rm "Enter CalculateStart_endpageno Method ...");

Log.debug (log_cm log_mm log_index log_rm "checks the currently selected page:" SELECTEDPAGENO);

INT StartPageno = 1; int endpageno = pgdes.gettotalpages ();

INT HALFSIZE = pgdes.getpageRange () / 2;

IF (pgdes.gettotalpages () <= pgdes.getpageRange ()) {endpageno = pgdes.gettotalpages ();} else if (SELSGENO <= HALFSIZE) {endpageno = pgdes.getPageRange (); // Because of the following features Add, the page range // endpageno = HalfSize SelectedPageno - 1; //}} else {endpageno = SELECTEDPAGENO HALFSIZE - 1; IF (Endpageno <= pgdes.gettotalpages ()) {startPageNo = endPageNo - pgDes.getPageRange () 1;} else {startPageNo = pgDes.getTotalPages () - pgDes.getPageRange () 1;}} if (endPageNo> pgDes.getTotalPages ()) {endPageNo = pgDes.getTotalPages (); Pgdes.setstartPageno (StartPageno); pgdes.setendpageno (Endpageno);

log.debug (log_CM log_MM log_Index log_RM "obtained by the calculation: startPageNo =" startPageNo "endPageNo =" endPageNo); log.info (log_CM log_MM log_Index log_RM "normal end calculateStart_EndPageNo method. ");

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

New Post(0)