Package proguard.evaluation.value
Class MultiTypedReferenceValue
- java.lang.Object
-
- proguard.evaluation.value.Value
-
- proguard.evaluation.value.Category1Value
-
- proguard.evaluation.value.ReferenceValue
-
- proguard.evaluation.value.MultiTypedReferenceValue
-
public class MultiTypedReferenceValue extends ReferenceValue
ThisTypedReferenceValue
can have multiple potential types during runtime. E.g. when evaluatingSuperClass s = someFlag ? new A() : new B()
, s may be of type LA; or LB;.
-
-
Field Summary
Fields Modifier and Type Field Description boolean
mayBeUnknown
-
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 MultiTypedReferenceValue(java.util.Set<TypedReferenceValue> potentialTypes, boolean mayBeUnknown)
MultiTypedReferenceValue(TypedReferenceValue type, boolean mayBeUnknown)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReferenceValue
cast(java.lang.String type, Clazz referencedClass, ValueFactory valueFactory, boolean alwaysCast)
Returns this ReferenceValue, cast to the given type.int
equal(MultiTypedReferenceValue other)
Returns whether thisReferenceValue
is equal to the given otherMultiTypedReferenceValue
.int
equal(ReferenceValue other)
Returns whether this ReferenceValue is equal to the given other ReferenceValue.boolean
equals(java.lang.Object o)
TypedReferenceValue
generalize(java.util.Set<TypedReferenceValue> potentialTypes)
ReferenceValue
generalize(MultiTypedReferenceValue other)
Returns the generalization of thisReferenceValue
and the given otherMultiTypedReferenceValue
.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
generalize(UnknownReferenceValue other)
Returns the generalization of this ReferenceValue and the given other UnknownReferenceValue.TypedReferenceValue
getGeneralizedType()
java.util.Set<TypedReferenceValue>
getPotentialTypes()
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.java.lang.String
internalType()
Returns the internal type of this Value.int
isNull()
Returns whether this ReferenceValue isnull
.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()
-
Methods inherited from class proguard.evaluation.value.ReferenceValue
arrayLength, arrayStore, computationalType, doubleArrayLoad, equal, equal, equal, equal, equal, equal, equal, equal, floatArrayLoad, generalize, generalize, generalize, generalize, generalize, generalize, generalize, getValue, integerArrayLoad, isNotNull, longArrayLoad, notEqual, referenceValue, value
-
Methods inherited from class proguard.evaluation.value.Category1Value
category1Value, isCategory2
-
Methods inherited from class proguard.evaluation.value.Value
category2Value, copyIfMutable, doubleValue, floatValue, instructionOffsetValue, integerValue, isParticular, isSpecific, longValue
-
-
-
-
Constructor Detail
-
MultiTypedReferenceValue
public MultiTypedReferenceValue(java.util.Set<TypedReferenceValue> potentialTypes, boolean mayBeUnknown)
-
MultiTypedReferenceValue
public MultiTypedReferenceValue(TypedReferenceValue type, boolean mayBeUnknown)
-
-
Method Detail
-
generalize
public TypedReferenceValue generalize(java.util.Set<TypedReferenceValue> potentialTypes)
-
getPotentialTypes
public java.util.Set<TypedReferenceValue> getPotentialTypes()
-
getGeneralizedType
public TypedReferenceValue getGeneralizedType()
-
getType
public java.lang.String getType()
Description copied from class:ReferenceValue
Returns the type.- Specified by:
getType
in classReferenceValue
-
getReferencedClass
public Clazz getReferencedClass()
Description copied from class:ReferenceValue
Returns the class that is referenced by the type.- Specified by:
getReferencedClass
in classReferenceValue
-
mayBeExtension
public boolean mayBeExtension()
Description copied from class:ReferenceValue
Returns whether the actual type of this ReferenceValue may be an extension of its type.- Specified by:
mayBeExtension
in classReferenceValue
-
isNull
public int isNull()
Description copied from class:ReferenceValue
Returns whether this ReferenceValue isnull
.- Specified by:
isNull
in classReferenceValue
- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
instanceOf
public int instanceOf(java.lang.String otherType, Clazz otherReferencedClass)
Description copied from class:ReferenceValue
Returns whether the type is an instance of the given type.- Specified by:
instanceOf
in classReferenceValue
-
cast
public ReferenceValue cast(java.lang.String type, Clazz referencedClass, ValueFactory valueFactory, boolean alwaysCast)
Description copied from class:ReferenceValue
Returns this ReferenceValue, cast to the given type.- Specified by:
cast
in classReferenceValue
-
referenceArrayLoad
public ReferenceValue referenceArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Description copied from class:ReferenceValue
Returns the value of the array at the given index, assuming this type is a reference array.- Overrides:
referenceArrayLoad
in classReferenceValue
-
generalize
public ReferenceValue generalize(ReferenceValue other)
Description copied from class:ReferenceValue
Returns the generalization of this ReferenceValue and the given other ReferenceValue.- Specified by:
generalize
in classReferenceValue
-
generalize
public ReferenceValue generalize(TypedReferenceValue other)
Description copied from class:ReferenceValue
Returns the generalization of this ReferenceValue and the given other TypedReferenceValue.- Overrides:
generalize
in classReferenceValue
-
generalize
public ReferenceValue generalize(UnknownReferenceValue other)
Description copied from class:ReferenceValue
Returns the generalization of this ReferenceValue and the given other UnknownReferenceValue.- Overrides:
generalize
in classReferenceValue
-
generalize
public ReferenceValue generalize(MultiTypedReferenceValue other)
Description copied from class:ReferenceValue
Returns the generalization of thisReferenceValue
and the given otherMultiTypedReferenceValue
.- Overrides:
generalize
in classReferenceValue
-
equal
public int equal(ReferenceValue other)
Description copied from class:ReferenceValue
Returns whether this ReferenceValue is equal to the given other ReferenceValue.- Specified by:
equal
in classReferenceValue
- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
equal
public int equal(MultiTypedReferenceValue other)
Description copied from class:ReferenceValue
Returns whether thisReferenceValue
is equal to the given otherMultiTypedReferenceValue
.- Overrides:
equal
in classReferenceValue
- Returns:
NEVER
,MAYBE
, orALWAYS
.
-
internalType
public java.lang.String internalType()
Description copied from class:Value
Returns the internal type of this Value.- Specified by:
internalType
in classValue
- Returns:
TypeConstants.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).
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classReferenceValue
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classReferenceValue
-
toString
public java.lang.String toString()
- Overrides:
toString
in classReferenceValue
-
-