public abstract class CFAbstractValue<V extends CFAbstractValue<V>> extends java.lang.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 |
---|---|
protected static java.lang.String |
annotationToString(javax.lang.model.element.AnnotationMirror a)
Returns a string representation of an
AnnotationMirror . |
boolean |
equals(java.lang.Object obj) |
AnnotatedTypeMirror |
getType() |
int |
hashCode() |
boolean |
isSubtypeOf(CFAbstractValue<V> other)
Returns whether this value is a subtype of the argument
other . |
AnnotatedTypeMirror |
leastUpperBound(AnnotatedTypeMirror type,
AnnotatedTypeMirror otherType)
Computes and returns the least upper bound of two
AnnotatedTypeMirror . |
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 . |
java.lang.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 AnnotatedTypeMirror leastUpperBound(AnnotatedTypeMirror type, AnnotatedTypeMirror otherType)
AnnotatedTypeMirror
.
TODO: The code in this method is rather similar to
mostSpecific(CFAbstractValue, CFAbstractValue)
.
Can code be reused?
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 boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
@Pure public int hashCode()
hashCode
in class java.lang.Object
@SideEffectFree public java.lang.String toString()
toString
in class java.lang.Object
protected static java.lang.String annotationToString(javax.lang.model.element.AnnotationMirror a)
AnnotationMirror
.