Source Code Cross Referenced for AutoMIDletInfoList.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » automation » 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 » j2me » com.sun.midp.automation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *
003:         *
004:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation.
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt).
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions.
025:         */
026:
027:        package com.sun.midp.automation;
028:
029:        import java.util.*;
030:        import com.sun.midp.main.*;
031:
032:        /**
033:         * AutoMIDletInfo list
034:         */
035:        class AutoMIDletInfoList {
036:            /** Vector of AutoMIDletInfo objects */
037:            private Vector midletsInfo;
038:
039:            /** The one and only instance of AutoMIDletInfoList */
040:            private static AutoMIDletInfoList midletInfoList = null;
041:
042:            /**
043:             * Private constructor to prevent direct creation of instances.
044:             */
045:            AutoMIDletInfoList() {
046:                midletsInfo = new Vector();
047:            }
048:
049:            /**
050:             * Gets AutoMIDletInfoList instance.
051:             *
052:             * @return AutoMIDletInfoList instance
053:             */
054:            synchronized static AutoMIDletInfoList getMIDletInfoList() {
055:                if (midletInfoList == null) {
056:                    midletInfoList = new AutoMIDletInfoList();
057:                }
058:
059:                return midletInfoList;
060:            }
061:
062:            /**
063:             * Creates AutoMIDletInfo and adds it to the list.
064:             *
065:             * @param suiteID suite ID
066:             * @param midletClassName MIDlet's class name
067:             * @return created AutoMIDletInfo instance
068:             */
069:            AutoMIDletInfo addToList(int suiteID, String midletClassName) {
070:                synchronized (this ) {
071:                    AutoMIDletInfo info = new AutoMIDletInfo(suiteID,
072:                            midletClassName);
073:                    midletsInfo.addElement(info);
074:
075:                    return info;
076:                }
077:            }
078:
079:            /**
080:             * Finds MIDlet info by MIDlet's suite ID and class name.
081:             *
082:             * @param suiteID suite ID
083:             * @param midletClassName MIDlet's class name
084:             * @return corresponding AutoMIDletInfo instance or null,
085:             *         if it hasn't been found
086:             */
087:            AutoMIDletInfo findMIDletInfo(int suiteID, String midletClassName) {
088:                synchronized (this ) {
089:                    for (int i = 0; i < midletsInfo.size(); ++i) {
090:                        AutoMIDletInfo info = (AutoMIDletInfo) midletsInfo
091:                                .elementAt(i);
092:                        if (info.suiteID == suiteID
093:                                && info.midletClassName.equals(midletClassName)) {
094:                            return info;
095:                        }
096:                    }
097:                }
098:
099:                return null;
100:            }
101:
102:            /**
103:             * Finds MIDlet info by AutoMIDletImpl.
104:             *
105:             * @param midlet AutoMIDletImpl reference to be used as key
106:             * @return corresponding AutoMIDletInfo instance or null,
107:             *         if it hasn't been found
108:             */
109:            AutoMIDletInfo findMIDletInfo(AutoMIDletImpl midlet) {
110:                synchronized (this ) {
111:                    for (int i = 0; i < midletsInfo.size(); ++i) {
112:                        AutoMIDletInfo info = (AutoMIDletInfo) midletsInfo
113:                                .elementAt(i);
114:                        if (info.midlet == midlet) {
115:                            return info;
116:                        }
117:                    }
118:                }
119:
120:                return null;
121:            }
122:
123:            /**
124:             * Finds MIDlet info by MIDletProxy.
125:             *
126:             * @param midletProxy MIDletProxy reference to be used as key
127:             * @return corresponding AutoMIDletInfo instance or null,
128:             *         if it hasn't been found
129:             */
130:            AutoMIDletInfo findMIDletInfo(MIDletProxy midletProxy) {
131:                AutoMIDletInfo info = findMIDletInfo(midletProxy.getSuiteId(),
132:                        midletProxy.getClassName());
133:
134:                return info;
135:            }
136:
137:            /**
138:             * Finds AutoMIDlet corresponding to specified MIDletProxy.
139:             *
140:             * @param midletProxy MIDletProxy instance
141:             * @return AutoMIDletImpl instance corresponding to MIDletProxy,
142:             *         or null if it hasn't been found
143:             */
144:            AutoMIDletImpl findMIDlet(MIDletProxy midletProxy) {
145:                AutoMIDletImpl midlet = null;
146:                AutoMIDletInfo info = findMIDletInfo(midletProxy);
147:                if (info != null) {
148:                    midlet = info.midlet;
149:                }
150:
151:                return midlet;
152:            }
153:
154:            /**
155:             * Finds MIDletProxy corresponding to specified AutoMIDlet
156:             *
157:             * @param midlet AutoMIDletImpl instance
158:             * @return MIDletProxy instance corresponding to AutoMIDletImpl,
159:             *         or null if it hasn't been found
160:             */
161:            MIDletProxy findMIDletProxy(AutoMIDletImpl midlet) {
162:                MIDletProxy midletProxy = null;
163:                AutoMIDletInfo info = findMIDletInfo(midlet);
164:                if (info != null) {
165:                    midletProxy = info.midletProxy;
166:                }
167:
168:                return midletProxy;
169:            }
170:
171:            /**
172:             * Removes specified AutoMIDletInfo instance from list.
173:             *
174:             * @param info AutoMIDletInfo instance to be removed
175:             */
176:            void removeFromList(AutoMIDletInfo info) {
177:                midletsInfo.removeElement(info);
178:            }
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.