Source Code Cross Referenced for TestDTO.java in  » GIS » GeoTools-2.4.1 » org » geotools » validation » dto » 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.validation.dto 
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 TOPP - www.openplans.org
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; either
010:         *    version 2.1 of the License, or (at your option) any later version.
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:         *    Created on Jan 14, 2004
018:         */
019:        package org.geotools.validation.dto;
020:
021:        import java.util.HashMap;
022:        import java.util.Iterator;
023:        import java.util.Map;
024:
025:        /**
026:         * TestConfig purpose.
027:         * 
028:         * <p>
029:         * Description of TestConfig ...
030:         * </p>
031:         *
032:         * @author dzwiers, Refractions Research, Inc.
033:         * @author $Author: dmzwiers $ (last modification)
034:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/dto/TestDTO.java $
035:         * @version $Id: TestDTO.java 20884 2006-08-07 14:10:46Z jgarnett $
036:         */
037:        public class TestDTO {
038:            /** the test name */
039:            private String name;
040:
041:            /** the test description */
042:            private String description;
043:
044:            /**
045:             * The plug-in which contains the class definition and default runtime
046:             * values
047:             */
048:            private PlugInDTO plugIn;
049:
050:            /**
051:             * The set of runtime args for this particular test to override the
052:             * defaults in the plug-in
053:             */
054:            private Map args;
055:
056:            /**
057:             * TestConfig constructor.
058:             * 
059:             * <p>
060:             * Does nothing
061:             * </p>
062:             */
063:            public TestDTO() {
064:            }
065:
066:            /**
067:             * TestConfig constructor.
068:             * 
069:             * <p>
070:             * Creates a copy from the TestConfig specified.
071:             * </p>
072:             *
073:             * @param t the data to copy
074:             */
075:            public TestDTO(TestDTO t) {
076:                name = t.getName();
077:                description = t.getDescription();
078:                plugIn = new PlugInDTO(t.getPlugIn());
079:                args = new HashMap();
080:
081:                if (t.getArgs() != null) {
082:                    Iterator i = t.getArgs().keySet().iterator();
083:
084:                    while (i.hasNext()) {
085:                        String key = (String) i.next();
086:
087:                        //TODO clone value.
088:                        args.put(key, new ArgumentDTO((ArgumentDTO) t.getArgs()
089:                                .get(key)));
090:                    }
091:                }
092:            }
093:
094:            /**
095:             * Implementation of clone.
096:             *
097:             * @return A copy of this TestConfig
098:             *
099:             * @see java.lang.Object#clone()
100:             */
101:            public Object clone() {
102:                return new TestDTO(this );
103:            }
104:
105:            /**
106:             * Implementation of equals.
107:             *
108:             * @param obj
109:             *
110:             * @return true when they have the same data.
111:             *
112:             * @see java.lang.Object#equals(java.lang.Object)
113:             */
114:            public boolean equals(Object obj) {
115:                if ((obj == null) || !(obj instanceof  TestDTO)) {
116:                    return false;
117:                }
118:
119:                TestDTO t = (TestDTO) obj;
120:                boolean r = true;
121:
122:                if (name != null) {
123:                    r = r && (name.equals(t.getName()));
124:                }
125:
126:                if (description != null) {
127:                    r = r && (description.equals(t.getDescription()));
128:                }
129:
130:                if (plugIn == null) {
131:                    if (t.getPlugIn() != null) {
132:                        return false;
133:                    }
134:                } else {
135:                    if (t.getPlugIn() != null) {
136:                        r = r && plugIn.equals(t.getPlugIn());
137:                    } else {
138:                        return false;
139:                    }
140:                }
141:
142:                if (args == null) {
143:                    if (t.getArgs() != null) {
144:                        return false;
145:                    }
146:                } else {
147:                    if (t.getArgs() != null) {
148:                        r = r && args.equals(t.getArgs());
149:                    } else {
150:                        return false;
151:                    }
152:                }
153:
154:                return r;
155:            }
156:
157:            /**
158:             * Implementation of hashCode.
159:             *
160:             * @return int hashcode
161:             *
162:             * @see java.lang.Object#hashCode()
163:             */
164:            public int hashCode() {
165:                int r = 1;
166:
167:                if (name != null) {
168:                    r *= name.hashCode();
169:                }
170:
171:                if (description != null) {
172:                    r *= description.hashCode();
173:                }
174:
175:                if (plugIn != null) {
176:                    r *= plugIn.hashCode();
177:                }
178:
179:                if (args != null) {
180:                    r *= args.hashCode();
181:                }
182:
183:                return r;
184:            }
185:
186:            /**
187:             * Access args property.
188:             *
189:             * @return Returns the args.
190:             */
191:            public Map getArgs() {
192:                return args;
193:            }
194:
195:            /**
196:             * Set args to args.
197:             *
198:             * @param args The args to set.
199:             */
200:            public void setArgs(Map args) {
201:                this .args = args;
202:            }
203:
204:            /**
205:             * Access description property.
206:             *
207:             * @return Returns the description.
208:             */
209:            public String getDescription() {
210:                return description;
211:            }
212:
213:            /**
214:             * Set description to description.
215:             *
216:             * @param description The description to set.
217:             */
218:            public void setDescription(String description) {
219:                this .description = description;
220:            }
221:
222:            /**
223:             * Access name property.
224:             *
225:             * @return Returns the name.
226:             */
227:            public String getName() {
228:                return name;
229:            }
230:
231:            /**
232:             * Set name to name.
233:             *
234:             * @param name The name to set.
235:             */
236:            public void setName(String name) {
237:                this .name = name;
238:            }
239:
240:            /**
241:             * Access plugIn property.
242:             *
243:             * @return Returns the plugIn.
244:             */
245:            public PlugInDTO getPlugIn() {
246:                return plugIn;
247:            }
248:
249:            /**
250:             * Set plugIn to plugIn.
251:             *
252:             * @param plugIn The plugIn to set.
253:             */
254:            public void setPlugIn(PlugInDTO plugIn) {
255:                this.plugIn = plugIn;
256:            }
257:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.