org.eclipse.jdt.internal.compiler.lookup
Class WildcardBinding

java.lang.Object
  extended by org.eclipse.jdt.internal.compiler.lookup.Binding
      extended by org.eclipse.jdt.internal.compiler.lookup.TypeBinding
          extended by org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
              extended by org.eclipse.jdt.internal.compiler.lookup.WildcardBinding
All Implemented Interfaces:
IDependent

public class WildcardBinding
extends ReferenceBinding


Field Summary
 TypeBinding bound
           
 int boundKind
           
 TypeBinding[] otherBounds
           
 
Fields inherited from class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
compoundName, fPackage, LUB_GENERIC, modifiers, sourceName
 
Fields inherited from class org.eclipse.jdt.internal.compiler.lookup.TypeBinding
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, id, INT, LONG, NULL, SHORT, tagBits, VOID
 
Fields inherited from class org.eclipse.jdt.internal.compiler.lookup.Binding
ANY_EXCEPTION, ARRAY_TYPE, BASE_TYPE, FIELD, GENERIC_TYPE, IMPORT, INTERSECTION_TYPE, LOCAL, METHOD, NO_ANNOTATIONS, NO_ELEMENT_VALUE_PAIRS, NO_EXCEPTIONS, NO_FIELDS, NO_MEMBER_TYPES, NO_METHODS, NO_PARAMETERS, NO_SUPERINTERFACES, NO_TYPE_VARIABLES, NO_TYPES, PACKAGE, PARAMETERIZED_TYPE, RAW_TYPE, TYPE, TYPE_PARAMETER, UNINITIALIZED_FIELDS, UNINITIALIZED_METHODS, VARIABLE, WILDCARD_TYPE
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.env.IDependent
JAR_FILE_ENTRY_SEPARATOR
 
Constructor Summary
WildcardBinding(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind, LookupEnvironment environment)
          When unbound, the bound denotes the corresponding type variable (so as to retrieve its bound lazily)
 
Method Summary
 boolean boundCheck(TypeBinding argumentType)
          Returns true if the argument type satisfies the wildcard bound(s)
 boolean canBeInstantiated()
          Answer true if the receiver can be instantiated
 java.util.List collectMissingTypes(java.util.List missingTypes)
          Iterate through the type components to collect instances of leaf missing types
 void collectSubstitutes(Scope scope, TypeBinding actualType, InferenceContext inferenceContext, int constraint)
          Collect the substitutes into a map for certain type variables inside the receiver type e.g.
 char[] computeUniqueKey(boolean isLeaf)
          p.X {} -> Lp/X;
 char[] constantPoolName()
          Answer the receiver's constant pool name.
 java.lang.String debugName()
           
 TypeBinding erasure()
           
 char[] genericTypeSignature()
          Answer the receiver classfile signature.
 int hashCode()
           
 boolean isIntersectionType()
          Returns true if the current type denotes an intersection type: Number & Comparable
 boolean isSuperclassOf(ReferenceBinding otherType)
          Answer true if the receiver is in the superclass hierarchy of aType NOTE: Object.isSuperclassOf(Object) -> false
 boolean isUnboundWildcard()
          Returns true if the type is a wildcard
 boolean isWildcard()
          Returns true if the type is a wildcard
 int kind()
           
 char[] readableName()
          Answer the receiver's signature.
 char[] shortReadableName()
           
 char[] signature()
          Answer the receiver classfile signature.
 char[] sourceName()
           
 ReferenceBinding superclass()
           
 ReferenceBinding[] superInterfaces()
           
 void swapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType, LookupEnvironment env)
           
 java.lang.String toString()
           
 TypeVariableBinding typeVariable()
          Returns associated type variable, or null in case of inconsistency
 
Methods inherited from class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
availableFields, availableMethods, binarySearch, binarySearch, canBeSeenBy, canBeSeenBy, canBeSeenBy, computeGenericTypeSignature, computeId, depth, detectAnnotationCycle, enclosingTypeAt, enumConstantCount, fieldCount, fields, getAccessFlags, getAnnotations, getAnnotationTagBits, getExactConstructor, getExactMethod, getField, getFileName, getMemberType, getMethods, getPackage, getTypeVariable, hasIncompatibleSuperType, hasMemberTypes, hasRestrictedAccess, implementsInterface, isAbstract, isAnnotationType, isBinaryBinding, isClass, isCompatibleWith, isDefault, isDeprecated, isEnum, isFinal, isHierarchyBeingConnected, isInterface, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isThrowable, isUncheckedException, isUsed, isViewedAsDeprecated, memberTypes, methods, outermostEnclosingType, qualifiedSourceName, retrieveAnnotationHolder, setAnnotations, sortFields, sortMethods, syntheticEnclosingInstanceTypes, syntheticOuterLocalVariables
 
Methods inherited from class org.eclipse.jdt.internal.compiler.lookup.TypeBinding
capture, closestMatch, dimensions, enclosingType, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, isAnonymousType, isArrayType, isBaseType, isBoundParameterizedType, isCapture, isEquivalentTo, isGenericType, isHierarchyInconsistent, isLocalType, isMemberType, isNestedType, isNumericType, isParameterizedType, isParameterizedWithOwnVariables, isProvablyDistinct, isRawType, isReifiable, isTypeArgumentContainedBy, isTypeVariable, leafComponentType, needsUncheckedConversion, original, qualifiedPackageName, typeVariables, wellKnownType
 
