Class CaptureBound
java.lang.Object
org.checkerframework.framework.util.typeinference8.bound.CaptureBound
A bound of the form:
G<a1, ..., an> = capture(G<A1, ..., An>). The variables a1, ..., an
represent the result of capture conversion applied to G<A1, ..., An> (where A1, ..., An
may be types or wildcards and may mention inference variables).-
Method Summary
Modifier and TypeMethodDescriptionstatic BoundSetcreateAndIncorporateCaptureConstraint(AbstractType r, AbstractType target, ExpressionTree invocation, Java8InferenceContext context) Givenr, a parameterized type,G<A1, ..., An>}, and one ofA1, ..., Anis a wildcard, then, for fresh inference variablesB1, ..., Bn, the constraint formula<G<B1, ..., Bn> -> T>is reduced and incorporated, along with the boundG<B1, ..., Bn> = capture(G<A1, ..., An>), with B2.List<? extends CaptureVariable> Return all variables on the left-hand side of this capture.Return all variables on the right-hand side of this capture.booleanisCaptureMentionsAny(Collection<Variable> variables) Returns whether this bound contains anyvariables.
-
Method Details
-
createAndIncorporateCaptureConstraint
public static BoundSet createAndIncorporateCaptureConstraint(AbstractType r, AbstractType target, ExpressionTree invocation, Java8InferenceContext context) Givenr, a parameterized type,G<A1, ..., An>}, and one ofA1, ..., Anis a wildcard, then, for fresh inference variablesB1, ..., Bn, the constraint formula<G<B1, ..., Bn> -> T>is reduced and incorporated, along with the boundG<B1, ..., Bn> = capture(G<A1, ..., An>), with B2.- Parameters:
r- a parameterized type,G<A1, ..., An>, and one ofA1, ..., Anis a wildcardtarget- target of the constraintinvocation- invocation a method or constructor invocation; used to create fresh inference variablescontext- the context- Returns:
- the result of incorporating the created capture constraint
-
getAllVariablesOnLHS
Return all variables on the left-hand side of this capture.- Returns:
- all variables on the left-hand side of this capture
-
getAllVariablesOnRHS
Return all variables on the right-hand side of this capture.- Returns:
- all variables on the right-hand side of this capture
-
isCaptureMentionsAny
Returns whether this bound contains anyvariables.- Parameters:
variables- inference variables- Returns:
- whether this bound contains any
variables
-