public class TypedReferenceValue extends ReferenceValue
ReferenceValue represents a partially evaluated reference value.
It has a type and a flag that indicates whether the value could be
null. If the type is null, the value is
null.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
mayBeExtension |
protected boolean |
mayBeNull |
protected Clazz |
referencedClass |
protected java.lang.String |
type |
ALWAYS, MAYBE, NEVER, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INSTRUCTION_OFFSET, TYPE_INTEGER, TYPE_LONG, TYPE_REFERENCE, TYPE_TOP, TYPE_UNKNOWN| Constructor and Description |
|---|
TypedReferenceValue(java.lang.String type,
Clazz referencedClass,
boolean mayBeExtension,
boolean mayBeNull)
Creates a new TypedReferenceValue.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allowsIncompleteClassHierarchy()
Returns whether incomplete class hierarchies are allowed.
|
void |
arrayStore(IntegerValue indexValue,
Value value)
Stores the given value at the given index in the given array, assuming
this type is an array.
|
ReferenceValue |
cast(java.lang.String type,
Clazz referencedClass,
ValueFactory valueFactory,
boolean alwaysCast)
Returns this ReferenceValue, cast to the given type.
|
DoubleValue |
doubleArrayLoad(IntegerValue indexValue,
ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type
is an double array.
|
int |
equal(ReferenceValue other)
Returns whether this ReferenceValue is equal to the given other
ReferenceValue.
|
int |
equal(TypedReferenceValue other)
Returns whether this ReferenceValue is equal to the given other
TypedReferenceValue.
|
boolean |
equals(java.lang.Object object) |
FloatValue |
floatArrayLoad(IntegerValue indexValue,
ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type
is an float array.
|
ReferenceValue |
generalize(ReferenceValue other)
Returns the generalization of this ReferenceValue and the given other
ReferenceValue.
|
ReferenceValue |
generalize(TypedReferenceValue other)
Returns the generalization of this ReferenceValue and the given other
TypedReferenceValue.
|
ReferenceValue |
generalizeMayBeNull(boolean mayBeNull) |
Clazz |
getReferencedClass()
Returns the class that is referenced by the type.
|
java.lang.String |
getType()
Returns the type.
|
int |
hashCode() |
int |
instanceOf(java.lang.String otherType,
Clazz otherReferencedClass)
Returns whether the type is an instance of the given type.
|
IntegerValue |
integerArrayLoad(IntegerValue indexValue,
ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type
is an integer array.
|
java.lang.String |
internalType()
Returns the internal type of this Value.
|
int |
isNull()
Returns whether this ReferenceValue is
null. |
boolean |
isParticular()
Returns whether this Value represents a single particular (known)
value.
|
LongValue |
longArrayLoad(IntegerValue indexValue,
ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type
is an long array.
|
boolean |
mayBeExtension()
Returns whether the actual type of this ReferenceValue may be an
extension of its type.
|
ReferenceValue |
referenceArrayLoad(IntegerValue indexValue,
ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type
is a reference array.
|
java.lang.String |
toString() |
arrayLength, computationalType, equal, equal, equal, equal, equal, equal, equal, equal, generalize, generalize, generalize, generalize, generalize, generalize, generalize, generalize, generalize, isNotNull, notEqual, referenceValue, valuecategory1Value, isCategory2category2Value, copyIfMutable, doubleValue, floatValue, instructionOffsetValue, integerValue, isSpecific, longValueprotected final java.lang.String type
protected final Clazz referencedClass
protected final boolean mayBeExtension
protected final boolean mayBeNull
public TypedReferenceValue(java.lang.String type,
Clazz referencedClass,
boolean mayBeExtension,
boolean mayBeNull)
public java.lang.String getType()
ReferenceValuegetType in class ReferenceValuepublic Clazz getReferencedClass()
ReferenceValuegetReferencedClass in class ReferenceValuepublic boolean mayBeExtension()
ReferenceValuemayBeExtension in class ReferenceValuepublic int isNull()
ReferenceValuenull.isNull in class ReferenceValueNEVER, MAYBE, or ALWAYS.public int instanceOf(java.lang.String otherType,
Clazz otherReferencedClass)
ReferenceValueinstanceOf in class ReferenceValuepublic ReferenceValue cast(java.lang.String type, Clazz referencedClass, ValueFactory valueFactory, boolean alwaysCast)
ReferenceValuecast in class ReferenceValuepublic ReferenceValue generalizeMayBeNull(boolean mayBeNull)
public ReferenceValue referenceArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
ReferenceValuereferenceArrayLoad in class ReferenceValuepublic ReferenceValue generalize(ReferenceValue other)
ReferenceValuegeneralize in class ReferenceValuepublic int equal(ReferenceValue other)
ReferenceValueequal in class ReferenceValueNEVER, MAYBE, or ALWAYS.public ReferenceValue generalize(TypedReferenceValue other)
ReferenceValuegeneralize in class ReferenceValuepublic static boolean allowsIncompleteClassHierarchy()
public DoubleValue doubleArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
ReferenceValuedoubleArrayLoad in class ReferenceValuepublic IntegerValue integerArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
ReferenceValueintegerArrayLoad in class ReferenceValuepublic LongValue longArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
ReferenceValuelongArrayLoad in class ReferenceValuepublic FloatValue floatArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
ReferenceValuefloatArrayLoad in class ReferenceValuepublic void arrayStore(IntegerValue indexValue, Value value)
ReferenceValuearrayStore in class ReferenceValuepublic int equal(TypedReferenceValue other)
ReferenceValueequal in class ReferenceValueNEVER, MAYBE, or ALWAYS.public boolean isParticular()
ValueisParticular in class Valuepublic final java.lang.String internalType()
ValueinternalType in class ValueTypeConstants.BOOLEAN,
TypeConstants.BYTE,
TypeConstants.CHAR,
TypeConstants.SHORT,
TypeConstants.INT,
TypeConstants.LONG,
TypeConstants.FLOAT,
TypeConstants.DOUBLE,
TypeConstants.CLASS_START ... TypeConstants.CLASS_END, or
an array type containing any of these types (always as String).public boolean equals(java.lang.Object object)
equals in class ReferenceValuepublic int hashCode()
hashCode in class ReferenceValuepublic java.lang.String toString()
toString in class ReferenceValue