Java Doc for Types.java in  » 6.0-JDK-Modules-com.sun » tools » com » sun » tools » javac » code » 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 com.sun » tools » com.sun.tools.javac.code 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.tools.javac.code.Types

Types
public class Types (Code)
Utility class containing various operations on types.

Unless other names are more illustrative, the following naming conventions should be observed in this file:

t
If the first argument to an operation is a type, it should be named t.
s
Similarly, if the second argument to an operation is a type, it should be named s.
ts
If an operations takes a list of types, the first should be named ts.
ss
A second list of types should be named ss.

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Inner Class :class TypePair
Inner Class :public static class AdaptFailure extends Exception
Inner Class :class SingletonType
Inner Class :abstract public static class DefaultTypeVisitor implements Type.Visitor<R, S>
Inner Class :abstract public static class SimpleVisitor extends DefaultTypeVisitor
Inner Class :abstract public static class TypeRelation extends SimpleVisitor
Inner Class :abstract public static class UnaryVisitor extends SimpleVisitor
Inner Class :public static class MapVisitor extends DefaultTypeVisitor

Field Summary
final  booleanallowBoxing
    
final  NamecapturedName
    
final  Checkchk
    
public  MappingfromUnknownFun
     A mapping that turns all unknown types in this type to fresh unknown variables.
 Map<Type, Boolean>isDerivedRawCache
    
 Set<TypePair>mergeCache
    
final  Name.Tablenames
    
final  ClassReaderreader
    
final  Sourcesource
    
final  Symtabsyms
    
final protected static  Context.Key<Types>typesKey
    
 List<Warner>warnStack
    

Constructor Summary
protected  Types(Context context)
    

Method Summary
public  voidadapt(Type source, Type target, ListBuffer<Type> from, ListBuffer<Type> to)
     Adapt a type by computing a substitution which maps a source type to a target type.
public  TypeasEnclosingSuper(Type t, Symbol sym)
     Return the base type of t or any of its enclosing types that starts with the given symbol.
public  TypeasOuterSuper(Type t, Symbol sym)
     Return the base type of t or any of its outer types that starts with the given symbol.
public  TypeasSub(Type t, Symbol sym)
     Return the least specific subtype of t that starts with symbol sym.
public  TypeasSuper(Type t, Symbol sym)
     Return the (most specific) base type of t that starts with the given symbol.
public  ClassSymbolboxedClass(Type t)
     Return the class that boxes the given primitive.
public  Typecapture(Type t)
     Capture conversion as specified by JLS 3rd Ed.
public  TypeclassBound(Type t)
     If the given type is a (possibly selected) type variable, return the bounding class of this type, otherwise return the type itself.
public  List<Type>closure(Type t)
     Returns the closure of a class or interface type.
public  booleancontainedBy(Type t, Type s)
    
 booleancontainsType(List<Type> ts, List<Type> ss)
    
public  booleancontainsType(Type t, Type s)
     Check if t contains s.

T contains S if:

L(T) <: L(S) && U(S) <: U(T)

This relation is only used by ClassType.isSubtype(), that is,

C <: C if T contains S.

public  booleancontainsTypeEquivalent(List<Type> ts, List<Type> ss)
    
public  booleancovariantReturnType(Type t, Type s, Warner warner)
    
public  intdimensions(Type t)
     The number of dimensions of an array type.
public  booleandisjointType(Type t, Type s)
     Two types or wildcards are considered disjoint if it can be proven that no type can be contained in both.
public  booleandisjointTypes(List<Type> ts, List<Type> ss)
    
public  Typeelemtype(Type t)
     The element type of an array.
public  Typeerasure(Type t)
     The erasure of t |t| -- the type that results when all type parameters in t are deleted.
public  List<Type>erasure(List<Type> ts)
    
public  List<Type>getBounds(TypeVar t)
     Return list of bounds of the given type variable.
public  Typeglb(Type t, Type s)
    
public  booleanhasSameArgs(Type t, Type s)
     Does t have the same arguments as s? It is assumed that both types are (possibly polymorphic) method types.
 booleanhasSameBounds(ForAll t, ForAll s)
    
