deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.table
Class DefaultTable

java.lang.Object
  extended by org.deegree.model.table.DefaultTable
All Implemented Interfaces:
Table

public class DefaultTable
extends Object
implements Table

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $

Constructor Summary
DefaultTable(String tableName, String[] columnNames, int[] columnTypes)
           
DefaultTable(String tableName, String[] columnNames, int[] columnTypes, int initialCapacity)
           
DefaultTable(String tableName, String[] columnNames, int[] columnTypes, Object[][] data)
           
 
Method Summary
 void addColumn(String name, int type)
          adds a new column to the table. for this a computional expensive operation this method should be used with care.
 void appendRow(Object[] data)
          appends a row to the table and sets its data
 int getColumnCount()
          returns the number columns of the table
 int getColumnIndex(String columnName)
          returns the index of the submitted columns name.
 String getColumnName(int col)
          returns the name of the specified column.
 String[] getColumnNames()
          returns the names of all table columns.
 int getColumnType(int col)
          returns the name of the type of the specifies column.
 int[] getColumnTypes()
          returns the names of all column types.
 Object[] getRow(int row)
          returns the data of the row'th row of the table
 int getRowCount()
          returns the number rows of the table
 String getTableName()
          returns the name of the table.
 Object getValueAt(int row, int col)
          returns the value of the table field indexed by row and col
 Object[] removeRow(int index)
          removes a row from the table
 void setColumnName(int col, String name)
          sets the name of a column.
 void setColumnType(int col, int type)
          sets the type of a column.
 void setRow(Object[] data, int row)
          sets the data of the row'th row
 void setTableName(String tableName)
           
 void setValueAt(Object value, int row, int col)
          set a value at the table field indexed by row and col
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultTable

public DefaultTable(String tableName,
                    String[] columnNames,
                    int[] columnTypes)
             throws TableException
Parameters:
tableName -
columnNames -
columnTypes -
Throws:
TableException

DefaultTable

public DefaultTable(String tableName,
                    String[] columnNames,
                    int[] columnTypes,
                    Object[][] data)
             throws TableException
Parameters:
tableName -
columnNames -
columnTypes -
data -
Throws:
TableException

DefaultTable

public DefaultTable(String tableName,
                    String[] columnNames,
                    int[] columnTypes,
                    int initialCapacity)
             throws TableException
Parameters:
tableName -
columnNames -
columnTypes -
initialCapacity -
Throws:
TableException
Method Detail

getTableName

public String getTableName()
returns the name of the table. If the table hasn't a name an empty string ("") will be returned.

Specified by:
getTableName in interface Table

setTableName

public void setTableName(String tableName)
Specified by:
setTableName in interface Table
See Also:
getTableName()

getValueAt

public Object getValueAt(int row,
                         int col)
returns the value of the table field indexed by row and col

Specified by:
getValueAt in interface Table

setValueAt

public void setValueAt(Object value,
                       int row,
                       int col)
set a value at the table field indexed by row and col

Specified by:
setValueAt in interface Table

getRow

public Object[] getRow(int row)
returns the data of the row'th row of the table

Specified by:
getRow in interface Table

setRow

public void setRow(Object[] data,
                   int row)
            throws TableException
sets the data of the row'th row

Specified by:
setRow in interface Table
Throws:
TableException

appendRow

public void appendRow(Object[] data)
               throws TableException
appends a row to the table and sets its data

Specified by:
appendRow in interface Table
Throws:
TableException

getRowCount

public int getRowCount()
returns the number rows of the table

Specified by:
getRowCount in interface Table

addColumn

public void addColumn(String name,
                      int type)
adds a new column to the table. for this a computional expensive operation this method should be used with care.

Specified by:
addColumn in interface Table

getColumnCount

public int getColumnCount()
returns the number columns of the table

Specified by:
getColumnCount in interface Table

getColumnNames

public String[] getColumnNames()
returns the names of all table columns. If a column hasn't a name a empty String ("") will be returned.

Specified by:
getColumnNames in interface Table

getColumnName

public String getColumnName(int col)
returns the name of the specified column. If a column hasn't a name a empty String ("") will be returned.

Specified by:
getColumnName in interface Table

getColumnTypes

public int[] getColumnTypes()
returns the names of all column types. For each column a type (name of a java class) has to be defined.

Specified by:
getColumnTypes in interface Table

getColumnType

public int getColumnType(int col)
returns the name of the type of the specifies column. For each column a type (name of a java class) has to be defined.

Specified by:
getColumnType in interface Table

setColumnType

public void setColumnType(int col,
                          int type)
                   throws TableException
sets the type of a column.

Specified by:
setColumnType in interface Table
Throws:
TableException

setColumnName

public void setColumnName(int col,
                          String name)
sets the name of a column.

Specified by:
setColumnName in interface Table

removeRow

public Object[] removeRow(int index)
removes a row from the table

Specified by:
removeRow in interface Table
Parameters:
index -
Returns:
removed row

getColumnIndex

public int getColumnIndex(String columnName)
returns the index of the submitted columns name. If no column with that name if present -1 will be returned. the test is not case sensitive

Specified by:
getColumnIndex in interface Table
Parameters:
columnName -

toString

public String toString()
Overrides:
toString in class Object
Returns:
string representation

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org