# Class: com.pnfsoftware.jeb.core.units.code.asm.render.AddressFormatter

A native memory address formatter. 

 The formatter can generate different types of addresses: 
 
- As an absolute address \(always in hexadecimal form\) 
- As a label \(using a [INativeCodeUnit](INativeCodeUnit)\) 
- As a relative address in hexadecimal/decimal 

 

 As an example: `loc_400248` \-\> `400248h` \-\> `PC+10h`/ `PC+16`.

## Constructor: AddressFormatter

Description: Create an address formatter.

## Constructor: AddressFormatter
- parameter: `base`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.AddressFormatter.AddressBase`
- parameter: `pcName`, type: `java.lang.String`
- parameter: `hexNotation`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.HexaNotationType`

Description: Create an address formatter.
parameter: base: address rendering base
parameter: pcName: relative address prefix
parameter: hexNotation: hexadecimal notation

## Method: format
- parameter: `unit`, type: `com.pnfsoftware.jeb.core.units.INativeCodeUnit<?>`
- parameter: `bitsize`, type: `int`
- parameter: `address`, type: `long`
- parameter: `opnd`, type: `com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandGeneric`
- return type: `java.lang.String`

Description: Format a number using the formatter's current settings.
parameter: unit: native code unit used for label resolution
parameter: bitsize: address size in bits
parameter: address: address to format
parameter: opnd: operand containing the raw relative value, or null
return: formatted address

## Method: format
- parameter: `bitsize`, type: `int`
- parameter: `address`, type: `long`
- parameter: `opnd`, type: `com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandGeneric`
- return type: `java.lang.String`

Description: Format an address without a code unit.
parameter: bitsize: address size in bits
parameter: address: address to format
parameter: opnd: operand containing the raw relative value, or null
return: formatted address

## Method: format
- parameter: `unit`, type: `com.pnfsoftware.jeb.core.units.INativeCodeUnit<?>`
- parameter: `bitsize`, type: `int`
- parameter: `address`, type: `long`
- parameter: `opnd`, type: `com.pnfsoftware.jeb.core.units.code.asm.processor.IInstructionOperandGeneric`
- parameter: `base`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.AddressFormatter.AddressBase`
- return type: `java.lang.String`

Description: Format an address.
parameter: unit: native code unit used for label resolution
parameter: bitsize: address size in bits
parameter: address: address to format
parameter: opnd: operand containing the raw relative value, or null
parameter: base: rendering base
return: formatted address

## Method: getBase
- return type: `com.pnfsoftware.jeb.core.units.code.asm.render.AddressFormatter.AddressBase`

Description: Retrieve the address rendering base.
return: address rendering base

## Method: getHexaNotationType
- return type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.HexaNotationType`

Description: Retrieve the hexadecimal notation style.
return: hexadecimal notation style

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

Description: Retrieve the relative address prefix.
return: relative address prefix

## Method: setBase
- parameter: `base`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.AddressFormatter.AddressBase`

Description: Set the address rendering base.
parameter: base: address rendering base

## Method: setHexaNotationType
- parameter: `hexaNotationType`, type: `com.pnfsoftware.jeb.core.units.code.asm.render.NumberFormatter.HexaNotationType`

Description: Set the hexadecimal notation style.
parameter: hexaNotationType: hexadecimal notation style

## Method: setRelativePrefix
- parameter: `relativePrefix`, type: `java.lang.String`

Description: Set the relative address prefix.
parameter: relativePrefix: relative address prefix

