deegree 2.5 (2011/06/29 09:44 build-8-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 java.lang.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(java.lang.String tableName, java.lang.String[] columnNames, int[] columnTypes)
           
DefaultTable(java.lang.String tableName, java.lang.String[] columnNames, int[] columnTypes, int initialCapacity)
           
DefaultTable(java.lang.String tableName, java.lang.String[] columnNames, int[] columnTypes, java.lang.Object[][] data)
           
 
Method Summary
 void addColumn(java.lang.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(java.lang.Object[] data)
          appends a row to the table and sets its data
 int getColumnCount()
          returns the number columns of the table
 int getColumnIndex(java.lang.String columnName)
          returns the index of the submitted columns name.
 java.lang.String getColumnName(int col)
          returns the name of the specified column.
 java.lang.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.
 java.lang.Object[] getRow(int row)
          returns the data of the row'th row of the table
 int getRowCount()
          returns the number rows of the table
 java.lang.String getTableName()
          returns the name of the table.
 java.lang.Object getValueAt(int row, int col)
          returns the value of the table field indexed by row and col
 java.lang.Object[] removeRow(int index)
          removes a row from the table
 void setColumnName(int col, java.lang.String name)
          sets the name of a column.
 void setColumnType(int col, int type)
          sets the type of a column.
 void setRow(java.lang.Object[] data, int row)
          sets the data of the row'th row
 void setTableName(java.lang.String tableName)
           
 void setValueAt(java.lang.Object value, int row, int col)
          set a value at the table field indexed by row and col
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultTable

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

DefaultTable

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

DefaultTable

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

getTableName

public java.lang.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(java.lang.String tableName)
Specified by:
setTableName in interface Table
See Also:
getTableName()

getValueAt

public java.lang.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(java.lang.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 java.lang.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(java.lang.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(java.lang.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(java.lang.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 java.lang.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 java.lang.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,
                          java.lang.String name)
sets the name of a column.

Specified by:
setColumnName in interface Table

removeRow

public java.lang.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(java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
string representation

deegree 2.5 (2011/06/29 09:44 build-8-official)

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