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

`dexdec` IR interface used to represent a variable \(a.k.a. an identifier\). Variables are factory\-created by an [IR context](IDMethodContext). Within a context, two variables with the same id are the same object. 

 Variables may be single\-slot \(encoded using a single register\) or double\-slot \(encoded using a pair of registers\). 

 Examples: 

```

 int x = 1;
     ^  // single-slot register
 long y = 2L;
      ^  // double-slot register
 
```

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

Description: Pseudo\-duplication. For variables, this method returns `this`.

## Method: getId
- return type: `int`

Description: Get this variable id.
return: the variable id

## Method: getPreferredName
- return type: `java.lang.String`

Description: Retrieve the preferred name of this identifier, if there is one. Typically, the preferred is set to the debug name, if one is provided.
return: preferred name, may be null \(in which case, a name would be auto\-generated\)

## Method: setPreferredName
- parameter: `name`, type: `java.lang.String`

Description: Set the optional preferred name of this identifier.
parameter: name: optional preferred name

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

Description: Determine whether this variable uses two slots \(registers\).
return: true if this variable uses a register pair

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

Description: Determine whether this variable uses one slot \(register\) only.
return: true if this variable uses one register

