Package randoop.types

Class LazyReferenceBound

    • Constructor Detail

      • LazyReferenceBound

        LazyReferenceBound​(ReferenceType boundType)
    • Method Detail

      • hashCode

        public int hashCode()

        LazyReferenceBound can be part of a recursive type, and so the hash code is based on the string representation of the bound to avoid recursive calls on hashCode().

        Overrides:
        hashCode in class ReferenceBound
        Returns:
        the hashCode for the string representation of this bound
      • substitute

        public ReferenceBound substitute​(Substitution substitution)
        Description copied from class: ParameterBound
        Applies the given substitution to this type bound by replacing type variables.
        Specified by:
        substitute in class ReferenceBound
        Parameters:
        substitution - the type substitution
        Returns:
        this bound with the type after the substitution has been applied
      • isLowerBound

        public boolean isLowerBound​(Type argType,
                                    Substitution substitution)
        Description copied from class: ParameterBound
        Indicates whether this bound is a lower bound of the given argument type.
        Specified by:
        isLowerBound in class ParameterBound
        Parameters:
        argType - the concrete argument type
        substitution - the substitution
        Returns:
        true if this bound is a subtype of the given type
      • isSubtypeOf

        public boolean isSubtypeOf​(ParameterBound boundType)
        Description copied from class: ParameterBound
        Indicates whether the type of this bound is a subtype of the type of the given bound.
        Specified by:
        isSubtypeOf in class ParameterBound
        Parameters:
        boundType - the other bound
        Returns:
        true if this type is a subtype of the other bound, false otherwise
      • isUpperBound

        public boolean isUpperBound​(Type argType,
                                    Substitution substitution)
        Description copied from class: ParameterBound
        Determines if this bound is an upper bound for the argument type.
        Specified by:
        isUpperBound in class ParameterBound
        Parameters:
        argType - the concrete argument type
        substitution - the substitution
        Returns:
        true if this bound is satisfied by the concrete type when the substitution is used on the bound, false otherwise
      • isUpperBound

        boolean isUpperBound​(ParameterBound bound,
                             Substitution substitution)
        Description copied from class: ParameterBound
        Indicates whether this bound is an upper bound on the type of the given bound with respect to the type substitution.
        Specified by:
        isUpperBound in class ParameterBound
        Parameters:
        bound - the other bound
        substitution - the type substitution
        Returns:
        true if this bound is an upper bound on the type of the given bound, false otherwise