public static  inthashCode(Type t)
     Compute a hash code on a type.
public  List<Type>insert(List<Type> cl, Type t)
    
public static  Typesinstance(Context context)
    
public  List<Type>interfaces(Type t)
     Return the interfaces implemented by this class.
public  List<Type>intersect(List<Type> cl1, List<Type> cl2)
    
public  booleanisArray(Type t)
    
public  booleanisAssignable(Type t, Type s)
    
public  booleanisAssignable(Type t, Type s, Warner warn)
    
public  booleanisCaptureOf(Type s, WildcardType t)
    
public  booleanisCastable(Type t, Type s)
    
public  booleanisCastable(Type t, Type s, Warner warn)
     Is t is castable to s?
s is assumed to be an erased type.
(not defined for Method and ForAll types).
public  booleanisConvertible(Type t, Type s, Warner warn)
    
public  booleanisConvertible(Type t, Type s)
    
public  booleanisDerivedRaw(Type t)
    
public  booleanisDerivedRaw(List<Type> ts)
    
public  booleanisDerivedRawInternal(Type t)
    
public  booleanisReifiable(Type t)
    
public  booleanisSameType(Type t, Type s)
    
public  booleanisSameTypes(List<Type> ts, List<Type> ss)
     Are corresponding elements of the lists the same type? If lists are of different length, return false.
public  booleanisSameWildcard(WildcardType t, Type s)
    
public  booleanisSubSignature(Type t, Type s)
     Returns true iff the first signature is a sub signature of the other.
final public  booleanisSubtype(Type t, Type s)
    
public  booleanisSubtype(Type t, Type s, boolean capture)
    
final public  booleanisSubtypeNoCapture(Type t, Type s)
    
public  booleanisSubtypeUnchecked(Type t, Type s)
    
public  booleanisSubtypeUnchecked(Type t, Type s, Warner warn)
    
public  booleanisSubtypeUnchecked(Type t, List<Type> ts, Warner warn)
     Is t a subtype of every type in given list `ts'?
(not defined for Method and ForAll types)
Allows unchecked conversions.
public  booleanisSubtypes(List<Type> ts, List<Type> ss)
     Are corresponding elements of ts subtypes of ss? If lists are of different length, return false.
public  booleanisSubtypesUnchecked(List<Type> ts, List<Type> ss, Warner warn)
     Are corresponding elements of ts subtypes of ss, allowing unchecked conversions? If lists are of different length, return false.
public  booleanisSuperType(Type t, Type s)
    
public  booleanisUnbounded(Type t)
     Checks that all the arguments to a class are unbounded wildcards or something else that doesn't make any restrictions on the arguments.
public  TypelowerBound(Type t)
     The "lvalue conversion".
The lower bound of most types is the type itself.
public  List<Type>lowerBoundArgtypes(Type t)
     Returns the lower bounds of the formals of a method.
public  Typelub(Type t1, Type t2)
     Return the least upper bound of pair of types.
public  Typelub(List<Type> ts)
     Return the least upper bound (lub) of set of types.
public  TypemakeCompoundType(List<Type> bounds, Type supertype)
    
public  TypemakeCompoundType(List<Type> bounds)
     Same as Types.makeCompoundType(List,Type) , except that the second parameter is computed directly.
public  TypemakeCompoundType(Type bound1, Type bound2)
     A convenience wrapper for Types.makeCompoundType(List) ; the arguments are converted to a list and passed to the other method.
public  TypememberType(Type t, Symbol sym)
     The type of given symbol, seen as a member of t.
public  List<Type>newInstances(List<Type> tvars)
     Create new vector of type variables from list of variables changing all recursive bounds from old to new list.
public  booleannotSoftSubtype(Type t, Type s)
     This relation answers the question: is impossible that something of type `t' can be a subtype of `s'? This is different from the question "is `t' not a subtype of `s'?" when type variables are involved: Integer is not a subtype of T where but it is not true that Integer cannot possibly be a subtype of T.
public  booleanoverrideEquivalent(Type t, Type s)
     Returns true iff these signatures are related by override equivalence.
