001 // Copyright 2004, 2005 The Apache Software Foundation 002 // 003 // Licensed under the Apache License, Version 2.0 (the "License"); 004 // you may not use this file except in compliance with the License. 005 // You may obtain a copy of the License at 006 // 007 // http://www.apache.org/licenses/LICENSE-2.0 008 // 009 // Unless required by applicable law or agreed to in writing, software 010 // distributed under the License is distributed on an "AS IS" BASIS, 011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 012 // See the License for the specific language governing permissions and 013 // limitations under the License. 014 015 package org.apache.tapestry.contrib.table.model; 016 017 /** 018 * An interface defining the management of the table's paging state. 019 * 020 * @author mindbridge 021 */ 022 public interface ITablePagingState 023 { 024 /** 025 * Method getPageSize provides the size of a page in a number of records. 026 * This value may be meaningless if the model uses a different method for pagination. 027 * @return int the current page size 028 */ 029 int getPageSize(); 030 031 /** 032 * Method setPageSize updates the size of a page in a number of records. 033 * This value may be meaningless if the model uses a different method for pagination. 034 * @param nPageSize the new page size 035 */ 036 void setPageSize(int nPageSize); 037 038 /** 039 * Gets the currently selected page. The page number is counted from 0. 040 * @return int the current active page 041 */ 042 int getCurrentPage(); 043 044 /** 045 * Sets the newly selected page. The page number is counted from 0. 046 * @param nPage the new active page 047 */ 048 void setCurrentPage(int nPage); 049 }