Source Code Cross Referenced for Gui4jMap1.java in  » XML-UI » gui4j » org » gui4j » core » 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 UI » gui4j » org.gui4j.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.gui4j.core;
002:
003:        import java.io.Serializable;
004:        import java.util.ArrayList;
005:        import java.util.Collection;
006:        import java.util.HashSet;
007:        import java.util.Map;
008:        import java.util.Set;
009:
010:        /**
011:         * The class <code>Gui4jAccess</code> works with parameter maps. Since usually only one
012:         * parameter is used, this class provides a very simple implementation of the
013:         * <code>Map</code> interface for exaclty one entry. Note that this class is only to
014:         * improve performance.
015:         * @author Joachim Schmid
016:         */
017:        public final class Gui4jMap1 implements  Map, Map.Entry, Serializable {
018:            private final Object mKey;
019:            private Object mValue;
020:
021:            public Gui4jMap1(Object key, Object value) {
022:                mKey = key;
023:                mValue = value;
024:            }
025:
026:            public Object getKey() {
027:                return mKey;
028:            }
029:
030:            public Object getValue() {
031:                return mValue;
032:            }
033:
034:            public Object setValue(Object value) {
035:                mValue = value;
036:                return value;
037:            }
038:
039:            /**
040:             * @see java.util.Map#size()
041:             */
042:            public int size() {
043:                return 1;
044:            }
045:
046:            /**
047:             * @see java.util.Map#isEmpty()
048:             */
049:            public boolean isEmpty() {
050:                return false;
051:            }
052:
053:            /**
054:             * @see java.util.Map#containsKey(Object)
055:             */
056:            public boolean containsKey(Object key) {
057:                if (mKey == null) {
058:                    return key == null;
059:                } else {
060:                    if (key == null) {
061:                        return false;
062:                    }
063:                    return mKey.equals(key);
064:                }
065:            }
066:
067:            /**
068:             * @see java.util.Map#containsValue(Object)
069:             */
070:            public boolean containsValue(Object value) {
071:                if (mValue == null) {
072:                    return value == null;
073:                } else {
074:                    if (value == null) {
075:                        return false;
076:                    }
077:                    return mValue.equals(value);
078:                }
079:            }
080:
081:            /**
082:             * @see java.util.Map#get(Object)
083:             */
084:            public Object get(Object key) {
085:                if (mKey == key) {
086:                    return mValue;
087:                }
088:                if (mKey == null || key == null) {
089:                    return null;
090:                }
091:                if (mKey.equals(key)) {
092:                    return mValue;
093:                }
094:                return null;
095:            }
096:
097:            /**
098:             * @see java.util.Map#put(Object, Object)
099:             */
100:            public Object put(Object key, Object value) {
101:                throw new UnsupportedOperationException(
102:                        "unexpected put operation");
103:            }
104:
105:            /**
106:             * @see java.util.Map#remove(Object)
107:             */
108:            public Object remove(Object arg0) {
109:                throw new UnsupportedOperationException(
110:                        "unexpected remove operation");
111:            }
112:
113:            /**
114:             * @see java.util.Map#putAll(Map)
115:             */
116:            public void putAll(Map arg0) {
117:                throw new UnsupportedOperationException(
118:                        "unexpected putAll operation");
119:            }
120:
121:            /**
122:             * @see java.util.Map#clear()
123:             */
124:            public void clear() {
125:                throw new UnsupportedOperationException(
126:                        "unexpected clear operation");
127:            }
128:
129:            /**
130:             * @see java.util.Map#keySet()
131:             */
132:            public Set keySet() {
133:                HashSet set = new HashSet();
134:                set.add(mKey);
135:                return set;
136:            }
137:
138:            /**
139:             * @see java.util.Map#values()
140:             */
141:            public Collection values() {
142:                ArrayList list = new ArrayList();
143:                list.add(mValue);
144:                return list;
145:            }
146:
147:            /**
148:             * @see java.util.Map#entrySet()
149:             */
150:            public Set entrySet() {
151:                Set set = new HashSet();
152:                set.add(this);
153:                return set;
154:            }
155:
156:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.