public static class Type.MethodType extends Type implements Cloneable, ExecutableType
Type.ArrayType, Type.BottomType, Type.CapturedType, Type.ClassType, Type.DelegatedType, Type.ErrorType, Type.ForAll, Type.JCNoType, Type.Mapping, Type.MethodType, Type.PackageType, Type.TypeVar, Type.UndetVar, Type.Visitor<R,S>, Type.WildcardType| Modifier and Type | Field and Description |
|---|---|
List<Type> |
argtypes |
Type |
restype |
List<Type> |
thrown |
| Constructor and Description |
|---|
Type.MethodType(List<Type> argtypes,
Type restype,
List<Type> thrown,
Symbol.TypeSymbol methodClass) |
| Modifier and Type | Method and Description |
|---|---|
<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(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()
Returns a hash code value for the object.
|
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) |
String |
toString()
The Java source which this type represents.
|
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, removeBounds, removeBounds, stringValue, toString, withTypeVarpublic Type.MethodType(List<Type> argtypes, Type restype, List<Type> thrown, Symbol.TypeSymbol methodClass)
public <R,S> R accept(Type.Visitor<R,S> v, S s)
public String toString()
toString in interface TypeMirrortoString in class Typepublic boolean equals(Object obj)
Typeequals in interface TypeMirrorequals in class Typeobj - the reference object with which to compare.true if this object is the same as the obj
argument; false otherwise.Object.hashCode(),
Hashtablepublic int hashCode()
Objectjava.util.Hashtable.
The general contract of hashCode is:
hashCode method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hashtables.
As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)
hashCode in interface TypeMirrorhashCode in class TypeObject.equals(java.lang.Object),
Hashtablepublic List<Type> getParameterTypes()
ExecutableTypegetParameterTypes in interface ExecutableTypegetParameterTypes in class Typepublic Type getReturnType()
ExecutableTypeNoType with kind VOID
if this executable is not a method, or is a method that does not
return a value.getReturnType in interface ExecutableTypegetReturnType in class Typepublic List<Type> getThrownTypes()
ExecutableTypethrows clause.getThrownTypes in interface ExecutableTypegetThrownTypes in class Typethrows clause,
or an empty list if there are none.public boolean isErroneous()
TypeisErroneous in class Typepublic Type map(Type.Mapping f)
Typepublic boolean contains(Type elem)
Typepublic Type.MethodType asMethodType()
TypeasMethodType in class Typepublic void complete()
Typepublic List<Type.TypeVar> getTypeVariables()
ExecutableTypegetTypeVariables in interface ExecutableTypepublic Symbol.TypeSymbol asElement()
public TypeKind getKind()
TypeMirrorkind of this type.getKind in interface TypeMirrorgetKind in class Typepublic <R,P> R accept(TypeVisitor<R,P> v, P p)
TypeMirroraccept in interface TypeMirroraccept in class TypeR - the return type of the visitor's methodsP - the type of the additional parameter to the visitor's methodsv - the visitor operating on this typep - additional parameter to the visitor