# Interface: com.pnfsoftware.jeb.core.units.code.asm.analyzer.IMemoryModel

A manager for the collection of [memory items](INativeContinuousItem) generated by the native code analyzer.

## Method: addListener
- parameter: `listener`, type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.IMemoryModelListener`

Description: Register a listener that will receive updates when this model is updated.
parameter: listener: listener to add

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

Description: Retrieve the bitsize
return: memory model bit size

## Method: getCommentManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.ICommentManager`

Description: Retrieve the comment manager associated with this model.
return: comment manager

## Method: getContinuousItemsInRange
- parameter: `addressBegin`, type: `long`
- parameter: `addressEnd`, type: `long`
- return type: `java.util.SortedMap<java.lang.Long,com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem>`

Description: Get a contiguous list of items, without gaps. The last item, if present, may have an end\-address past `addressEnd`. Gaps are filled using [#getGapFactory()](#getGapFactory()).
parameter: addressBegin: start address
parameter: addressEnd: end address
return: a list of items, with gap items to fill in possible gaps

## Method: getFirstItem
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Get the lowest\-address element in the model.
return: first item, or null if the model is empty

## Method: getGapFactory
- return type: `com.pnfsoftware.jeb.util.collect.ISegmentFactory<java.lang.Long,com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem>`

Description: Retrieve a "gap items" factory. The factory is used to produce temporary items to fill in gaps, when using methods like [#getContinuousItemsInRange(long, long)](#getContinuousItemsInRange(long, long)).
return: a factory \(mandatory\)

## Method: getItemAt
- parameter: `address`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Retrieve the item starting at the given address.
parameter: address: item start address
return: the item or null

## Method: getItemOver
- parameter: `address`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Retrieve the item spanning over the given address.
parameter: address: address to query
return: the item or null

## Method: getItemOverOrGap
- parameter: `address`, type: `long`
- parameter: `lowerBound`, type: `long`
- parameter: `upperBound`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Retrieve the item spanning over the given address, or if no item exists, return a temporary item that fills the gap, partially or fully. In the latter case, the gap item is not attached to the memory model.
parameter: address: the address to be queried; the address must be in the bounds range defined            below
parameter: lowerBound: the lower bound for the gap, if no item was found
parameter: upperBound: the higher bound for the gap, used if no item was found; must be \>= that            the lower bound
return: an item or a gap item, or null if the addresses are invalid

## Method: getItemsInRange
- parameter: `addressBegin`, type: `long`
- parameter: `includePartialFirstItem`, type: `boolean`
- parameter: `addressEnd`, type: `long`
- parameter: `includePartialLastItem`, type: `boolean`
- return type: `java.util.SortedMap<java.lang.Long,com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem>`

Description: Get a map of items in the given range.
parameter: addressBegin: start address
parameter: includePartialFirstItem: include the first item if it spans over \(not starts on\) the            start address
parameter: addressEnd: end address
parameter: includePartialLastItem: include the last item if it spans over \(not ends on\) the last            address
return: matching items

## Method: getItemsInRange
- parameter: `addressBegin`, type: `long`
- parameter: `includePartialFirstItem`, type: `boolean`
- parameter: `addressEnd`, type: `long`
- parameter: `includePartialLastItem`, type: `boolean`
- parameter: `predicate`, type: `java.util.function.Predicate<com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem>`
- return type: `java.util.SortedMap<java.lang.Long,com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem>`

Description: Get a map of items in the given range.
parameter: addressBegin: start address
parameter: includePartialFirstItem: include the first item if it spans over \(not starts on\) the            start address
parameter: addressEnd: end address
parameter: includePartialLastItem: include the last item if it spans over \(not ends on\) the last            address
parameter: predicate: [Predicate](Predicate) to use to filter required values.
return: matching items

## Method: getLabelManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.ILabelManager`

Description: Retrieve the label manager associated with this model.
return: label manager

## Method: getLastItem
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Get the highest\-address element in the model.
return: last item, or null if the model is empty

## Method: getLock
- return type: `com.pnfsoftware.jeb.core.units.IUnitLock`

Description: Retrieve the model lock, used to request a full\-access model lock or a partial, read\-only, transactional lock. All plugin code accessing the native units and units relying on native units should use those locks to perform operations safely in a concurrent environment.
return: model lock

## Method: getNextItem
- parameter: `address`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Retrieve the closest item whose address is strictly greater than the provided address.
parameter: address: address to query
return: the next item or null

## Method: getNextItem
- parameter: `item`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Retrieve the closest item after the given one..
parameter: item: current item
return: the next item or null

## Method: getPreviousItem
- parameter: `item`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Retrieve the closest before the given one..
parameter: item: current item
return: the previous item or null

## Method: getPreviousItem
- parameter: `address`, type: `long`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem`

Description: Retrieve the closest item whose address is strictly less than the provided address.
parameter: address: address to query
return: the previous item or null

## Method: getView
- return type: `java.util.SortedMap<java.lang.Long,com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem>`

Description: Get a full view of the current model. Same as [getView\(null, null\)](#getView(Long, Long)).
return: an unmodifiable view of the model containing the native items

## Method: getView
- parameter: `fromAddress`, type: `java.lang.Long`
- parameter: `toAddress`, type: `java.lang.Long`
- return type: `java.util.SortedMap<java.lang.Long,com.pnfsoftware.jeb.core.units.code.asm.items.INativeContinuousItem>`

Description: Get a copy view of the current model.
parameter: fromAddress: optional start address
parameter: toAddress: optional end address
return: an unmodifiable view of the model containing the native items

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

Description: Determine if the model is empty.
return: true if the model has no item

## Method: isEmptyRange
- parameter: `address`, type: `long`
- parameter: `size`, type: `int`
- return type: `boolean`

Description: Determine if a provided range is free \(ie, contains no item or overlapping item\).
parameter: address: start address
parameter: size: range size
return: true if the range contains no item

## Method: notifyListenersOfModelChange
- parameter: `eventType`, type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.MemoryModelEventType`
- parameter: `eventDetails`, type: `java.lang.Object`

Description: Issue a notification of model change to all listeners.
parameter: eventType: event type
parameter: eventDetails: event details

## Method: removeListener
- parameter: `listener`, type: `com.pnfsoftware.jeb.core.units.code.asm.analyzer.IMemoryModelListener`

Description: Unregister a listener.
parameter: listener: listener to remove

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

Description: Provide the number of elements in the model.
return: number of items

