翻页工具类
来源:互联网 发布:java做计算器 编辑:程序博客网 时间:2024/05/21 10:09
简洁明了,一直在用的一个翻页类. 本地数据翻页的话,可以使用.
效果:
界面很简单,不再浪费感情.
源码如下:
/** * * @Title: Page.java* @Package fay.frame.tools* @Description: 翻页工具* @author : Fay* @date 2014-6-27 下午3:14:31* @version V1.0 */public class Page {int total = 100;int curPage = 1;int maxPage = 0;int perPageNum = 10;int startIndex = 0;int endIndex = 0;public void setTotal(int total) {this.total = total;}public void setPerPageNum(int perPageNum) {this.perPageNum = perPageNum;}public Page() {}public Page(int _total, int _perPageNum) {total = _total;perPageNum = _perPageNum;if (total % perPageNum == 0) {maxPage = total / perPageNum;} else {maxPage = total / perPageNum + 1;}}public void toPage(int index) {if (index < 1) {index = 1;} else if (index > maxPage) {index = maxPage;}curPage = index;startIndex = (curPage - 1) * perPageNum + 1;endIndex = startIndex + perPageNum - 1;if (endIndex > total) {endIndex = total;startIndex = endIndex - perPageNum + 1;}}public void prePage() {toPage(curPage--);}public void nextPage() {toPage(curPage++);}}
2 0
- 翻页工具类
- sqlplus 上下翻页工具
- 实现Android立体翻页效果的工具类!
- php 翻页区间切割算法(翻页类)
- PHP翻页类
- 翻页
- 翻页
- 翻页
- 翻页
- 翻页
- 翻页
- PHP翻页的一个类
- 用于处理画面翻页的类
- 一个asp翻页类,改进版
- C#图片采集软件 自动翻页 自动分类(收集美图必备工具)(一)
- C#图片采集软件 自动翻页 自动分类(收集美图必备工具)(二)
- symfony 笔记(翻页类,数据库查询,模板快捷变量)
- 又一款不错的HTML5翻页效果类库介绍
- 一种典型的Content Provider 代码架构
- 云安全三大趋势:纵深防御、软件定义安全、设备虚拟化
- 闲来看看View.java的Developer Guides
- IE浏览器 应用程序发生异常 未知的软件异常(0x0000417),位置为 0x6546120
- 设计模式 - 迭代器模式(iterator pattern) Java 迭代器(Iterator) 详解
- 翻页工具类
- OCP-1Z0-051-题目解析-第4题
- 关于CString字符类型
- Android开发之Frame动画实现方法
- 【KMP】 HDOJ 3336 Count the string
- javascript中鼠标事件
- 分布式搜索elasticsearch java API 之(六)------批量添加删除索引
- 黑马程序员——06多线程的实现方式与安全机制
- 【周年庆】china-pub 14周年庆感恩回馈四波狂热来袭