Package proguard.evaluation.value
Class TypedReferenceValue
- java.lang.Object
-
- proguard.evaluation.value.Value
-
- proguard.evaluation.value.Category1Value
-
- proguard.evaluation.value.ReferenceValue
-
- proguard.evaluation.value.TypedReferenceValue
-
- Direct Known Subclasses:
ArrayReferenceValue,IdentifiedReferenceValue
public class TypedReferenceValue extends ReferenceValue
ThisReferenceValuerepresents a partially evaluated reference value. It has a type and a flag that indicates whether the value could benull. If the type isnull, the value isnull.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanALLOW_INCOMPLETE_CLASS_HIERARCHYIf true, do not throw anIncompleteClassHierarchyExceptionwhen one would occur.static booleanINCOMPLETE_CLASS_HIERARCHYIndicates whether there were occurrences ofIncompleteClassHierarchyException.protected booleanmayBeExtensionprotected booleanmayBeNullprotected ClazzreferencedClassprotected java.lang.Stringtypestatic booleanWARN_INCOMPLETE_CLASS_HIERARCHYIf true, print warnings for occurrences ofIncompleteClassHierarchyExceptionwhen ALLOW_INCOMPLETE_CLASS_HIERARCHY is enabled.-
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 TypedReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull)Creates a new TypedReferenceValue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanallowsIncompleteClassHierarchy()Returns whether incomplete class hierarchies are allowed.voidarrayStore(IntegerValue indexValue, Value value)Stores the given value at the given index in the given array, assuming this type is an array.ReferenceValuecast(java.lang.String type, Clazz referencedClass, ValueFactory valueFactory, boolean alwaysCast)Returns this ReferenceValue, cast to the given type.DoubleValuedoubleArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)Returns the value of the array at the given index, assuming this type is an double array.intequal(ReferenceValue other)Returns whether this ReferenceValue is equal to the given other ReferenceValue.intequal(TypedReferenceValue other)Returns whether this ReferenceValue is equal to the given other TypedReferenceValue.booleanequals(java.lang.Object object)FloatValuefloatArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)Returns the value of the array at the given index, assuming this type is an float array.ReferenceValuegeneralize(ReferenceValue other)Returns the generalization of this ReferenceValue and the given other ReferenceValue.ReferenceValuegeneralize(TypedReferenceValue other)Returns the generalization of this ReferenceValue and the given other TypedReferenceValue.ReferenceValuegeneralizeMayBeNull(boolean mayBeNull)ClazzgetReferencedClass()Returns the class that is referenced by the type.java.lang.StringgetType()Returns the type.inthashCode()intinstanceOf(java.lang.String otherType, Clazz otherReferencedClass)Returns whether the type is an instance of the given type.IntegerValueintegerArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)Returns the value of the array at the given index, assuming this type is an integer array.java.lang.StringinternalType()Returns the internal type of this Value.intisNull()Returns whether this ReferenceValue isnull.booleanisParticular()Returns whether this Value represents a single particular (known) value.LongValuelongArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)Returns the value of the array at the given index, assuming this type is an long array.booleanmayBeExtension()Returns whether the actual type of this ReferenceValue may be an extension of its type.ReferenceValuereferenceArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)Returns the value of the array at the given index, assuming this type is a reference array.java.lang.StringtoString()-
Methods inherited from class proguard.evaluation.value.ReferenceValue
arrayLength, computationalType, equal, equal, equal, equal, equal, equal, equal, equal, generalize, generalize, generalize, generalize, generalize, generalize, generalize, generalize, generalize, getValue, isNotNull, 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, isSpecific, longValue
-
-
-
-
Field Detail
-
INCOMPLETE_CLASS_HIERARCHY
public static boolean INCOMPLETE_CLASS_HIERARCHY
Indicates whether there were occurrences ofIncompleteClassHierarchyException.
-
ALLOW_INCOMPLETE_CLASS_HIERARCHY
public static boolean ALLOW_INCOMPLETE_CLASS_HIERARCHY
If true, do not throw anIncompleteClassHierarchyExceptionwhen one would occur.
-
WARN_INCOMPLETE_CLASS_HIERARCHY
public static boolean WARN_INCOMPLETE_CLASS_HIERARCHY
If true, print warnings for occurrences ofIncompleteClassHierarchyExceptionwhen ALLOW_INCOMPLETE_CLASS_HIERARCHY is enabled.
-
type
protected final java.lang.String type
-
referencedClass
protected final Clazz referencedClass
-
mayBeExtension
protected final boolean mayBeExtension
-
mayBeNull
protected final boolean mayBeNull
-
-
Constructor Detail
-
TypedReferenceValue
public TypedReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull)Creates a new TypedReferenceValue.
-
-
Method Detail
-
getType
public java.lang.String getType()
Description copied from class:ReferenceValueReturns the type.- Specified by:
getTypein classReferenceValue
-
getReferencedClass
public Clazz getReferencedClass()
Description copied from class:ReferenceValueReturns the class that is referenced by the type.- Specified by:
getReferencedClassin classReferenceValue
-
mayBeExtension
public boolean mayBeExtension()
Description copied from class:ReferenceValueReturns whether the actual type of this ReferenceValue may be an extension of its type.- Specified by:
mayBeExtensionin classReferenceValue
-
isNull
public int isNull()
Description copied from class:ReferenceValueReturns whether this ReferenceValue isnull.- Specified by:
isNullin classReferenceValue- Returns:
NEVER,MAYBE, orALWAYS.
-
instanceOf
public int instanceOf(java.lang.String otherType, Clazz otherReferencedClass)Description copied from class:ReferenceValueReturns whether the type is an instance of the given type.- Specified by:
instanceOfin classReferenceValue
-
cast
public ReferenceValue cast(java.lang.String type, Clazz referencedClass, ValueFactory valueFactory, boolean alwaysCast)
Description copied from class:ReferenceValueReturns this ReferenceValue, cast to the given type.- Specified by:
castin classReferenceValue
-
generalizeMayBeNull
public ReferenceValue generalizeMayBeNull(boolean mayBeNull)
-
referenceArrayLoad
public ReferenceValue referenceArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Description copied from class:ReferenceValueReturns the value of the array at the given index, assuming this type is a reference array.- Overrides:
referenceArrayLoadin classReferenceValue
-
generalize
public ReferenceValue generalize(ReferenceValue other)
Description copied from class:ReferenceValueReturns the generalization of this ReferenceValue and the given other ReferenceValue.- Specified by:
generalizein classReferenceValue
-
equal
public int equal(ReferenceValue other)
Description copied from class:ReferenceValueReturns whether this ReferenceValue is equal to the given other ReferenceValue.- Specified by:
equalin classReferenceValue- Returns:
NEVER,MAYBE, orALWAYS.
-
generalize
public ReferenceValue generalize(TypedReferenceValue other)
Description copied from class:ReferenceValueReturns the generalization of this ReferenceValue and the given other TypedReferenceValue.- Overrides:
generalizein classReferenceValue
-
allowsIncompleteClassHierarchy
public static boolean allowsIncompleteClassHierarchy()
Returns whether incomplete class hierarchies are allowed.
-
doubleArrayLoad
public DoubleValue doubleArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Description copied from class:ReferenceValueReturns the value of the array at the given index, assuming this type is an double array.- Overrides:
doubleArrayLoadin classReferenceValue
-
integerArrayLoad
public IntegerValue integerArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Description copied from class:ReferenceValueReturns the value of the array at the given index, assuming this type is an integer array.- Overrides:
integerArrayLoadin classReferenceValue
-
longArrayLoad
public LongValue longArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Description copied from class:ReferenceValueReturns the value of the array at the given index, assuming this type is an long array.- Overrides:
longArrayLoadin classReferenceValue
-
floatArrayLoad
public FloatValue floatArrayLoad(IntegerValue indexValue, ValueFactory valueFactory)
Description copied from class:ReferenceValueReturns the value of the array at the given index, assuming this type is an float array.- Overrides:
floatArrayLoadin classReferenceValue
-
arrayStore
public void arrayStore(IntegerValue indexValue, Value value)
Description copied from class:ReferenceValueStores the given value at the given index in the given array, assuming this type is an array.- Overrides:
arrayStorein classReferenceValue
-
equal
public int equal(TypedReferenceValue other)
Description copied from class:ReferenceValueReturns whether this ReferenceValue is equal to the given other TypedReferenceValue.- Overrides:
equalin classReferenceValue- Returns:
NEVER,MAYBE, orALWAYS.
-
isParticular
public boolean isParticular()
Description copied from class:ValueReturns whether this Value represents a single particular (known) value.- Overrides:
isParticularin classValue
-
internalType
public final java.lang.String internalType()
Description copied from class:ValueReturns the internal type of this Value.- Specified by:
internalTypein 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 object)
- Overrides:
equalsin classReferenceValue
-
hashCode
public int hashCode()
- Overrides:
hashCodein classReferenceValue
-
toString
public java.lang.String toString()
- Overrides:
toStringin classReferenceValue
-
-