# Class: com.pnfsoftware.jeb.core.units.codeobject.AbstractCodeObjectUnit

Convenient base class for code objects.

## Constructor: AbstractCodeObjectUnit
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `formatType`, type: `java.lang.String`
- parameter: `name`, type: `java.lang.String`
- parameter: `unitProcessor`, type: `com.pnfsoftware.jeb.core.units.IUnitProcessor`
- parameter: `parent`, type: `com.pnfsoftware.jeb.core.IUnitCreator`
- parameter: `pdm`, type: `com.pnfsoftware.jeb.core.properties.IPropertyDefinitionManager`


## Protected Method: addAllSections
- parameter: `sections`, type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`


## Protected Method: addAllSegments
- parameter: `segments`, type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`


## Protected Method: addAllSymbols
- parameter: `symbols`, type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation>`


## Protected Method: addSection
- parameter: `section`, type: `com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation`


## Protected Method: addSegment
- parameter: `segment`, type: `com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation`


## Protected Method: addSymbol
- parameter: `symbol`, type: `com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation`
- return type: `boolean`


## Protected Method: applyRelocations
- parameter: `mem`, type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`
- parameter: `base`, type: `long`
- parameter: `linkInfoPrv`, type: `com.pnfsoftware.jeb.core.units.codeobject.ILinkInfoProvider`
- return type: `boolean`

Description: Relocate a mapped code object.
parameter: mem: virtual memory
parameter: base: mapping base address
parameter: linkInfoPrv: optional
return: 

## Method: convertFileOffsetToRelativeAddress
- parameter: `offset`, type: `long`
- return type: `long`


## Method: convertRelativeAddressToFileOffset
- parameter: `rel`, type: `long`
- return type: `long`


## Protected Method: createSuitableMemory
- return type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`

Description: Create a virtual memory suitable to map this code object.
return: 

## Method: getExportedSymbols
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation>`


## Method: getImportedSymbols
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation>`


## Method: getLoaderInformation
- return type: `com.pnfsoftware.jeb.core.units.codeobject.ILoaderInformation`


## Protected Method: getMappableInput
- return type: `com.pnfsoftware.jeb.core.input.IInput`

Description: Retrieve the input that is truly mappable. The default implementation simply returns [#getInput()](#getInput()), as is expected in most cases \(eg, ELF, PE\). For formats requiring pre\-processing of the input data, such as IHEX or other ascii\-encoded code objects, this method should be overridden.
return: 

## Method: getRawMemoryMappedImage
- return type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`


## Method: getSection
- parameter: `i`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation`


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


## Method: getSections
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`


## Method: getSections
- parameter: `wflags`, type: `int`
- parameter: `bflags`, type: `int`
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`


## Method: getSegment
- parameter: `i`, type: `int`
- return type: `com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation`


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


## Method: getSegments
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`


## Method: getSegments
- parameter: `wflags`, type: `int`
- parameter: `bflags`, type: `int`
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`


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


## Method: getSymbols
- return type: `java.util.Collection<? extends com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation>`


## Method: getSymbols
- parameter: `mustHaveFlags`, type: `int`
- parameter: `mustNotHaveFlags`, type: `int`
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.codeobject.ISymbolInformation>`


## Method: getValidSections
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`


## Method: getValidSegments
- return type: `java.util.List<? extends com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation>`


## Protected Method: insertSection
- parameter: `index`, type: `int`
- parameter: `section`, type: `com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation`


## Protected Method: insertSegment
- parameter: `index`, type: `int`
- parameter: `segment`, type: `com.pnfsoftware.jeb.core.units.codeobject.ISegmentInformation`


## Method: map
- parameter: `mem`, type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`
- parameter: `wantedBase`, type: `long`
- parameter: `applyRelocations`, type: `boolean`
- parameter: `linkInfoPrv`, type: `com.pnfsoftware.jeb.core.units.codeobject.ILinkInfoProvider`
- return type: `boolean`


## Protected Method: mapRawNoReloc
- parameter: `mem`, type: `com.pnfsoftware.jeb.core.units.code.asm.memory.IVirtualMemory`
- parameter: `base`, type: `long`
- return type: `boolean`

Description: Map the object's segments at the provided base without applying relocations.
parameter: mem: 
parameter: base: 
return: the VM, null on error

## Protected Method: removeSection
- parameter: `index`, type: `int`


## Protected Method: removeSegment
- parameter: `index`, type: `int`


## Protected Method: setLoaderInformation
- parameter: `ldInfo`, type: `com.pnfsoftware.jeb.core.units.codeobject.ILoaderInformation`


## Protected Method: shouldAllocateFullImage
- return type: `boolean`

Description: Indicate whether the loader should allocate the full image range when preparing to load and map a code object file to memory. 

 Typically, the answer is yes for PE\-like files, no for ELF\-like files.
return: 

