public class TypeVariable_c extends ReferenceType_c implements TypeVariable
TypeVariable.TVarDecl
Modifier and Type | Field and Description |
---|---|
protected TypeVariable.TVarDecl |
declaredIn |
protected ClassType |
declaringClass |
protected JL5ProcedureInstance |
declaringProcedure |
protected ReferenceType |
lowerBound
It is possible for type variables to have lower bounds.
|
protected java.lang.String |
name |
protected java.lang.Long |
syntheticUniqueId
Unique Id for type variables where declaredIn is either null or equal to
TVarDecl.SYNTHETIC_TYPE_VARIABLE.
|
protected ReferenceType |
upperBound
The upper bound of this type variable.
|
position, ts
Constructor and Description |
---|
TypeVariable_c(TypeSystem ts,
Position pos,
java.lang.String id,
ReferenceType upperBound) |
Modifier and Type | Method and Description |
---|---|
TypeVariable.TVarDecl |
declaredIn() |
ClassType |
declaringClass() |
JL5ProcedureInstance |
declaringProcedure() |
boolean |
descendsFromImpl(Type ancestor)
Return true if this type descends from
ancestor . |
boolean |
equalsImpl(TypeObject t)
Default implementation is pointer equality.
|
ReferenceType |
erasureType() |
FieldInstance |
fieldNamed(java.lang.String name)
Return the field named
name , or null. |
java.util.List<? extends FieldInstance> |
fields()
Returns a list of fields declared in this type.
|
java.lang.String |
fullName()
Full dotted-name of the type object.
|
int |
hashCode() |
boolean |
hasLowerBound()
Does this type variable have a lower bound? See JLS 3rd ed 4.10.2 and 5.1.10
|
java.util.List<? extends ReferenceType> |
interfaces()
Returns a list of all the type's interfaces.
|
boolean |
isCanonical()
Return true if the type object contains no unknown/ambiguous types.
|
boolean |
isCastValidImpl(Type toType)
Requires: all type arguments are canonical.
|
ReferenceType |
lowerBound() |
java.util.List<? extends MethodInstance> |
methods()
Returns a list of methods declared in this type.
|
java.lang.String |
name()
Simple name of the type object.
|
void |
setDeclaringClass(ClassType ct) |
void |
setDeclaringProcedure(JL5ProcedureInstance pi) |
void |
setLowerBound(ReferenceType lowerBound) |
void |
setSyntheticOrigin() |
void |
setUpperBound(ReferenceType upperBound) |
Type |
superType()
Returns the supertype of this type.
|
java.lang.String |
toString()
Yields a string representing this type.
|
java.lang.String |
translate(Resolver c)
Return a string into which to translate the type.
|
boolean |
typeEqualsImpl(Type t)
Return true if this type is equivalent to t.
|
ReferenceType |
upperBound() |
TypeVariable |
upperBound(ReferenceType upperBound) |
hasMethod, hasMethodImpl, isImplicitCastValidImpl, isReference, members, methods, methodsNamed, toReference
arrayOf, arrayOf, descendsFrom, isArray, isBoolean, isByte, isCastValid, isChar, isClass, isComparable, isDouble, isFloat, isImplicitCastValid, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPackage, isPrimitive, isShort, isSubtype, isSubtypeImpl, isThrowable, isType, isUncheckedException, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, print, toArray, toClass, toNull, toPackage, toPrimitive, toType, typeEquals
copy, equals, position, typeSystem
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
hasMethod, hasMethodImpl, members, methods, methodsNamed
arrayOf, arrayOf, descendsFrom, isArray, isBoolean, isByte, isCastValid, isChar, isClass, isComparable, isDouble, isFloat, isImplicitCastValid, isImplicitCastValidImpl, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPrimitive, isReference, isShort, isSubtype, isSubtypeImpl, isThrowable, isUncheckedException, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, print, toArray, toClass, toNull, toPrimitive, toReference, typeEquals
position, typeSystem
protected java.lang.String name
protected TypeVariable.TVarDecl declaredIn
protected ClassType declaringClass
protected JL5ProcedureInstance declaringProcedure
protected transient java.lang.Long syntheticUniqueId
protected ReferenceType upperBound
protected ReferenceType lowerBound
public TypeVariable_c(TypeSystem ts, Position pos, java.lang.String id, ReferenceType upperBound)
public void setDeclaringProcedure(JL5ProcedureInstance pi)
setDeclaringProcedure
in interface TypeVariable
public void setDeclaringClass(ClassType ct)
setDeclaringClass
in interface TypeVariable
public void setSyntheticOrigin()
setSyntheticOrigin
in interface TypeVariable
public TypeVariable.TVarDecl declaredIn()
declaredIn
in interface TypeVariable
public ClassType declaringClass()
declaringClass
in interface TypeVariable
public JL5ProcedureInstance declaringProcedure()
declaringProcedure
in interface TypeVariable
public java.lang.String name()
Named
public java.lang.String fullName()
Named
public boolean isCanonical()
TypeObject
isCanonical
in interface TypeObject
isCanonical
in class Type_c
public java.util.List<? extends MethodInstance> methods()
ReferenceType
methods
in interface ReferenceType
methods
in class ReferenceType_c
MethodInstance
.MethodInstance
public java.util.List<? extends FieldInstance> fields()
ReferenceType
fields
in interface ReferenceType
fields
in class ReferenceType_c
FieldInstance
.FieldInstance
public FieldInstance fieldNamed(java.lang.String name)
ReferenceType
name
, or null.fieldNamed
in interface ReferenceType
public java.util.List<? extends ReferenceType> interfaces()
ReferenceType
interfaces
in interface ReferenceType
interfaces
in class ReferenceType_c
Type
.Type
public ReferenceType erasureType()
erasureType
in interface TypeVariable
public Type superType()
ReferenceType
superType
in interface ReferenceType
superType
in class ReferenceType_c
public java.lang.String translate(Resolver c)
Type
public java.lang.String toString()
Type
public boolean isCastValidImpl(Type toType)
ReferenceType_c
isCastValidImpl
in interface Type
isCastValidImpl
in class ReferenceType_c
public boolean descendsFromImpl(Type ancestor)
Type
ancestor
.descendsFromImpl
in interface Type
descendsFromImpl
in class ReferenceType_c
public boolean hasLowerBound()
TypeVariable
hasLowerBound
in interface TypeVariable
public ReferenceType lowerBound()
lowerBound
in interface TypeVariable
public void setLowerBound(ReferenceType lowerBound)
setLowerBound
in interface TypeVariable
public ReferenceType upperBound()
upperBound
in interface TypeVariable
public void setUpperBound(ReferenceType upperBound)
setUpperBound
in interface TypeVariable
public TypeVariable upperBound(ReferenceType upperBound)
upperBound
in interface TypeVariable
public boolean equalsImpl(TypeObject t)
TypeObject_c
equalsImpl
in interface TypeObject
equalsImpl
in class TypeObject_c
TypeObject_c.equalsImpl(TypeObject)
,
Object.hashCode()
public boolean typeEqualsImpl(Type t)
Type
typeEqualsImpl
in interface Type
typeEqualsImpl
in class Type_c
t
- Type to compare topublic int hashCode()
hashCode
in class TypeObject_c