001 //$HeadURL: svn+ssh://rbezema@svn.wald.intevation.org/deegree/base/tags/2.1/src/org/deegree/model/table/Table.java $
002 package org.deegree.model.table;
003
004 /**
005 *
006 *
007 *
008 * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
009 * @author last edited by: $Author: apoth $
010 *
011 * @version. $Revision: 6705 $, $Date: 2007-04-26 21:55:39 +0200 (Do, 26 Apr 2007) $
012 */
013 public interface Table {
014
015 /**
016 * returns the name of the table. If the table hasn't a name an empty string
017 * ("") will be returned.
018 *
019 */
020 String getTableName();
021
022 /**
023 * @see Table#getTableName()
024 *
025 */
026 void setTableName(String tableName);
027
028 /**
029 * returns the value of the table field indexed by <tt>row</tt> and <tt>col</tt>
030 */
031 Object getValueAt(int row, int col);
032
033 /**
034 * set a value at the table field indexed by <tt>row</tt> and <tt>col</tt>
035 */
036 void setValueAt(Object value, int row, int col);
037
038 /**
039 * returns the data of the row'th row of the table
040 */
041 Object[] getRow(int row);
042
043 /**
044 * sets the data of the row'th row
045 */
046 void setRow(Object[] data, int row) throws TableException;
047
048 /**
049 * appends a row to the table and sets its data
050 */
051 void appendRow(Object[] data) throws TableException;
052
053 /**
054 * returns the number rows of the table
055 */
056 int getRowCount();
057
058 /**
059 * adds a new column to the table
060 */
061 void addColumn(String name, int type);
062
063 /**
064 * returns the number columns of the table
065 */
066 int getColumnCount();
067
068 /**
069 * returns the names of all table columns. If a column hasn't a name a empty
070 * String ("") will be returned.
071 */
072 String[] getColumnNames();
073
074 /**
075 * returns the name of the specified column. If a column hasn't a name a empty
076 * String ("") will be returned.
077 */
078 String getColumnName(int col);
079
080 /**
081 * returns the names of all column types. For each column a type (name of a
082 * java class) has to be defined.
083 */
084 int[] getColumnTypes();
085
086 /**
087 * returns the name of the type of the specifies column. For each column a
088 * type (name of a java class) has to be defined.
089 */
090 int getColumnType(int col);
091
092 /**
093 * sets the type of a column. the implementing class have to
094 * ensure that this is a valid operation
095 */
096 void setColumnType(int col, int type) throws TableException;
097
098 /**
099 * sets the name of a column.
100 */
101 void setColumnName(int col, String name);
102
103 /**
104 * removes a row from the table
105 */
106 Object[] removeRow(int index);
107
108 /**
109 * returns the index of the submitted columns name. If no column with that
110 * name if present -1 will be returned.
111 */
112 int getColumnIndex(String columnName);
113
114
115 }