public  intrank(Type t)
     The rank of a class is the length of the longest path between the class and java.lang.Object in the class inheritance graph.
public  booleanresultSubtype(Type t, Type s, Warner warner)
     Does t have a result that is a subtype of the result type of s, suitable for covariant returns? It is assumed that both types are (possibly polymorphic) method types.
public  booleanreturnTypeSubstitutable(Type r1, Type r2)
     Return-Type-Substitutable.
See Also:    The Java * Language Specification, Third Ed.
public  booleanreturnTypeSubstitutable(Type r1, Type r2, Type r2res, Warner warner)
    
public  voidsetBounds(TypeVar t, List<Type> bounds, Type supertype)
     Set the bounds field of the given type variable to reflect a (possibly multiple) list of bounds.
public  voidsetBounds(TypeVar t, List<Type> bounds)
     Same as Types.setBounds(Type.TypeVar,List,Type) , except that third parameter is computed directly.
public  List<Type>subst(List<Type> ts, List<Type> from, List<Type> to)
    
public  Typesubst(Type t, List<Type> from, List<Type> to)
     Substitute all occurrences of a type in `from' with the corresponding type in `to' in 't'.
public  TypeVarsubstBound(TypeVar t, List<Type> from, List<Type> to)
    
public  List<Type>substBounds(List<Type> tvars, List<Type> from, List<Type> to)
    
public  Typesupertype(Type t)
    
public  StringtoString(Type t)
     This toString is slightly more descriptive than the one on Type.
public  TypeunboxedType(Type t)
     Return the primitive type corresponding to a boxed type.
public  List<Type>union(List<Type> cl1, List<Type> cl2)
    
public  TypeupperBound(Type t)
     The "rvalue conversion".
The upper bound of most types is the type itself.

Field Detail
allowBoxing
final boolean allowBoxing(Code)



capturedName
final Name capturedName(Code)



chk
final Check chk(Code)



fromUnknownFun
public Mapping fromUnknownFun(Code)
A mapping that turns all unknown types in this type to fresh unknown variables.



isDerivedRawCache
Map<Type, Boolean> isDerivedRawCache(Code)



mergeCache
Set<TypePair> mergeCache(Code)



names
final Name.Table names(Code)



reader
final ClassReader reader(Code)



source
final Source source(Code)



syms
final Symtab syms(Code)



typesKey
final protected static Context.Key<Types> typesKey(Code)



warnStack
List<Warner> warnStack(Code)




Constructor Detail
Types
protected Types(Context context)(Code)




Method Detail
adapt
public void adapt(Type source, Type target, ListBuffer<Type> from, ListBuffer<Type> to) throws AdaptFailure(Code)
Adapt a type by computing a substitution which maps a source type to a target type.
Parameters:
  source - the source type
Parameters:
  target - the target type
Parameters:
  from - the type variables of the computed substitution
Parameters:
  to - the types of the computed substitution.



asEnclosingSuper
public Type asEnclosingSuper(Type t, Symbol sym)(Code)
Return the base type of t or any of its enclosing types that starts with the given symbol. If none exists, return null.
Parameters:
  t - a type
Parameters:
  sym - a symbol



asOuterSuper
public Type asOuterSuper(Type t, Symbol sym)(Code)
Return the base type of t or any of its outer types that starts with the given symbol. If none exists, return null.
Parameters:
  t - a type
Parameters:
  sym - a symbol



asSub
public Type asSub(Type t, Symbol sym)(Code)
Return the least specific subtype of t that starts with symbol sym. If none exists, return null. The least specific subtype is determined as follows:

If there is exactly one parameterized instance of sym that is a subtype of t, that parameterized instance is returned.
Otherwise, if the plain type or raw type `sym' is a subtype of type t, the type `sym' itself is returned. Otherwise, null is returned.




asSuper
public Type asSuper(Type t, Symbol sym)(Code)
Return the (most specific) base type of t that starts with the given symbol. If none exists, return null.
Parameters:
  t - a type
Parameters:
  sym - a symbol



boxedClass
public ClassSymbol boxedClass(Type t)(Code)
Return the class that boxes the given primitive.



capture
public Type capture(Type t)(Code)
Capture conversion as specified by JLS 3rd Ed.



