# Interface: com.pnfsoftware.jeb.core.units.code.java.IJavaAssignment

Java AST interface to represent assignments. 

 Example of a simple assignment:  

```

 left = right
 
```
 

 A simple assignment can be modified to represent non\-standard assignments: 
 
- A combined\-operator assignment
-  
- A unary\-operator assignment
-

## Method: duplicate
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaAssignment`


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

Description: Retrieve the combined operator of a combined assignment. 

 Example: for "a \+= b", the operator returned would be "\+"
return: the basic operator that is used to make the assignment a combined assignment
throws: if the assignment is not a combined assignment

## Method: getLeft
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaLeftExpression`

Description: Get the left part of the assignment.
return: 

## Method: getRight
- return type: `com.pnfsoftware.jeb.core.units.code.java.IJavaExpression`

Description: Get the right part of the assignment.
return: 

## Method: getUnaryOperator
- parameter: `r`, type: `boolean[]`

Description: Retrieve the unary operator of a unary operator assignment.
parameter: r: mandatory 2\-element array, will be set to {is\_increment, is\_prefixed}
throws: if the assignment is not a unary assignment

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

Description: Determine if the assignment is a combined assignment. There are 11 possible types of combined operators. Examples include: '\+=', '\-=', etc.
return: 

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

Description: Determine if the assignment is a regular \('='\) assignment.
return: 

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

Description: Determine if the assignment is a unary\-operator assignment. 

 Example: `i++` or `--j`
return: true if the assignment is a unary\-operator assignment

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

Description: Transform a simple assignment into a combined operator assignment. The current assignment cannot be a unary assignment, else the method will throw.
parameter: operator: mandatory combined operator, there are eleven possibilities:
            `MUL, DIV, ADD, SUB, REM, SHL, SHR, USHR, AND, XOR, OR`

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

Description: Transform a simple assignment into a combined operator assignment. The current assignment cannot be a unary assignment, else the method will throw.
parameter: operator: mandatory combined operator, there are eleven possibilities:
            `MUL, DIV, ADD, SUB, REM, SHL, SHR, USHR, AND, XOR, OR`
parameter: right: optional, updated right member of the assignment

## Method: setLeft
- parameter: `left`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaLeftExpression`

Description: Set the left part of the assignment.
parameter: left: mandatory left expression

## Method: setRight
- parameter: `right`, type: `com.pnfsoftware.jeb.core.units.code.java.IJavaExpression`

Description: Set the right part of the assignment. The assignment cannot be a unary assignment.
parameter: right: mandatory right expression

## Method: setUnaryOperator
- parameter: `isIncrement`, type: `boolean`
- parameter: `isPrefixed`, type: `boolean`

Description: Transform the non\-unary assignment into one of the four unary assignments: postfix increment, postfix decrement, prefix increment, prefix decrement. The right member of the expression is automatically nullified.
parameter: isIncrement: true for increment, false for decrement
parameter: isPrefixed: true for prefixed, false for postfixed

