Class JSwitchStmt
java.lang.Object
sootup.core.jimple.common.stmt.AbstractStmt
sootup.core.jimple.javabytecode.stmt.JSwitchStmt
- All Implemented Interfaces:
EquivTo,BranchingStmt,Stmt,Acceptor<StmtVisitor>
-
Field Summary
Fields inherited from class sootup.core.jimple.common.stmt.AbstractStmt
positionInfo -
Constructor Summary
ConstructorsConstructorDescriptionJSwitchStmt(@NonNull Immediate key, int lowIndex, int highIndex, @NonNull StmtPositionInfo positionInfo) JSwitchStmt(@NonNull Immediate key, @NonNull List<IntConstant> lookupValues, @NonNull StmtPositionInfo positionInfo) Constructs a new JSwitchStmt. lookupValues should be a list of IntConst s. -
Method Summary
Modifier and TypeMethodDescription<V extends StmtVisitor>
Vaccept(@NonNull V v) Called when this object is visited.booleanbranches()Returns true if execution after this statement does not necessarily continue at the following statement.voidcollectUses(List<Value> collector) Collects all values used by this statement into the given list.intReturns a (not necessarily fixed) hash code for this object.booleanequivTo(@NonNull Object o, @NonNull JimpleComparator comparator) Returns true if this object is equivalent to o according to the given comparator.booleanReturns true if execution after this statement may continue at the following statement.getDefaultTarget(@NonNull Body body) intReturns the amount of unexceptional successors the Stmt needs to have in the ControlFlowGraph.getKey()getTargetStmts(Body body) intgetValue(int index) intAmount of labels +1 for default handler@NonNull List<IntConstant>booleanbooleantoString()voidtoString(@NonNull StmtPrinter stmtPrinter) @NonNull JSwitchStmt@NonNull JSwitchStmtwithPositionInfo(@NonNull StmtPositionInfo positionInfo) @NonNull JSwitchStmtwithValues(@NonNull List<IntConstant> values) Methods inherited from class sootup.core.jimple.common.stmt.AbstractStmt
asInvokableStmt, containsArrayRef, containsFieldRef, getArrayRef, getDef, getFieldRef, getPositionInfo, isInvokableStmt, withNewUseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface sootup.core.jimple.common.stmt.Stmt
asInvokableStmt, asJAssignStmt, asJBreakpointStmt, asJEnterMonitorStmt, asJExitMonitorStmt, asJGotoStmt, asJIdentityStmt, asJIfStmt, asJInvokeStmt, asJNopStmt, asJRetStmt, asJReturnStmt, asJReturnVoidStmt, asJThrowStmt, containsArrayRef, containsFieldRef, getArrayRef, getDef, getFieldRef, getPositionInfo, getUses, getUsesAndDefs, isInvokableStmt, isJAssignStmt, isJBreakpointStmt, isJEnterMonitorStmt, isJExitMonitorStmt, isJGotoStmt, isJIdentityStmt, isJIfStmt, isJInvokeStmt, isJNopStmt, isJRetStmt, isJReturnStmt, isJReturnVoidStmt, isJThrowStmt, toJAssignStmt, toJBreakpointStmt, toJEnterMonitorStmt, toJExitMonitorStmt, toJGotoStmt, toJIdentityStmt, toJIfStmt, toJInvokeStmt, toJNopStmt, toJRetStmt, toJReturnStmt, toJReturnVoidStmt, toJThrowStmt, withNewUse
-
Constructor Details
-
JSwitchStmt
public JSwitchStmt(@NonNull Immediate key, int lowIndex, int highIndex, @NonNull StmtPositionInfo positionInfo) -
JSwitchStmt
public JSwitchStmt(@NonNull Immediate key, @NonNull List<IntConstant> lookupValues, @NonNull StmtPositionInfo positionInfo) Constructs a new JSwitchStmt. lookupValues should be a list of IntConst s.
-
-
Method Details
-
isTableSwitch
public boolean isTableSwitch() -
getDefaultTarget
-
getKey
-
collectUses
Description copied from interface:StmtCollects all values used by this statement into the given list.- Specified by:
collectUsesin interfaceStmt- Overrides:
collectUsesin classAbstractStmt
-
fallsThrough
public boolean fallsThrough()Description copied from interface:StmtReturns true if execution after this statement may continue at the following statement. (e.g. GotoStmt will return false and e.g. IfStmt will return true).- Specified by:
fallsThroughin interfaceStmt- Returns:
- true if control may fall through to the next statement
-
branches
public boolean branches()Description copied from interface:StmtReturns true if execution after this statement does not necessarily continue at the following statement. TheBranchingStmt's GotoStmt, JSwitchStmt and IfStmt will return true.- Specified by:
branchesin interfaceBranchingStmt- Specified by:
branchesin interfaceStmt- Returns:
- true if this statement may branch to a non-sequential successor
-
accept
Description copied from interface:AcceptorCalled when this object is visited.- Specified by:
acceptin interfaceAcceptor<StmtVisitor>- Type Parameters:
V- the concrete visitor type- Parameters:
v- the visitor processing this object- Returns:
- the visitor after processing
-
getValueCount
public int getValueCount()Amount of labels +1 for default handler -
getValue
public int getValue(int index) -
getValues
-
getTargetStmts
- Specified by:
getTargetStmtsin interfaceBranchingStmt
-
getExpectedSuccessorCount
public int getExpectedSuccessorCount()Description copied from class:AbstractStmtReturns the amount of unexceptional successors the Stmt needs to have in the ControlFlowGraph.- Specified by:
getExpectedSuccessorCountin interfaceStmt- Overrides:
getExpectedSuccessorCountin classAbstractStmt
-
equivTo
Description copied from interface:EquivToReturns true if this object is equivalent to o according to the given comparator. -
equivHashCode
public int equivHashCode()Description copied from interface:EquivToReturns a (not necessarily fixed) hash code for this object. This hash code coincides with equivTo; it is undefined in the presence of mutable objects. The contract is defined inJimpleComparator.- Specified by:
equivHashCodein interfaceEquivTo- Returns:
- a structural hash code consistent with equivTo
-
toString
-
toString
-
isJSwitchStmt
public boolean isJSwitchStmt()- Specified by:
isJSwitchStmtin interfaceStmt
-
asJSwitchStmt
- Specified by:
asJSwitchStmtin interfaceStmt
-
toJSwitchStmt
- Specified by:
toJSwitchStmtin interfaceStmt
-
withKey
-
withValues
-
withPositionInfo
-