classBound
public Type classBound(Type t)(Code)
If the given type is a (possibly selected) type variable, return the bounding class of this type, otherwise return the type itself.



closure
public List<Type> closure(Type t)(Code)
Returns the closure of a class or interface type.



containedBy
public boolean containedBy(Type t, Type s)(Code)



containsType
boolean containsType(List<Type> ts, List<Type> ss)(Code)



containsType
public boolean containsType(Type t, Type s)(Code)
Check if t contains s.

T contains S if:

L(T) <: L(S) && U(S) <: U(T)

This relation is only used by ClassType.isSubtype(), that is,

C <: C if T contains S.

Because of F-bounds, this relation can lead to infinite recursion. Thus we must somehow break that recursion. Notice that containsType() is only called from ClassType.isSubtype(). Since the arguments have already been checked against their bounds, we know:

U(S) <: U(T) if T is "super" bound (U(T) *is* the bound)

L(T) <: L(S) if T is "extends" bound (L(T) is bottom)
Parameters:
  t - a type
Parameters:
  s - a type




containsTypeEquivalent
public boolean containsTypeEquivalent(List<Type> ts, List<Type> ss)(Code)



covariantReturnType
public boolean covariantReturnType(Type t, Type s, Warner warner)(Code)
Is t an appropriate return type in an overrider for a method that returns s?



dimensions
public int dimensions(Type t)(Code)
The number of dimensions of an array type.



disjointType
public boolean disjointType(Type t, Type s)(Code)
Two types or wildcards are considered disjoint if it can be proven that no type can be contained in both. It is conservative in that it is allowed to say that two types are not disjoint, even though they actually are. The type C is castable to C exactly if X and Y are not disjoint.



disjointTypes
public boolean disjointTypes(List<Type> ts, List<Type> ss)(Code)



elemtype
public Type elemtype(Type t)(Code)
The element type of an array.



erasure
public Type erasure(Type t)(Code)
The erasure of t |t| -- the type that results when all type parameters in t are deleted.



erasure
public List<Type> erasure(List<Type> ts)(Code)



getBounds
public List<Type> getBounds(TypeVar t)(Code)
Return list of bounds of the given type variable.



glb
public Type glb(Type t, Type s)(Code)



hasSameArgs
public boolean hasSameArgs(Type t, Type s)(Code)
Does t have the same arguments as s? It is assumed that both types are (possibly polymorphic) method types. Monomorphic method types "have the same arguments", if their argument lists are equal. Polymorphic method types "have the same arguments", if they have the same arguments after renaming all type variables of one to corresponding type variables in the other, where correspondence is by position in the type parameter list.



hasSameBounds
boolean hasSameBounds(ForAll t, ForAll s)(Code)
Does t have the same bounds for quantified variables as s?



hashCode
public static int hashCode(Type t)(Code)
Compute a hash code on a type.



insert
public List<Type> insert(List<Type> cl, Type t)(Code)
Insert a type in a closure



instance
public static Types instance(Context context)(Code)



interfaces
public List<Type> interfaces(Type t)(Code)
Return the interfaces implemented by this class.



intersect
public List<Type> intersect(List<Type> cl1, List<Type> cl2)(Code)
Intersect two closures



isArray
public boolean isArray(Type t)(Code)



isAssignable
public boolean isAssignable(Type t, Type s)(Code)



isAssignable
public boolean isAssignable(Type t, Type s, Warner warn)(Code)
Is t assignable to s?
Equivalent to subtype except for constant values and raw types.
(not defined for Method and ForAll types)



isCaptureOf
public boolean isCaptureOf(Type s, WildcardType t)(Code)



isCastable
public boolean isCastable(Type t, Type s)(Code)



isCastable
public boolean isCastable(Type t, Type s, Warner warn)(Code)
Is t is castable to s?
s is assumed to be an erased type.
(not defined for Method and ForAll types).



isConvertible
public boolean isConvertible(Type t, Type s, Warner warn)(Code)
Is t a subtype of or convertiable via boxing/unboxing convertions to s?



