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

java.lang.Object
  extended by com.sun.tools.javac.code.Type
      extended by com.sun.tools.javac.code.Type.MethodType
All Implemented Interfaces:
java.lang.Cloneable, ExecutableType, PrimitiveType, TypeMirror
Enclosing class:
Type

public static class Type.MethodType
extends Type
implements java.lang.Cloneable, ExecutableType


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> argtypes
           
 Type restype
           
 List<Type> thrown
           
 
Fields inherited from class com.sun.tools.javac.code.Type
moreInfo, noType, tag, tsym
 
Constructor Summary
Type.MethodType(List<Type> argtypes, Type restype, List<Type> thrown, Symbol.TypeSymbol methodClass)
           
 
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.
 Symbol.TypeSymbol asElement()
           
 Type.MethodType asMethodType()
          The underlying method type of this type.
 void complete()
          Complete loading all classes in this type.
 boolean contains(Type elem)
          Does this type contain occurrences of type t?
 boolean equals(java.lang.Object obj)
          This method is analogous to isSameType, but weaker, since we never complete classes.
 TypeKind getKind()
          Returns the kind of this type.
 List<Type> getParameterTypes()
          Returns the types of this executable's formal parameters.
 Type getReturnType()
          Returns the return type of this executable.
 List<Type> getThrownTypes()
          Returns the exceptions and other throwables listed in this executable's throws clause.
 List<Type.TypeVar> getTypeVariables()
          Returns the type variables declared by the formal type parameters of this executable.
 int hashCode()
          Obeys the general contract of Object.hashCode.
 boolean isErroneous()
          Does this type contain "error" elements?
 Type map(Type.Mapping f)
          map a type function over all immediate descendants of this type
 void setThrown(List<Type> t)
           
 java.lang.String toString()
          The Java source which this type represents.
 
Methods inherited from class com.sun.tools.javac.code.Type
allparams, argtypes, baseType, baseTypes, clone, constType, constValue, contains, containsSome, getEnclosingType, getLowerBound, getTypeArguments, getUpperBound, isCompound, isErroneous, isExtendsBound, isFalse, isInterface, isParameterized, isPrimitive, isRaw, isSuperBound, isTrue, isUnbound, map, stringValue, toString, withTypeVar
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

argtypes

public List<Type> argtypes

restype

public Type restype

thrown

public List<Type> thrown
Constructor Detail

Type.MethodType

public Type.MethodType(List<Type> argtypes,
                       Type restype,
                       List<Type> thrown,
                       Symbol.TypeSymbol methodClass)
Method Detail

accept

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

toString

public java.lang.String toString()
The Java source which this type represents. XXX 06/09/99 iris This isn't correct Java syntax, but it probably should be.

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

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Type
This method is analogous to isSameType, but weaker, since we never complete classes. Where isSameType would complete a class, equals assumes that the two types are different.

Specified by:
equals in interface TypeMirror
Overrides:
equals in class Type
Parameters:
obj - the object to be compared with this type
Returns:
true if the specified object is equal to this one

hashCode

public int hashCode()
Description copied from interface: TypeMirror
Obeys the general contract of Object.hashCode.

Specified by:
hashCode in interface TypeMirror
Overrides:
hashCode in class Type
See Also:
TypeMirror.equals(java.lang.Object)

getParameterTypes

public List<Type> getParameterTypes()
Description copied from interface: ExecutableType
Returns the types of this executable's formal parameters.

Specified by:
getParameterTypes in interface ExecutableType
Overrides:
getParameterTypes in class Type
Returns:
the types of this executable's formal parameters, or an empty list if there are none

getReturnType

public Type getReturnType()
Description copied from interface: ExecutableType
Returns the return type of this executable. Returns a NoType with kind VOID if this executable is not a method, or is a method that does not return a value.

Specified by:
getReturnType in interface ExecutableType
Overrides:
getReturnType in class Type
Returns:
the return type of this executable

getThrownTypes

public List<Type> getThrownTypes()
Description copied from interface: ExecutableType
Returns the exceptions and other throwables listed in this executable's throws clause.

Specified by:
getThrownTypes in interface ExecutableType
Overrides:
getThrownTypes in class Type
Returns:
the exceptions and other throwables listed in this executable's throws clause, or an empty list if there are none.

setThrown

public void setThrown(List<Type> t)
Overrides:
setThrown in class Type

isErroneous

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

Overrides:
isErroneous 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

asMethodType

public Type.MethodType asMethodType()
Description copied from class: Type
The underlying method type of this type.

Overrides:
asMethodType in class Type

complete

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

Overrides:
complete in class Type

getTypeVariables

public List<Type.TypeVar> getTypeVariables()
Description copied from interface: ExecutableType
Returns the type variables declared by the formal type parameters of this executable.

Specified by:
getTypeVariables in interface ExecutableType
Returns:
the type variables declared by the formal type parameters, or an empty list if there are none

asElement

public Symbol.TypeSymbol asElement()
Overrides:
asElement 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