public abstract class CFAbstractValue<V extends CFAbstractValue<V>> extends Object implements AbstractValue<V>
Modifier and Type | Field and Description |
---|---|
protected CFAbstractAnalysis<V,?,?> |
analysis
The analysis class this store belongs to.
|
protected AnnotatedTypeMirror |
type
The type (with annotations) corresponding to this abstract value.
|
protected TypeHierarchy |
typeHierarchy |
Constructor and Description |
---|
CFAbstractValue(CFAbstractAnalysis<V,?,?> analysis,
AnnotatedTypeMirror type) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
AnnotatedTypeMirror |
getType() |
int |
hashCode() |
boolean |
isSubtypeOf(CFAbstractValue<V> other)
Returns whether this value is a subtype of the argument
other . |
V |
leastUpperBound(V other)
Compute the least upper bound of two stores.
|
V |
mostSpecific(V other,
V backup)
Returns the more specific version of two values
this and
other . |
static boolean |
mostSpecificTypeVariable(AnnotatedTypeFactory typeFactory,
AnnotatedTypeMirror type1,
AnnotatedTypeMirror type2,
AnnotatedTypeMirror backup,
AnnotatedTypeMirror.AnnotatedTypeVariable result)
Refines the result annotated type variable with the most specific of type1 and type2.
|
String |
toString() |
protected final CFAbstractAnalysis<V extends CFAbstractValue<V>,?,?> analysis
protected final TypeHierarchy typeHierarchy
protected final AnnotatedTypeMirror type
public CFAbstractValue(CFAbstractAnalysis<V,?,?> analysis, AnnotatedTypeMirror type)
@Pure public AnnotatedTypeMirror getType()
public V leastUpperBound(V other)
AbstractValue
Important: This method must fulfill the following contract:
this
.other
.this
, even if
the signature is more permissive.leastUpperBound
in interface AbstractValue<V extends CFAbstractValue<V>>
public boolean isSubtypeOf(CFAbstractValue<V> other)
other
.
The annotations are compared per hierarchy, and missing annotations are
treated as 'top'.public V mostSpecific(V other, V backup)
this
and
other
. If they do not contain information for all hierarchies,
then it is possible that information from both this
and
other
are taken.
If neither of the two is more specific for one of the hierarchies (i.e.,
if the two are incomparable as determined by
TypeHierarchy.isSubtype(AnnotatedTypeMirror, AnnotatedTypeMirror)
, then the respective value from backup
is used.
TODO: The code in this method is rather similar to
leastUpperBound(CFAbstractValue)
. Can code be reused?
public static boolean mostSpecificTypeVariable(AnnotatedTypeFactory typeFactory, AnnotatedTypeMirror type1, AnnotatedTypeMirror type2, AnnotatedTypeMirror backup, AnnotatedTypeMirror.AnnotatedTypeVariable result)
@SideEffectFree public String toString()