Package randoop.types
Class EagerReferenceBound
- java.lang.Object
-
- randoop.types.ParameterBound
-
- randoop.types.ReferenceBound
-
- randoop.types.EagerReferenceBound
-
class EagerReferenceBound extends ReferenceBound
Represents a bound on a type variable where the bound is aReferenceType
that can be used directly. Contrast withLazyReferenceBound
.
-
-
Constructor Summary
Constructors Constructor Description EagerReferenceBound(ReferenceType boundType)
Creates a bound for the given reference type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EagerReferenceBound
applyCaptureConversion()
Applies a capture conversion to any wildcard arguments in the type of this bound.List<TypeVariable>
getTypeParameters()
Returns any type parameters in the type of this bound.(package private) boolean
isLowerBound(ParameterBound bound, Substitution substitution)
Tests whether this is a lower bound on the type of a given bound with respect to a type substitution.boolean
isLowerBound(Type argType, Substitution subst)
Indicates whether this bound is a lower bound of the given argument type.boolean
isSubtypeOf(ParameterBound bound)
Indicates whether the type of this bound is a subtype of the type of the given bound.(package private) boolean
isUpperBound(ParameterBound bound, Substitution substitution)
Indicates whether this bound is an upper bound on the type of the given bound with respect to the type substitution.boolean
isUpperBound(Type argType, Substitution subst)
Determines if this bound is an upper bound for the argument type.EagerReferenceBound
substitute(Substitution substitution)
Applies the given substitution to this type bound by replacing type variables.-
Methods inherited from class randoop.types.ReferenceBound
equals, getBoundType, hasCaptureVariable, hashCode, hasWildcard, isGeneric, isObject, isVariable, toString
-
Methods inherited from class randoop.types.ParameterBound
forType, forType, forTypes, isGeneric, isTypeVariable
-
-
-
-
Constructor Detail
-
EagerReferenceBound
EagerReferenceBound(ReferenceType boundType)
Creates a bound for the given reference type.- Parameters:
boundType
- the reference boundType
-
-
Method Detail
-
substitute
public EagerReferenceBound substitute(Substitution substitution)
Description copied from class:ParameterBound
Applies the given substitution to this type bound by replacing type variables.- Specified by:
substitute
in classReferenceBound
- Parameters:
substitution
- the type substitution- Returns:
- this bound with the type after the substitution has been applied
-
applyCaptureConversion
public EagerReferenceBound applyCaptureConversion()
Description copied from class:ParameterBound
Applies a capture conversion to any wildcard arguments in the type of this bound.- Specified by:
applyCaptureConversion
in classReferenceBound
- Returns:
- this type with any wildcards replaced by capture conversion
- See Also:
ReferenceType.applyCaptureConversion()
-
getTypeParameters
public List<TypeVariable> getTypeParameters()
Description copied from class:ParameterBound
Returns any type parameters in the type of this bound.- Specified by:
getTypeParameters
in classParameterBound
- Returns:
- the list of
TypeVariable
objects in this bound
-
isLowerBound
public boolean isLowerBound(Type argType, Substitution subst)
Description copied from class:ParameterBound
Indicates whether this bound is a lower bound of the given argument type.- Specified by:
isLowerBound
in classParameterBound
- Parameters:
argType
- the concrete argument typesubst
- the substitution- Returns:
- true if this bound is a subtype of the given type
-
isLowerBound
boolean isLowerBound(ParameterBound bound, Substitution substitution)
Description copied from class:ParameterBound
Tests whether this is a lower bound on the type of a given bound with respect to a type substitution. The body is approximately:return this.substitute(substitution).isLowerBound(bound.substitute(substitution);
- Overrides:
isLowerBound
in classParameterBound
- Parameters:
bound
- the other boundsubstitution
- the type substitution- Returns:
- true iff this bound is a lower bound on the type of the given bound
-
isSubtypeOf
public boolean isSubtypeOf(ParameterBound bound)
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 classParameterBound
- Parameters:
bound
- the other bound- Returns:
- true if this type is a subtype of the other bound, false otherwise
-
isUpperBound
public boolean isUpperBound(Type argType, Substitution subst)
Description copied from class:ParameterBound
Determines if this bound is an upper bound for the argument type.- Specified by:
isUpperBound
in classParameterBound
- Parameters:
argType
- the concrete argument typesubst
- 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 classParameterBound
- Parameters:
bound
- the other boundsubstitution
- the type substitution- Returns:
- true if this bound is an upper bound on the type of the given bound, false otherwise
-
-