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

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.ArrayBinding

public final class ArrayBinding
extends TypeBinding


Field Summary
static FieldBinding ArrayLength
           
 int dimensions
           
 TypeBinding leafComponentType
           
 
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
 
Constructor Summary
ArrayBinding(TypeBinding type, int dimensions, LookupEnvironment environment)
           
 
Method Summary
 TypeBinding closestMatch()
          In case of problems, returns the closest match found.
 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)
           
 char[] constantPoolName()
          Answer the receiver's constant pool name.
 java.lang.String debugName()
           
 int dimensions()
           
 TypeBinding elementsType()
           
 LookupEnvironment environment()
           
 TypeBinding erasure()
           
 char[] genericTypeSignature()
          Answer the receiver classfile signature.
 PackageBinding getPackage()
           
 int hashCode()
           
 boolean isCompatibleWith(TypeBinding otherType)
           
 int kind()
           
 TypeBinding leafComponentType()
           
 int problemId()
           
 char[] qualifiedSourceName()
          Answer the source name for the type.
 char[] readableName()
           
 char[] shortReadableName()
           
 char[] sourceName()
           
 void swapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType, LookupEnvironment env)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.jdt.internal.compiler.lookup.TypeBinding
canBeInstantiated, capture, enclosingType, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, isAnnotationType, isAnonymousType, isArrayType, isBaseType, isBoundParameterizedType, isCapture, isClass, isEnum, isEquivalentTo, isGenericType, isHierarchyInconsistent, isInterface, isIntersectionType, isLocalType, isMemberType, isNestedType, isNumericType, isParameterizedType, isParameterizedWithOwnVariables, isProvablyDistinct, isRawType, isReifiable, isThrowable, isTypeArgumentContainedBy, isTypeVariable, isUnboundWildcard, isUncheckedException, isWildcard, needsUncheckedConversion, original, qualifiedPackageName, signature, typeVariables, wellKnownType
 
Methods inherited from class org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, getAnnotationTagBits, initializeDeprecatedAnnotationTagBits, isValidBinding
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ArrayLength

public static final FieldBinding ArrayLength

leafComponentType

public TypeBinding leafComponentType

dimensions

public int dimensions
Constructor Detail

ArrayBinding

public ArrayBinding(TypeBinding type,
                    int dimensions,
                    LookupEnvironment environment)
Method Detail

closestMatch

public TypeBinding closestMatch()
Description copied from class: TypeBinding
In case of problems, returns the closest match found. It may not be perfect match, but the result of a best effort to improve fault-tolerance.

Overrides:
closestMatch in class TypeBinding

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)
Overrides:
computeUniqueKey in class Binding

constantPoolName

public char[] constantPoolName()
Answer the receiver's constant pool name. NOTE: This method should only be used during/after code gen. e.g. '[Ljava/lang/Object;'

Specified by:
constantPoolName in class TypeBinding

debugName

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

dimensions

public int dimensions()
Overrides:
dimensions in class TypeBinding

elementsType

public TypeBinding elementsType()

erasure

public TypeBinding erasure()
Overrides:
erasure in class TypeBinding
See Also:
TypeBinding.erasure()

environment

public LookupEnvironment environment()

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

getPackage

public PackageBinding getPackage()
Specified by:
getPackage in class TypeBinding

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isCompatibleWith

public boolean isCompatibleWith(TypeBinding otherType)
Specified by:
isCompatibleWith in class TypeBinding

kind

public int kind()
Overrides:
kind in class TypeBinding

leafComponentType

public TypeBinding leafComponentType()
Overrides:
leafComponentType in class TypeBinding

problemId

public int problemId()
Overrides:
problemId in class Binding

qualifiedSourceName

public char[] qualifiedSourceName()
Answer the source name for the type. In the case of member types, as the qualified name from its top level type. For example, for a member type N defined inside M & A: "A.M.N".

Specified by:
qualifiedSourceName in class TypeBinding

readableName

public char[] readableName()
Specified by:
readableName in class Binding

shortReadableName

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

sourceName

public char[] sourceName()
Specified by:
sourceName in class TypeBinding

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