Package randoop.types
Class ReferenceBound
- java.lang.Object
-
- randoop.types.ParameterBound
-
- randoop.types.ReferenceBound
-
- Direct Known Subclasses:
EagerReferenceBound
,LazyReferenceBound
public abstract class ReferenceBound extends ParameterBound
Represents a bound on a type variable where the bound is aReferenceType
.
-
-
Field Summary
Fields Modifier and Type Field Description private ReferenceType
boundType
The type for this bound.
-
Constructor Summary
Constructors Constructor Description ReferenceBound(ReferenceType boundType)
Creates aReferenceBound
with the given bound type.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ReferenceBound
applyCaptureConversion()
Applies a capture conversion to any wildcard arguments in the type of this bound.boolean
equals(Object obj)
ReferenceType
getBoundType()
Returns theReferenceType
bound of this type.boolean
hasCaptureVariable()
Indicates whether the type of this bound has a capture variable.int
hashCode()
(package private) boolean
hasWildcard()
Indicates whether the type of this bound has a wildcard type argument.boolean
isGeneric(boolean ignoreWildcards)
Indicates whether the type of this bound is generic.boolean
isObject()
Indicate whether this bound isObject
.boolean
isVariable()
Indicates whether this bound is a type variable.abstract ReferenceBound
substitute(Substitution substitution)
Applies the given substitution to this type bound by replacing type variables.String
toString()
-
Methods inherited from class randoop.types.ParameterBound
forType, forType, forTypes, getTypeParameters, isGeneric, isLowerBound, isLowerBound, isSubtypeOf, isTypeVariable, isUpperBound, isUpperBound
-
-
-
-
Field Detail
-
boundType
private final ReferenceType boundType
The type for this bound.
-
-
Constructor Detail
-
ReferenceBound
ReferenceBound(ReferenceType boundType)
Creates aReferenceBound
with the given bound type.- Parameters:
boundType
- theReferenceType
of this bound
-
-
Method Detail
-
getBoundType
public ReferenceType getBoundType()
Returns theReferenceType
bound of this type.- Returns:
- the type for this bound
-
substitute
public abstract 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 classParameterBound
- Parameters:
substitution
- the type substitution- Returns:
- this bound with the type after the substitution has been applied
-
applyCaptureConversion
public abstract ReferenceBound applyCaptureConversion()
Description copied from class:ParameterBound
Applies a capture conversion to any wildcard arguments in the type of this bound.- Specified by:
applyCaptureConversion
in classParameterBound
- Returns:
- this type with any wildcards replaced by capture conversion
- See Also:
ReferenceType.applyCaptureConversion()
-
hasWildcard
boolean hasWildcard()
Description copied from class:ParameterBound
Indicates whether the type of this bound has a wildcard type argument.- Specified by:
hasWildcard
in classParameterBound
- Returns:
- true, if this bound has a wildcard argument, and false otherwise
-
hasCaptureVariable
public boolean hasCaptureVariable()
Description copied from class:ParameterBound
Indicates whether the type of this bound has a capture variable.- Specified by:
hasCaptureVariable
in classParameterBound
- Returns:
- true iff this bound has a capture variable
-
isGeneric
public boolean isGeneric(boolean ignoreWildcards)
Description copied from class:ParameterBound
Indicates whether the type of this bound is generic.- Specified by:
isGeneric
in classParameterBound
- Parameters:
ignoreWildcards
- if true, ignore wildcards; that is, treat wildcards as not making the operation generic- Returns:
- true, if this bound type is generic, and false otherwise
-
isObject
public boolean isObject()
Description copied from class:ParameterBound
Indicate whether this bound isObject
.- Specified by:
isObject
in classParameterBound
- Returns:
- true if this bound is
Object
, false otherwise
-
isVariable
public boolean isVariable()
Description copied from class:ParameterBound
Indicates whether this bound is a type variable.- Overrides:
isVariable
in classParameterBound
- Returns:
- true if this bound is a type variable, false otherwise
-
-