proguard.evaluation
Class Variables

java.lang.Object
  extended by proguard.evaluation.Variables
Direct Known Subclasses:
TracedVariables

public class Variables
extends java.lang.Object

This class represents a local variable frame that contains Value objects. Values are generalizations of all values that have been stored in the respective variables.


Field Summary
protected  int size
           
protected  Value[] values
           
 
Constructor Summary
Variables(int size)
          Creates a new Variables object with a given maximum number of variables.
Variables(Variables variables)
          Creates a Variables object that is a copy of the given Variables object.
 
Method Summary
 ReferenceValue aload(int index)
          Loads the ReferenceValue from the variable with the given index.
 DoubleValue dload(int index)
          Loads the DoubleValue from the variable with the given index.
 boolean equals(java.lang.Object object)
           
 FloatValue fload(int index)
          Loads the FloatValue from the variable with the given index.
 boolean generalize(Variables other, boolean clearConflictingOtherVariables)
          Generalizes the values of this Variables object with the values of the given Variables object.
 Value getValue(int index)
          Gets the Value of the variable with the given index, without disturbing it.
 int hashCode()
           
 IntegerValue iload(int index)
          Loads the IntegerValue from the variable with the given index.
 void initialize(Variables other)
          Initializes the values of this Variables object with the values of the given Variables object.
 LongValue lload(int index)
          Loads the LongValue from the variable with the given index.
 Value load(int index)
          Loads the Value from the variable with the given index.
 InstructionOffsetValue oload(int index)
          Loads the InstructionOffsetValue from the variable with the given index.
 void reset(int size)
          Resets this Variables object, so that it can be reused.
 int size()
          Returns the number of variables.
 void store(int index, Value value)
          Stores the given Value at the given variable index.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

values

protected Value[] values

size

protected int size
Constructor Detail

Variables

public Variables(int size)
Creates a new Variables object with a given maximum number of variables.


Variables

public Variables(Variables variables)
Creates a Variables object that is a copy of the given Variables object.

Method Detail

reset

public void reset(int size)
Resets this Variables object, so that it can be reused.


initialize

public void initialize(Variables other)
Initializes the values of this Variables object with the values of the given Variables object. The other object may have fewer values, in which case the remaining values are left unchanged.


generalize

public boolean generalize(Variables other,
                          boolean clearConflictingOtherVariables)
Generalizes the values of this Variables object with the values of the given Variables object.

Parameters:
clearConflictingOtherVariables - specifies whether the other variables should be cleared too, in case of conflicts.
Returns:
whether the generalization has made any difference.

size

public int size()
Returns the number of variables.


getValue

public Value getValue(int index)
Gets the Value of the variable with the given index, without disturbing it.


store

public void store(int index,
                  Value value)
Stores the given Value at the given variable index.


load

public Value load(int index)
Loads the Value from the variable with the given index.


iload

public IntegerValue iload(int index)
Loads the IntegerValue from the variable with the given index.


lload

public LongValue lload(int index)
Loads the LongValue from the variable with the given index.


fload

public FloatValue fload(int index)
Loads the FloatValue from the variable with the given index.


dload

public DoubleValue dload(int index)
Loads the DoubleValue from the variable with the given index.


aload

public ReferenceValue aload(int index)
Loads the ReferenceValue from the variable with the given index.


oload

public InstructionOffsetValue oload(int index)
Loads the InstructionOffsetValue from the variable with the given index.


equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object