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
ConstructorDescriptionJSwitchStmt
(Immediate key, int lowIndex, int highIndex, StmtPositionInfo positionInfo) JSwitchStmt
(Immediate key, List<IntConstant> lookupValues, StmtPositionInfo positionInfo) Constructs a new JSwitchStmt. -
Method Summary
Modifier and TypeMethodDescription<V extends StmtVisitor>
Vaccept
(V v) Called when this object is visited.boolean
branches()
Returns true if execution after this statement does not necessarily continue at the following statement.int
Returns a (not necessarily fixed) hash code for this object.boolean
equivTo
(Object o, JimpleComparator comparator) Returns true if this object is equivalent to o according to the given comparator.boolean
Returns true if execution after this statement may continue at the following statement.getDefaultTarget
(Body body) int
Returns the amount of unexceptional successors the Stmt needs to have in the StmtGraph.getKey()
getTargetStmts
(Body body) getUses()
Returns a list of Values used in this Stmt.int
getValue
(int index) int
Amount of labels +1 for default handlerboolean
toString()
void
toString
(StmtPrinter stmtPrinter) withPositionInfo
(StmtPositionInfo positionInfo) withValues
(List<IntConstant> values) Methods inherited from class sootup.core.jimple.common.stmt.AbstractStmt
asInvokableStmt, containsArrayRef, containsFieldRef, getArrayRef, getDef, getFieldRef, getPositionInfo, getUsesAndDefs, isInvokableStmt, withNewUse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface sootup.core.jimple.common.stmt.Stmt
asInvokableStmt, containsArrayRef, containsFieldRef, getArrayRef, getDef, getFieldRef, getPositionInfo, getUsesAndDefs, isInvokableStmt, 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
-
getUses
Description copied from class:AbstractStmt
Returns a list of Values used in this Stmt. Note that they are returned in usual evaluation order.- Specified by:
getUses
in interfaceStmt
- Overrides:
getUses
in classAbstractStmt
-
fallsThrough
public boolean fallsThrough()Description copied from interface:Stmt
Returns 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:
fallsThrough
in interfaceStmt
-
branches
public boolean branches()Description copied from interface:Stmt
Returns 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:
branches
in interfaceBranchingStmt
- Specified by:
branches
in interfaceStmt
-
accept
Description copied from interface:Acceptor
Called when this object is visited.- Specified by:
accept
in interfaceAcceptor<StmtVisitor>
-
getValueCount
public int getValueCount()Amount of labels +1 for default handler -
getValue
public int getValue(int index) -
getValues
-
getTargetStmts
- Specified by:
getTargetStmts
in interfaceBranchingStmt
-
getExpectedSuccessorCount
public int getExpectedSuccessorCount()Description copied from class:AbstractStmt
Returns the amount of unexceptional successors the Stmt needs to have in the StmtGraph.- Specified by:
getExpectedSuccessorCount
in interfaceStmt
- Overrides:
getExpectedSuccessorCount
in classAbstractStmt
-
equivTo
Description copied from interface:EquivTo
Returns true if this object is equivalent to o according to the given comparator. -
equivHashCode
public int equivHashCode()Description copied from interface:EquivTo
Returns 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:
equivHashCode
in interfaceEquivTo
-
toString
-
toString
-
withKey
-
withValues
-
withPositionInfo
-