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    import java.util.Iterator;
018    
019    /**
020     * The main interface defining the abstraction containing the table data and
021     * state.
022     * 
023     * @author mindbridge
024     */
025    public interface ITableModel
026    {
027    
028        /**
029         * Method getColumnModel.
030         * 
031         * @return ITableColumnModel the column model of the table
032         */
033        ITableColumnModel getColumnModel();
034    
035        /**
036         * Method getSortingState.
037         * 
038         * @return ITableSortingState the sorting state of the table
039         */
040        ITableSortingState getSortingState();
041    
042        /**
043         * Method getPagingState.
044         * 
045         * @return ITablePagingState the paging state of the table
046         */
047        ITablePagingState getPagingState();
048    
049        /**
050         * Method getPageCount.
051         * 
052         * @return int the number of pages this table would have given the current
053         *         data and paging state
054         */
055        int getPageCount();
056    
057        /**
058         * Method getCurrentPageRows.
059         * 
060         * @return Iterator the rows in the current table page given the current
061         *         data, sorting, and paging state
062         */
063        Iterator getCurrentPageRows();
064    
065        /**
066         * Returns the total number of rows / values this model is managing.
067         *
068         * @return The total number of rows - if known.
069         */
070        int getRowCount();
071    }