Source Code Cross Referenced for MapImpl.java in  » Database-ORM » Speedo_1.4.5 » org » objectweb » speedo » genclass » 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 » Database ORM » Speedo_1.4.5 » org.objectweb.speedo.genclass.map 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright (C) 2001-2004 France Telecom R&D
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2 of the License, or (at your option) any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */package org.objectweb.speedo.genclass.map;
018:
019:        import org.objectweb.speedo.genclass.GenClass;
020:        import org.objectweb.speedo.mim.api.StateItf;
021:
022:        import java.util.Collection;
023:        import java.util.HashMap;
024:        import java.util.Map;
025:        import java.util.Set;
026:
027:        public class MapImpl extends GenClass implements  Map {
028:
029:            private static final long serialVersionUID = 64364678132168L;
030:
031:            /**
032:             * Instantiates a new map.
033:             */
034:            public MapImpl() {
035:                super ();
036:                accessor = (MapAccessor) speedoCreateState();
037:            }
038:
039:            // ------------------------------------------------------------------------
040:            // IMPLEMENTATION OF THE Collection INTERFACE
041:            // ------------------------------------------------------------------------
042:
043:            public int size() {
044:                if (!speedoIsActive) {
045:                    return accessor.size();
046:                } else {
047:                    MapAccessor ca = (MapAccessor) speedoGetHome()
048:                            .readIntention(this , null);
049:                    return ca.size();
050:                }
051:            }
052:
053:            public boolean isEmpty() {
054:                if (!speedoIsActive) {
055:                    return accessor.isEmpty();
056:                } else {
057:                    MapAccessor ca = (MapAccessor) speedoGetHome()
058:                            .readIntention(this , null);
059:                    return ca.isEmpty();
060:                }
061:            }
062:
063:            public boolean containsKey(Object key) {
064:                if (!speedoIsActive) {
065:                    return accessor.containsKey(key);
066:                } else {
067:                    MapAccessor ca = (MapAccessor) speedoGetHome()
068:                            .readIntention(this , null);
069:                    return ca.containsKey(key);
070:                }
071:            }
072:
073:            public boolean containsValue(Object value) {
074:                if (!speedoIsActive) {
075:                    return accessor.containsValue(value);
076:                } else {
077:                    MapAccessor ca = (MapAccessor) speedoGetHome()
078:                            .readIntention(this , null);
079:                    return ca.containsValue(value);
080:                }
081:            }
082:
083:            public Object get(Object key) {
084:                if (!speedoIsActive) {
085:                    return accessor.get(key);
086:                } else {
087:                    MapAccessor ca = (MapAccessor) speedoGetHome()
088:                            .readIntention(this , null);
089:                    return ca.get(key);
090:                }
091:            }
092:
093:            public Object put(Object key, Object value) {
094:                if (!speedoIsActive) {
095:                    return accessor.put(key, value);
096:                } else {
097:                    MapAccessor ca = (MapAccessor) speedoGetHome()
098:                            .writeIntention(this , null);
099:                    return ca.put(key, value);
100:                }
101:            }
102:
103:            public Object remove(Object key) {
104:                if (!speedoIsActive) {
105:                    return accessor.remove(key);
106:                } else {
107:                    MapAccessor ca = (MapAccessor) speedoGetHome()
108:                            .writeIntention(this , null);
109:                    return ca.remove(key);
110:                }
111:            }
112:
113:            public void putAll(Map t) {
114:                if (!speedoIsActive) {
115:                    accessor.putAll(t);
116:                } else {
117:                    MapAccessor ca = (MapAccessor) speedoGetHome()
118:                            .writeIntention(this , null);
119:                    ca.putAll(t);
120:                }
121:            }
122:
123:            public void clear() {
124:                if (!speedoIsActive) {
125:                    accessor.clear();
126:                } else {
127:                    MapAccessor ca = (MapAccessor) speedoGetHome()
128:                            .writeIntention(this , null);
129:                    ca.clear();
130:                }
131:            }
132:
133:            public Set keySet() {
134:                if (!speedoIsActive) {
135:                    return accessor.keySet();
136:                } else {
137:                    MapAccessor ca = (MapAccessor) speedoGetHome()
138:                            .readIntention(this , null);
139:                    return ca.keySet();
140:                }
141:            }
142:
143:            public Collection values() {
144:                if (!speedoIsActive) {
145:                    return accessor.values();
146:                } else {
147:                    MapAccessor ca = (MapAccessor) speedoGetHome()
148:                            .writeIntention(this , null);
149:                    return ca.values();
150:                }
151:            }
152:
153:            public Set entrySet() {
154:                if (!speedoIsActive) {
155:                    return accessor.entrySet();
156:                } else {
157:                    MapAccessor ca = (MapAccessor) speedoGetHome()
158:                            .readIntention(this , null);
159:                    return ca.entrySet();
160:                }
161:            }
162:
163:            // IMPLEMENTATION OF THE PersistentObjectItf INTERFACE //
164:            //---------------------------------------------//
165:
166:            public void setGCValue(Object o) {
167:                if (speedoIsActive) {
168:                    MapAccessor ca = (MapAccessor) speedoGetHome()
169:                            .writeIntention(this , null);
170:                    ca.clear();
171:                    if (o != null) {
172:                        ca.putAll(((Map) o));
173:                    }
174:                } else {
175:                    accessor.clear();
176:                    if (o != null) {
177:                        accessor.putAll(((Map) o));
178:                    }
179:                }
180:            }
181:
182:            MapAccessor accessor;
183:
184:            public StateItf speedoGetReferenceState() {
185:                return accessor;
186:            }
187:
188:            public void speedoSetReferenceState(StateItf refAcc) {
189:                accessor = (MapAccessor) refAcc;
190:            }
191:
192:            public StateItf speedoCreateState() {
193:                return new MapAccessor(this );
194:            }
195:
196:            public Object createGenClass() {
197:                return new HashMap();
198:            }
199:
200:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.