Class CaptureBound
java.lang.Object
de.monticore.types3.generics.bounds.Bound
de.monticore.types3.generics.bounds.CaptureBound
- All Implemented Interfaces:
Comparable<Bound>
A bound representing that a given type will be capture converted later.
This is required, as one cannot capture convert types
that have inference variables.
The only SymType-kinds applicable are generics and functions,
as their symbols can have type parameters.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SymTypeExpressionbooleandeepEquals(Bound other) protected SymTypeExpressions.Helper function;returns the inference variables created for this bound, e.g., for boundG<a1,a2> = capture(G<A1,A2>), this will return [a1,a2].returns the declared bounds with the type parameters replaced by the inference variables, e.g., for boundG<a1,a2> = capture(G<A1,A2>)with G declared with type parameters [P1,P2] and corresponding (upper) bounds [B1,B2], this will return [B1,B2][P1:=a1,P2:=a2].returns the type arguments to be captured for this bound, e.g., for boundG<a1,a2> = capture(G<A1,A2>), this will return[A1,A2].protected List<SymTypeExpression> returns the mapping from type parameters to inference variables e.g., for boundG<a1,a2> = capture(G<A1,A2>)with G declared with type parameters [P1,P2], this will return [P1:=a1,P2:=a2].returns the type parameters of the declared type e.g., for boundG<a1,a2> = capture(G<A1,A2>)with G declared with type parameters [P1,P2], this will return [P1,P2].booleanprint()returns a human-readable String, e.g., for the logMethods inherited from class de.monticore.types3.generics.bounds.Bound
asSubTypingBound, asTypeCompatibilityBound, asTypeEqualityBound, asUnsatisfiableBound, compareTo, isSubTypingBound, isTypeCompatibilityBound, isTypeEqualityBound, isUnsatisfiableBound
-
Field Details
-
placeHolder
-
toBeCaptured
-
-
Constructor Details
-
CaptureBound
-
-
Method Details
-
getPlaceHolder
-
getToBeCaptured
-
isCaptureBound
public boolean isCaptureBound()- Overrides:
isCaptureBoundin classBound
-
asCaptureBound
- Overrides:
asCaptureBoundin classBound
-
deepEquals
- Specified by:
deepEqualsin classBound
-
print
Description copied from class:Boundreturns a human-readable String, e.g., for the log -
getIncludedTypes
Description copied from class:BoundHelper function;- Specified by:
getIncludedTypesin classBound- Returns:
- the types included in the bounds (most have two).
-
getInferenceVariables
returns the inference variables created for this bound, e.g., for boundG<a1,a2> = capture(G<A1,A2>), this will return [a1,a2]. s. Java Spec 21 5.1.10. They include the implied bounds according to Java Spec 21 18.1.3. -
getTypeArguments
returns the type arguments to be captured for this bound, e.g., for boundG<a1,a2> = capture(G<A1,A2>), this will return[A1,A2]. -
getTypeParameters
returns the type parameters of the declared type e.g., for boundG<a1,a2> = capture(G<A1,A2>)with G declared with type parameters [P1,P2], this will return [P1,P2]. -
getModifiedDeclaredBounds
returns the declared bounds with the type parameters replaced by the inference variables, e.g., for boundG<a1,a2> = capture(G<A1,A2>)with G declared with type parameters [P1,P2] and corresponding (upper) bounds [B1,B2], this will return [B1,B2][P1:=a1,P2:=a2]. S. Java Spec 21 18.3.2 -
getTypeParameter2InferenceVarMap
returns the mapping from type parameters to inference variables e.g., for boundG<a1,a2> = capture(G<A1,A2>)with G declared with type parameters [P1,P2], this will return [P1:=a1,P2:=a2]. S. Java Spec 21 18.3.2 -
getImpliedBounds
s. Java Spec 21 18.3.2 returns the bounds implied by the type arguments that are not wildcards. -
calculatePlaceHolder
-
getTypeArguments
-
getDeclaredType
-