Source Code Cross Referenced for ExtendedType.java in  » XML » xalan » org » apache » xml » dtm » ref » 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 » XML » xalan » org.apache.xml.dtm.ref 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 1999-2004 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /*
017:         * $Id: ExtendedType.java,v 1.3 2004/02/16 23:06:11 minchau Exp $
018:         */
019:        package org.apache.xml.dtm.ref;
020:
021:        /**
022:         * The class ExtendedType represents an extended type object used by
023:         * ExpandedNameTable.
024:         */
025:        public final class ExtendedType {
026:            private int nodetype;
027:            private String namespace;
028:            private String localName;
029:            private int hash;
030:
031:            /**
032:             * Create an ExtendedType object from node type, namespace and local name.
033:             * The hash code is calculated from the node type, namespace and local name.
034:             * 
035:             * @param nodetype Type of the node
036:             * @param namespace Namespace of the node
037:             * @param localName Local name of the node
038:             */
039:            public ExtendedType(int nodetype, String namespace, String localName) {
040:                this .nodetype = nodetype;
041:                this .namespace = namespace;
042:                this .localName = localName;
043:                this .hash = nodetype + namespace.hashCode()
044:                        + localName.hashCode();
045:            }
046:
047:            /**
048:             * Create an ExtendedType object from node type, namespace, local name
049:             * and a given hash code.
050:             * 
051:             * @param nodetype Type of the node
052:             * @param namespace Namespace of the node
053:             * @param localName Local name of the node
054:             * @param hash The given hash code
055:             */
056:            public ExtendedType(int nodetype, String namespace,
057:                    String localName, int hash) {
058:                this .nodetype = nodetype;
059:                this .namespace = namespace;
060:                this .localName = localName;
061:                this .hash = hash;
062:            }
063:
064:            /** 
065:             * Redefine this ExtendedType object to represent a different extended type.
066:             * This is intended to be used ONLY on the hashET object. Using it elsewhere
067:             * will mess up existing hashtable entries!
068:             */
069:            protected void redefine(int nodetype, String namespace,
070:                    String localName) {
071:                this .nodetype = nodetype;
072:                this .namespace = namespace;
073:                this .localName = localName;
074:                this .hash = nodetype + namespace.hashCode()
075:                        + localName.hashCode();
076:            }
077:
078:            /** 
079:             * Redefine this ExtendedType object to represent a different extended type.
080:             * This is intended to be used ONLY on the hashET object. Using it elsewhere
081:             * will mess up existing hashtable entries!
082:             */
083:            protected void redefine(int nodetype, String namespace,
084:                    String localName, int hash) {
085:                this .nodetype = nodetype;
086:                this .namespace = namespace;
087:                this .localName = localName;
088:                this .hash = hash;
089:            }
090:
091:            /**
092:             * Override the hashCode() method in the Object class
093:             */
094:            public int hashCode() {
095:                return hash;
096:            }
097:
098:            /**
099:             * Test if this ExtendedType object is equal to the given ExtendedType.
100:             * 
101:             * @param other The other ExtendedType object to test for equality
102:             * @return true if the two ExtendedType objects are equal.
103:             */
104:            public boolean equals(ExtendedType other) {
105:                try {
106:                    return other.nodetype == this .nodetype
107:                            && other.localName.equals(this .localName)
108:                            && other.namespace.equals(this .namespace);
109:                } catch (NullPointerException e) {
110:                    return false;
111:                }
112:            }
113:
114:            /**
115:             * Return the node type
116:             */
117:            public int getNodeType() {
118:                return nodetype;
119:            }
120:
121:            /**
122:             * Return the local name
123:             */
124:            public String getLocalName() {
125:                return localName;
126:            }
127:
128:            /**
129:             * Return the namespace
130:             */
131:            public String getNamespace() {
132:                return namespace;
133:            }
134:
135:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.