# Class: com.pnfsoftware.jeb.core.units.code.asm.analyzer.MemoryRanges

A collection of byte\-addressable memory ranges. The final addressable byte \(e.g., @ 0xFFFFFFFF in a 32\-bit address space\) cannot be part of any range. 

 This class is not thread\-safe.

## Constructor: MemoryRanges
- parameter: `spaceBits`, type: `int`

Description: Create memory ranges for an address space width.
parameter: spaceBits: number of bits in the address space

## Constructor: MemoryRanges

Description: Create memory ranges for a 64\-bit address space.

## Constructor: MemoryRanges
- parameter: `mem`, type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`

Description: Create memory ranges from the allocated pages of a virtual memory object.
parameter: mem: virtual memory

## Method: add
- parameter: `begin0`, type: `long`
- parameter: `end0`, type: `long`

Description: Add a memory range.
parameter: begin0: start address, inclusive
parameter: end0: end address, exclusive

## Method: aggregatedRangesSize
- return type: `long`

Description: Get the sum of all range sizes.
return: aggregate size of all ranges

## Method: asList
- return type: `java.util.List<com.pnfsoftware.jeb.util.base.Couple<java.lang.Long,java.lang.Long>>`

Description: Convert the [MemoryRanges](MemoryRanges) to a [List](List) of ranges \(stored as [Couple](Couple).
return: the list of [MemoryRanges](MemoryRanges)

## Method: clear

Description: Remove all ranges.

## Method: contains
- parameter: `address`, type: `long`
- return type: `boolean`

Description: Indicate if an address is defined in this [MemoryRanges](MemoryRanges)
parameter: address: address to test
return: true if [MemoryRanges](MemoryRanges) contains this address

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

Description: Get the number of recorded ranges.
return: range count

## Method: getLocalBegin
- parameter: `address0`, type: `long`
- return type: `java.lang.Long`

Description: Get the start of the range containing an address.
parameter: address0: address to look up
return: range start address, or null if the address is not contained in a range

## Method: getLocalEnd
- parameter: `address0`, type: `long`
- return type: `java.lang.Long`

Description: Get the end of the range containing an address.
parameter: address0: address to look up
return: range exclusive end address, or null if the address is not contained in a range

## Method: getLocalRange
- parameter: `address0`, type: `long`
- return type: `com.pnfsoftware.jeb.util.base.Couple<java.lang.Long,java.lang.Long>`

Description: Get the range containing an address.
parameter: address0: address to look up
return: containing range as a start/end pair, or null if none exists

## Method: getNextRange
- parameter: `address0`, type: `long`
- return type: `com.pnfsoftware.jeb.util.base.Couple<java.lang.Long,java.lang.Long>`

Description: Get the first range after an address.
parameter: address0: address to look up
return: next range as a start/end pair, or null if none exists

## Method: getPreviousRange
- parameter: `address0`, type: `long`
- return type: `com.pnfsoftware.jeb.util.base.Couple<java.lang.Long,java.lang.Long>`

Description: Get the first range before an address.
parameter: address0: address to look up
return: previous range as a start/end pair, or null if none exists

## Method: intersects
- parameter: `addressStart`, type: `long`
- parameter: `addressEnd`, type: `long`
- return type: `boolean`

Description: Indicate if an element from range \[addressStart:addressEnd\[ is defined in this [MemoryRanges](MemoryRanges).
parameter: addressStart: start address \(inclusive\)
parameter: addressEnd: end address \(exclusive\)
return: true if [MemoryRanges](MemoryRanges) contains at least one address from the given range

## Method: max
- return type: `java.lang.Long`

Description: Get the highest range end address.
return: highest exclusive end address, or null if no range is recorded

## Method: min
- return type: `java.lang.Long`

Description: Get the lowest range start address.
return: lowest address, or null if no range is recorded

## Method: remove
- parameter: `begin0`, type: `long`
- parameter: `end0`, type: `long`

Description: Remove a memory range.
parameter: begin0: start address, inclusive
parameter: end0: end address, exclusive

## Method: spanSize
- return type: `long`

Description: Get the size spanned by all ranges.
return: distance between the lowest start and highest end, or 0 if no range is recorded

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