isConvertible
public boolean isConvertible(Type t, Type s)(Code)
Is t a subtype of or convertiable via boxing/unboxing convertions to s?



isDerivedRaw
public boolean isDerivedRaw(Type t)(Code)



isDerivedRaw
public boolean isDerivedRaw(List<Type> ts)(Code)



isDerivedRawInternal
public boolean isDerivedRawInternal(Type t)(Code)



isReifiable
public boolean isReifiable(Type t)(Code)



isSameType
public boolean isSameType(Type t, Type s)(Code)
Is t the same type as s?



isSameTypes
public boolean isSameTypes(List<Type> ts, List<Type> ss)(Code)
Are corresponding elements of the lists the same type? If lists are of different length, return false.



isSameWildcard
public boolean isSameWildcard(WildcardType t, Type s)(Code)



isSubSignature
public boolean isSubSignature(Type t, Type s)(Code)
Returns true iff the first signature is a sub signature of the other. This is not an equivalence relation.
See Also:    "The Java Language Specification, Third Ed. (8.4.2)."
See Also:   Types.overrideEquivalent(Type t,Type s)
Parameters:
  t - first signature (possibly raw).
Parameters:
  s - second signature (could be subjected to erasure). true if t is a sub signature of s.



isSubtype
final public boolean isSubtype(Type t, Type s)(Code)
Is t a subtype of s?
(not defined for Method and ForAll types)



isSubtype
public boolean isSubtype(Type t, Type s, boolean capture)(Code)



isSubtypeNoCapture
final public boolean isSubtypeNoCapture(Type t, Type s)(Code)



isSubtypeUnchecked
public boolean isSubtypeUnchecked(Type t, Type s)(Code)
Is t an unchecked subtype of s?



isSubtypeUnchecked
public boolean isSubtypeUnchecked(Type t, Type s, Warner warn)(Code)
Is t an unchecked subtype of s?



isSubtypeUnchecked
public boolean isSubtypeUnchecked(Type t, List<Type> ts, Warner warn)(Code)
Is t a subtype of every type in given list `ts'?
(not defined for Method and ForAll types)
Allows unchecked conversions.



isSubtypes
public boolean isSubtypes(List<Type> ts, List<Type> ss)(Code)
Are corresponding elements of ts subtypes of ss? If lists are of different length, return false.



isSubtypesUnchecked
public boolean isSubtypesUnchecked(List<Type> ts, List<Type> ss, Warner warn)(Code)
Are corresponding elements of ts subtypes of ss, allowing unchecked conversions? If lists are of different length, return false.



isSuperType
public boolean isSuperType(Type t, Type s)(Code)
Is t a supertype of s?



isUnbounded
public boolean isUnbounded(Type t)(Code)
Checks that all the arguments to a class are unbounded wildcards or something else that doesn't make any restrictions on the arguments. If a class isUnbounded, a raw super- or subclass can be cast to it without a warning.
Parameters:
  t - a type true iff the given type is unbounded or raw



lowerBound
public Type lowerBound(Type t)(Code)
The "lvalue conversion".
The lower bound of most types is the type itself. Wildcards, on the other hand have upper and lower bounds.
Parameters:
  t - a type the lower bound of the given type



lowerBoundArgtypes
public List<Type> lowerBoundArgtypes(Type t)(Code)
Returns the lower bounds of the formals of a method.



lub
public Type lub(Type t1, Type t2)(Code)
Return the least upper bound of pair of types. if the lub does not exist return null.



lub
public Type lub(List<Type> ts)(Code)
Return the least upper bound (lub) of set of types. If the lub does not exist return the type of null (bottom).



makeCompoundType
public Type makeCompoundType(List<Type> bounds, Type supertype)(Code)
Make a compound type from non-empty list of types
Parameters:
  bounds - the types from which the compound type is formed
Parameters:
  supertype - is objectType if all bounds are interfaces,null otherwise.



makeCompoundType
public Type makeCompoundType(List<Type> bounds)(Code)
Same as Types.makeCompoundType(List,Type) , except that the second parameter is computed directly. Note that this might cause a symbol completion. Hence, this version of makeCompoundType may not be called during a classfile read.



makeCompoundType
public Type makeCompoundType(Type bound1, Type bound2)(Code)
A convenience wrapper for Types.makeCompoundType(List) ; the arguments are converted to a list and passed to the other method. Note that this might cause a symbol completion. Hence, this version of makeCompoundType may not be called during a classfile read.



memberType
public Type memberType(Type t, Symbol sym)(Code)
The type of given symbol, seen as a member of t.
Parameters:
  t - a type
Parameters:
  sym - a symbol



newInstances
public List<Type> newInstances(List<Type> tvars)(Code)
Create new vector of type variables from list of variables changing all recursive bounds from old to new list.



notSoftSubtype
public boolean notSoftSubtype(Type t, Type s)(Code)
This relation answers the question: is impossible that something of type `t' can be a subtype of `s'? This is different from the question "is `t' not a subtype of `s'?" when type variables are involved: Integer is not a subtype of T where but it is not true that Integer cannot possibly be a subtype of T.



