Package proguard.evaluation.value
Class Value
- java.lang.Object
-
- proguard.evaluation.value.Value
-
- Direct Known Subclasses:
Category1Value
,Category2Value
,TracingValue
,UnknownValue
public abstract class Value extends java.lang.Object
This abstract class represents a partially evaluated value.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALWAYS
static int
MAYBE
static int
NEVER
static int
TYPE_DOUBLE
static int
TYPE_FLOAT
static int
TYPE_INSTRUCTION_OFFSET
static int
TYPE_INTEGER
static int
TYPE_LONG
static int
TYPE_REFERENCE
static int
TYPE_TOP
static int
TYPE_UNKNOWN
-
Constructor Summary
Constructors Constructor Description Value()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Category1Value
category1Value()
Returns this Value as a Category1Value.Category2Value
category2Value()
Returns this Value as a Category2Value.abstract int
computationalType()
Returns the computational type of this Value.Value
copyIfMutable()
Returns a deep copy of the value if it mutable, returns the value itself otherwise.DoubleValue
doubleValue()
Returns this Value as a DoubleValue.FloatValue
floatValue()
Returns this Value as a FloatValue.abstract Value
generalize(Value other)
Returns the generalization of this Value and the given other Value.InstructionOffsetValue
instructionOffsetValue()
Returns this Value as an InstructionOffsetValue.IntegerValue
integerValue()
Returns this Value as an IntegerValue.abstract java.lang.String
internalType()
Returns the internal type of this Value.abstract boolean
isCategory2()
Returns whether the computational type of this Value is a category 2 type.boolean
isParticular()
Returns whether this Value represents a single particular (known) value.boolean
isSpecific()
Returns whether this Value represents a single specific (but possibly unknown) value.LongValue
longValue()
Returns this Value as a LongValue.ReferenceValue
referenceValue()
Returns this Value as a ReferenceValue.
-
-
-
Field Detail
-
NEVER
public static final int NEVER
- See Also:
- Constant Field Values
-
MAYBE
public static final int MAYBE
- See Also:
- Constant Field Values
-
ALWAYS
public static final int ALWAYS
- See Also:
- Constant Field Values
-
TYPE_UNKNOWN
public static final int TYPE_UNKNOWN
- See Also:
- Constant Field Values
-
TYPE_INTEGER
public static final int TYPE_INTEGER
- See Also:
- Constant Field Values
-
TYPE_LONG
public static final int TYPE_LONG
- See Also:
- Constant Field Values
-
TYPE_FLOAT
public static final int TYPE_FLOAT
- See Also:
- Constant Field Values
-
TYPE_DOUBLE
public static final int TYPE_DOUBLE
- See Also:
- Constant Field Values
-
TYPE_REFERENCE
public static final int TYPE_REFERENCE
- See Also:
- Constant Field Values
-
TYPE_INSTRUCTION_OFFSET
public static final int TYPE_INSTRUCTION_OFFSET
- See Also:
- Constant Field Values
-
TYPE_TOP
public static final int TYPE_TOP
- See Also:
- Constant Field Values
-
-
Method Detail
-
category1Value
public Category1Value category1Value()
Returns this Value as a Category1Value.
-
category2Value
public Category2Value category2Value()
Returns this Value as a Category2Value.
-
integerValue
public IntegerValue integerValue()
Returns this Value as an IntegerValue.
-
longValue
public LongValue longValue()
Returns this Value as a LongValue.
-
floatValue
public FloatValue floatValue()
Returns this Value as a FloatValue.
-
doubleValue
public DoubleValue doubleValue()
Returns this Value as a DoubleValue.
-
referenceValue
public ReferenceValue referenceValue()
Returns this Value as a ReferenceValue.
-
instructionOffsetValue
public InstructionOffsetValue instructionOffsetValue()
Returns this Value as an InstructionOffsetValue.
-
isSpecific
public boolean isSpecific()
Returns whether this Value represents a single specific (but possibly unknown) value.
-
isParticular
public boolean isParticular()
Returns whether this Value represents a single particular (known) value.
-
generalize
public abstract Value generalize(Value other)
Returns the generalization of this Value and the given other Value.
-
isCategory2
public abstract boolean isCategory2()
Returns whether the computational type of this Value is a category 2 type. This means that it takes up the space of two category 1 types on the stack, for instance.
-
computationalType
public abstract int computationalType()
Returns the computational type of this Value.- Returns:
TYPE_INTEGER
,TYPE_LONG
,TYPE_FLOAT
,TYPE_DOUBLE
,TYPE_REFERENCE
, orTYPE_INSTRUCTION_OFFSET
.
-
internalType
public abstract java.lang.String internalType()
Returns the internal type of this Value.- 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).
-
copyIfMutable
public Value copyIfMutable()
Returns a deep copy of the value if it mutable, returns the value itself otherwise.
-
-