Source Code Cross Referenced for Format.java in  » GIS » deegree » org » deegree » model » coverage » grid » 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 » deegree » org.deegree.model.coverage.grid 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/model/coverage/grid/Format.java $
002:        /*----------------    FILE HEADER  ------------------------------------------
003:
004:         This file is part of deegree.
005:         Copyright (C) 2001-2008 by:
006:         EXSE, Department of Geography, University of Bonn
007:         http://www.giub.uni-bonn.de/deegree/
008:         lat/lon GmbH
009:         http://www.lat-lon.de
010:
011:         This library is free software; you can redistribute it and/or
012:         modify it under the terms of the GNU Lesser General Public
013:         License as published by the Free Software Foundation; either
014:         version 2.1 of the License, or (at your option) any later version.
015:
016:         This library is distributed in the hope that it will be useful,
017:         but WITHOUT ANY WARRANTY; without even the implied warranty of
018:         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
019:         Lesser General Public License for more details.
020:
021:         You should have received a copy of the GNU Lesser General Public
022:         License along with this library; if not, write to the Free Software
023:         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
024:
025:         Contact:
026:
027:         Andreas Poth
028:         lat/lon GmbH
029:         Aennchenstr. 19
030:         53115 Bonn
031:         Germany
032:         E-Mail: poth@lat-lon.de
033:
034:         Prof. Dr. Klaus Greve
035:         Department of Geography
036:         University of Bonn
037:         Meckenheimer Allee 166
038:         53115 Bonn
039:         Germany
040:         E-Mail: greve@giub.uni-bonn.de
041:
042:        
043:         ---------------------------------------------------------------------------*/
044:        package org.deegree.model.coverage.grid;
045:
046:        import java.io.Serializable;
047:        import java.util.Arrays;
048:        import java.util.List;
049:
050:        import org.deegree.datatypes.Code;
051:        import org.deegree.datatypes.parameter.GeneralOperationParameterIm;
052:
053:        /**
054:         * This interface is a discovery mechanism to determine the formats supported by a
055:         * {@link "org.opengis.coverage.grid.GridCoverageExchange"} implementation. A
056:         * <code>GC_GridCoverageExchange</code> implementation can support a number of file format or
057:         * resources.
058:         * 
059:         * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
060:         * @author last edited by: $Author: apoth $
061:         * 
062:         * @version $Revision: 9343 $, $Date: 2007-12-27 05:30:32 -0800 (Thu, 27 Dec 2007) $
063:         */
064:        public class Format implements  Serializable {
065:
066:            private static final long serialVersionUID = 3847909077719638612L;
067:
068:            private String name = null;
069:
070:            private String description = null;
071:
072:            private String docURL = null;
073:
074:            private String vendor = null;
075:
076:            private String version = null;
077:
078:            private List<GeneralOperationParameterIm> readParameters = null;
079:
080:            private List<GeneralOperationParameterIm> writeParameters = null;
081:
082:            /**
083:             * Initializes a format with a Code containing a code that will be used as format name and a
084:             * code space (optional) that will be interpreted as format vendor.
085:             * 
086:             * @param code
087:             */
088:            public Format(Code code) {
089:                this .name = code.getCode();
090:                if (code.getCodeSpace() != null) {
091:                    vendor = code.getCodeSpace().toString();
092:                }
093:            }
094:
095:            /**
096:             * @param description
097:             * @param docURL
098:             * @param name
099:             * @param vendor
100:             * @param version
101:             */
102:            public Format(String name, String description, String docURL,
103:                    String vendor, String version) {
104:                this .description = description;
105:                this .docURL = docURL;
106:                this .name = name;
107:                this .vendor = vendor;
108:                this .version = version;
109:            }
110:
111:            /**
112:             * @param description
113:             * @param docURL
114:             * @param name
115:             * @param vendor
116:             * @param version
117:             * @param readParameters
118:             * @param writeParameters
119:             */
120:            public Format(String name, String description, String docURL,
121:                    String vendor, String version,
122:                    GeneralOperationParameterIm[] readParameters,
123:                    GeneralOperationParameterIm[] writeParameters) {
124:                this .description = description;
125:                this .docURL = docURL;
126:                this .name = name;
127:                this .vendor = vendor;
128:                this .version = version;
129:                setReadParameters(readParameters);
130:                setWriteParameters(writeParameters);
131:            }
132:
133:            /**
134:             * @param description
135:             *            The description to set.
136:             * 
137:             */
138:            public void setDescription(String description) {
139:                this .description = description;
140:            }
141:
142:            /**
143:             * @param docURL
144:             *            The docURL to set.
145:             * 
146:             */
147:            public void setDocURL(String docURL) {
148:                this .docURL = docURL;
149:            }
150:
151:            /**
152:             * @param name
153:             *            The name to set.
154:             * 
155:             */
156:            public void setName(String name) {
157:                this .name = name;
158:            }
159:
160:            /**
161:             * @param readParameters
162:             *            The readParameters to set.
163:             */
164:            public void setReadParameters(
165:                    GeneralOperationParameterIm[] readParameters) {
166:                if (readParameters == null)
167:                    readParameters = new GeneralOperationParameterIm[0];
168:                this .readParameters = Arrays.asList(readParameters);
169:            }
170:
171:            /**
172:             * @param readParameter
173:             */
174:            public void addReadParameter(
175:                    GeneralOperationParameterIm readParameter) {
176:                this .readParameters.add(readParameter);
177:            }
178:
179:            /**
180:             * @param vendor
181:             *            The vendor to set.
182:             * 
183:             */
184:            public void setVendor(String vendor) {
185:                this .vendor = vendor;
186:            }
187:
188:            /**
189:             * @param version
190:             *            The version to set.
191:             * 
192:             */
193:            public void setVersion(String version) {
194:                this .version = version;
195:            }
196:
197:            /**
198:             * @param writeParameters
199:             *            The writeParameters to set.
200:             */
201:            public void setWriteParameters(
202:                    GeneralOperationParameterIm[] writeParameters) {
203:                if (writeParameters == null)
204:                    writeParameters = new GeneralOperationParameterIm[0];
205:                this .writeParameters = Arrays.asList(writeParameters);
206:            }
207:
208:            /**
209:             * @param writeParameter
210:             */
211:            public void addWriteParameter(
212:                    GeneralOperationParameterIm writeParameter) {
213:                this .readParameters.add(writeParameter);
214:            }
215:
216:            /**
217:             * Name of the file format.
218:             * 
219:             * @return the name of the file format.
220:             * 
221:             */
222:            public String getName() {
223:                return name;
224:            }
225:
226:            /**
227:             * Description of the file format. If no description, the value will be <code>null</code>.
228:             * 
229:             * @return the description of the file format.
230:             */
231:            public String getDescription() {
232:                return description;
233:            }
234:
235:            /**
236:             * Vendor or agency for the format.
237:             * 
238:             * @return the vendor or agency for the format.
239:             */
240:            public String getVendor() {
241:                return vendor;
242:            }
243:
244:            /**
245:             * Documentation URL for the format.
246:             * 
247:             * @return the documentation URL for the format.
248:             */
249:            public String getDocURL() {
250:                return docURL;
251:            }
252:
253:            /**
254:             * Version number of the format.
255:             * 
256:             * @return the version number of the format.
257:             */
258:            public String getVersion() {
259:                return version;
260:            }
261:
262:            /**
263:             * Retrieve the parameter information for a
264:             * {@link "org.opengis.coverage.grid.GridCoverageReader#read" read} operation.
265:             */
266:            public GeneralOperationParameterIm[] getReadParameters() {
267:                GeneralOperationParameterIm[] rp = new GeneralOperationParameterIm[readParameters
268:                        .size()];
269:                return readParameters.toArray(rp);
270:            }
271:
272:            /**
273:             * Retrieve the parameter information for a org.opengis.coverage.grid.GridCoverageWriter#write
274:             * operation.
275:             * 
276:             * @return
277:             * 
278:             */
279:            public GeneralOperationParameterIm[] getWriteParameters() {
280:                GeneralOperationParameterIm[] rp = new GeneralOperationParameterIm[writeParameters
281:                        .size()];
282:                return writeParameters.toArray(rp);
283:            }
284:
285:            /**
286:             * performs a test if the passed Object is equal to this Format. Two Formats are equal if their
287:             * names ar equal and (if not null) their vendors and versions are equal.
288:             * 
289:             * @see java.lang.Object#equals(java.lang.Object)
290:             * @param obj
291:             *            object to compare
292:             */
293:            public boolean equals(Object obj) {
294:                if (obj == null || !(obj instanceof  Format)) {
295:                    return false;
296:                }
297:                Format other = (Format) obj;
298:                boolean eq = this .getName().equals(other.getName());
299:                if (getVendor() != null && other.getVendor() != null) {
300:                    eq = eq && getVendor().equals(other.getVendor());
301:                } else if (getVendor() == null && other.getVendor() != null) {
302:                    return false;
303:                } else if (getVendor() != null && other.getVendor() == null) {
304:                    return false;
305:                }
306:                if (getVersion() != null && other.getVersion() != null) {
307:                    eq = eq && getVersion().equals(other.getVersion());
308:                } else if (getVersion() == null && other.getVersion() != null) {
309:                    return false;
310:                } else if (getVersion() != null && other.getVersion() == null) {
311:                    return false;
312:                }
313:                return eq;
314:            }
315:
316:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.