proguard.evaluation
Class BasicBranchUnit

java.lang.Object
  extended by proguard.evaluation.BasicBranchUnit
All Implemented Interfaces:
BranchUnit

public class BasicBranchUnit
extends java.lang.Object
implements BranchUnit

This BranchUnit remembers the branch unit commands that are invoked on it. I doesn't consider conditions when branching.


Constructor Summary
BasicBranchUnit()
           
 
Method Summary
 void branch(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget)
          Sets the new instruction offset.
 void branchConditionally(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget, int conditional)
          Sets the new instruction offset, depending on the certainty of the conditional branch.
 InstructionOffsetValue getTraceBranchTargets()
           
 void resetCalled()
          Resets the flag that tells whether any of the branch unit commands was called.
 void returnFromMethod()
          Returns from the method with the given value.
protected  void setCalled()
          Sets the flag that tells whether any of the branch unit commands was called.
 void setTraceBranchTargets(InstructionOffsetValue branchTargets)
          Sets the initial branch targets, which will be updated as the branch methods of the branch unit are called.
 void throwException()
          Handles the throwing of an exception.
 boolean wasCalled()
          Returns whether any of the branch unit commands was called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicBranchUnit

public BasicBranchUnit()
Method Detail

resetCalled

public void resetCalled()
Resets the flag that tells whether any of the branch unit commands was called.


setCalled

protected void setCalled()
Sets the flag that tells whether any of the branch unit commands was called.


wasCalled

public boolean wasCalled()
Returns whether any of the branch unit commands was called.


setTraceBranchTargets

public void setTraceBranchTargets(InstructionOffsetValue branchTargets)
Sets the initial branch targets, which will be updated as the branch methods of the branch unit are called.


getTraceBranchTargets

public InstructionOffsetValue getTraceBranchTargets()

branch

public void branch(Clazz clazz,
                   CodeAttribute codeAttribute,
                   int offset,
                   int branchTarget)
Description copied from interface: BranchUnit
Sets the new instruction offset.

Specified by:
branch in interface BranchUnit

branchConditionally

public void branchConditionally(Clazz clazz,
                                CodeAttribute codeAttribute,
                                int offset,
                                int branchTarget,
                                int conditional)
Description copied from interface: BranchUnit
Sets the new instruction offset, depending on the certainty of the conditional branch.

Specified by:
branchConditionally in interface BranchUnit

returnFromMethod

public void returnFromMethod()
Description copied from interface: BranchUnit
Returns from the method with the given value.

Specified by:
returnFromMethod in interface BranchUnit

throwException

public void throwException()
Description copied from interface: BranchUnit
Handles the throwing of an exception.

Specified by:
throwException in interface BranchUnit