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


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2007, GeoTools Project Managment Committee (PMC)
005:         *    (C) 2007, Geomatys
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.image.io.metadata;
018:
019:        // J2SE dependencies
020:        import java.io.Serializable;
021:        import org.w3c.dom.Node;
022:
023:        // Geotools dependencies
024:        import org.geotools.resources.Utilities;
025:
026:        /**
027:         * An immutable ({@code "name"}, {@code "type"}) pair.
028:         *
029:         * @since 2.4
030:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/coverageio/src/main/java/org/geotools/image/io/metadata/Identification.java $
031:         * @version $Id: Identification.java 26137 2007-07-03 17:59:44Z desruisseaux $
032:         * @author Martin Desruisseaux
033:         */
034:        public class Identification implements  CharSequence, Serializable {
035:            /**
036:             * For cross-version compatibility.
037:             */
038:            private static final long serialVersionUID = 7439545624472885445L;
039:
040:            /**
041:             * The object name, or {@code null} if none.
042:             */
043:            public final String name;
044:
045:            /**
046:             * The object type, or {@code null} if none.
047:             */
048:            public final String type;
049:
050:            /**
051:             * Creates an identification from the specified object name and type.
052:             */
053:            public Identification(final String name, final String type) {
054:                this .name = name;
055:                this .type = type;
056:            }
057:
058:            /**
059:             * Creates an identification from the {@code "name"} and {@code "type"} attributes
060:             * in the specified accessor.
061:             */
062:            public Identification(final MetadataAccessor accessor) {
063:                name = accessor.getString("name");
064:                type = accessor.getString("type");
065:            }
066:
067:            /**
068:             * Returns the {@linkplain #name} length.
069:             */
070:            public int length() {
071:                return (name != null) ? name.length() : 0;
072:            }
073:
074:            /**
075:             * Returns the {@linkplain #name} character at the specified index.
076:             */
077:            public char charAt(final int index) {
078:                return name.charAt(index);
079:            }
080:
081:            /**
082:             * Returns a subsequence of this identification. The new identification will contains a
083:             * substring of the {@linkplain #name}, but the {@linkplain #type} will be unchanged.
084:             */
085:            public CharSequence subSequence(final int start, final int end) {
086:                if (start == 0 && end == length()) {
087:                    return this ;
088:                }
089:                return new Identification(name.substring(start, end), type);
090:            }
091:
092:            /**
093:             * Returns the {@linkplain #name}.
094:             */
095:            public String toString() {
096:                return name;
097:            }
098:
099:            /**
100:             * Returns a hash value for this identification.
101:             */
102:            public int hashCode() {
103:                int code = (int) serialVersionUID;
104:                if (name != null)
105:                    code ^= name.hashCode();
106:                if (type != null)
107:                    code += type.hashCode() * 37;
108:                return code;
109:            }
110:
111:            /**
112:             * Compares the specified object with this identification for equality.
113:             */
114:            public boolean equals(final Object object) {
115:                if (object != null && object.getClass().equals(getClass())) {
116:                    final Identification that = (Identification) object;
117:                    return Utilities.equals(this .name, that.name)
118:                            && Utilities.equals(this .type, that.type);
119:                }
120:                return false;
121:            }
122:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.