    001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.4_testing/src/org/deegree/model/table/Table.java $
    002    /*----------------------------------------------------------------------------
    003     This file is part of deegree, http://deegree.org/
    004     Copyright (C) 2001-2009 by:
    005       Department of Geography, University of Bonn
    006     and
    007       lat/lon GmbH
    008
    009     This library is free software; you can redistribute it and/or modify it under
    010     the terms of the GNU Lesser General Public License as published by the Free
    011     Software Foundation; either version 2.1 of the License, or (at your option)
    012     any later version.
    013     This library is distributed in the hope that it will be useful, but WITHOUT
    014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
    016     details.
    017     You should have received a copy of the GNU Lesser General Public License
    018     along with this library; if not, write to the Free Software Foundation, Inc.,
    019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    020
    021     Contact information:
    022
    023     lat/lon GmbH
    024     Aennchenstr. 19, 53177 Bonn
    025     Germany
    026     http://lat-lon.de/
    027
    028     Department of Geography, University of Bonn
    029     Prof. Dr. Klaus Greve
    030     Postfach 1147, 53001 Bonn
    031     Germany
    032     http://www.geographie.uni-bonn.de/deegree/
    033
    034     e-mail: info@deegree.org
    035    ----------------------------------------------------------------------------*/
    036    package org.deegree.model.table;
    037
    038    /**
    039     *
    040     *
    041     *
    042     * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
    043     * @author last edited by: $Author: mschneider $
    044     *
    045     * @version $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
    046     */
    047    public interface Table {
    048
    049        /**
    050         * returns the name of the table. If the table hasn't a name an empty string ("") will be
    051         * returned.
    052         *
    053         */
    054        String getTableName();
    055
    056        /**
    057         * @see Table#getTableName()
    058         *
    059         */
    060        void setTableName( String tableName );
    061
    062        /**
    063         * returns the value of the table field indexed by <tt>row</tt> and <tt>col</tt>
    064         */
    065        Object getValueAt( int row, int col );
    066
    067        /**
    068         * set a value at the table field indexed by <tt>row</tt> and <tt>col</tt>
    069         */
    070        void setValueAt( Object value, int row, int col );
    071
    072        /**
    073         * returns the data of the row'th row of the table
    074         */
    075        Object[] getRow( int row );
    076
    077        /**
    078         * sets the data of the row'th row
    079         */
    080        void setRow( Object[] data, int row )
    081                                throws TableException;
    082
    083        /**
    084         * appends a row to the table and sets its data
    085         */
    086        void appendRow( Object[] data )
    087                                throws TableException;
    088
    089        /**
    090         * returns the number rows of the table
    091         */
    092        int getRowCount();
    093
    094        /**
    095         * adds a new column to the table
    096         */
    097        void addColumn( String name, int type );
    098
    099        /**
    100         * returns the number columns of the table
    101         */
    102        int getColumnCount();
    103
    104        /**
    105         * returns the names of all table columns. If a column hasn't a name a empty String ("") will be
    106         * returned.
    107         */
    108        String[] getColumnNames();
    109
    110        /**
    111         * returns the name of the specified column. If a column hasn't a name a empty String ("") will
    112         * be returned.
    113         */
    114        String getColumnName( int col );
    115
    116        /**
    117         * returns the names of all column types. For each column a type (name of a java class) has to
    118         * be defined.
    119         */
    120        int[] getColumnTypes();
    121
    122        /**
    123         * returns the name of the type of the specifies column. For each column a type (name of a java
    124         * class) has to be defined.
    125         */
    126        int getColumnType( int col );
    127
    128        /**
    129         * sets the type of a column. the implementing class have to ensure that this is a valid
    130         * operation
    131         */
    132        void setColumnType( int col, int type )
    133                                throws TableException;
    134
    135        /**
    136         * sets the name of a column.
    137         */
    138        void setColumnName( int col, String name );
    139
    140        /**
    141         * removes a row from the table
    142         */
    143        Object[] removeRow( int index );
    144
    145        /**
    146         * returns the index of the submitted columns name. If no column with that name if present -1
    147         * will be returned.
    148         */
    149        int getColumnIndex( String columnName );
    150
    151    }