pagination.java

来自「基于struts+hibernate的电子商务网站。可运行。数据库mysql」· Java 代码 · 共 107 行

JAVA
107
字号
package tarena.data;

import java.util.List;


/**
 * 分页信息类
 *
 */
@SuppressWarnings("unchecked")
public class Pagination {
	
	/**
	 * 总页数
	 */
	private int total;
	
	/**
	 * 当前页
	 */
	private int current;
	
	/**
	 * 同时显示的最大页数
	 */
	private int maxPages;
	
	/**
	 * 首页
	 */
	private Page first;
	/**
	 * 上一页
	 */
	private Page previous;
	/**
	 * 每页详细集合
	 */
	private List<Page>  content;
	/**
	 * 下一页
	 */
	private Page next;
	/**
	 * 最后一页
	 */
	private Page last;
	
	
	
	
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public int getCurrent() {
		return current;
	}
	public void setCurrent(int current) {
		this.current = current;
	}	
	public int getMaxPages() {
		return maxPages;
	}
	public void setMaxPages(int maxPages) {
		this.maxPages = maxPages;
	}
	public Page getPrevious() {
		return previous;
	}
	public void setPrevious(Page previous) {
		this.previous = previous;
	}
	public List<Page> getContent() {
		/*if(content.size()<=this.maxPages){			
			return content;
		}else{
			return PageUtil.getPageSubList(this.content, this.current, this.total, this.maxPages);
		}*/
		return this.content;
	}
	public void setContent(List<Page> content) {
		this.content = content;
	}
	public Page getNext() {
		return next;
	}
	public void setNext(Page next) {
		this.next = next;
	}
	public Page getFirst() {
		return first;
	}
	public void setFirst(Page first) {
		this.first = first;
	}
	public Page getLast() {
		return last;
	}
	public void setLast(Page last) {
		this.last = last;
	}
	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?