Package randoop.types
Class BoundsCheck
- java.lang.Object
-
- randoop.types.BoundsCheck
-
public class BoundsCheck extends Object
Predicate to check the type of a substitution for a list of type variables.
-
-
Field Summary
Fields Modifier and Type Field Description private List<TypeVariable>
typeParameters
The type variables to check against.
-
Constructor Summary
Constructors Constructor Description BoundsCheck(List<TypeVariable> typeParameters)
Creates aBoundsCheck
predicate for a given list of type parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
test(List<ReferenceType> tuple, Substitution substitution)
Checks if each type argument is within the bounds of the corresponding type parameter, after both arguments and parameters have been substituted.
-
-
-
Field Detail
-
typeParameters
private final List<TypeVariable> typeParameters
The type variables to check against.
-
-
Constructor Detail
-
BoundsCheck
public BoundsCheck(List<TypeVariable> typeParameters)
Creates aBoundsCheck
predicate for a given list of type parameters.- Parameters:
typeParameters
- the list of type parameters to be checked by the predicate
-
-
Method Detail
-
test
public boolean test(List<ReferenceType> tuple, Substitution substitution)
Checks if each type argument is within the bounds of the corresponding type parameter, after both arguments and parameters have been substituted.Requires that the list of types be the same length as the parameters. Generally, the substitution is constructed from the tuple instantiating the type parameters of this object, but all that is required is that it instantiate any generic bounds of the type parameters.
- Parameters:
tuple
- the list of instantiating typessubstitution
- substitution for checking bounds- Returns:
- true if each argument's instantiation is within the bounds of the corresponding type parameter, after both have been substituted
-
-