View Javadoc

    1   /***
    2    * @(#)PageModel.java
    3    *
    4    * JFoxSOAF, Service-Oriented Application Framework
    5    *
    6    * Copyright(c) JFoxSOAF Team
    7    *
    8    * Licensed under the GNU LGPL, Version 2.1 (the "License");
    9    * you may not use this file except in compliance with the License.
    10   * You may obtain a copy of the License at
    11   *
    12   * http://www.gnu.org/copyleft/lesser.html
    13   *
    14   * Unless required by applicable law or agreed to in writing, software
    15   * distributed under the License is distributed on an "AS IS" BASIS,
    16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    17   * See the License for the specific language governing permissions and
    18   * limitations under the License.
    19   *
    20   * For more information, please visit:
    21   * http://www.jfox.cn/confluence/display/JFoxSOAF/Home
    22   * http://www.huihoo.org/jfox/jfoxsoaf
    23   */
    24
    25  package org.huihoo.jfox.soaf.util.pager;
    26
    27  /***
    28   * <p>
    29   * Page info model.
    30   * </p>
    31   *
    32   * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
    33   * @version $Revision: 1.1 $ $Date: 2005/05/22 06:51:48 $
    34   * @version Revision: 1.0
    35   */
    36
    37  public class PageModel {
    38
    39      private int totalPage = 0;
    40
    41      private int resultCount = 0;
    42
    43      private int page = 0;
    44
    45      private int previousPage;
    46
    47      private int nextPage;
    48
    49      private int finalPage;
    50
    51      /***
    52       * @return Returns the finalPage.
    53       */
    54      public int getFinalPage() {
    55          return this.totalPage + 1;
    56      }
    57
    58      /***
    59       * @param finalPage The finalPage to set.
    60       */
    61      public void setFinalPage(int finalPage) {
    62          this.finalPage = finalPage;
    63      }
    64
    65      /***
    66       * @return Returns the nextpage.
    67       */
    68      public int getNextPage() {
    69          return this.page + 1;
    70      }
    71
    72      /***
    73       * @param nextpage The nextpage to set.
    74       */
    75      public void setNextPage(int nextpage) {
    76          this.nextPage = nextpage;
    77      }
    78
    79      /***
    80       * @return Returns the page.
    81       */
    82      public int getPage() {
    83          return page;
    84      }
    85
    86      /***
    87       * @param page The page to set.
    88       */
    89      public void setPage(int page) {
    90          this.page = page;
    91      }
    92
    93      /***
    94       * @return Returns the previousPage.
    95       */
    96      public int getPreviousPage() {
    97          return this.page - 1;
    98      }
    99
    100     /***
    101      * @param previousPage The previousPage to set.
    102      */
    103     public void setPreviousPage(int previousPage) {
    104         this.previousPage = previousPage;
    105     }
    106
    107     /***
    108      * @return Returns the resultCount.
    109      */
    110     public int getResultCount() {
    111         return resultCount;
    112     }
    113
    114     /***
    115      * @param resultCount The resultCount to set.
    116      */
    117     public void setResultCount(int resultCount) {
    118         this.resultCount = resultCount;
    119     }
    120
    121     /***
    122      * @return Returns the totalPage.
    123      */
    124     public int getTotalPage() {
    125         return totalPage;
    126     }
    127
    128     /***
    129      * @param totalPage The totalPage to set.
    130      */
    131     public void setTotalPage(int totalPage) {
    132         this.totalPage = totalPage;
    133     }
    134
    135 }