# Interface: com.pnfsoftware.jeb.core.units.code.android.ir.IDOperation

`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](IJavaOperator) 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;
        ^^^^^^^^^
 
```

## 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

## Method: duplicate
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDOperation`


## 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

## 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

## 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

## Method: getLeft
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Retrieve the left operand.
return: null for unary expressions

## 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

## 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

## Method: getOperator
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaOperator`

Description: Get the expression's operator.
return: the operator object

## 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

## Method: getRight
- return type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Retrieve the right operand.
return: never null

## 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

## 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`

## Method: isConditional
- return type: `boolean`

Description: Convenience operation to determine whether this is the tertiary conditional expression.
return: true for conditional operations

## Method: isUnary
- return type: `boolean`

Description: Convenience operation to determine whether this is a unary expression.
return: true for unary operations

## Method: reverse

Description: Perform in\-place reversal of this logical operation, assuming [#canReverse()](#canReverse()) returned `true`. This method throws on failure.

## 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

## Method: setLeft
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Set the left operand.
parameter: exp: left operand

## 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

## 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

## Method: setOperator
- parameter: `operator`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaOperator`

Description: Set the expression operator.
parameter: operator: new operator

## 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

## Method: setRight
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.android.ir.IDExpression`

Description: Set the right operand.
parameter: exp: right operand

## 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\)

