Package randoop.types

Class BoundsCheck


  • public class BoundsCheck
    extends Object
    Predicate to check the type of a substitution for a list of type variables.
    • Field Detail

      • typeParameters

        private final List<TypeVariable> typeParameters
        The type variables to check against.
    • Constructor Detail

      • BoundsCheck

        public BoundsCheck​(List<TypeVariable> typeParameters)
        Creates a BoundsCheck 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 types
        substitution - 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