Class JAssignStmt

All Implemented Interfaces:
EquivTo, FallsThroughStmt, InvokableStmt, Stmt, Acceptor<StmtVisitor>

public final class JAssignStmt extends AbstractDefinitionStmt implements FallsThroughStmt, InvokableStmt
Represents the assignment of one value to another
  • Constructor Details

    • JAssignStmt

      public JAssignStmt(@NonNull LValue variable, @NonNull Value rValue, @NonNull StmtPositionInfo positionInfo)
      Instantiates a new JAssignStmt.
      Parameters:
      variable - the variable on the left side of the assign statement.
      rValue - the value on the right side of the assign statement.
  • Method Details

    • containsInvokeExpr

      public boolean containsInvokeExpr()
      Description copied from interface: InvokableStmt
      Checks if the invokable statement contains a invoke expression that defines the invoke.
      Specified by:
      containsInvokeExpr in interface InvokableStmt
      Returns:
      true if the statement contains an invoke expression, false if not
    • invokesStaticInitializer

      public boolean invokesStaticInitializer()
      Description copied from interface: InvokableStmt
      Checks if the invokable statement can potentially invoke a static initializer To cause a static initializer call, the statement contains a static method call, a new expression, or a static field reference.
      Specified by:
      invokesStaticInitializer in interface InvokableStmt
      Returns:
      true if the statement can cause a static initializer call, and false if not.
    • getInvokeExpr

      public Optional<AbstractInvokeExpr> getInvokeExpr()
      Description copied from interface: InvokableStmt
      Returns the possible invoke expression in the invokable statement
      Specified by:
      getInvokeExpr in interface InvokableStmt
      Returns:
      The optional contains the invoke expression of the invokable statement or is empty if there is no invoke expression.
    • containsArrayRef

      public boolean containsArrayRef()
      Specified by:
      containsArrayRef in interface Stmt
      Overrides:
      containsArrayRef in class AbstractStmt
    • getArrayRef

      public JArrayRef getArrayRef()
      Description copied from class: AbstractStmt
      This method must only be used for Stmts which contain an ArrayRef - possible with JAssignStmts. check via containsArrayRef().
      Specified by:
      getArrayRef in interface Stmt
      Overrides:
      getArrayRef in class AbstractStmt
    • containsFieldRef

      public boolean containsFieldRef()
      Specified by:
      containsFieldRef in interface Stmt
      Overrides:
      containsFieldRef in class AbstractStmt
    • getFieldRef

      public JFieldRef getFieldRef()
      Description copied from class: AbstractStmt
      This method must only be used for Stmts which contain an FieldRef - possible with JAssignStmts. check via containsFieldRef().
      Specified by:
      getFieldRef in interface Stmt
      Overrides:
      getFieldRef in class AbstractStmt
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public void toString(@NonNull StmtPrinter up)
      Specified by:
      toString in interface Stmt
    • accept

      public <V extends StmtVisitor> V accept(@NonNull V v)
      Description copied from interface: Acceptor
      Called when this object is visited.
      Specified by:
      accept in interface Acceptor<StmtVisitor>
    • equivTo

      public boolean equivTo(Object o, @NonNull JimpleComparator comparator)
      Description copied from interface: EquivTo
      Returns true if this object is equivalent to o according to the given comparator.
      Specified by:
      equivTo in interface EquivTo
    • 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 in JimpleComparator.
      Specified by:
      equivHashCode in interface EquivTo
    • getLeftOp

      public @NonNull LValue getLeftOp()
      Specified by:
      getLeftOp in class AbstractDefinitionStmt
    • getRightOp

      public @NonNull Value getRightOp()
      Specified by:
      getRightOp in class AbstractDefinitionStmt
    • 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 interface FallsThroughStmt
      Specified by:
      fallsThrough in interface Stmt
      Overrides:
      fallsThrough in class AbstractDefinitionStmt
    • branches

      public boolean branches()
      Description copied from interface: Stmt
      Returns true if execution after this statement does not necessarily continue at the following statement. The BranchingStmt's GotoStmt, JSwitchStmt and IfStmt will return true.
      Specified by:
      branches in interface Stmt
      Overrides:
      branches in class AbstractDefinitionStmt
    • withNewDef

      public @NonNull JAssignStmt withNewDef(@NonNull Local newLocal)
      Specified by:
      withNewDef in class AbstractDefinitionStmt
    • withVariable

      public @NonNull JAssignStmt withVariable(@NonNull LValue variable)
    • withRValue

      public @NonNull JAssignStmt withRValue(@NonNull Value rValue)
    • withPositionInfo

      public @NonNull JAssignStmt withPositionInfo(@NonNull StmtPositionInfo positionInfo)