Klasse TypeVariableBinding

Bekannte direkte Unterklassen:
CaptureBinding, InferenceVariable

public class TypeVariableBinding extends ReferenceBinding
Binding for a type parameter, held by source/binary type or method.
  • Felddetails

    • declaringElement

      public Binding declaringElement
    • rank

      public int rank
    • firstBound

      public TypeBinding firstBound
      Denote the first explicit (binding) bound amongst the supertypes (from declaration in source) If no superclass was specified, then it denotes the first superinterface, or null if none was specified.
    • superclass

      public ReferenceBinding superclass
    • superInterfaces

      public ReferenceBinding[] superInterfaces
    • genericTypeSignature

      public char[] genericTypeSignature
  • Konstruktordetails

    • TypeVariableBinding

      public TypeVariableBinding(char[] sourceName, Binding declaringElement, int rank, LookupEnvironment environment)
    • TypeVariableBinding

      protected TypeVariableBinding(char[] sourceName, LookupEnvironment environment)
    • TypeVariableBinding

      public TypeVariableBinding(TypeVariableBinding prototype)
  • Methodendetails

    • boundCheck

      public TypeConstants.BoundCheckStatus boundCheck(Substitution substitution, TypeBinding argumentType, Scope scope, ASTNode location)
      Returns true if the argument type satisfies all bounds of the type parameter
      Parameter:
      location - if non-null this may be used for reporting errors relating to null type annotations (if enabled)
    • boundsCount

      public int boundsCount()
    • canBeInstantiated

      public boolean canBeInstantiated()
      Beschreibung aus Klasse kopiert: ReferenceBinding
      Answer true if the receiver can be instantiated
      Setzt außer Kraft:
      canBeInstantiated in Klasse ReferenceBinding
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#canBeInstantiated()
    • 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(CollectionUngültige Eingabe: "<"List>, Map), will populate Map with: T --> List Constraints: A Ungültige Eingabe: "<"Ungültige Eingabe: "<" 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))
      Setzt außer Kraft:
      collectSubstitutes in Klasse TypeBinding
    • computeUniqueKey

      public char[] computeUniqueKey(boolean isLeaf)
      Beschreibung aus Klasse kopiert: ReferenceBinding
      p.XUngültige Eingabe: "<"T extends Y Ungültige Eingabe: "&" I, U extends Y> {} -> Lp/XUngültige Eingabe: "<"TT;TU;>;
      Setzt außer Kraft:
      computeUniqueKey in Klasse ReferenceBinding
    • constantPoolName

      public char[] constantPoolName()
      Beschreibung aus Klasse kopiert: ReferenceBinding
      Answer the receiver's constant pool name. NOTE: This method should only be used during/after code gen.
      Setzt außer Kraft:
      constantPoolName in Klasse ReferenceBinding
    • clone

      public TypeBinding clone(TypeBinding enclosingType)
      Beschreibung aus Klasse kopiert: TypeBinding
      Virtual copy constructor: a copy is made of the receiver's entire instance state and then suitably parameterized by the arguments to the clone operation as seen fit by each type. Parameters may not make sense for every type in the hierarchy, in which case they are silently ignored. A type may choose to retain a copy of the prototype for reference.
      Setzt außer Kraft:
      clone in Klasse TypeBinding
    • annotatedDebugName

      public String annotatedDebugName()
      Setzt außer Kraft:
      annotatedDebugName in Klasse TypeBinding
    • debugName

      public String debugName()
      Setzt außer Kraft:
      debugName in Klasse ReferenceBinding
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.internal.compiler.lookup.TypeBinding#debugName()
    • erasure

      public TypeBinding erasure()
      Setzt außer Kraft:
      erasure in Klasse TypeBinding
    • genericSignature

      public char[] genericSignature()
      T::Ljava/util/Map;:Ljava/io/Serializable; T:LYUngültige Eingabe: "<"TT;>
    • genericTypeSignature

      public char[] genericTypeSignature()
      T::Ljava/util/Map;:Ljava/io/Serializable; T:LYUngültige Eingabe: "<"TT;>
      Setzt außer Kraft:
      genericTypeSignature in Klasse TypeBinding
    • hasTypeBit

      public boolean hasTypeBit(int bit)
      Beschreibung aus Klasse kopiert: TypeBinding
      Answer an additional bit characterizing this type, like TypeIds.BitAutoCloseable.
      Setzt außer Kraft:
      hasTypeBit in Klasse TypeBinding
    • isErasureBoundTo

      public boolean isErasureBoundTo(TypeBinding type)
      Returns true if the type variable is directly bound to a given type
    • isHierarchyConnected

      public boolean isHierarchyConnected()
      Beschreibung aus Klasse kopiert: ReferenceBinding
      Returns true if the type hierarchy is connected
      Setzt außer Kraft:
      isHierarchyConnected in Klasse ReferenceBinding
    • isInterchangeableWith

      public boolean isInterchangeableWith(TypeVariableBinding otherVariable, Substitution substitute)
      Returns true if the 2 variables are playing exact same role: they have the same bounds, providing one is substituted with the other: Ungültige Eingabe: "<"T1 extends List> is interchangeable with Ungültige Eingabe: "<"T2 extends List>.
    • isSubtypeOf

      public boolean isSubtypeOf(TypeBinding other, boolean simulatingBugJDK8026527)
      Setzt außer Kraft:
      isSubtypeOf in Klasse ReferenceBinding
    • enterRecursiveFunction

      public boolean enterRecursiveFunction()
      Beschreibung aus Klasse kopiert: TypeBinding
      Call this before descending into type details to prevent infinite recursion.
      Setzt außer Kraft:
      enterRecursiveFunction in Klasse TypeBinding
      Gibt zurück:
      true if a recursion was not already started.
    • exitRecursiveFunction

      public void exitRecursiveFunction()
      Beschreibung aus Klasse kopiert: TypeBinding
      Exit the context of a potentially recursive function.
      Setzt außer Kraft:
      exitRecursiveFunction in Klasse TypeBinding
    • enterRecursiveProjectionFunction

      public boolean enterRecursiveProjectionFunction()
    • exitRecursiveProjectionFunction

      public void exitRecursiveProjectionFunction()
    • isProperType

      public boolean isProperType(boolean admitCapture18)
      Beschreibung aus Klasse kopiert: TypeBinding
      JLS8 Sect 18.1.1
      Setzt außer Kraft:
      isProperType in Klasse ReferenceBinding
      Parameter:
      admitCapture18 - request if CaptureBinding18 shuld be considered as a proper type. If unsure say 'true', only in Scope.greaterLowerBound(TypeBinding[], Scope, LookupEnvironment) CaptureBinding18 has to be excluded to prevent an NPE on a branch that heuristically tries to avoid inconsistent intersections.
    • isTypeVariable

      public boolean isTypeVariable()
      Returns true if the type was declared as a type variable
      Setzt außer Kraft:
      isTypeVariable in Klasse TypeBinding
    • kind

      public int kind()
      Setzt außer Kraft:
      kind in Klasse TypeBinding
    • mentionsAny

      public boolean mentionsAny(TypeBinding[] parameters, int idx)
      Beschreibung aus Klasse kopiert: TypeBinding
      Does this type mention any of the given type parameters, except the one at position 'idx'?
      Setzt außer Kraft:
      mentionsAny in Klasse TypeBinding
    • otherUpperBounds

      public TypeBinding[] otherUpperBounds()
    • readableName

      public char[] readableName()
      Beschreibung aus Klasse kopiert: ReferenceBinding
      Answer the receiver's signature. NOTE: This method should only be used during/after code gen.
      Setzt außer Kraft:
      readableName in Klasse ReferenceBinding
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#readableName()
    • setTypeAnnotations

      public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations)
      Setzt außer Kraft:
      setTypeAnnotations in Klasse TypeBinding
    • shortReadableName

      public char[] shortReadableName()
      Setzt außer Kraft:
      shortReadableName in Klasse ReferenceBinding
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#shortReadableName()
    • superclass

      public ReferenceBinding superclass()
      Setzt außer Kraft:
      superclass in Klasse ReferenceBinding
    • superInterfaces

      public ReferenceBinding[] superInterfaces()
      Setzt außer Kraft:
      superInterfaces in Klasse ReferenceBinding
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
      Siehe auch:
    • nullAnnotatedReadableName

      public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNames)
      Beschreibung aus Klasse kopiert: TypeBinding
      Answer a readable name (for error reporting) that includes nullness type annotations.
      Setzt außer Kraft:
      nullAnnotatedReadableName in Klasse ReferenceBinding
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.internal.compiler.lookup.TypeBinding#nullAnnotatedReadableName(CompilerOptions,boolean)
    • appendNullAnnotation

      protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options)
      Setzt außer Kraft:
      appendNullAnnotation in Klasse ReferenceBinding
    • unannotated

      public TypeBinding unannotated()
      Beschreibung aus Klasse kopiert: TypeBinding
      Return this type minus its type annotations
      Setzt außer Kraft:
      unannotated in Klasse TypeBinding
    • withoutToplevelNullAnnotation

      public TypeBinding withoutToplevelNullAnnotation()
      Beschreibung aus Klasse kopiert: TypeBinding
      Return this type minus its toplevel null annotations. Any annotations on type arguments or bounds are retained.
      Setzt außer Kraft:
      withoutToplevelNullAnnotation in Klasse TypeBinding
    • upperBound

      public TypeBinding upperBound()
      Upper bound doesn't perform erasure
    • allUpperBounds

      public TypeBinding[] allUpperBounds()
    • evaluateNullAnnotations

      public void evaluateNullAnnotations(Scope scope, TypeParameter parameter)
    • setFirstBound

      public TypeBinding setFirstBound(TypeBinding firstBound)
    • setSuperClass

      public ReferenceBinding setSuperClass(ReferenceBinding superclass)
    • setSuperInterfaces

      public ReferenceBinding[] setSuperInterfaces(ReferenceBinding[] superInterfaces)
    • getDerivedTypesForDeferredInitialization

      protected TypeBinding[] getDerivedTypesForDeferredInitialization()
    • combineTypeAnnotations

      public TypeBinding combineTypeAnnotations(TypeBinding substitute)
    • acceptsNonNullDefault

      public boolean acceptsNonNullDefault()
      Beschreibung aus Klasse kopiert: TypeBinding
      Used to implement this sentence from o.e.j.annotation.DefaultLocation: "Wildcards and the use of type variables are always excluded from NonNullByDefault."
      Setzt außer Kraft:
      acceptsNonNullDefault in Klasse ReferenceBinding
    • updateTagBits

      public long updateTagBits()
      Beschreibung aus Klasse kopiert: TypeBinding
      Refresh some tagBits from details into the main type. Currently handled: TagBits.HasNullTypeAnnotation
      Setzt außer Kraft:
      updateTagBits in Klasse TypeBinding
    • isFreeTypeVariable

      public boolean isFreeTypeVariable()
      Setzt außer Kraft:
      isFreeTypeVariable in Klasse TypeBinding
    • upwardsProjection

      public ReferenceBinding upwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables)
      Beschreibung aus Klasse kopiert: ReferenceBinding
      Perform an upwards type projection as per JLS 4.10.5
      Setzt außer Kraft:
      upwardsProjection in Klasse ReferenceBinding
      Parameter:
      scope - Relevant scope for evaluating type projection
      mentionedTypeVariables - Filter for mentioned type variabled
    • downwardsProjection

      public ReferenceBinding downwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables)
      Beschreibung aus Klasse kopiert: ReferenceBinding
      Perform a downwards type projection as per JLS 4.10.5
      Setzt außer Kraft:
      downwardsProjection in Klasse ReferenceBinding
      Parameter:
      scope - Relevant scope for evaluating type projection
      mentionedTypeVariables - Filter for mentioned type variabled