public class IntersectionType_c extends ClassType_c implements IntersectionType
ClassType.Kind
Modifier and Type | Field and Description |
---|---|
protected TypeVariable |
boundOf_ |
protected java.util.List<ReferenceType> |
bounds |
decl, memberCache
position, ts
INTERSECTION
Constructor and Description |
---|
IntersectionType_c(TypeSystem ts,
Position pos,
java.util.List<ReferenceType> bounds) |
Modifier and Type | Method and Description |
---|---|
AnnotationTypeElemInstance |
annotationElemNamed(java.lang.String name) |
java.util.List<AnnotationTypeElemInstance> |
annotationElems() |
Annotations |
annotations()
Annotations on the declaration of this type.
|
TypeVariable |
boundOf() |
void |
boundOf(TypeVariable tv) |
java.util.List<ReferenceType> |
bounds() |
java.util.List<? extends ConstructorInstance> |
constructors()
The class's constructors.
|
EnumInstance |
enumConstantNamed(java.lang.String name) |
java.util.List<EnumInstance> |
enumConstants() |
boolean |
equalsImpl(TypeObject other)
Default implementation is pointer equality.
|
java.util.List<? extends FieldInstance> |
fields()
Returns a list of fields declared in this type.
|
Flags |
flags()
Get the class's flags.
|
int |
hashCode() |
boolean |
inStaticContext()
Return true if the class declaration occurs in a static context.
|
java.util.List<? extends ReferenceType> |
interfaces()
Returns a list of all the type's interfaces.
|
boolean |
isCastValidImpl(Type toType)
Requires: all type arguments are canonical.
|
boolean |
isEnclosedImpl(ClassType maybe_outer)
Implementation of
isEnclosed . |
java.util.LinkedList<Type> |
isImplicitCastValidChainImpl(Type toType)
Return a chain of types that show that this class can be implicitly cast
to toType.
|
boolean |
isRawClass()
Is this class a Raw Class? See JLS 3rd ed., 4.8
|
boolean |
isSubtypeImpl(Type ancestor)
Return true if this type is a subtype of
ancestor . |
Job |
job() |
ClassType.Kind |
kind()
Get the class's kind: top-level, member, local, or anonymous.
|
java.util.List<? extends ClassType> |
memberClasses()
The class's member classes.
|
java.util.List<? extends MethodInstance> |
methods()
Returns a list of methods declared in this type.
|
java.lang.String |
name()
Get the short name of the class, if possible.
|
ClassType |
outer()
The class's outer class, or null if a top-level class.
|
Package |
package_()
Get the class's package.
|
void |
setBounds(java.util.List<ReferenceType> newBounds) |
void |
setContainer(ReferenceType container)
Destructively set the member's container.
|
void |
setFlags(Flags flags)
Destructively set the member's flags.
|
java.util.Set<Type> |
superclasses()
All direct superclasses of the class.
|
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.
|
java.lang.String |
translateAsReceiver(Resolver resolver)
Translate the type as it should be if it were the receiver
of a field or method call.
|
boolean |
typeEqualsImpl(Type other)
Return true if this type is equivalent to t.
|
container, copy, declaration, descendsFromImpl, fieldNamed, fullName, hasEnclosingInstance, hasEnclosingInstanceImpl, isAnonymous, isCanonical, isClass, isEnclosed, isImplicitCastValidImpl, isInner, isInnerClass, isLocal, isMember, isNested, isThrowable, isTopLevel, isUncheckedException, memberClassNamed, members, print, resolver, setDeclaration, toClass
hasMethod, hasMethodImpl, isReference, methods, methodsNamed, toReference
arrayOf, arrayOf, descendsFrom, isArray, isBoolean, isByte, isCastValid, isChar, isComparable, isDouble, isFloat, isImplicitCastValid, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPackage, isPrimitive, isShort, isSubtype, isType, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, toArray, toNull, toPackage, toPrimitive, toType, typeEquals
equals, position, typeSystem
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
fieldNamed, hasEnclosingInstance, hasEnclosingInstanceImpl, isAnonymous, isEnclosed, isInner, isInnerClass, isLocal, isMember, isNested, isTopLevel, memberClassNamed, resolver
hasMethod, hasMethodImpl, members, methods, methodsNamed
arrayOf, arrayOf, descendsFrom, descendsFromImpl, isArray, isBoolean, isByte, isCastValid, isChar, isClass, isComparable, isDouble, isFloat, isImplicitCastValid, isImplicitCastValidImpl, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPrimitive, isReference, isShort, isSubtype, isThrowable, isUncheckedException, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, print, toArray, toClass, toNull, toPrimitive, toReference, typeEquals
isCanonical, position, typeSystem
container
declaration, setDeclaration
protected java.util.List<ReferenceType> bounds
protected TypeVariable boundOf_
public IntersectionType_c(TypeSystem ts, Position pos, java.util.List<ReferenceType> bounds)
public java.util.List<ReferenceType> bounds()
bounds
in interface IntersectionType
public boolean isEnclosedImpl(ClassType maybe_outer)
ClassType
isEnclosed
.
This method should only be called by the TypeSystem
or by a subclass.isEnclosedImpl
in interface ClassType
isEnclosedImpl
in class ClassType_c
public java.lang.String translate(Resolver c)
Type
translate
in interface Type
translate
in class ClassType_c
c
- A resolver in which to lookup this type to determine if
the type is unique in the given resolver.public java.lang.String toString()
Type
toString
in interface Type
toString
in class ClassType_c
public Type superType()
ReferenceType
superType
in interface ReferenceType
superType
in class ClassType_c
public java.util.List<? extends ConstructorInstance> constructors()
ClassType
ConstructorInstance
.constructors
in interface ClassType
constructors
in class ClassType_c
ConstructorInstance
public java.util.List<? extends FieldInstance> fields()
ReferenceType
fields
in interface ReferenceType
fields
in class ClassType_c
FieldInstance
.FieldInstance
public Flags flags()
ClassType_c
flags
in interface MemberInstance
flags
in class ClassType_c
public java.util.List<? extends ReferenceType> interfaces()
ReferenceType
interfaces
in interface ReferenceType
interfaces
in class ClassType_c
Type
.Type
public ClassType.Kind kind()
ClassType
kind
in interface ClassType
kind
in class ClassType_c
public java.util.List<? extends ClassType> memberClasses()
ClassType
ClassType
.memberClasses
in interface ClassType
memberClasses
in class ClassType_c
ClassType
public java.util.List<? extends MethodInstance> methods()
ReferenceType
methods
in interface ReferenceType
methods
in class ClassType_c
MethodInstance
.MethodInstance
public java.lang.String name()
ClassType_c
name
in interface Named
name
in class ClassType_c
public ClassType outer()
ClassType
outer
in interface ClassType
outer
in class ClassType_c
public Package package_()
ClassType_c
package_
in interface Importable
package_
in class ClassType_c
public boolean inStaticContext()
ClassType
inStaticContext
in interface ClassType
public java.util.LinkedList<Type> isImplicitCastValidChainImpl(Type toType)
JL5ClassType
isImplicitCastValidChainImpl
in interface JL5ClassType
public boolean isSubtypeImpl(Type ancestor)
Type
ancestor
.isSubtypeImpl
in interface Type
isSubtypeImpl
in class Type_c
public boolean isCastValidImpl(Type toType)
ReferenceType_c
isCastValidImpl
in interface Type
isCastValidImpl
in class ClassType_c
public void boundOf(TypeVariable tv)
boundOf
in interface IntersectionType
public TypeVariable boundOf()
boundOf
in interface IntersectionType
public boolean equalsImpl(TypeObject other)
TypeObject_c
equalsImpl
in interface TypeObject
equalsImpl
in class TypeObject_c
TypeObject_c.equalsImpl(TypeObject)
,
Object.hashCode()
public boolean typeEqualsImpl(Type other)
Type
typeEqualsImpl
in interface Type
typeEqualsImpl
in class Type_c
other
- Type to compare topublic int hashCode()
hashCode
in class TypeObject_c
public void setFlags(Flags flags)
MemberInstance
setFlags
in interface MemberInstance
flags
- the flags to setpublic void setContainer(ReferenceType container)
MemberInstance
setContainer
in interface MemberInstance
container
- the container to setpublic Job job()
job
in class ClassType_c
public void setBounds(java.util.List<ReferenceType> newBounds)
setBounds
in interface IntersectionType
public boolean isRawClass()
JL5ClassType
isRawClass
in interface JL5ClassType
public EnumInstance enumConstantNamed(java.lang.String name)
enumConstantNamed
in interface JL5ClassType
public java.util.List<EnumInstance> enumConstants()
enumConstants
in interface JL5ClassType
public java.lang.String translateAsReceiver(Resolver resolver)
JL5ClassType
translateAsReceiver
in interface JL5ClassType
public AnnotationTypeElemInstance annotationElemNamed(java.lang.String name)
annotationElemNamed
in interface JL5ClassType
public java.util.List<AnnotationTypeElemInstance> annotationElems()
annotationElems
in interface JL5ClassType
public Annotations annotations()
JL5ClassType
annotations
in interface JL5ClassType
public java.util.Set<Type> superclasses()
JL5ClassType
superclasses
in interface JL5ClassType