001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) Copyright IBM Corporation, 2005. All rights reserved.
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: */
017: package org.geotools.data.db2;
018:
019: import org.geotools.factory.FactoryRegistryException;
020: import org.opengis.referencing.FactoryException;
021: import org.opengis.referencing.crs.CoordinateReferenceSystem;
022:
023: /**
024: * Hold information about a DB2 geometry column and provide access.
025: *
026: * @author David Adler - IBM Corporation
027: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/db2/src/main/java/org/geotools/data/db2/DB2GeometryColumn.java $
028: */
029: public class DB2GeometryColumn {
030: private String tableSchema;
031: private String tableName;
032: private String columnName;
033: private String typeName;
034: private Integer srsId;
035: private DB2CoordinateSystem cs;
036:
037: /**
038: * Constructs a DB2GeometryColumn from all relevant values.
039: *
040: * @param tableSchema
041: * @param tableName
042: * @param columnName
043: * @param typeName
044: * @param srsId
045: * @param cs
046: */
047: public DB2GeometryColumn(String tableSchema, String tableName,
048: String columnName, String typeName, Integer srsId,
049: DB2CoordinateSystem cs) {
050: super ();
051: this .tableSchema = tableSchema;
052: this .tableName = tableName;
053: this .columnName = columnName;
054: this .typeName = typeName;
055: this .srsId = srsId;
056: this .cs = cs;
057: }
058:
059: String getTableSchema() {
060: return this .tableSchema;
061: }
062:
063: String getTableName() {
064: return this .tableName;
065: }
066:
067: String getColumnName() {
068: return this .columnName;
069: }
070:
071: String getTypeName() {
072: return this .typeName;
073: }
074:
075: int getCsId() {
076: return this .cs.getCsId();
077: }
078:
079: /**
080: * Gets the OpenGIS CoordinateReferenceSystem for this geometry column.
081: *
082: * @return a CoordinateReferenceSystem
083: *
084: * @throws FactoryRegistryException
085: * @throws FactoryException
086: */
087: CoordinateReferenceSystem getCRS() throws FactoryRegistryException,
088: FactoryException {
089: return this .cs.getCRS();
090: }
091:
092: Integer getSrsId() {
093: return this .srsId;
094: }
095:
096: /**
097: * Returns the table schema, table name and column name.
098: *
099: * @return the table schema, table name and column name as a String.
100: */
101: public String toString() {
102: return this .tableSchema + "." + this .tableName + "("
103: + this .columnName + "); srid=" + this.srsId;
104: }
105: }
|