overrideEquivalent
public boolean overrideEquivalent(Type t, Type s)(Code)
Returns true iff these signatures are related by override equivalence. This is the natural extension of isSubSignature to an equivalence relation.
See Also:    "The Java Language Specification, Third Ed. (8.4.2)."
See Also:   Types.isSubSignature(Type t,Type s)
Parameters:
  t - a signature (possible raw, could be subjected toerasure).
Parameters:
  s - a signature (possible raw, could be subjected toerasure). true if either argument is a sub signature of the other.



rank
public int rank(Type t)(Code)
The rank of a class is the length of the longest path between the class and java.lang.Object in the class inheritance graph. Undefined for all but reference types.



resultSubtype
public boolean resultSubtype(Type t, Type s, Warner warner)(Code)
Does t have a result that is a subtype of the result type of s, suitable for covariant returns? It is assumed that both types are (possibly polymorphic) method types. Monomorphic method types are handled in the obvious way. Polymorphic method types require renaming all type variables of one to corresponding type variables in the other, where correspondence is by position in the type parameter list.



returnTypeSubstitutable
public boolean returnTypeSubstitutable(Type r1, Type r2)(Code)
Return-Type-Substitutable.
See Also:    The Java * Language Specification, Third Ed. (8.4.5)



returnTypeSubstitutable
public boolean returnTypeSubstitutable(Type r1, Type r2, Type r2res, Warner warner)(Code)



setBounds
public void setBounds(TypeVar t, List<Type> bounds, Type supertype)(Code)
Set the bounds field of the given type variable to reflect a (possibly multiple) list of bounds.
Parameters:
  t - a type variable
Parameters:
  bounds - the bounds, must be nonempty
Parameters:
  supertype - is objectType if all bounds are interfaces,null otherwise.



setBounds
public void setBounds(TypeVar t, List<Type> bounds)(Code)
Same as Types.setBounds(Type.TypeVar,List,Type) , except that third parameter is computed directly. Note that this test might cause a symbol completion. Hence, this version of setBounds may not be called during a classfile read.



subst
public List<Type> subst(List<Type> ts, List<Type> from, List<Type> to)(Code)



subst
public Type subst(Type t, List<Type> from, List<Type> to)(Code)
Substitute all occurrences of a type in `from' with the corresponding type in `to' in 't'. Match lists `from' and `to' from the right: If lists have different length, discard leading elements of the longer list.



substBound
public TypeVar substBound(TypeVar t, List<Type> from, List<Type> to)(Code)



substBounds
public List<Type> substBounds(List<Type> tvars, List<Type> from, List<Type> to)(Code)



supertype
public Type supertype(Type t)(Code)



toString
public String toString(Type t)(Code)
This toString is slightly more descriptive than the one on Type.



unboxedType
public Type unboxedType(Type t)(Code)
Return the primitive type corresponding to a boxed type.



union
public List<Type> union(List<Type> cl1, List<Type> cl2)(Code)
Form the union of two closures



upperBound
public Type upperBound(Type t)(Code)
The "rvalue conversion".
The upper bound of most types is the type itself. Wildcards, on the other hand have upper and lower bounds.
Parameters:
  t - a type the upper bound of the given type



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.