/* ===================================================================
 * IndexCriteriaImpl.java
 * 
 * Created Sep 17, 2004 5:11:09 PM
 * 
 * Copyright (c) 2004 Matt Magoffin (spamsqr@msqr.us)
 * 
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License as 
 * published by the Free Software Foundation; either version 2 of 
 * the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
 * 02111-1307 USA
 * ===================================================================
 * $Id: IndexCriteriaImpl.java 26 2009-05-03 23:35:54Z msqr $
 * ===================================================================
 */

package magoffin.matt.ieat.util;

import magoffin.matt.ieat.biz.RecipeSearchBiz.IndexCriteria;

/**
 * Simple implementation of IndexCriteria.
 * 
 * @author Matt Magoffin (spamsqr@msqr.us)
 * @version $Revision: 26 $ $Date: 2009-05-04 11:35:54 +1200 (Mon, 04 May 2009) $
 */

public class IndexCriteriaImpl implements IndexCriteria {
	
	private String displaySection = null;
	private int pageSize = 0;
	private int pageStart = 0;
	
	/**
	 * Default constructor.
	 */
	public IndexCriteriaImpl() { 
		// nothing to do
	}
	
	/**
	 * Construct with values.
	 * 
	 * @param displaySection the display section
	 * @param pageSize the page size
	 * @param pageStart the page start
	 */
	public IndexCriteriaImpl(String displaySection, int pageSize, int pageStart) {
		setDisplaySection(displaySection);
		this.pageSize = pageSize;
		this.pageStart = pageStart;
	}
	
	/**
	 * Print out a debug-friendly String representing this instance.
	 */
	@Override
	public String toString() {
		return "IndexCriteria{displaySection="+displaySection
			+",pageSize=" +pageSize 
			+",pageStart=" +pageStart
			+"}";
	}
	
	/**
	 * @return the pageSize
	 */
	public int getPageSize() {
		return pageSize;
	}

	/**
	 * @param pageSize the pageSize to set
	 */
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	/**
	 * @return the pageStart
	 */
	public int getPageStart() {
		return pageStart;
	}

	/**
	 * @param pageStart the pageStart to set
	 */
	public void setPageStart(int pageStart) {
		this.pageStart = pageStart;
	}

	/**
	 * @return the displaySection
	 */
	public String getDisplaySection() {
		return displaySection;
	}

	/**
	 * @param displaySection the display section to set
	 */
	public void setDisplaySection(String displaySection) {
		this.displaySection = displaySection != null ? displaySection.trim() : null;
	}

}
