# Interface: com.pnfsoftware.jeb.core.units.code.android.ir.IDOperation
- Super interfaces: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

`dexdec` IR operation expression. Operations include: arithmetic and bitwise operations,  logical expressions, the ternary \(conditional\) expression, cast operations, etc.  

  An operation is made of one [operator](com.pnfsoftware.jeb.core.units.code.java.IJavaOperator.md) and 1, 2, or 3 operands:
  \- 1 operand for unary expressions, e.g a cast
  \- 2 operands for duary expressions, e.g. an addition
  \- 3 operands for ternary expressions, e.g. a conditional
  

  Examples:   

```

 c = a + 1;
     ^^^^^

 e = x ? c: d;
     ^^^^^^^^

 s = (short)x;
     ^^^^^^^^

 list = (List)obj;
        ^^^^^^^^^
 
```

## Abstract Method: canReverse
- return type: `boolean`

Description: Determine whether this operation, if it is a logical operation, can be reversed in\-place  \(no new IR element would created\).
return: true if this operation can be reversed in\-place

## Abstract Method: duplicate
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDOperation`


## Abstract Method: getCondFalseExpression
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: If this IR is a conditional operation, retrieve the conditional's true expression. The same  as [#getRight()](#getRight()).
return: the expression evaluated when the predicate is false

## Abstract Method: getCondPredicate
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: If this IR is a conditional operation, retrieve the conditional's predicate.
return: null for non conditional expressions

## Abstract Method: getCondTrueExpression
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: If this IR is a conditional operation, retrieve the conditional's true expression. The same  as [#getLeft()](#getLeft()).
return: the expression evaluated when the predicate is true

## Abstract Method: getLeft
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Retrieve the left operand.
return: null for unary expressions

## Default Method: getOperand1
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Retrieve the first operand. Same as [#getLeft()](#getLeft()).
return: null for unary expressions

## Default Method: getOperand2
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Retrieve the second operand. Same as [#getRight()](#getRight()).
return: never null

## Abstract Method: getOperator
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaOperator`

Description: Get the expression's operator.
return: the operator object

## Abstract Method: getOperatorType
- return type: `com.pnfsoftware.jeb.core.units.code.java.JavaOperatorType`

Description: This convenience method can be used to retrieve the operator type. It is the same as  `getOperator().getOperatorType()`.
return: an operator type enumerated constant

## Abstract Method: getRight
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Retrieve the right operand.
return: never null

## Abstract Method: isCast
- return type: `boolean`

Description: Convenience operation to determine whether this is operation is a cast.
return: true if this operation is a cast operation

## Abstract Method: isCast
- parameter: `wantedType`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaType`
- return type: `boolean`

Description: Convenience operation to determine whether this is operation is a cast to the provided type.
parameter: wantedType: checked cast type
return: true if this operation is a cast to `wantedType`

## Abstract Method: isConditional
- return type: `boolean`

Description: Convenience operation to determine whether this is the tertiary conditional expression.
return: true for conditional operations

## Abstract Method: isUnary
- return type: `boolean`

Description: Convenience operation to determine whether this is a unary expression.
return: true for unary operations

## Abstract Method: reverse

Description: Perform in\-place reversal of this logical operation, assuming [#canReverse()](#canReverse()) returned  `true`. This method throws on failure.

## Abstract Method: setCondPredicate
- parameter: `pred`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Set the predicate of a conditional operation.
parameter: pred: predicate expression

## Abstract Method: setLeft
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Set the left operand.
parameter: exp: left operand

## Default Method: setOperand1
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Set the first operand. Same as [#setLeft(IDExpression)](#setLeft(IDExpression)).
parameter: exp: first operand

## Default Method: setOperand2
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Set the second operand. Same as [#setRight(IDExpression)](#setRight(IDExpression)).
parameter: exp: second operand

## Abstract Method: setOperator
- parameter: `operator`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaOperator`

Description: Set the expression operator.
parameter: operator: new operator

## Abstract Method: setOperator
- parameter: `operatorType`, type: `com.pnfsoftware.jeb.core.units.code.java.JavaOperatorType`
- parameter: `of`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaOperatorFactory`

Description: Set the expression operator. Alternate method.
parameter: operatorType: operator type
parameter: of: operator factory

## Abstract Method: setRight
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Set the right operand.
parameter: exp: right operand

## Abstract Method: updateConversionOperators
- parameter: `ti`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.DTypeInfo`
- parameter: `gctx`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDGlobalContext`

Description: Upgrade temporary [conversion](JavaOperatorType#CAST_CONVERSION) operators to legal  `cast` operators. Ths method should be called once only, on a low\-level IR. It is  reserved for internal use.
parameter: ti: optional type information object, used to record type updates and conflicts
parameter: gctx: global IR context \(mandatory\)

