Source Code Cross Referenced for AbstractReferenceSystem.java in  » GIS » GeoTools-2.4.1 » org » geotools » referencing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.referencing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2004-2006, GeoTools Project Managment Committee (PMC)
005:         *    (C) 2004, Institut de Recherche pour le Développement
006:         *   
007:         *    This library is free software; you can redistribute it and/or
008:         *    modify it under the terms of the GNU Lesser General Public
009:         *    License as published by the Free Software Foundation;
010:         *    version 2.1 of the License.
011:         *
012:         *    This library is distributed in the hope that it will be useful,
013:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015:         *    Lesser General Public License for more details.
016:         *
017:         *    This package contains documentation from OpenGIS specifications.
018:         *    OpenGIS consortium's work is fully acknowledged here.
019:         */
020:        package org.geotools.referencing;
021:
022:        // J2SE dependencies
023:        import java.util.HashMap;
024:        import java.util.Map;
025:
026:        // OpenGIS dependencies
027:        import org.opengis.metadata.extent.Extent;
028:        import org.opengis.util.InternationalString;
029:        import org.opengis.referencing.ReferenceSystem;
030:
031:        // Geotools dependencies
032:        import org.geotools.resources.Utilities;
033:
034:        /**
035:         * Description of a spatial and temporal reference system used by a dataset.
036:         * <p>
037:         * This class is conceptually <cite>abstract</cite>, even if it is technically possible to
038:         * instantiate it. Typical applications should create instances of the most specific subclass with
039:         * {@code Default} prefix instead. An exception to this rule may occurs when it is not possible to
040:         * identify the exact type.
041:         *
042:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/referencing/src/main/java/org/geotools/referencing/AbstractReferenceSystem.java $
043:         * @version $Id: AbstractReferenceSystem.java 28264 2007-12-05 21:53:08Z desruisseaux $
044:         * @author Martin Desruisseaux
045:         *
046:         * @since 2.1
047:         */
048:        public class AbstractReferenceSystem extends AbstractIdentifiedObject
049:                implements  ReferenceSystem {
050:            /**
051:             * Serial number for interoperability with different versions.
052:             */
053:            private static final long serialVersionUID = 3337659819553899435L;
054:
055:            /**
056:             * List of localizable properties. To be given to {@link AbstractIdentifiedObject} constructor.
057:             */
058:            private static final String[] LOCALIZABLES = { SCOPE_KEY };
059:
060:            /**
061:             * Area for which the (coordinate) reference system is valid.
062:             */
063:            private final Extent domainOfValidity;
064:
065:            /**
066:             * Description of domain of usage, or limitations of usage, for which this
067:             * (coordinate) reference system object is valid.
068:             */
069:            private final InternationalString scope;
070:
071:            /**
072:             * Constructs a new reference system with the same values than the specified one.
073:             * This copy constructor provides a way to wrap an arbitrary implementation into a
074:             * Geotools one or a user-defined one (as a subclass), usually in order to leverage
075:             * some implementation-specific API. This constructor performs a shallow copy,
076:             * i.e. the properties are not cloned.
077:             *
078:             * @since 2.2
079:             */
080:            public AbstractReferenceSystem(final ReferenceSystem object) {
081:                super (object);
082:                domainOfValidity = object.getDomainOfValidity();
083:                scope = object.getScope();
084:            }
085:
086:            /**
087:             * Constructs a reference system from a set of properties.
088:             * The properties given in argument follow the same rules than for the
089:             * {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map) super-class constructor}.
090:             * Additionally, the following properties are understood by this construtor:
091:             * <p>
092:             * <table border='1'>
093:             *   <tr bgcolor="#CCCCFF" class="TableHeadingColor">
094:             *     <th nowrap>Property name</th>
095:             *     <th nowrap>Value type</th>
096:             *     <th nowrap>Value given to</th>
097:             *   </tr>
098:             *   <tr>
099:             *     <td nowrap>&nbsp;{@link #DOMAIN_OF_VALIDITY_KEY "domainOfValidity"}&nbsp;</td>
100:             *     <td nowrap>&nbsp;{@link Extent}&nbsp;</td>
101:             *     <td nowrap>&nbsp;{@link #getDomainOfValidity}</td>
102:             *   </tr>
103:             *   <tr>
104:             *     <td nowrap>&nbsp;{@link #SCOPE_KEY "scope"}&nbsp;</td>
105:             *     <td nowrap>&nbsp;{@link String} or {@link InternationalString}&nbsp;</td>
106:             *     <td nowrap>&nbsp;{@link #getScope}</td>
107:             *   </tr>
108:             * </table>
109:             */
110:            public AbstractReferenceSystem(final Map properties) {
111:                this (properties, new HashMap());
112:            }
113:
114:            /**
115:             * Work around for RFE #4093999 in Sun's bug database
116:             * ("Relax constraint on placement of this()/super() call in constructors").
117:             */
118:            private AbstractReferenceSystem(final Map properties,
119:                    final Map subProperties) {
120:                super (properties, subProperties, LOCALIZABLES);
121:                domainOfValidity = (Extent) subProperties
122:                        .get(DOMAIN_OF_VALIDITY_KEY);
123:                scope = (InternationalString) subProperties.get(SCOPE_KEY);
124:            }
125:
126:            /**
127:             * Area or region or timeframe in which this (coordinate) reference system is valid.
128:             * Returns {@code null} if not available.
129:             *
130:             * @since 2.4
131:             */
132:            public Extent getDomainOfValidity() {
133:                return domainOfValidity;
134:            }
135:
136:            /**
137:             * Area for which the (coordinate) reference system is valid.
138:             * Returns {@code null} if not available.
139:             *
140:             * @deprecated Renamed {@link #getDomainOfValidity}.
141:             */
142:            public Extent getValidArea() {
143:                return domainOfValidity;
144:            }
145:
146:            /**
147:             * Description of domain of usage, or limitations of usage, for which this
148:             * (coordinate) reference system object is valid.
149:             * Returns {@code null} if not available.
150:             */
151:            public InternationalString getScope() {
152:                return scope;
153:            }
154:
155:            /**
156:             * Compare this reference system with the specified object for equality.
157:             * If {@code compareMetadata} is {@code true}, then all available properties are
158:             * compared including {@linkplain #getValidArea valid area} and {@linkplain #getScope scope}.
159:             *
160:             * @param  object The object to compare to {@code this}.
161:             * @param  compareMetadata {@code true} for performing a strict comparaison, or
162:             *         {@code false} for comparing only properties relevant to transformations.
163:             * @return {@code true} if both objects are equal.
164:             */
165:            public boolean equals(final AbstractIdentifiedObject object,
166:                    final boolean compareMetadata) {
167:                if (super .equals(object, compareMetadata)) {
168:                    if (!compareMetadata) {
169:                        return true;
170:                    }
171:                    final AbstractReferenceSystem that = (AbstractReferenceSystem) object;
172:                    return Utilities.equals(domainOfValidity,
173:                            that.domainOfValidity)
174:                            && Utilities.equals(scope, that.scope);
175:                }
176:                return false;
177:            }
178:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.