Source Code Cross Referenced for HashedMap.java in  » Library » Apache-common-Collections » org » apache » commons » collections » map » 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 » Library » Apache common Collections » org.apache.commons.collections.map 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Copyright 2003-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:        package org.apache.commons.collections.map;
017:
018:        import java.io.IOException;
019:        import java.io.ObjectInputStream;
020:        import java.io.ObjectOutputStream;
021:        import java.io.Serializable;
022:        import java.util.Map;
023:
024:        /**
025:         * A <code>Map</code> implementation that is a general purpose alternative
026:         * to <code>HashMap</code>.
027:         * <p>
028:         * This implementation improves on the JDK1.4 HashMap by adding the 
029:         * {@link org.apache.commons.collections.MapIterator MapIterator}
030:         * functionality and many methods for subclassing.
031:         * <p>
032:         * <strong>Note that HashedMap is not synchronized and is not thread-safe.</strong>
033:         * If you wish to use this map from multiple threads concurrently, you must use
034:         * appropriate synchronization. The simplest approach is to wrap this map
035:         * using {@link java.util.Collections#synchronizedMap(Map)}. This class may throw 
036:         * exceptions when accessed by concurrent threads without synchronization.
037:         *
038:         * @since Commons Collections 3.0
039:         * @version $Revision: 348007 $ $Date: 2005-11-21 22:52:57 +0000 (Mon, 21 Nov 2005) $
040:         *
041:         * @author Stephen Colebourne
042:         */
043:        public class HashedMap extends AbstractHashedMap implements 
044:                Serializable, Cloneable {
045:
046:            /** Serialisation version */
047:            private static final long serialVersionUID = -1788199231038721040L;
048:
049:            /**
050:             * Constructs a new empty map with default size and load factor.
051:             */
052:            public HashedMap() {
053:                super (DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_THRESHOLD);
054:            }
055:
056:            /**
057:             * Constructs a new, empty map with the specified initial capacity. 
058:             *
059:             * @param initialCapacity  the initial capacity
060:             * @throws IllegalArgumentException if the initial capacity is less than one
061:             */
062:            public HashedMap(int initialCapacity) {
063:                super (initialCapacity);
064:            }
065:
066:            /**
067:             * Constructs a new, empty map with the specified initial capacity and
068:             * load factor. 
069:             *
070:             * @param initialCapacity  the initial capacity
071:             * @param loadFactor  the load factor
072:             * @throws IllegalArgumentException if the initial capacity is less than one
073:             * @throws IllegalArgumentException if the load factor is less than zero
074:             */
075:            public HashedMap(int initialCapacity, float loadFactor) {
076:                super (initialCapacity, loadFactor);
077:            }
078:
079:            /**
080:             * Constructor copying elements from another map.
081:             *
082:             * @param map  the map to copy
083:             * @throws NullPointerException if the map is null
084:             */
085:            public HashedMap(Map map) {
086:                super (map);
087:            }
088:
089:            //-----------------------------------------------------------------------
090:            /**
091:             * Clones the map without cloning the keys or values.
092:             *
093:             * @return a shallow clone
094:             */
095:            public Object clone() {
096:                return super .clone();
097:            }
098:
099:            /**
100:             * Write the map out using a custom routine.
101:             */
102:            private void writeObject(ObjectOutputStream out) throws IOException {
103:                out.defaultWriteObject();
104:                doWriteObject(out);
105:            }
106:
107:            /**
108:             * Read the map in using a custom routine.
109:             */
110:            private void readObject(ObjectInputStream in) throws IOException,
111:                    ClassNotFoundException {
112:                in.defaultReadObject();
113:                doReadObject(in);
114:            }
115:
116:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.