@@ -0,0 +1,1588 @@
+import java.util.List;%0A%0Apublic class PageView%3CT%3E %7B%0A%09/** %E5%88%86%E9%A1%B5%E6%95%B0%E6%8D%AE **/%0A%09private List%3CT%3E records;%0A%09/** %E9%A1%B5%E7%A0%81%E5%BC%80%E5%A7%8B%E7%B4%A2%E5%BC%95%E5%92%8C%E7%BB%93%E6%9D%9F%E7%B4%A2%E5%BC%95 **/%0A%09private PageIndex pageindex;%0A%09/** %E6%80%BB%E9%A1%B5%E6%95%B0 **/%0A%09private long totalpage = 1;%0A%09/** %E6%AF%8F%E9%A1%B5%E6%98%BE%E7%A4%BA%E8%AE%B0%E5%BD%95%E6%95%B0 **/%0A%09private int maxresult = 12;%0A%09/** %E5%BD%93%E5%89%8D%E9%A1%B5 **/%0A%09private int currentpage = 1;%0A%09/** %E6%80%BB%E8%AE%B0%E5%BD%95%E6%95%B0 **/%0A%09private long totalrecord;%0A%09/** %E9%A1%B5%E7%A0%81%E6%95%B0%E9%87%8F **/%0A%09private int pagecode = 10;%0A%09/** %E8%A6%81%E8%8E%B7%E5%8F%96%E8%AE%B0%E5%BD%95%E7%9A%84%E5%BC%80%E5%A7%8B%E7%B4%A2%E5%BC%95 **/%0A%09public int getFirstResult() %7B%0A%09%09return (this.currentpage-1)*this.maxresult;%0A%09%7D%0A%09public int getPagecode() %7B%0A%09%09return pagecode;%0A%09%7D%0A%0A%09public void setPagecode(int pagecode) %7B%0A%09%09this.pagecode = pagecode;%0A%09%7D%0A%0A%09public PageView(int maxresult, int currentpage) %7B%0A%09%09this.maxresult = maxresult;%0A%09%09this.currentpage = currentpage;%0A%09%7D%0A%09%0A%09public void setQueryResult(QueryResult%3CT%3E qr)%7B%0A%09%09setTotalrecord(qr.getTotalrecord());%0A%09%09setRecords(qr.getResultlist());%0A%09%7D%0A%09%0A%09public long getTotalrecord() %7B%0A%09%09return totalrecord;%0A%09%7D%0A%09public void setTotalrecord(long totalrecord) %7B%0A%09%09this.totalrecord = totalrecord;%0A%09%09setTotalpage(this.totalrecord%25this.maxresult==0? this.totalrecord/this.maxresult : this.totalrecord/this.maxresult+1);%0A%09%7D%0A%09public List%3CT%3E getRecords() %7B%0A%09%09return records;%0A%09%7D%0A%09public void setRecords(List%3CT%3E records) %7B%0A%09%09this.records = records;%0A%09%7D%0A%09public PageIndex getPageindex() %7B%0A%09%09return pageindex;%0A%09%7D%0A%09public long getTotalpage() %7B%0A%09%09return totalpage;%0A%09%7D%0A%09public void setTotalpage(long totalpage) %7B%0A%09%09this.totalpage = totalpage;%0A%09%09this.pageindex = PageIndex.getPageIndex(pagecode, currentpage, totalpage);%0A%09%7D%0A%09public int getMaxresult() %7B%0A%09%09return maxresult;%0A%09%7D%0A%09public int getCurrentpage() %7B%0A%09%09return currentpage;%0A%09%7D%0A%7D%0A

Create PageView.java