Source Code Cross Referenced for Types.java in  » IDE-Eclipse » jdt » com » sun » mirror » util » 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 » com.sun.mirror.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)Types.java	1.3 04/06/07
003:         *
004:         * Copyright (c) 2004, Sun Microsystems, Inc.
005:         * All rights reserved.
006:         * 
007:         * Redistribution and use in source and binary forms, with or without
008:         * modification, are permitted provided that the following conditions are met:
009:         *
010:         *     * Redistributions of source code must retain the above copyright
011:         *       notice, this list of conditions and the following disclaimer.
012:         *     * Redistributions in binary form must reproduce the above copyright
013:         *       notice, this list of conditions and the following disclaimer in the
014:         *       documentation and/or other materials provided with the distribution.
015:         *     * Neither the name of the Sun Microsystems, Inc. nor the names of
016:         *       its contributors may be used to endorse or promote products derived from
017:         *       this software without specific prior written permission.
018:         * 
019:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
020:         * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
021:         * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
022:         * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
023:         * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
024:         * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
025:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
026:         * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
027:         * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
028:         * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
029:         * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030:         */
031:
032:        package com.sun.mirror.util;
033:
034:        import java.util.Collection;
035:
036:        import com.sun.mirror.declaration.*;
037:        import com.sun.mirror.type.*;
038:
039:        /**
040:         * Utility methods for operating on types.
041:         *
042:         * @author Joseph D. Darcy
043:         * @author Scott Seligman
044:         * @version 1.3 04/06/07
045:         * @since 1.5
046:         */
047:
048:        public interface Types {
049:
050:            /**
051:             * Tests whether one type is a subtype of the another.
052:             * Any type is considered to be a subtype of itself.
053:             *
054:             * @param t1  the first type
055:             * @param t2  the second type
056:             * @return <tt>true</tt> if and only if the first type is a subtype
057:             *		of the second
058:             */
059:            boolean isSubtype(TypeMirror t1, TypeMirror t2);
060:
061:            /**
062:             * Tests whether one type is assignable to another.
063:             *
064:             * @param t1  the first type
065:             * @param t2  the second type
066:             * @return <tt>true</tt> if and only if the first type is assignable
067:             *		to the second
068:             */
069:            boolean isAssignable(TypeMirror t1, TypeMirror t2);
070:
071:            /**
072:             * Returns the erasure of a type.
073:             *
074:             * @param t  the type to be erased
075:             * @return the erasure of the given type
076:             */
077:            TypeMirror getErasure(TypeMirror t);
078:
079:            /**
080:             * Returns a primitive type.
081:             *
082:             * @param kind  the kind of primitive type to return
083:             * @return a primitive type
084:             */
085:            PrimitiveType getPrimitiveType(PrimitiveType.Kind kind);
086:
087:            /**
088:             * Returns the pseudo-type representing the type of <tt>void</tt>.
089:             *
090:             * @return the pseudo-type representing the type of <tt>void</tt>
091:             */
092:            VoidType getVoidType();
093:
094:            /**
095:             * Returns an array type with the specified component type.
096:             *
097:             * @param componentType  the component type
098:             * @return an array type with the specified component type.
099:             * @throws IllegalArgumentException if the component type is not valid for
100:             *		an array
101:             */
102:            ArrayType getArrayType(TypeMirror componentType);
103:
104:            /**
105:             * Returns the type variable declared by a type parameter.
106:             *
107:             * @param tparam  the type parameter
108:             * @return the type variable declared by the type parameter
109:             */
110:            TypeVariable getTypeVariable(TypeParameterDeclaration tparam);
111:
112:            /**
113:             * Returns a new wildcard.
114:             * Either the wildcards's upper bounds or lower bounds may be
115:             * specified, or neither, but not both.
116:             *
117:             * @param upperBounds  the upper bounds of this wildcard,
118:             *		or an empty collection if none
119:             * @param lowerBounds  the lower bounds of this wildcard,
120:             *		or an empty collection if none
121:             * @return a new wildcard
122:             * @throws IllegalArgumentException if bounds are not valid
123:             */
124:            WildcardType getWildcardType(Collection<ReferenceType> upperBounds,
125:                    Collection<ReferenceType> lowerBounds);
126:
127:            /**
128:             * Returns the type corresponding to a type declaration and
129:             * actual type arguments.
130:             * Given the declaration for <tt>String</tt>, for example, this
131:             * method may be used to get the <tt>String</tt> type.  It may
132:             * then be invoked a second time, with the declaration for <tt>Set</tt>,
133:             * to make the parameterized type {@code Set<String>}.
134:             *
135:             * <p> The number of type arguments must either equal the
136:             * number of the declaration's formal type parameters, or must be
137:             * zero.  If zero, and if the declaration is generic,
138:             * then the declaration's raw type is returned.
139:             *
140:             * <p> If a parameterized type is being returned, its declaration
141:             * must not be contained within a generic outer class.
142:             * The parameterized type {@code Outer<String>.Inner<Number>},
143:             * for example, may be constructed by first using this
144:             * method to get the type {@code Outer<String>}, and then invoking
145:             * {@link #getDeclaredType(DeclaredType, TypeDeclaration, TypeMirror...)}.
146:             *
147:             * @param decl	the type declaration
148:             * @param typeArgs	the actual type arguments
149:             * @return the type corresponding to the type declaration and
150:             *		actual type arguments
151:             * @throws IllegalArgumentException if too many or too few
152:             *		type arguments are given, or if an inappropriate type
153:             *		argument or declaration is provided
154:             */
155:            DeclaredType getDeclaredType(TypeDeclaration decl,
156:                    TypeMirror... typeArgs);
157:
158:            /**
159:             * Returns the type corresponding to a type declaration
160:             * and actual arguments, given a
161:             * {@linkplain DeclaredType#getContainingType() containing type}
162:             * of which it is a member.
163:             * The parameterized type {@code Outer<String>.Inner<Number>},
164:             * for example, may be constructed by first using
165:             * {@link #getDeclaredType(TypeDeclaration, TypeMirror...)}
166:             * to get the type {@code Outer<String>}, and then invoking
167:             * this method.
168:             *
169:             * <p> If the containing type is a parameterized type,
170:             * the number of type arguments must equal the
171:             * number of the declaration's formal type parameters.
172:             * If it is not parameterized or if it is <tt>null</tt>, this method is
173:             * equivalent to <tt>getDeclaredType(decl, typeArgs)</tt>.
174:             *
175:             * @param containing  the containing type, or <tt>null</tt> if none
176:             * @param decl	  the type declaration
177:             * @param typeArgs	  the actual type arguments
178:             * @return the type corresponding to the type declaration and
179:             *		actual type arguments,
180:             *		contained within the given type
181:             * @throws IllegalArgumentException if too many or too few
182:             *		type arguments are given, or if an inappropriate type
183:             *		argument, declaration, or containing type is provided
184:             */
185:            DeclaredType getDeclaredType(DeclaredType containing,
186:                    TypeDeclaration decl, TypeMirror... typeArgs);
187:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.