Top Description Fields Constructors Methods
org.aspectj.weaver

public Class TypeVariable

extends Object
Class Inheritance
Imports
java.io.IOException

Represents a type variable with possible bounds.
Authors
Adrian Colyer, Andy Clement

Field Summary

Modifier and TypeField and Description
private boolean
private TypeVariableDeclaringElement
private int
private UnresolvedType
public boolean
public static final int
private String
public static final TypeVariable[]
private int
private UnresolvedType
private UnresolvedType[]
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
TypeVariable(String name)

Constructor for an unbound type variable, eg.

public
TypeVariable(String name, UnresolvedType anUpperBound)

public
TypeVariable(String name, UnresolvedType anUpperBound, UnresolvedType[] superInterfaces)

Method Summary

Modifier and TypeMethod and Description
public boolean
canBeBoundTo(ResolvedType candidate)

answer true if the given type satisfies all of the bound constraints of this type variable.

public TypeVariableDeclaringElement
public int
public String
public String
public UnresolvedType

Returns:

the first bound, either the superclass or if non is specified the first interface or if non are specified then OBJECT
getFirstBound
()

public String
public String
public int
public String
getSignature()

Return complete signature, e.g. "T extends Number" would return "T:Ljava/lang/Number;" note: MAY INCLUDE P types if bounds are parameterized types

public String

Returns:

signature for inclusion in an attribute, there must be no 'P' in it signatures
getSignatureForAttribute
()

public UnresolvedType
public UnresolvedType[]
public UnresolvedType
private boolean
isASubtypeOf(UnresolvedType candidateSuperType, UnresolvedType candidateSubType)

public static TypeVariable
public TypeVariable
resolve(World world)

resolve all the bounds of this type variable

public void
public void
public void
public void
setRank(int rank)

public void
public void
public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

beingResolvedback to summary
private boolean beingResolved
declaringElementback to summary
private TypeVariableDeclaringElement declaringElement
declaringElementKindback to summary
private int declaringElementKind
firstboundback to summary
private UnresolvedType firstbound
isResolvedback to summary
public boolean isResolved
METHODback to summary
public static final int METHOD
nameback to summary
private String name
NONEback to summary
public static final TypeVariable[] NONE
rankback to summary
private int rank
superclassback to summary
private UnresolvedType superclass
superInterfacesback to summary
private UnresolvedType[] superInterfaces
TYPEback to summary
public static final int TYPE
UNKNOWNback to summary
public static final int UNKNOWN

Constructor Detail

TypeVariableback to summary
public TypeVariable(String name)

Constructor for an unbound type variable, eg. 'T'

TypeVariableback to summary
public TypeVariable(String name, UnresolvedType anUpperBound)
TypeVariableback to summary
public TypeVariable(String name, UnresolvedType anUpperBound, UnresolvedType[] superInterfaces)

Method Detail

canBeBoundToback to summary
public boolean canBeBoundTo(ResolvedType candidate)

answer true if the given type satisfies all of the bound constraints of this type variable. If type variable has not been resolved then throws IllegalStateException

getDeclaringElementback to summary
public TypeVariableDeclaringElement getDeclaringElement()
getDeclaringElementKindback to summary
public int getDeclaringElementKind()
getDisplayNameback to summary
public String getDisplayName()
getErasureSignatureback to summary
public String getErasureSignature()
getFirstBoundback to summary
public UnresolvedType getFirstBound()
Returns:UnresolvedType

the first bound, either the superclass or if non is specified the first interface or if non are specified then OBJECT

getGenericSignatureback to summary
public String getGenericSignature()
getNameback to summary
public String getName()
getRankback to summary
public int getRank()
getSignatureback to summary
public String getSignature()

Return complete signature, e.g. "T extends Number" would return "T:Ljava/lang/Number;" note: MAY INCLUDE P types if bounds are parameterized types

getSignatureForAttributeback to summary
public String getSignatureForAttribute()
Returns:String

signature for inclusion in an attribute, there must be no 'P' in it signatures

getSuperclassback to summary
public UnresolvedType getSuperclass()
getSuperInterfacesback to summary
public UnresolvedType[] getSuperInterfaces()
getUpperBoundback to summary
public UnresolvedType getUpperBound()
isASubtypeOfback to summary
private boolean isASubtypeOf(UnresolvedType candidateSuperType, UnresolvedType candidateSubType)
readback to summary
public static TypeVariable read(VersionedDataInputStream s) throws IOException
resolveback to summary
public TypeVariable resolve(World world)

resolve all the bounds of this type variable

setAdditionalInterfaceBoundsback to summary
public void setAdditionalInterfaceBounds(UnresolvedType[] superInterfaces)
setDeclaringElementback to summary
public void setDeclaringElement(TypeVariableDeclaringElement element)
setDeclaringElementKindback to summary
public void setDeclaringElementKind(int kind)
setRankback to summary
public void setRank(int rank)
setSuperclassback to summary
public void setSuperclass(UnresolvedType superclass)
setUpperBoundback to summary
public void setUpperBound(UnresolvedType superclass)
toDebugStringback to summary
public String toDebugString()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
writeback to summary
public void write(CompressingDataOutputStream s) throws IOException