Package proguard.evaluation.value
Class ReferenceValue
- java.lang.Object
-
- proguard.evaluation.value.Value
-
- proguard.evaluation.value.Category1Value
-
- proguard.evaluation.value.ReferenceValue
-
- Direct Known Subclasses:
MultiTypedReferenceValue
,TracedReferenceValue
,TypedReferenceValue
,UnknownReferenceValue
public abstract class ReferenceValue extends Category1Value
Representation of a partially evaluated reference value.
-
-
Field Summary
-
Fields inherited from class proguard.evaluation.value.Value
ALWAYS, MAYBE, NEVER, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INSTRUCTION_OFFSET, TYPE_INTEGER, TYPE_LONG, TYPE_REFERENCE, TYPE_TOP, TYPE_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description ReferenceValue()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IntegerValue
arrayLength(ValueFactory valueFactory)
Returns the length of the array, assuming this type is an array.void
arrayStore(IntegerValue indexValue, Value value)
Stores the given value at the given index in the given array, assuming this type is an array.abstract ReferenceValue
cast(java.lang.String type, Clazz referencedClass, ValueFactory valueFactory, boolean alwaysCast)
Returns this ReferenceValue, cast to the given type.int
computationalType()
Returns the computational type of this Value.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(ArrayReferenceValue other)
Returns whether this ReferenceValue is equal to the given other ArrayReferenceValue.int
equal(DetailedArrayReferenceValue other)
Returns whether this ReferenceValue is equal to the given other DetailedArrayReferenceValue.int
equal(IdentifiedArrayReferenceValue other)
Returns whether this ReferenceValue is equal to the given other IdentifiedArrayReferenceValue.int
equal(IdentifiedReferenceValue other)
Returns whether this ReferenceValue is equal to the given other IdentifiedReferenceValue.int
equal(MultiTypedReferenceValue other)
Returns whether thisReferenceValue
is equal to the given otherMultiTypedReferenceValue
.int
equal(ParticularReferenceValue other)
Returns whether this ReferenceValue is equal to the given other ParticularReferenceValue.abstract int
equal(ReferenceValue other)
Returns whether this ReferenceValue is equal to the given other ReferenceValue.int
equal(TracedReferenceValue other)
Returns whether this ReferenceValue is equal to the given other TracedReferenceValue.int
equal(TypedReferenceValue other)
Returns whether this ReferenceValue is equal to the given other TypedReferenceValue.int
equal(UnknownReferenceValue other)
Returns whether this ReferenceValue is equal to the given other UnknownReferenceValue.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(ArrayReferenceValue other)
Returns the generalization of this ReferenceValue and the given other ArrayReferenceValue.ReferenceValue
generalize(DetailedArrayReferenceValue other)
Returns the generalization of this ReferenceValue and the given other DetailedArrayReferenceValue.ReferenceValue
generalize(IdentifiedArrayReferenceValue other)
Returns the generalization of this ReferenceValue and the given other IdentifiedArrayReferenceValue.ReferenceValue
generalize(IdentifiedReferenceValue other)
Returns the generalization of this ReferenceValue and the given other IdentifiedReferenceValue.ReferenceValue
generalize(MultiTypedReferenceValue other)
Returns the generalization of thisReferenceValue
and the given otherMultiTypedReferenceValue
.ReferenceValue
generalize(ParticularReferenceValue other)
Returns the generalization of this ReferenceValue and the given other ParticularReferenceValue.abstract ReferenceValue
generalize(ReferenceValue other)
Returns the generalization of this ReferenceValue and the given other ReferenceValue.ReferenceValue
generalize(TracedReferenceValue other)
Returns the generalization of this ReferenceValue and the given other TracedReferenceValue.ReferenceValue
generalize(TypedReferenceValue other)
Returns the generalization of this ReferenceValue and the given other TypedReferenceValue.ReferenceValue
generalize(UnknownReferenceValue other)
Returns the generalization of this ReferenceValue and the given other UnknownReferenceValue.Value
generalize(Value other)
Returns the generalization of this Value and the given other Value.abstract Clazz
getReferencedClass()
Returns the class that is referenced by the type.abstract java.lang.String
getType()
Returns the type.@NotNull AnalyzedObject
getValue()
int
hashCode()
abstract 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.int
isNotNull()
Returns whether this ReferenceValue is notnull
.abstract int
isNull()
Returns whether this ReferenceValue isnull
.LongValue
longArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type is an long array.abstract boolean
mayBeExtension()
Returns whether the actual type of this ReferenceValue may be an extension of its type.int
notEqual(ReferenceValue other)
Returns whether this ReferenceValue and the given ReferenceValue are different.ReferenceValue
referenceArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type is a reference array.ReferenceValue
referenceValue()
Returns this Value as a ReferenceValue.java.lang.String
toString()
java.lang.Object
value()
Deprecated.-
Methods inherited from class proguard.evaluation.value.Category1Value
category1Value, isCategory2
-
Methods inherited from class proguard.evaluation.value.Value
category2Value, copyIfMutable, doubleValue, floatValue, instructionOffsetValue, integerValue, internalType, isParticular, isSpecific, longValue
-
-
-
-
Method Detail
-
value
@Deprecated public java.lang.Object value()
Deprecated.Returns the value.Deprecated, use
getValue()
instead.
-
getValue
@NotNull public @NotNull AnalyzedObject getValue()
-
getType
public abstract java.lang.String getType()
Returns the type.
-
getReferencedClass
public abstract Clazz getReferencedClass()
Returns the class that is referenced by the type.
-
mayBeExtension
public abstract boolean mayBeExtension()
Returns whether the actual type of this ReferenceValue may be an extension of its type.
-
isNull
public abstract int isNull()
Returns whether this ReferenceValue isnull
.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
instanceOf
public abstract int instanceOf(java.lang.String otherType, Clazz otherReferencedClass)
Returns whether the type is an instance of the given type.
-
cast
public abstract ReferenceValue cast(java.lang.String type, Clazz referencedClass, ValueFactory valueFactory, boolean alwaysCast)
Returns this ReferenceValue, cast to the given type.
-
arrayLength
public IntegerValue arrayLength(ValueFactory valueFactory)
Returns the length of the array, assuming this type is an array.
-
integerArrayLoad
public IntegerValue integerArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type is an integer array.
-
longArrayLoad
public LongValue longArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type is an long array.
-
floatArrayLoad
public FloatValue floatArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type is an float array.
-
doubleArrayLoad
public DoubleValue doubleArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type is an double array.
-
referenceArrayLoad
public ReferenceValue referenceArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Returns the value of the array at the given index, assuming this type is a reference array.
-
arrayStore
public void arrayStore(IntegerValue indexValue, Value value)
Stores the given value at the given index in the given array, assuming this type is an array.
-
generalize
public abstract ReferenceValue generalize(ReferenceValue other)
Returns the generalization of this ReferenceValue and the given other ReferenceValue.
-
equal
public abstract int equal(ReferenceValue other)
Returns whether this ReferenceValue is equal to the given other ReferenceValue.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
isNotNull
public final int isNotNull()
Returns whether this ReferenceValue is notnull
.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
notEqual
public final int notEqual(ReferenceValue other)
Returns whether this ReferenceValue and the given ReferenceValue are different.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
generalize
public ReferenceValue generalize(UnknownReferenceValue other)
Returns the generalization of this ReferenceValue and the given other UnknownReferenceValue.
-
equal
public int equal(UnknownReferenceValue other)
Returns whether this ReferenceValue is equal to the given other UnknownReferenceValue.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
generalize
public ReferenceValue generalize(TypedReferenceValue other)
Returns the generalization of this ReferenceValue and the given other TypedReferenceValue.
-
equal
public int equal(TypedReferenceValue other)
Returns whether this ReferenceValue is equal to the given other TypedReferenceValue.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
generalize
public ReferenceValue generalize(MultiTypedReferenceValue other)
Returns the generalization of thisReferenceValue
and the given otherMultiTypedReferenceValue
.
-
equal
public int equal(MultiTypedReferenceValue other)
Returns whether thisReferenceValue
is equal to the given otherMultiTypedReferenceValue
.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
generalize
public ReferenceValue generalize(IdentifiedReferenceValue other)
Returns the generalization of this ReferenceValue and the given other IdentifiedReferenceValue.
-
equal
public int equal(IdentifiedReferenceValue other)
Returns whether this ReferenceValue is equal to the given other IdentifiedReferenceValue.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
generalize
public ReferenceValue generalize(ArrayReferenceValue other)
Returns the generalization of this ReferenceValue and the given other ArrayReferenceValue.
-
equal
public int equal(ArrayReferenceValue other)
Returns whether this ReferenceValue is equal to the given other ArrayReferenceValue.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
generalize
public ReferenceValue generalize(IdentifiedArrayReferenceValue other)
Returns the generalization of this ReferenceValue and the given other IdentifiedArrayReferenceValue.
-
equal
public int equal(IdentifiedArrayReferenceValue other)
Returns whether this ReferenceValue is equal to the given other IdentifiedArrayReferenceValue.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
generalize
public ReferenceValue generalize(DetailedArrayReferenceValue other)
Returns the generalization of this ReferenceValue and the given other DetailedArrayReferenceValue.
-
equal
public int equal(DetailedArrayReferenceValue other)
Returns whether this ReferenceValue is equal to the given other DetailedArrayReferenceValue.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
generalize
public ReferenceValue generalize(TracedReferenceValue other)
Returns the generalization of this ReferenceValue and the given other TracedReferenceValue.
-
equal
public int equal(TracedReferenceValue other)
Returns whether this ReferenceValue is equal to the given other TracedReferenceValue.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
generalize
public ReferenceValue generalize(ParticularReferenceValue other)
Returns the generalization of this ReferenceValue and the given other ParticularReferenceValue.
-
equal
public int equal(ParticularReferenceValue other)
Returns whether this ReferenceValue is equal to the given other ParticularReferenceValue.- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
referenceValue
public final ReferenceValue referenceValue()
Description copied from class:Value
Returns this Value as a ReferenceValue.- Overrides:
referenceValue
in classValue
-
generalize
public final Value generalize(Value other)
Description copied from class:Value
Returns the generalization of this Value and the given other Value.- Specified by:
generalize
in classValue
-
computationalType
public final int computationalType()
Description copied from class:Value
Returns the computational type of this Value.- Specified by:
computationalType
in classValue
- Returns:
TYPE_INTEGER
,TYPE_LONG
,TYPE_FLOAT
,TYPE_DOUBLE
,TYPE_REFERENCE
, orTYPE_INSTRUCTION_OFFSET
.
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-