class IntersectionTypeBound extends ParameterBound
Java requires that an intersection type bound consist of class and interface types, with at most one class, and if there is a class it appears in the conjunction term first. This class preserves the order of the types. In a capture conversion, if both types are classes, one must be a subclass of the other.
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<ParameterBound> |
boundList
The list of type bounds for the intersection bound.
|
| Constructor and Description |
|---|
IntersectionTypeBound(java.util.List<ParameterBound> boundList)
Create an intersection type bound from the list of type bounds.
|
| Modifier and Type | Method and Description |
|---|---|
ParameterBound |
applyCaptureConversion()
Applies a capture conversion to any wildcard arguments in the type of this bound.
|
boolean |
equals(@Nullable java.lang.Object obj) |
java.util.List<TypeVariable> |
getTypeParameters()
Returns any type parameters in the type of this bound.
|
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 |
isLowerBound(Type otherType,
Substitution subst)
Indicates whether this bound is a lower bound of the given argument type.
|
boolean |
isObject()
Indicate whether this bound is
Object. |
boolean |
isSubtypeOf(ParameterBound boundType)
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.
|
IntersectionTypeBound |
substitute(Substitution substitution)
Applies the given substitution to this type bound by replacing type variables.
|
java.lang.String |
toString() |
forType, forType, forTypes, isGeneric, isLowerBound, isTypeVariable, isVariableprivate java.util.List<ParameterBound> boundList
IntersectionTypeBound(java.util.List<ParameterBound> boundList)
boundList - the list of type boundspublic boolean equals(@Nullable java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic IntersectionTypeBound substitute(Substitution substitution)
substitute in class ParameterBoundsubstitution - the type substitutionpublic ParameterBound applyCaptureConversion()
applyCaptureConversion in class ParameterBoundReferenceType.applyCaptureConversion()public java.util.List<TypeVariable> getTypeParameters()
getTypeParameters in class ParameterBoundboolean hasWildcard()
ParameterBoundhasWildcard in class ParameterBoundpublic boolean hasCaptureVariable()
ParameterBoundhasCaptureVariable in class ParameterBoundpublic boolean isGeneric(boolean ignoreWildcards)
ParameterBoundisGeneric in class ParameterBoundignoreWildcards - if true, ignore wildcards; that is, treat wildcards as not making the
operation genericpublic boolean isLowerBound(Type otherType, Substitution subst)
Specifically, this method checks that the argument type is a subtype of all of the member bounds of this object.
isLowerBound in class ParameterBoundotherType - the concrete argument typesubst - the substitutionpublic boolean isObject()
Object.
Determines whether all types in this bound are Object.
isObject in class ParameterBoundObject, false otherwisepublic boolean isSubtypeOf(ParameterBound boundType)
This method should never be tested for IntersectionTypeBound. Will fail if
assertions are enabled.
isSubtypeOf in class ParameterBoundboundType - the other boundpublic boolean isUpperBound(Type argType, Substitution subst)
isUpperBound in class ParameterBoundargType - the concrete argument typesubst - the substitutionboolean isUpperBound(ParameterBound bound, Substitution substitution)
isUpperBound in class ParameterBoundbound - the other boundsubstitution - the type substitution