Methods inherited from class org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isValidBinding, problemId
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

bound

public TypeBinding bound

otherBounds

public TypeBinding[] otherBounds

boundKind

public int boundKind
Constructor Detail

WildcardBinding

public WildcardBinding(ReferenceBinding genericType,
                       int rank,
                       TypeBinding bound,
                       TypeBinding[] otherBounds,
                       int boundKind,
                       LookupEnvironment environment)
When unbound, the bound denotes the corresponding type variable (so as to retrieve its bound lazily)

Method Detail

kind

public int kind()
Overrides:
kind in class TypeBinding

boundCheck

public boolean boundCheck(TypeBinding argumentType)
Returns true if the argument type satisfies the wildcard bound(s)


canBeInstantiated

public boolean canBeInstantiated()
Description copied from class: ReferenceBinding
Answer true if the receiver can be instantiated

Overrides:
canBeInstantiated in class ReferenceBinding
See Also:
ReferenceBinding.canBeInstantiated()

collectMissingTypes

public java.util.List collectMissingTypes(java.util.List missingTypes)
Description copied from class: TypeBinding
Iterate through the type components to collect instances of leaf missing types

Overrides:
collectMissingTypes in class TypeBinding
Returns:
missing types
See Also:
TypeBinding.collectMissingTypes(java.util.List)

collectSubstitutes

public void collectSubstitutes(Scope scope,
                               TypeBinding actualType,
                               InferenceContext inferenceContext,
                               int constraint)
Collect the substitutes into a map for certain type variables inside the receiver type e.g. Collection.collectSubstitutes(Collection>, Map), will populate Map with: T --> List Constraints: A << F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_EXTENDS (1)) A = F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_EQUAL (0)) A >> F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_SUPER (2))

Overrides:
collectSubstitutes in class TypeBinding

computeUniqueKey

public char[] computeUniqueKey(boolean isLeaf)
Description copied from class: ReferenceBinding
p.X {} -> Lp/X;

Overrides:
computeUniqueKey in class ReferenceBinding

constantPoolName

public char[] constantPoolName()
Description copied from class: ReferenceBinding
Answer the receiver's constant pool name. NOTE: This method should only be used during/after code gen.

Overrides:
constantPoolName in class ReferenceBinding
See Also:
TypeBinding.constantPoolName()

debugName

public java.lang.String debugName()
Overrides:
debugName in class ReferenceBinding
See Also:
TypeBinding.debugName()

erasure

public TypeBinding erasure()
Overrides:
erasure in class TypeBinding

genericTypeSignature

public char[] genericTypeSignature()
Description copied from class: TypeBinding
Answer the receiver classfile signature. Arrays & base types do not distinguish between signature() & constantPoolName(). NOTE: This method should only be used during/after code gen.

Overrides:
genericTypeSignature in class TypeBinding

hashCode

public int hashCode()
Overrides:
hashCode in class ReferenceBinding

isSuperclassOf

public boolean isSuperclassOf(ReferenceBinding otherType)
Description copied from class: ReferenceBinding
Answer true if the receiver is in the superclass hierarchy of aType NOTE: Object.isSuperclassOf(Object) -> false

Overrides:
isSuperclassOf in class ReferenceBinding
See Also:
ReferenceBinding.isSuperclassOf(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding)

isIntersectionType

public boolean isIntersectionType()
Returns true if the current type denotes an intersection type: Number & Comparable

Overrides:
isIntersectionType in class TypeBinding

isUnboundWildcard

public boolean isUnboundWildcard()
Returns true if the type is a wildcard

Overrides:
isUnboundWildcard in class TypeBinding

isWildcard

public boolean isWildcard()
Returns true if the type is a wildcard

Overrides:
isWildcard in class TypeBinding

readableName

public char[] readableName()
Description copied from class: ReferenceBinding
Answer the receiver's signature. NOTE: This method should only be used during/after code gen.

Overrides:
readableName in class ReferenceBinding

shortReadableName

public char[] shortReadableName()
Overrides:
shortReadableName in class ReferenceBinding

signature

public char[] signature()
Description copied from class: TypeBinding
Answer the receiver classfile signature. Arrays & base types do not distinguish between signature() & constantPoolName(). NOTE: This method should only be used during/after code gen.

Overrides:
signature in class ReferenceBinding
See Also:
TypeBinding.signature()

sourceName

public char[] sourceName()
Overrides:
sourceName in class ReferenceBinding

superclass

public ReferenceBinding superclass()
Overrides:
superclass in class ReferenceBinding

superInterfaces

public ReferenceBinding[] superInterfaces()
Overrides:
superInterfaces in class ReferenceBinding

swapUnresolved

public void swapUnresolved(UnresolvedReferenceBinding unresolvedType,
                           ReferenceBinding resolvedType,
                           LookupEnvironment env)
Overrides:
swapUnresolved in class TypeBinding

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

typeVariable

public TypeVariableBinding typeVariable()
Returns associated type variable, or null in case of inconsistency