Source Code Cross Referenced for JavaElementRequestor.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » internal » 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 » IDE Eclipse » jdt » org.eclipse.jdt.internal.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.jdt.internal.core;
011:
012:        import java.util.ArrayList;
013:
014:        import org.eclipse.jdt.core.IField;
015:        import org.eclipse.jdt.core.IInitializer;
016:        import org.eclipse.jdt.core.IMethod;
017:        import org.eclipse.jdt.core.IPackageFragment;
018:        import org.eclipse.jdt.core.IType;
019:
020:        /**
021:         * @see IJavaElementRequestor
022:         */
023:
024:        public class JavaElementRequestor implements  IJavaElementRequestor {
025:            /**
026:             * True if this requestor no longer wants to receive
027:             * results from its <code>IRequestorNameLookup</code>.
028:             */
029:            protected boolean fCanceled = false;
030:
031:            /**
032:             * A collection of the resulting fields, or <code>null</code>
033:             * if no field results have been received.
034:             */
035:            protected ArrayList fFields = null;
036:
037:            /**
038:             * A collection of the resulting initializers, or <code>null</code>
039:             * if no initializer results have been received.
040:             */
041:            protected ArrayList fInitializers = null;
042:
043:            /**
044:             * A collection of the resulting member types, or <code>null</code>
045:             * if no member type results have been received.
046:             */
047:            protected ArrayList fMemberTypes = null;
048:
049:            /**
050:             * A collection of the resulting methods, or <code>null</code>
051:             * if no method results have been received.
052:             */
053:            protected ArrayList fMethods = null;
054:
055:            /**
056:             * A collection of the resulting package fragments, or <code>null</code>
057:             * if no package fragment results have been received.
058:             */
059:            protected ArrayList fPackageFragments = null;
060:
061:            /**
062:             * A collection of the resulting types, or <code>null</code>
063:             * if no type results have been received.
064:             */
065:            protected ArrayList fTypes = null;
066:
067:            /**
068:             * Empty arrays used for efficiency
069:             */
070:            protected static IField[] fgEmptyFieldArray = new IField[0];
071:            protected static IInitializer[] fgEmptyInitializerArray = new IInitializer[0];
072:            protected static IType[] fgEmptyTypeArray = new IType[0];
073:            protected static IPackageFragment[] fgEmptyPackageFragmentArray = new IPackageFragment[0];
074:            protected static IMethod[] fgEmptyMethodArray = new IMethod[0];
075:
076:            /**
077:             * @see IJavaElementRequestor
078:             */
079:            public void acceptField(IField field) {
080:                if (fFields == null) {
081:                    fFields = new ArrayList();
082:                }
083:                fFields.add(field);
084:            }
085:
086:            /**
087:             * @see IJavaElementRequestor
088:             */
089:            public void acceptInitializer(IInitializer initializer) {
090:                if (fInitializers == null) {
091:                    fInitializers = new ArrayList();
092:                }
093:                fInitializers.add(initializer);
094:            }
095:
096:            /**
097:             * @see IJavaElementRequestor
098:             */
099:            public void acceptMemberType(IType type) {
100:                if (fMemberTypes == null) {
101:                    fMemberTypes = new ArrayList();
102:                }
103:                fMemberTypes.add(type);
104:            }
105:
106:            /**
107:             * @see IJavaElementRequestor
108:             */
109:            public void acceptMethod(IMethod method) {
110:                if (fMethods == null) {
111:                    fMethods = new ArrayList();
112:                }
113:                fMethods.add(method);
114:            }
115:
116:            /**
117:             * @see IJavaElementRequestor
118:             */
119:            public void acceptPackageFragment(IPackageFragment packageFragment) {
120:                if (fPackageFragments == null) {
121:                    fPackageFragments = new ArrayList();
122:                }
123:                fPackageFragments.add(packageFragment);
124:            }
125:
126:            /**
127:             * @see IJavaElementRequestor
128:             */
129:            public void acceptType(IType type) {
130:                if (fTypes == null) {
131:                    fTypes = new ArrayList();
132:                }
133:                fTypes.add(type);
134:            }
135:
136:            /**
137:             * @see IJavaElementRequestor
138:             */
139:            public IField[] getFields() {
140:                if (fFields == null) {
141:                    return fgEmptyFieldArray;
142:                }
143:                int size = fFields.size();
144:                IField[] results = new IField[size];
145:                fFields.toArray(results);
146:                return results;
147:            }
148:
149:            /**
150:             * @see IJavaElementRequestor
151:             */
152:            public IInitializer[] getInitializers() {
153:                if (fInitializers == null) {
154:                    return fgEmptyInitializerArray;
155:                }
156:                int size = fInitializers.size();
157:                IInitializer[] results = new IInitializer[size];
158:                fInitializers.toArray(results);
159:                return results;
160:            }
161:
162:            /**
163:             * @see IJavaElementRequestor
164:             */
165:            public IType[] getMemberTypes() {
166:                if (fMemberTypes == null) {
167:                    return fgEmptyTypeArray;
168:                }
169:                int size = fMemberTypes.size();
170:                IType[] results = new IType[size];
171:                fMemberTypes.toArray(results);
172:                return results;
173:            }
174:
175:            /**
176:             * @see IJavaElementRequestor
177:             */
178:            public IMethod[] getMethods() {
179:                if (fMethods == null) {
180:                    return fgEmptyMethodArray;
181:                }
182:                int size = fMethods.size();
183:                IMethod[] results = new IMethod[size];
184:                fMethods.toArray(results);
185:                return results;
186:            }
187:
188:            /**
189:             * @see IJavaElementRequestor
190:             */
191:            public IPackageFragment[] getPackageFragments() {
192:                if (fPackageFragments == null) {
193:                    return fgEmptyPackageFragmentArray;
194:                }
195:                int size = fPackageFragments.size();
196:                IPackageFragment[] results = new IPackageFragment[size];
197:                fPackageFragments.toArray(results);
198:                return results;
199:            }
200:
201:            /**
202:             * @see IJavaElementRequestor
203:             */
204:            public IType[] getTypes() {
205:                if (fTypes == null) {
206:                    return fgEmptyTypeArray;
207:                }
208:                int size = fTypes.size();
209:                IType[] results = new IType[size];
210:                fTypes.toArray(results);
211:                return results;
212:            }
213:
214:            /**
215:             * @see IJavaElementRequestor
216:             */
217:            public boolean isCanceled() {
218:                return fCanceled;
219:            }
220:
221:            /**
222:             * Reset the state of this requestor.
223:             */
224:            public void reset() {
225:                fCanceled = false;
226:                fFields = null;
227:                fInitializers = null;
228:                fMemberTypes = null;
229:                fMethods = null;
230:                fPackageFragments = null;
231:                fTypes = null;
232:            }
233:
234:            /**
235:             * Sets the #isCanceled state of this requestor to true or false.
236:             */
237:            public void setCanceled(boolean b) {
238:                fCanceled = b;
239:            }
240:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.