Source Code Cross Referenced for AbstractGeoResource.java in  » GIS » GeoTools-2.4.1 » org » geotools » catalog » 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.catalog 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2005-2006, GeoTools Project Managment Committee (PMC)
005:         *    (C) 2005, Refractions Research Inc.
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:        package org.geotools.catalog;
018:
019:        import java.io.IOException;
020:        import java.util.List;
021:        import java.util.logging.Logger;
022:
023:        import org.geotools.util.ProgressListener;
024:
025:        /**
026:         * Abstract implementation of GeoResource.
027:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/catalog/AbstractGeoResource.java $
028:         */
029:        public abstract class AbstractGeoResource implements  GeoResource {
030:
031:            /**
032:             * logger
033:             */
034:            protected static Logger logger = org.geotools.util.logging.Logging
035:                    .getLogger("org.geotools.catalog");
036:
037:            /**
038:             * Error message
039:             */
040:            private Throwable msg;
041:
042:            /**
043:             * This method is shorthand for
044:             * <pre>
045:             * 	<code>
046:             * 		return (Service) resolve(Service.class, monitor);
047:             * 	</code>
048:             * </pre>
049:             *
050:             * @param monitor DOCUMENT ME!
051:             *
052:             * @return The service containg the resource, an object of type Service.
053:             *
054:             * @throws IOException DOCUMENT ME!
055:             *
056:             * @see AbstractGeoResource#resolve(Class, ProgressListener)
057:             */
058:            public Resolve parent(ProgressListener monitor) throws IOException {
059:                return (Service) resolve(Service.class, monitor);
060:            }
061:
062:            /**
063:             * return null ... almost always a leaf
064:             *
065:             * @see net.refractions.udig.catalog.IResolve#members(org.eclipse.core.runtime.ProgressListener)
066:             */
067:            public List members(ProgressListener monitor) {
068:                return null;
069:            }
070:
071:            /**
072:             * @return The cached error message.
073:             */
074:            public Throwable getMessage() {
075:                return msg;
076:            }
077:
078:            /**
079:             * Sets the cached error message.
080:             * 
081:             * @param msg An exception which occured when connecting to the service.
082:             */
083:            protected void setMessage(Throwable msg) {
084:                this .msg = msg;
085:            }
086:
087:            /**
088:             * This should represent the identifier
089:             *
090:             * @param other
091:             *
092:             *
093:             * @see Object#equals(java.lang.Object)
094:             */
095:            public boolean equals(Object other) {
096:                if ((other != null) && other instanceof  GeoResource) {
097:                    GeoResource resource = (GeoResource) other;
098:
099:                    if ((getIdentifier() != null)
100:                            && (resource.getIdentifier() != null)) {
101:                        return getIdentifier().equals(resource.getIdentifier());
102:                    }
103:                }
104:
105:                return false;
106:            }
107:
108:            /**
109:             * This method does nothing. Sublcasses should override if events are
110:             * supported.
111:             *
112:             * @param listener DOCUMENT ME!
113:             */
114:            public void addListener(ResolveChangeListener listener) {
115:                // do nothing
116:            }
117:
118:            /**
119:             * This method does nothing. Sublcasses should override if events are
120:             * supported.
121:             *
122:             * @param listener DOCUMENT ME!
123:             */
124:            public void removeListener(ResolveChangeListener listener) {
125:                // do nothing
126:            }
127:
128:            /**
129:             * This method does nothing. Sublcasses should override if events are
130:             * supported.
131:             *
132:             * @param event DOCUMENT ME!
133:             */
134:            public void fire(ResolveChangeEvent event) {
135:                // do nothing
136:            }
137:
138:            /**
139:             * This should represent the identified
140:             *
141:             *
142:             * @see Object#hashCode()
143:             */
144:            public int hashCode() {
145:                if (getIdentifier() != null) {
146:                    return getIdentifier().hashCode();
147:                }
148:
149:                return super .hashCode();
150:            }
151:
152:            /**
153:             * Non blocking label used by LabelProvider. public static final String
154:             * getGenericLabel(IGeoResource resource){ assert resource.getIdentifier()
155:             * != null; return resource==null ||
156:             * resource.getIdentifier()==null?"Resource":resource.getIdentifier().toString();
157:             * }
158:             *
159:             * @return DOCUMENT ME!
160:             */
161:            /**
162:             * Non blocking icon used by LabelProvider. public static final
163:             * ImageDescriptor getGenericIcon(IGeoResource resource){ if(resource
164:             * !=null){ assert resource.getIdentifier() != null;
165:             * if(resource.canResolve(FeatureSource.class)){ // default feature return
166:             * Images.getDescriptor(ISharedImages.FEATURE_OBJ); }
167:             * if(resource.canResolve(GridCoverage.class)){ // default raster return
168:             * Images.getDescriptor(ISharedImages.GRID_OBJ); }} return
169:             * Images.getDescriptor(ISharedImages.RESOURCE_OBJ); }
170:             *
171:             * @return DOCUMENT ME!
172:             */
173:            /**
174:             * Indicate class and id.
175:             *
176:             * @return string representing this IResolve
177:             */
178:            public String toString() {
179:                StringBuffer buf = new StringBuffer();
180:                String classname = getClass().getName();
181:                String name = classname
182:                        .substring(classname.lastIndexOf('.') + 1);
183:                buf.append(name);
184:                buf.append("("); //$NON-NLS-1$
185:                buf.append(getIdentifier());
186:                buf.append(")"); //$NON-NLS-1$
187:
188:                return buf.toString();
189:            }
190:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.