Source Code Cross Referenced for VerificationTypeInfo.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » internal » compiler » codegen » 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.compiler.codegen 
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.compiler.codegen;
011:
012:        import org.eclipse.jdt.core.compiler.CharOperation;
013:        import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
014:        import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
015:
016:        public class VerificationTypeInfo {
017:            /**
018:             * The tag value representing top variable info
019:             * @since 3.2
020:             */
021:            public static final int ITEM_TOP = 0;
022:            /**
023:             * The tag value representing integer variable info
024:             * @since 3.2
025:             */
026:            public static final int ITEM_INTEGER = 1;
027:            /**
028:             * The tag value representing float variable info
029:             * @since 3.2
030:             */
031:            public static final int ITEM_FLOAT = 2;
032:            /**
033:             * The tag value representing double variable info
034:             * @since 3.2
035:             */
036:            public static final int ITEM_DOUBLE = 3;
037:            /**
038:             * The tag value representing long variable info
039:             * @since 3.2
040:             */
041:            public static final int ITEM_LONG = 4;
042:            /**
043:             * The tag value representing null variable info
044:             * @since 3.2
045:             */
046:            public static final int ITEM_NULL = 5;
047:            /**
048:             * The tag value representing uninitialized this variable info
049:             * @since 3.2
050:             */
051:            public static final int ITEM_UNINITIALIZED_THIS = 6;
052:            /**
053:             * The tag value representing object variable info
054:             * @since 3.2
055:             */
056:            public static final int ITEM_OBJECT = 7;
057:            /**
058:             * The tag value representing uninitialized variable info
059:             * @since 3.2
060:             */
061:            public static final int ITEM_UNINITIALIZED = 8;
062:
063:            public int tag;
064:            private int id;
065:            private char[] constantPoolName;
066:            public int offset;
067:
068:            private VerificationTypeInfo() {
069:                // for duplication
070:            }
071:
072:            public VerificationTypeInfo(int id, char[] constantPoolName) {
073:                this (id, VerificationTypeInfo.ITEM_OBJECT, constantPoolName);
074:            }
075:
076:            public VerificationTypeInfo(int id, int tag, char[] constantPoolName) {
077:                this .id = id;
078:                this .tag = tag;
079:                this .constantPoolName = constantPoolName;
080:            }
081:
082:            public VerificationTypeInfo(int tag, TypeBinding binding) {
083:                this (binding);
084:                this .tag = tag;
085:            }
086:
087:            public VerificationTypeInfo(TypeBinding binding) {
088:                this .id = binding.id;
089:                switch (binding.id) {
090:                case TypeIds.T_boolean:
091:                case TypeIds.T_byte:
092:                case TypeIds.T_char:
093:                case TypeIds.T_int:
094:                case TypeIds.T_short:
095:                    this .tag = VerificationTypeInfo.ITEM_INTEGER;
096:                    break;
097:                case TypeIds.T_float:
098:                    this .tag = VerificationTypeInfo.ITEM_FLOAT;
099:                    break;
100:                case TypeIds.T_long:
101:                    this .tag = VerificationTypeInfo.ITEM_LONG;
102:                    break;
103:                case TypeIds.T_double:
104:                    this .tag = VerificationTypeInfo.ITEM_DOUBLE;
105:                    break;
106:                case TypeIds.T_null:
107:                    this .tag = VerificationTypeInfo.ITEM_NULL;
108:                    break;
109:                default:
110:                    this .tag = VerificationTypeInfo.ITEM_OBJECT;
111:                    this .constantPoolName = binding.constantPoolName();
112:                }
113:            }
114:
115:            public void setBinding(TypeBinding binding) {
116:                this .constantPoolName = binding.constantPoolName();
117:                final int typeBindingId = binding.id;
118:                this .id = typeBindingId;
119:                switch (typeBindingId) {
120:                case TypeIds.T_boolean:
121:                case TypeIds.T_byte:
122:                case TypeIds.T_char:
123:                case TypeIds.T_int:
124:                case TypeIds.T_short:
125:                    this .tag = VerificationTypeInfo.ITEM_INTEGER;
126:                    break;
127:                case TypeIds.T_float:
128:                    this .tag = VerificationTypeInfo.ITEM_FLOAT;
129:                    break;
130:                case TypeIds.T_long:
131:                    this .tag = VerificationTypeInfo.ITEM_LONG;
132:                    break;
133:                case TypeIds.T_double:
134:                    this .tag = VerificationTypeInfo.ITEM_DOUBLE;
135:                    break;
136:                case TypeIds.T_null:
137:                    this .tag = VerificationTypeInfo.ITEM_NULL;
138:                    break;
139:                default:
140:                    this .tag = VerificationTypeInfo.ITEM_OBJECT;
141:                }
142:            }
143:
144:            public int id() {
145:                return this .id;
146:            }
147:
148:            public String toString() {
149:                StringBuffer buffer = new StringBuffer();
150:                switch (this .tag) {
151:                case VerificationTypeInfo.ITEM_UNINITIALIZED_THIS:
152:                    buffer
153:                            .append("uninitialized_this(").append(this .readableName()).append(")"); //$NON-NLS-1$//$NON-NLS-2$
154:                    break;
155:                case VerificationTypeInfo.ITEM_UNINITIALIZED:
156:                    buffer
157:                            .append("uninitialized(").append(this .readableName()).append(")"); //$NON-NLS-1$//$NON-NLS-2$
158:                    break;
159:                case VerificationTypeInfo.ITEM_OBJECT:
160:                    buffer.append(this .readableName());
161:                    break;
162:                case VerificationTypeInfo.ITEM_DOUBLE:
163:                    buffer.append('D');
164:                    break;
165:                case VerificationTypeInfo.ITEM_FLOAT:
166:                    buffer.append('F');
167:                    break;
168:                case VerificationTypeInfo.ITEM_INTEGER:
169:                    buffer.append('I');
170:                    break;
171:                case VerificationTypeInfo.ITEM_LONG:
172:                    buffer.append('J');
173:                    break;
174:                case VerificationTypeInfo.ITEM_NULL:
175:                    buffer.append("null"); //$NON-NLS-1$
176:                    break;
177:                case VerificationTypeInfo.ITEM_TOP:
178:                    buffer.append("top"); //$NON-NLS-1$
179:                    break;
180:                }
181:                return String.valueOf(buffer);
182:            }
183:
184:            public VerificationTypeInfo duplicate() {
185:                final VerificationTypeInfo verificationTypeInfo = new VerificationTypeInfo();
186:                verificationTypeInfo.id = this .id;
187:                verificationTypeInfo.tag = this .tag;
188:                verificationTypeInfo.constantPoolName = this .constantPoolName;
189:                verificationTypeInfo.offset = this .offset;
190:                return verificationTypeInfo;
191:            }
192:
193:            public boolean equals(Object obj) {
194:                if (obj instanceof  VerificationTypeInfo) {
195:                    VerificationTypeInfo info1 = (VerificationTypeInfo) obj;
196:                    return info1.tag == this .tag
197:                            && CharOperation.equals(info1.constantPoolName(),
198:                                    this .constantPoolName());
199:                }
200:                return false;
201:            }
202:
203:            public int hashCode() {
204:                return this .tag + this .id + this .constantPoolName.length
205:                        + this .offset;
206:            }
207:
208:            public char[] constantPoolName() {
209:                return this .constantPoolName;
210:            }
211:
212:            public char[] readableName() {
213:                return this .constantPoolName;
214:            }
215:
216:            public void replaceWithElementType() {
217:                if (this .constantPoolName[1] == 'L') {
218:                    this .constantPoolName = CharOperation.subarray(
219:                            this .constantPoolName, 2,
220:                            this .constantPoolName.length - 1);
221:                } else {
222:                    this .constantPoolName = CharOperation.subarray(
223:                            this .constantPoolName, 1,
224:                            this .constantPoolName.length);
225:                    if (this .constantPoolName.length == 1) {
226:                        switch (this .constantPoolName[0]) {
227:                        case 'I':
228:                            this .id = TypeIds.T_int;
229:                            break;
230:                        case 'B':
231:                            this .id = TypeIds.T_byte;
232:                            break;
233:                        case 'S':
234:                            this .id = TypeIds.T_short;
235:                            break;
236:                        case 'C':
237:                            this .id = TypeIds.T_char;
238:                            break;
239:                        case 'J':
240:                            this .id = TypeIds.T_long;
241:                            break;
242:                        case 'F':
243:                            this .id = TypeIds.T_float;
244:                            break;
245:                        case 'D':
246:                            this .id = TypeIds.T_double;
247:                            break;
248:                        case 'Z':
249:                            this .id = TypeIds.T_boolean;
250:                            break;
251:                        case 'N':
252:                            this .id = TypeIds.T_null;
253:                            break;
254:                        case 'V':
255:                            this.id = TypeIds.T_void;
256:                            break;
257:                        }
258:                    }
259:                }
260:            }
261:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.