Source Code Cross Referenced for CaselessStringKeyHashtable.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » com » sun » media » jai » util » 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 » 6.0 JDK Modules » Java Advanced Imaging » com.sun.media.jai.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: CaselessStringKeyHashtable.java,v $
003:         *
004:         * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * Use is subject to license terms.
007:         *
008:         * $Revision: 1.1 $
009:         * $Date: 2005/02/11 04:56:59 $
010:         * $State: Exp $
011:         */
012:        package com.sun.media.jai.util;
013:
014:        import java.util.Hashtable;
015:        import java.util.Map;
016:        import javax.media.jai.util.CaselessStringKey;
017:
018:        /**
019:         * A Hashtable where the keys are <code>CaselessStringKey</code>s.
020:         */
021:        public class CaselessStringKeyHashtable extends Hashtable implements 
022:                Cloneable, java.io.Serializable {
023:
024:            /**
025:             * Constructs a new, empty CaselessStringKeyHashtable.
026:             */
027:            public CaselessStringKeyHashtable() {
028:                super ();
029:            }
030:
031:            /**
032:             * Constructs a new CaselessStringKeyHashtable with the same
033:             * mappings as the given Map.
034:             *
035:             * @param t the map whose mappings are to be placed in this map.
036:             */
037:            public CaselessStringKeyHashtable(Map t) {
038:                super (t);
039:            }
040:
041:            /**
042:             * Returns a clone of the <code>CaselessStringKeyHashtable</code>
043:             * as an <code>Object</code>.
044:             */
045:            public Object clone() {
046:                return super .clone();
047:            }
048:
049:            /**
050:             * Tests if the specified <code>String</code> is a key in this
051:             * hashtable. The key is wrapped by a <code>CaselessStringKey</code>
052:             * before being looked up.
053:             *
054:             * @param   key   possible key.
055:             *
056:             * @return  <code>true</code> if and only if the specified object 
057:             *          is a key in this hashtable, as determined by the 
058:             *          <tt>equals</tt> method; <code>false</code> otherwise.
059:             */
060:            public boolean containsKey(String key) {
061:                return super .containsKey(new CaselessStringKey(key));
062:            }
063:
064:            /**
065:             * Tests if the specified <code>CaselessStringKey</code> is a key in
066:             * this hashtable.
067:             *
068:             * @param   key   possible key.
069:             *
070:             * @return  <code>true</code> if and only if the specified object 
071:             *          is a key in this hashtable, as determined by the 
072:             *          <tt>equals</tt> method; <code>false</code> otherwise.
073:             */
074:            public boolean containsKey(CaselessStringKey key) {
075:                return super .containsKey(key);
076:            }
077:
078:            /**
079:             * Allow only <code>String</code> and <code>CaselessStringKey</code>
080:             * keys to be looked up. This always throws an IllegalArgumentException.
081:             *
082:             * @param   key   possible key.
083:             *
084:             * @return  always throws IllegalArgumentException.
085:             */
086:            public boolean containsKey(Object key) {
087:                throw new IllegalArgumentException();
088:            }
089:
090:            /**
091:             * Returns the value to which the specified key is mapped in this
092:             * hashtable. The key is wrapped by a <code>CaselessStringKey</code>
093:             * before being looked up.
094:             *
095:             * @param   key   a key in the hashtable.
096:             *
097:             * @return  the value to which the key is mapped in this hashtable;
098:             *          <code>null</code> if the key is not mapped to any value in
099:             *          this hashtable.
100:             * @see     #put(String, Object)
101:             */
102:            public Object get(String key) {
103:                return super .get(new CaselessStringKey(key));
104:            }
105:
106:            /**
107:             * Returns the value to which the specified key is mapped in this
108:             * hashtable.
109:             *
110:             * @param   key   a key in the hashtable.
111:             *
112:             * @return  the value to which the key is mapped in this hashtable;
113:             *          <code>null</code> if the key is not mapped to any value in
114:             *          this hashtable.
115:             * @see     #put(CaselessStringKey, Object)
116:             */
117:            public Object get(CaselessStringKey key) {
118:                return super .get(key);
119:            }
120:
121:            /**
122:             * Allow only String and CaselessStringKey keys to be looked up.
123:             * This always throws an IllegalArgumentException.
124:             *
125:             * @param   key   possible key.
126:             *
127:             * @return  always throws IllegalArgumentException.
128:             * @see     #put(Object, Object)
129:             */
130:            public Object get(Object key) {
131:                throw new IllegalArgumentException();
132:            }
133:
134:            /**
135:             * Maps the specified <code>key</code> to the specified
136:             * <code>value</code> in this hashtable. Neither the key nor
137:             * the value can be <code>null</code>. The key is wrapped by a
138:             * <code>CaselessStringKey</code> before mapping the key to the
139:             * value. <p>
140:             *
141:             * The value can be retrieved by calling the <code>get</code> method 
142:             * with a key that is equal to the original key. 
143:             *
144:             * @param      key     the hashtable key.
145:             * @param      value   the value.
146:             * @return     the previous value of the specified key in this hashtable,
147:             *             or <code>null</code> if it did not have one.
148:             * @exception  IllegalArgumentException  if the key or value is
149:             *               <code>null</code>.
150:             * @see     Object#equals(Object)
151:             * @see     #get(String)
152:             */
153:            public Object put(String key, Object value) {
154:                if (key == null || value == null) {
155:                    throw new IllegalArgumentException(JaiI18N
156:                            .getString("Generic0"));
157:                }
158:
159:                return super .put(new CaselessStringKey(key), value);
160:            }
161:
162:            /**
163:             * Maps the specified <code>key</code> to the specified
164:             * <code>value</code> in this hashtable. Neither the key nor the
165:             * value can be <code>null</code>. <p>
166:             *
167:             * The value can be retrieved by calling the <code>get</code> method 
168:             * with a key that is equal to the original key. 
169:             *
170:             * @param      key     the hashtable key.
171:             * @param      value   the value.
172:             * @return     the previous value of the specified key in this hashtable,
173:             *             or <code>null</code> if it did not have one.
174:             * @exception  IllegalArgumentException  if the key or value is
175:             *               <code>null</code>.
176:             * @see     Object#equals(Object)
177:             * @see     #get(CaselessStringKey)
178:             */
179:            public Object put(CaselessStringKey key, Object value) {
180:                if (key == null || value == null) {
181:                    throw new IllegalArgumentException(JaiI18N
182:                            .getString("Generic0"));
183:                }
184:
185:                return super .put(key, value);
186:            }
187:
188:            /**
189:             * Allow only String and CaselessStringKey keys to be mapped.
190:             * This always throws an IllegalArgumentException.
191:             *
192:             * @param   key   possible key.
193:             * @param      value   the value.
194:             *
195:             * @return  always throws IllegalArgumentException.
196:             * @see     #get(Object)
197:             */
198:            public Object put(Object key, Object value) {
199:                throw new IllegalArgumentException();
200:            }
201:
202:            /**
203:             * Removes the key (and its corresponding value) from this
204:             * hashtable. This method does nothing if the key is not in the
205:             * hashtable. The key is wrapped by a <code>CaselessStringKey</code>
206:             * before trying to remove the entry.
207:             *
208:             * @param   key   the key that needs to be removed.
209:             * @return  the value to which the key had been mapped in this hashtable,
210:             *          or <code>null</code> if the key did not have a mapping.
211:             */
212:            public Object remove(String key) {
213:                return super .remove(new CaselessStringKey(key));
214:            }
215:
216:            /**
217:             * Removes the key (and its corresponding value) from this
218:             * hashtable. This method does nothing if the key is not in the
219:             * hashtable.
220:             *
221:             * @param   key   the key that needs to be removed.
222:             * @return  the value to which the key had been mapped in this hashtable,
223:             *          or <code>null</code> if the key did not have a mapping.
224:             */
225:            public Object remove(CaselessStringKey key) {
226:                return super .remove(key);
227:            }
228:
229:            /**
230:             * Allow only String and CaselessStringKey keys to be removed.
231:             * This always throws an IllegalArgumentException.
232:             *
233:             * @param   key   possible key.
234:             *
235:             * @return  always throws IllegalArgumentException.
236:             * @see     #get(Object)
237:             */
238:            public Object remove(Object key) {
239:                throw new IllegalArgumentException();
240:            }
241:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.