com.sun.tools.javac.code
Class Type.ClassType

java.lang.Object
  extended by com.sun.tools.javac.code.Type
      extended by com.sun.tools.javac.code.Type.ClassType
All Implemented Interfaces:
DeclaredType, PrimitiveType, ReferenceType, TypeMirror
Direct Known Subclasses:
Type.ErasedClassType, Type.ErrorType
Enclosing class:
Type

public static class Type.ClassType
extends Type
implements DeclaredType


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.tools.javac.code.Type
Type.ArrayType, Type.BottomType, Type.CapturedType, Type.ClassType, Type.DelegatedType, Type.ErasedClassType, Type.ErrorType, Type.ForAll, Type.JCNoType, Type.Mapping, Type.MethodType, Type.PackageType, Type.TypeVar, Type.UndetVar, Type.Visitor<R,S>, Type.WildcardType
 
Field Summary
 List<Type> allparams_field
          A cache variable for the type parameters of this type, appended to all parameters of its enclosing class.
 List<Type> interfaces_field
          The interfaces of this class (to be set once class is loaded).
private  Type outer_field
          The enclosing type of this type.
(package private)  int rank_field
          A cache for the rank.
 Type supertype_field
          The supertype of this class (to be set once class is loaded).
 List<Type> typarams_field
          The type parameters of this type (to be set once class is loaded).
 
Fields inherited from class com.sun.tools.javac.code.Type
moreInfo, noType, tag, tsym
 
Constructor Summary
Type.ClassType(Type outer, List<Type> typarams, Symbol.TypeSymbol tsym)
           
 
Method Summary
<R,S> R
accept(Type.Visitor<R,S> v, S s)
           
<R,P> R
accept(TypeVisitor<R,P> v, P p)
          Applies a visitor to this type.
 List<Type> allparams()
          Return all parameters of this type and all its outer types in order outer (first) to inner (last).
private  java.lang.String className(Symbol sym, boolean longform)
           
 void complete()
          Complete loading all classes in this type.
 Type constType(java.lang.Object constValue)
          Define a constant type, of the same kind as this type and with given constant value
 boolean contains(Type elem)
          Does this type contain occurrences of type t?
 Type getEnclosingType()
          Returns the type of the innermost enclosing instance or a NoType of kind NONE if there is no enclosing instance.
 TypeKind getKind()
          Returns the kind of this type.
 List<Type> getTypeArguments()
          Access methods.
 boolean hasErasedSupertypes()
           
 boolean isErroneous()
          Does this type contain "error" elements?
 boolean isParameterized()
          Is this type parameterized? A class type is parameterized if it has some parameters.
 boolean isRaw()
          A class type is raw if it misses some of its type parameter sections.
 Type map(Type.Mapping f)
          map a type function over all immediate descendants of this type
 void setEnclosingType(Type outer)
           
 java.lang.String toString()
          The Java source which this type represents.
 
Methods inherited from class com.sun.tools.javac.code.Type
argtypes, asElement, asMethodType, baseType, baseTypes, clone, constValue, contains, containsSome, equals, getLowerBound, getParameterTypes, getReturnType, getThrownTypes, getUpperBound, hashCode, isCompound, isErroneous, isExtendsBound, isFalse, isInterface, isPrimitive, isSuperBound, isTrue, isUnbound, map, setThrown, stringValue, toString, withTypeVar
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.lang.model.type.DeclaredType
asElement
 
Methods inherited from interface javax.lang.model.type.TypeMirror
equals, hashCode
 

Field Detail

outer_field

private Type outer_field
The enclosing type of this type. If this is the type of an inner class, outer_field refers to the type of its enclosing instance class, in all other cases it referes to noType.


typarams_field

public List<Type> typarams_field
The type parameters of this type (to be set once class is loaded).


allparams_field

public List<Type> allparams_field
A cache variable for the type parameters of this type, appended to all parameters of its enclosing class.

See Also:
allparams()

supertype_field

public Type supertype_field
The supertype of this class (to be set once class is loaded).


interfaces_field

public List<Type> interfaces_field
The interfaces of this class (to be set once class is loaded).


rank_field

int rank_field
A cache for the rank.

Constructor Detail

Type.ClassType

public Type.ClassType(Type outer,
                      List<Type> typarams,
                      Symbol.TypeSymbol tsym)
Method Detail

accept

public <R,S> R accept(Type.Visitor<R,S> v,
                      S s)
Overrides:
accept in class Type

constType

public Type constType(java.lang.Object constValue)
Description copied from class: Type
Define a constant type, of the same kind as this type and with given constant value

Overrides:
constType in class Type

toString

public java.lang.String toString()
The Java source which this type represents.

Specified by:
toString in interface TypeMirror
Overrides:
toString in class Type
Returns:
a string representation of this type

className

private java.lang.String className(Symbol sym,
                                   boolean longform)

getTypeArguments

public List<Type> getTypeArguments()
Description copied from class: Type
Access methods.

Specified by:
getTypeArguments in interface DeclaredType
Overrides:
getTypeArguments in class Type
Returns:
the actual type arguments of this type, or an empty list if none

hasErasedSupertypes

public boolean hasErasedSupertypes()

getEnclosingType

public Type getEnclosingType()
Description copied from interface: DeclaredType
Returns the type of the innermost enclosing instance or a NoType of kind NONE if there is no enclosing instance. Only types corresponding to inner classes have an enclosing instance.

Specified by:
getEnclosingType in interface DeclaredType
Overrides:
getEnclosingType in class Type
Returns:
a type mirror for the enclosing type

setEnclosingType

public void setEnclosingType(Type outer)

allparams

public List<Type> allparams()
Description copied from class: Type
Return all parameters of this type and all its outer types in order outer (first) to inner (last).

Overrides:
allparams in class Type

isErroneous

public boolean isErroneous()
Description copied from class: Type
Does this type contain "error" elements?

Overrides:
isErroneous in class Type

isParameterized

public boolean isParameterized()
Description copied from class: Type
Is this type parameterized? A class type is parameterized if it has some parameters. An array type is parameterized if its element type is parameterized. All other types are not parameterized.

Overrides:
isParameterized in class Type

isRaw

public boolean isRaw()
A class type is raw if it misses some of its type parameter sections. After validation, this is equivalent to: allparams.isEmpty() && tsym.type.allparams.nonEmpty();

Overrides:
isRaw in class Type

map

public Type map(Type.Mapping f)
Description copied from class: Type
map a type function over all immediate descendants of this type

Overrides:
map in class Type

contains

public boolean contains(Type elem)
Description copied from class: Type
Does this type contain occurrences of type t?

Overrides:
contains in class Type

complete

public void complete()
Description copied from class: Type
Complete loading all classes in this type.

Overrides:
complete in class Type

getKind

public TypeKind getKind()
Description copied from interface: TypeMirror
Returns the kind of this type.

Specified by:
getKind in interface TypeMirror
Overrides:
getKind in class Type
Returns:
the kind of this type

accept

public <R,P> R accept(TypeVisitor<R,P> v,
                      P p)
Description copied from interface: TypeMirror
Applies a visitor to this type.

Specified by:
accept in interface TypeMirror
Overrides:
accept in class Type
Type Parameters:
R - the return type of the visitor's methods
P - the type of the additional parameter to the visitor's methods
Parameters:
v - the visitor operating on this type
p - additional parameter to the visitor
Returns:
a visitor-specified result